# Customized Panes for 'xxxxxxxx' Created: 2009/04/09
# PANE:Job Tracking
[PANE]
ADMIN INVPENLZ 01000Job Tracking 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 & ""
' 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, Job
CustomizedPane.CodeObject.ListviewData = " "
' Populate the Stockcode variable with the refresh value
Job = CustomizedPane.CodeObject.RefreshValue
if Job = "" then
exit function
end if
' Build up the XML to be passed to the business object
XMLParam = XMLParam & " "
XMLParam = XMLParam & " "
XMLParam = XMLParam & " " & Job & ""
XMLParam = XMLParam & " "
XMLParam = XMLParam & " "
XMLParam = XMLParam & " "
on error resume next
' Call the business object, supply the XML and put the resulting XML in to XMLOut
XMLOut = CallBO("WIPQRY",XMLParam,"auto")
if err then
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.
Dim NewXML, NewXMLE, xDoc, xList, xList2, Counter, Counter2, XMLDoc, UseIncase
Dim LAB, LAE, WCB, WCE, WCDB, WCDE, OB, OE, QCB, QCE, QSB, QSE, PSB, PSE, PEB, PEE, CRB, CRE
Dim ASDB, ASDE, AFDB, AFDE, TIB, TIE, SOB, SOE, SB, SE, PCB, PCE, MacB, MacE, QOB, QOE, QRB, QRE
Dim StatusValue, QtyOutstanding, QtyOutstandingF
NewXML = ""
NewXMLE = ""
LAB = ""
LAE = ""
WCB = ""
WCE = ""
WCDB = ""
WCDE = ""
OB = ""
OE = ""
QCB = ""
QCE = ""
QSB = ""
QSE = ""
QOB = ""
QOE = ""
QRB = ""
QRE = ""
PSB = ""
PSE = ""
PEB = ""
PEE = ""
CRB = ""
CRE = ""
ASDB = ""
ASDE = ""
AFDB = ""
AFDE = ""
TIB = ""
TIE = ""
SOB = ""
SOE = ""
SB = ""
SE = ""
PCB = ""
PCE = ""
MacB = ""
MacE = ""
' Load the output from the business object in to the DOM
Set XMLDoc = createobject("MSXML2.DOMDocument")
XMLDoc.async = false
XMLDoc.LoadXML(XMLOut)
' Locate the OperationItem elements
Set xList2 = XMLDoc.SelectNodes("//WipQuery/LabourAlloc")
' Loop through each MaterialPosting section
For Counter2 = 0 To xList2.length - 1
' Build the new XML containing the original content of the OperationItem nodes and
' combine the two required times and the two issued times.
NewXML = NewXML & LAB
NewXML = NewXML & WCB & xList2(Counter2).SelectSingleNode("WorkCentre").Text & WCE
NewXML = NewXML & WCDB & xList2(Counter2).SelectSingleNode("WorkCentreDesc").Text & WCDE
NewXML = NewXML & OB & xList2(Counter2).SelectSingleNode("Operation").Text & OE
NewXML = NewXML & QRB & xList2(Counter2).SelectSingleNode("ParentQtyPlanned").Text & QRE
NewXML = NewXML & QCB & xList2(Counter2).SelectSingleNode("QtyCompleted").Text & QCE
NewXML = NewXML & QSB & xList2(Counter2).SelectSingleNode("QtyScrapped").Text & QSE
QtyOutstanding = ""
QtyOutstanding = xList2(Counter2).SelectSingleNode("ParentQtyPlanned").Text - xList2(Counter2).SelectSingleNode("QtyCompleted").Text - xList2(Counter2).SelectSingleNode("QtyScrapped").Text
QtyOutstandingF = FormatNumber(QtyOutstanding,3)
NewXML = NewXML & QOB & QtyOutstandingF & QOE
NewXML = NewXML & PSB & xList2(Counter2).SelectSingleNode("PlannedStartDate").Text & PSE
NewXML = NewXML & PEB & xList2(Counter2).SelectSingleNode("PlannedEndDate").Text & PEE
NewXML = NewXML & CRB & xList2(Counter2).SelectSingleNode("ICapacityReqd").Text & CRE
NewXML = NewXML & ASDB & xList2(Counter2).SelectSingleNode("ActualStartDate").Text & ASDE
NewXML = NewXML & AFDB & xList2(Counter2).SelectSingleNode("ActualFinishDate").Text & AFDE
NewXML = NewXML & TIB & xList2(Counter2).SelectSingleNode("TimeIssued").Text & TIE
NewXML = NewXML & SOB & xList2(Counter2).SelectSingleNode("SubcontractOp").Text & SOE
StatusValue = ""
If xList2(Counter2).SelectSingleNode("Milestone").Text = "Y" Then
StatusValue = "Milestone"
End If
If xList2(Counter2).SelectSingleNode("OperCompleted").Text = "Y" Then
StatusValue = "Completed"
End If
NewXML = NewXML & SB & StatusValue & SE
NewXML = NewXML & PCB & xList2(Counter2).SelectSingleNode("PiecesCompleted").Text & PCE
NewXML = NewXML & MacB & xList2(Counter2).SelectSingleNode("IMachine").Text & MacE
NewXML = NewXML & LAE
Next
' Complete the XML by closing off the root element
NewXML = NewXML & NewXMLE
' Load the new XML file in to the ListviewData variable
CustomizedPane.CodeObject.ListviewData = NewXML
End Function