# Customized Panes for 'xxxxxxxx' Created: 2009/04/09
# PANE:Sales Order Values (Foreign)
[PANE]
ADMIN INVPENLZ 01000Sales Order Values (Foreign) 020 000000500000INVPEN000M
[VBSCRIPT]
' This script contains functions for customized pane events.
' You must not modify the name of the functions.
Option Explicit
Function CustomizedPane_OnLoad()
' Specify the variable used to contain the XML that defines the listview structure
dim ListXML
' Populate the XML that defines the listview structure
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
'
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
'
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
ListXML = ListXML & ""
'
ListXML = ListXML & ""
' Hidden='true'
' Take the XML and pass it to the ListviewProperties variable
CustomizedPane.CodeObject.ListviewProperties = ListXML
End Function
Function CustomizedPane_OnRefresh()
' Specify the variables that will be used when calling the business object
dim XMLOut, XMLParam, Salesorder
CustomizedPane.CodeObject.ListviewData = " "
' Populate the Stockcode variable with the refresh value
Salesorder = CustomizedPane.CodeObject.RefreshValue
if Salesorder = "" 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
XMLOut = CallBO("SORQOV",XMLParam,"auto")
if err then
msgbox err.Description, vBCritical, "Calling Business Object"
exit function
end if
' Switch on error handling
on error goto 0
' Define the variables required for building the new XML structure and extracting the information from
' the DOM. This is required because only lines containing a valid MLot must be displayed.
' Define the variables required for building the new XML structure and extracting the information from
' the DOM. This is required because the Warehouse element is held at a different level in the original
' XML, so was not available to be used in the listview
Dim NewXML, NewXMLE, xDoc, xList, xList2, xList3, xList4, Counter, Counter2, Counter3, Counter4, OTB, OTE, XMLDoc
Dim ORG, ORG1B, ORG1E, ORG2B, ORG2E, ORG3B, ORG3E, ORG4B, ORG4E, ORG5B, ORG5E, ORG6B, ORG6E, ORG7B, ORG7E
Dim OUT, OUT1B, OUT1E, OUT2B, OUT2E, OUT3B, OUT3E, OUT4B, OUT4E, OUT5B, OUT5E, OUT6B, OUT6E, OUT7B, OUT7E
Dim INV, INV1B, INV1E, INV2B, INV2E, INV3B, INV3E, INV4B, INV4E, INV5B, INV5E, INV6B, INV6E, INV7B, INV7E
NewXML = ""
NewXMLE = ""
OTB = ""
OTE = ""
ORG="Original Values"
ORG1B = ""
ORG1E = ""
ORG2B = ""
ORG2E = ""
ORG3B = ""
ORG3E = ""
ORG4B = ""
ORG4E = ""
ORG5B = ""
ORG5E = ""
ORG6B = ""
ORG6E = ""
ORG7B = ""
ORG7E = ""
OUT="Outstanding Values"
OUT1B = ""
OUT1E = ""
OUT2B = ""
OUT2E = ""
OUT3B = ""
OUT3E = ""
OUT4B = ""
OUT4E = ""
OUT5B = ""
OUT5E = ""
OUT6B = ""
OUT6E = ""
OUT7B = ""
OUT7E = ""
INV="To Invoice Values"
INV1B = ""
INV1E = ""
INV2B = ""
INV2E = ""
INV3B = ""
INV3E = ""
INV4B = ""
INV4E = ""
INV5B = ""
INV5E = ""
INV6B = ""
INV6E = ""
INV7B = ""
INV7E = ""
' Load the output from the business object in to the DOM
Set XMLDoc = createobject("MSXML2.DOMDocument")
XMLDoc.async = false
XMLDoc.LoadXML(XMLOut)
NewXML = NewXML & OTB
' Look for all LocalCurrency elements
Set xList = XMLDoc.SelectNodes("//OrderCurrency")
' 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
' Build the new XML containing the original content of the nodes under OriginalValues
NewXML = NewXML & ORG
NewXML = NewXML & ORG1B & xList2(Counter2).SelectSingleNode("NetMerchValueExcl").Text & ORG1E
NewXML = NewXML & ORG2B & xList2(Counter2).SelectSingleNode("NetMerchTotalExcl").Text & ORG2E
NewXML = NewXML & ORG3B & xList2(Counter2).SelectSingleNode("NetFreightValueExcl").Text & ORG3E
NewXML = NewXML & ORG4B & xList2(Counter2).SelectSingleNode("NetMiscValueExcl").Text & ORG4E
NewXML = NewXML & ORG5B & xList2(Counter2).SelectSingleNode("GrossMerchValueExcl").Text & ORG5E
NewXML = NewXML & ORG6B & xList2(Counter2).SelectSingleNode("DiscMerchValueExcl").Text & ORG6E
NewXML = NewXML & ORG7B & xList2(Counter2).SelectSingleNode("InvoiceDiscExcl").Text & ORG7E
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
' Build the new XML containing the original content of the nodes under OutstandingValues
NewXML = NewXML & OUT
NewXML = NewXML & OUT1B & xList3(Counter3).SelectSingleNode("NetMerchValueExcl").Text & OUT1E
NewXML = NewXML & OUT2B & xList3(Counter3).SelectSingleNode("NetMerchTotalExcl").Text & OUT2E
NewXML = NewXML & OUT3B & xList3(Counter3).SelectSingleNode("NetFreightValueExcl").Text & OUT3E
NewXML = NewXML & OUT4B & xList3(Counter3).SelectSingleNode("NetMiscValueExcl").Text & OUT4E
NewXML = NewXML & OUT5B & xList3(Counter3).SelectSingleNode("GrossMerchValueExcl").Text & OUT5E
NewXML = NewXML & OUT6B & xList3(Counter3).SelectSingleNode("DiscMerchValueExcl").Text & OUT6E
NewXML = NewXML & OUT7B & xList3(Counter3).SelectSingleNode("InvoiceDiscExcl").Text & OUT7E
Next
' Within the LocalCurrency section, locate the InvoiceValues elements
Set xList4 = xList(Counter).SelectNodes("InvoiceValues")
' Loop through each SerialItem section
For Counter4 = 0 To xList4.length - 1
' Build the new XML containing the original content of the nodes under InvoiceValues
NewXML = NewXML & INV
NewXML = NewXML & INV1B & xList4(Counter4).SelectSingleNode("NetMerchValueExcl").Text & INV1E
NewXML = NewXML & INV2B & xList4(Counter4).SelectSingleNode("NetMerchTotalExcl").Text & INV2E
NewXML = NewXML & INV3B & xList4(Counter4).SelectSingleNode("NetFreightValueExcl").Text & INV3E
NewXML = NewXML & INV4B & xList4(Counter4).SelectSingleNode("NetMiscValueExcl").Text & INV4E
NewXML = NewXML & INV5B & xList4(Counter4).SelectSingleNode("GrossMerchValueExcl").Text & INV5E
NewXML = NewXML & INV6B & xList4(Counter4).SelectSingleNode("DiscMerchValueExcl").Text & INV6E
NewXML = NewXML & INV7B & xList4(Counter4).SelectSingleNode("InvoiceDiscExcl").Text & INV7E
Next
Next
' Complete the XML by closing off the root element
NewXML = NewXML & OTE
NewXML = NewXML & NewXMLE
' Load the new XML file in to the ListviewData variable
CustomizedPane.CodeObject.ListviewData = NewXML
End Function