# Customized Panes for 'xxxxxxxx' Created: 2009/04/09
# PANE:Purchase Order Values Graph
[PANE]
ADMIN xxxxxxxx 01000Purchase Order Values Graph 010 000000500000INVPEN011M000
[VBSCRIPT]
' This script contains functions for customized pane events.
' You must not modify the name of the functions.
Option Explicit
Function CustomizedPane_OnLoad()
dim GraphProperties
GraphProperties = GraphProperties & ""
GraphProperties = GraphProperties & ""
GraphProperties = GraphProperties & ""
GraphProperties = GraphProperties & ""
GraphProperties = GraphProperties & ""
GraphProperties = GraphProperties & ""
GraphProperties = GraphProperties & ""
GraphProperties = GraphProperties & ""
CustomizedPane.CodeObject.GraphProperties = GraphProperties
RefreshGraph()
End Function
Function CustomizedPane_OnRefresh()
RefreshGraph()
End Function
Function RefreshGraph()
' Specify the variables to be used when calling the business object
dim XMLOut, XMLParam, Purchaseorder, PurchValMth1
dim Node(6)
' Populate the Stockcode variable with the refresh value
Purchaseorder = CustomizedPane.CodeObject.RefreshValue
if Purchaseorder = "" then
exit function
end if
' Build up the XML to be passed to the business object
XMLParam = XMLParam & " "
XMLParam = XMLParam & " "
XMLParam = XMLParam & " "
on error resume next
' Call the business object, supplying the XML and putting the result in to XMLOut
XMLOut = CallBO("PORQOV",XMLParam,"auto")
if err then
exit function
end if
' Switch on error handling
on error goto 0
' Define the variables required for building the Graph
Dim NewXML, NewXMLE, XMLDoc, xDoc, xList, xList2, xList3, xList4, xList5, xList6
Dim FinalString, Counter, Counter2, Counter3, Counter4, Counter5, Counter6
' Load the output from the business object in to the DOM
Set XMLDoc = createobject("MSXML2.DOMDocument")
XMLDoc.async = false
XMLDoc.LoadXML(XMLOut)
If XMLDoc.SelectSingleNode("//Description").Text = "Local Currency" then
' Look for all LocalCurrency elements
Set xList = XMLDoc.SelectNodes("//LocalCurrency")
' Loop through each of the LocalCurrency elements
For Counter = 0 To xList.length - 1
' Within the LocalCurrency section, locate the OriginalValues elements
Set xList2 = xList(Counter).SelectNodes("OriginalValues")
' Loop through each SerialItem section
For Counter2 = 0 To xList2.length - 1
Set Node(1) = xList2(Counter2).SelectSingleNode("GrossMerchValue")
Set Node(2) = xList2(Counter2).SelectSingleNode("NetMerchValue")
Set Node(3) = xList2(Counter2).SelectSingleNode("NetTotal")
Next
' Within the LocalCurrency section, locate the OutstandingValues elements
Set xList3 = xList(Counter).SelectNodes("OutstandingValues")
' Loop through each SerialItem section
For Counter3 = 0 To xList3.length - 1
Set Node(4) = xList3(Counter3).SelectSingleNode("GrossMerchValue")
Set Node(5) = xList3(Counter3).SelectSingleNode("NetMerchValue")
Set Node(6) = xList3(Counter3).SelectSingleNode("NetTotal")
Next
Next
Else
' Look for all OrderCurrency elements
Set xList4 = XMLDoc.SelectNodes("//OrderCurrency")
' Loop through each of the LocalCurrency elements
For Counter4 = 0 To xList4.length - 1
' Within the LocalCurrency section, locate the OriginalValues elements
Set xList5 = xList4(Counter4).SelectNodes("OriginalValues")
' Loop through each SerialItem section
For Counter5 = 0 To xList5.length - 1
Set Node(1) = xList5(Counter5).SelectSingleNode("GrossMerchValue")
Set Node(2) = xList5(Counter5).SelectSingleNode("NetMerchValue")
Set Node(3) = xList5(Counter5).SelectSingleNode("NetTotal")
Next
' Within the LocalCurrency section, locate the OutstandingValues elements
Set xList6 = xList4(Counter4).SelectNodes("OutstandingValues")
' Loop through each SerialItem section
For Counter6 = 0 To xList6.length - 1
Set Node(4) = xList6(Counter6).SelectSingleNode("GrossMerchValue")
Set Node(5) = xList6(Counter6).SelectSingleNode("NetMerchValue")
Set Node(6) = xList6(Counter6).SelectSingleNode("NetTotal")
Next
Next
End If
FinalString = FinalString & ""
FinalString = FinalString & ""
FinalString = FinalString & ""
FinalString = FinalString & ""
FinalString = FinalString & ""
FinalString = FinalString & ""
FinalString = FinalString & ""
FinalString = FinalString & ""
FinalString = FinalString & ""
FinalString = FinalString & ""
CustomizedPane.CodeObject.GraphData = FinalString
set xmldoc = nothing
End Function