# Customized Panes for 'xxxxxxxx' Created: 2010/03/03
# PANE:Sales Order Header Details
[PANE]
ADMIN ARSPENLZ 01001Sales Order Header Details 090settings\ADMIN_VBS_ARSPEN01.XML 000000500000ARSPEN010M000 0000 00000
[VBSCRIPT]
' This script contains functions for form and field events.
' You must not modify the name of the functions.
Option Explicit
Function CustomizedPane_OnLoad()
Dim FormProps
FormProps = "
"
CustomizedPane.CodeObject.FormProperties = FormProps
End Function
Function CustomizedPane_OnRefresh()
' Specify the variables to be used when calling the business object
dim XMLOut, XMLParam, SalesOrder, FormData
CustomizedPane.CodeObject.UpdateFormValues = " "
' Populate the SalesOrder 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 & " " & SalesOrder & ""
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("SORQRY",XMLParam,"auto")
if err then
exit function
end if
' Switch on error handling
on error goto 0
' Define the variables required for extracting the information from the DOM.
Dim XMLDoc, SONum, CusPO, Cust, CustName, SoToName, SoldAddr1, SoldAddr2, SoldAddr3, SoldAddr4, SoldAddr5, SoldPCode
Dim ShipAddr1, ShipAddr2, ShipAddr3, ShipAddr4, ShipAddr5, ShipPCode, SalesP, SalesPName, OStatus, ShipInstrs, SpecInstrs
Dim DocType, OrdType, OrdDate, ShipDate, Branch, BranchDesc, Area, AreaDesc, CurrencyCode, CurrencyDesc, Job, AltKey, TaxNum
Dim LastInv, DateLastInv, Terms, OStatusDesc, DocTypeDesc
Dim Sched, CounterS, InterWH, HierFlag, FullDocType
' Load the output from the business object in to the DOM
Set XMLDoc = createobject("MSXML2.DOMDocument")
XMLDoc.async = false
XMLDoc.LoadXML(XMLOut)
' Populate the values for the fields
SONUm = XMLDoc.SelectSingleNode("//SalesOrder").Text
CusPO = XMLDoc.SelectSingleNode("//CustomerPoNumber").Text
Cust = XMLDoc.SelectSingleNode("//Customer").Text
CustName = XMLDoc.SelectSingleNode("//CustomerName").Text
SoToName = XMLDoc.SelectSingleNode("//SoldToName").Text
SoldAddr1 = XMLDoc.SelectSingleNode("//SoldAddr1").Text
SoldAddr2 = XMLDoc.SelectSingleNode("//SoldAddr2").Text
SoldAddr3 = XMLDoc.SelectSingleNode("//SoldAddr3").Text
SoldAddr4 = XMLDoc.SelectSingleNode("//SoldAddr4").Text
SoldAddr5 = XMLDoc.SelectSingleNode("//SoldAddr5").Text
SoldPCode = XMLDoc.SelectSingleNode("//SoldPostalCode").Text
ShipAddr1 = XMLDoc.SelectSingleNode("//ShipAddress1").Text
ShipAddr2 = XMLDoc.SelectSingleNode("//ShipAddress2").Text
ShipAddr3 = XMLDoc.SelectSingleNode("//ShipAddress3").Text
ShipAddr4 = XMLDoc.SelectSingleNode("//ShipAddress4").Text
ShipAddr5 = XMLDoc.SelectSingleNode("//ShipAddress5").Text
ShipPCode = XMLDoc.SelectSingleNode("//ShipPostalCode").Text
SalesP = XMLDoc.SelectSingleNode("//Salesperson").Text
SalesPName = XMLDoc.SelectSingleNode("//SALSLS_Name").Text
OStatus = XMLDoc.SelectSingleNode("//OrderStatus").Text
ShipInstrs = XMLDoc.SelectSingleNode("//ShippingInstrs").Text
SpecInstrs = XMLDoc.SelectSingleNode("//SpecialInstrs").Text
DocType = XMLDoc.SelectSingleNode("//DocumentType").Text
OrdType = XMLDoc.SelectSingleNode("//OrderType").Text
OrdDate = XMLDoc.SelectSingleNode("//OrderDate").Text
ShipDate = XMLDoc.SelectSingleNode("//ReqShipDate").Text
Branch = XMLDoc.SelectSingleNode("//Branch").Text
BranchDesc = XMLDoc.SelectSingleNode("//SALBRN_Description").Text
Area = XMLDoc.SelectSingleNode("//Area").Text
AreaDesc = XMLDoc.SelectSingleNode("//SALARE_Description").Text
CurrencyCode= XMLDoc.SelectSingleNode("//Currency").Text
CurrencyDesc = XMLDoc.SelectSingleNode("//TBLCUR_Description").Text
Job = XMLDoc.SelectSingleNode("//Job").Text
AltKey = XMLDoc.SelectSingleNode("//AlternateKey").Text
TaxNum = XMLDoc.SelectSingleNode("//CompanyTaxNo").Text
LastInv = XMLDoc.SelectSingleNode("//LastInvoice").Text
DateLastInv = XMLDoc.SelectSingleNode("//DateLastInvPrt").Text
Terms = XMLDoc.SelectSingleNode("//TBLART_Description").Text
FullDocType = "Order"
If Not IsNull(XMLDoc.SelectSingleNode("//ScheduledOrdFlag").Text) Then
Sched = XMLDoc.SelectSingleNode("//ScheduledOrdFlag").Text
Else
Sched = "N"
End If
If Not IsNull(XMLDoc.SelectSingleNode("//CounterSalesFlag").Text) Then
CounterS = XMLDoc.SelectSingleNode("//CounterSalesFlag").Text
Else
CounterS = "N"
End If
If Not IsNull(XMLDoc.SelectSingleNode("//InterWhSale").Text) Then
InterWH = XMLDoc.SelectSingleNode("//InterWhSale").Text
Else
InterWH = "N"
End If
If Not IsNull(XMLDoc.SelectSingleNode("//HierarchyFlag").Text) Then
HierFlag = XMLDoc.SelectSingleNode("//HierarchyFlag").Text
Else
HierFlag = "N"
End If
If DocType = "O" Then
If Sched = "Y" Then
FullDocType = "Scheduled order"
ElseIf InterWH = "Y" Then
FullDocType = "SCT"
End If
End If
If DocType = "B" Then
If CounterS = "Y" Then
FullDocType = "Counter sale"
Else
FullDocType = "Billing"
End If
End If
If DocType = "C" Then
FullDocType = "Credit note"
End If
If DocType = "D" Then
FullDocType = "Debit note"
End If
Select case OStatus
Case "S"
OStatusDesc = "S - Suspense order"
Case "F"
OStatusDesc = "F - Forward order"
Case "0"
OStatusDesc = "0 - In process"
Case "1"
OStatusDesc = "1 - Open order"
Case "2"
OStatusDesc = "2 - Open backorder"
Case "3"
OStatusDesc = "3 - Released backorder"
Case "4"
OStatusDesc = "4 - In warehouse"
Case "8"
OStatusDesc = "8 - Ready to invoice"
Case "9"
OStatusDesc = "9 - Complete"
Case "*"
OStatusDesc = "* - Cancelled at entry"
Case "\"
OStatusDesc = "\ - Cancelled"
Case Else
OStatusDesc = OStatus
End Select
FormData = ""
CustomizedPane.CodeObject.UpdateFormValues = FormData
End Function