refactored material track code for front end
This commit is contained in:
committed by
Stieber Daniel (CSC FI SPS MESLEO)
parent
c36cf5fedc
commit
d7d8fc0289
@ -78,6 +78,8 @@ API config.ID.PUT
|
||||
end
|
||||
If Key EQ 'userID' then
|
||||
CurrUser = Field(Cookie, '=', 2)
|
||||
end else
|
||||
If OIWizardID NE '' then CurrUser = Xlate('OI_WIZARD', OIWizardID, 'EMPLOYEE_ID', 'X')
|
||||
end
|
||||
Next Cookie
|
||||
|
||||
@ -109,7 +111,23 @@ CreateHALItem:
|
||||
|
||||
Begin Case
|
||||
Case ConfigID _EQC 'OEE'
|
||||
JSONResponse = Config_Services('GetOEE', FullEndpointURL)
|
||||
JSONResponse = Config_Services('GetOEE', FullEndpointURL)
|
||||
Case ConfigID _EQC 'MaterialTrack'
|
||||
OIWizardID = ''
|
||||
CurrUser = ''
|
||||
Cookies = HTTP_Services('GetHTTPCookie')
|
||||
For each Cookie in Cookies using ';'
|
||||
Key = Trim(Field(Cookie, '=', 1))
|
||||
If Key EQ 'sessionID' then
|
||||
OIWizardID = Field(Cookie, '=', 2)
|
||||
end
|
||||
If Key EQ 'userID' then
|
||||
CurrUser = Field(Cookie, '=', 2)
|
||||
end else
|
||||
If OIWizardID NE '' then CurrUser = Xlate('OI_WIZARD', OIWizardID, 'EMPLOYEE_ID', 'X')
|
||||
end
|
||||
Next Cookie
|
||||
JSONResponse = Config_Services('GetMaterialTrackSettings', CurrUser)
|
||||
Case Otherwise$
|
||||
Error_Services('Add', 'Unsupported configID')
|
||||
End Case
|
||||
@ -166,6 +184,17 @@ UpdateHALItem:
|
||||
end else
|
||||
Error_Services('Add', 'User is not authorized to update OEE setpoints.')
|
||||
end
|
||||
Case ConfigID _EQC 'MaterialTrack'
|
||||
// The resource will have been put into the POST string.
|
||||
Body = HTTP_Services('GetHTTPPostString')
|
||||
If Body NE '' then
|
||||
// The POST string will have been encoded so use percent (URL) decoding.
|
||||
MtSettingsJson = HTTP_Services('DecodePercentString', Body)
|
||||
Config_Services('UpdateMaterialTrackSettings', MtSettingsJson, CurrUser)
|
||||
end else
|
||||
Error_Services('Add', 'No body was sent with the request.')
|
||||
end
|
||||
|
||||
Case Otherwise$
|
||||
Error_Services('Add', 'Unsupported configID')
|
||||
End Case
|
||||
@ -184,3 +213,4 @@ UpdateHALItem:
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
|
@ -130,3 +130,29 @@ Service UpdateOEE(OEEjson)
|
||||
end service
|
||||
|
||||
|
||||
Service GetMaterialTrackSettings(UserId)
|
||||
|
||||
Response = ''
|
||||
If (UserId NE '') then
|
||||
RepUserId = UserId
|
||||
Convert @Lower.Case to @Upper.Case in RepUserId
|
||||
Response = Database_Services('ReadDataRow', 'REPORT_CONFIG', 'MATERIAL_TRACK_WEB*':RepUserId)
|
||||
end else
|
||||
Error_Services('Add', 'Error in ':Service:' service. Null UserId passed into service.')
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service UpdateMaterialTrackSettings(MtSettingsJson, UserId)
|
||||
|
||||
If ( (MtSettingsJson NE '') and (UserId NE '') ) then
|
||||
RepUserId = UserId
|
||||
Convert @Lower.Case to @Upper.Case in RepUserId
|
||||
Database_Services('WriteDataRow', 'REPORT_CONFIG', 'MATERIAL_TRACK_WEB*':RepUserId, MtSettingsJson)
|
||||
end else
|
||||
Error_Services('Add', 'Error in ':Service:' service. Null MtSettingsJson or UserId passed into service.')
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
@ -49,8 +49,7 @@ Compile function NDW_MATERIAL_TRACK_PRO_REPORT_EVENTS(CtrlEntId, Event, @PARAMS)
|
||||
#window NDW_MATERIAL_TRACK_PRO_REPORT
|
||||
|
||||
Declare function Form_Services, Database_Services, RTI_Task_Submit, RTI_Task_Status, MemberOf
|
||||
Declare subroutine SRP_Show_Window, Send_Message, Set_Property, Report_Services_Dev, Database_Services, Material_Track
|
||||
Declare subroutine Report_Services_Dev2, Report_Services_Dev5
|
||||
Declare subroutine SRP_Show_Window, Send_Message, Set_Property, Database_Services, Material_Track, Report_Services
|
||||
|
||||
$Insert EVENT_SETUP
|
||||
$Insert LOGICAL
|
||||
@ -129,25 +128,8 @@ Event PUB_GEN_REPORT.CLICK()
|
||||
If LocationEnabled then RptLocations<0, -1> = Location
|
||||
Next Location
|
||||
|
||||
* Report_Services_Dev5('GetMaterialTrackReport', RptColumns, RptLocations, NoMatFlag)
|
||||
|
||||
|
||||
Begin Case
|
||||
Case OldReport
|
||||
Report_Services_Dev('GetMaterialTrackReport', RptColumns, RptLocations, NoMatFlag)
|
||||
Case Otherwise$
|
||||
Report_Services_Dev5('GetMaterialTrackReport', RptColumns, RptLocations, NoMatFlag)
|
||||
End Case
|
||||
Report_Services('PrintMaterialTrackReport', RptColumns, RptLocations, NoMatFlag, OldReport)
|
||||
|
||||
* Begin Case
|
||||
* Case DevReport
|
||||
* Report_Services_Dev5('GetMaterialTrackReport', RptColumns, RptLocations, NoMatFlag)
|
||||
* Case @User4 EQ 'JUSTIN_H' or @User4 EQ 'DANIEL_ST'
|
||||
* Report_Services_Dev2('GetMaterialTrackReport', RptColumns, RptLocations, NoMatFlag)
|
||||
* Case Otherwise$
|
||||
* Report_Services_Dev('GetMaterialTrackReport', RptColumns, RptLocations, NoMatFlag)
|
||||
* End Case
|
||||
|
||||
end event
|
||||
|
||||
|
||||
@ -438,4 +420,3 @@ EnableReportColumns:
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
@ -1,422 +0,0 @@
|
||||
Compile function NDW_MATERIAL_TRACK_REPORT_EVENTS(CtrlEntId, Event, @PARAMS)
|
||||
/***********************************************************************************************************************
|
||||
|
||||
Name : NDW_MATERIAL_TRACK_EVENTS
|
||||
|
||||
Description : Commuter module for the NDW_MATERIAL_TRACK_EVENTS form.
|
||||
|
||||
Notes : Application errors should be logged using the Error Services module. There are a few methodological
|
||||
assumptions built into way errors are managed which are important to understand in order to properly
|
||||
work with Error Services:
|
||||
|
||||
- The term 'top' refers to the originating procedure of a call stack and the term 'bottom' refers to
|
||||
the last routine (or the current routine) within a call stack. Within the OpenInsight Debugger
|
||||
this will appear backwards since the originating procedure always appears at the bottom of the
|
||||
list and the current routine appears at the top of the list. We are using this orientation because
|
||||
it is common to refer to the process of calling other procedures as 'drilling down'.
|
||||
|
||||
- The reason for defining the orientation of the call stack is because Error_Services allows for
|
||||
multiple error conditions to be appended to an original error. In most cases this will happen when
|
||||
a procedure at the bottom of the stack generates an error condition and then returns to its
|
||||
calling procedure. This higher level procedure can optionally add more information relevant to
|
||||
itself. This continues as the call stack 'bubbles' its way back to the top to where the
|
||||
originating procedure is waiting.
|
||||
|
||||
- Native OpenInsight commands that handle errors (e.g., Set_Status, Set_FSError, Set_EventStatus)
|
||||
preserve their error state until explicitly cleared. This can hinder the normal execution of code
|
||||
since subsequent procedures (usually SSPs) will fail if a pre-existing error condition exists.
|
||||
Our philosophy is that error conditions should automatically be cleared before a new procedure
|
||||
is executed to avoid this problem. However, the nature of Basic+ does not make this easy to
|
||||
automate for any given stored procedure. Therefore, if a stored procedure wants to conform to our
|
||||
philosophy then it should include a call into the 'Clear' service request at the top of the
|
||||
program. Alternatively this can be done through a common insert (see SERVICE_SETUP for example.)
|
||||
|
||||
- Service modules will use the SERVICE_SETUP insert and therefore automatically clear out any
|
||||
error conditions that were set before.
|
||||
|
||||
Parameters :
|
||||
Service [in] -- Name of the service being requested
|
||||
Param1-10 [in/out] -- Additional request parameter holders
|
||||
Response [out] -- Response to be sent back to the Controller (MCP) or requesting procedure
|
||||
|
||||
Metadata :
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
10/29/20 djs Original programmer.
|
||||
|
||||
***********************************************************************************************************************/
|
||||
#pragma precomp SRP_PreCompiler
|
||||
#window NDW_MATERIAL_TRACK_REPORT
|
||||
|
||||
Declare function Form_Services, Database_Services, RTI_Task_Submit, RTI_Task_Status
|
||||
Declare subroutine SRP_Show_Window, Send_Message, Set_Property, Report_Services, Database_Services, Material_Track
|
||||
|
||||
$Insert EVENT_SETUP
|
||||
$Insert LOGICAL
|
||||
$Insert REPORT_CONFIG_EQUATES
|
||||
|
||||
SubclassInfo = Form_Services('FindSubclassControl')
|
||||
Subclass = SubclassInfo<1>
|
||||
|
||||
// Update the arguments so that the OpenInsight OLE event will treate the ActiveX event as a native event handler.
|
||||
If Event EQ 'OLE' then
|
||||
Transfer Event to OIEvent
|
||||
Transfer Param1 to Event
|
||||
Transfer Param2 to Param1
|
||||
Transfer Param3 to Param2
|
||||
Transfer Param4 to Param3
|
||||
Transfer Param5 to Param4
|
||||
Transfer Param6 to Param5
|
||||
Transfer Param7 to Param6
|
||||
Transfer Param8 to Param7
|
||||
end
|
||||
|
||||
GoToEvent Event for CtrlEntId else
|
||||
// Event not implemented
|
||||
end
|
||||
|
||||
Return EventFlow or 1
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// EVENT HANDLERS
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Event WINDOW.CREATE(CreateParam)
|
||||
|
||||
RptConfigKey = 'MATERIAL_TRACK*':@User4
|
||||
If RowExists('REPORT_CONFIG', RptConfigKey) then
|
||||
UserSettings = Database_Services('ReadDataRow', 'REPORT_CONFIG', RptConfigKey)
|
||||
Set_Property(@Window:'.PUB_SAVE_SETTINGS', 'ENABLED', False$)
|
||||
end else
|
||||
UserSettings = ''
|
||||
Set_Property(@Window:'.PUB_SAVE_SETTINGS', 'ENABLED', True$)
|
||||
end
|
||||
GoSub Setup_OLE_Controls
|
||||
GoSub EnableGenerateReportButton
|
||||
FormSize = ''
|
||||
SRP_Show_Window(@Window, '', 'C', 'C', 1, '', False$, False$, FormSize)
|
||||
|
||||
End Event
|
||||
|
||||
|
||||
Event PUB_GEN_REPORT.CLICK()
|
||||
|
||||
// Gather settings from form
|
||||
ColFltrArray = Get_Property(@Window:'.OLE_EDT_COL_FILTER', 'OLE.ARRAY')
|
||||
LocFltrArray = Get_Property(@Window:'.OLE_EDT_LOC_FILTER', 'OLE.ARRAY')
|
||||
|
||||
RptColumns = ''
|
||||
RptLocations = ''
|
||||
|
||||
Columns = ColFltrArray<1>
|
||||
Flags = ColFltrArray<2>
|
||||
For each Column in Columns using @VM setting vPos
|
||||
ColumnEnabled = Flags<0, vPos>
|
||||
If ColumnEnabled then RptColumns<0, -1> = Column
|
||||
Next Column
|
||||
|
||||
Locations = LocFltrArray<1>
|
||||
Flags = LocFltrArray<3>
|
||||
For each Location in Locations using @VM setting vPos
|
||||
LocationEnabled = Flags<0, vPos>
|
||||
If LocationEnabled then RptLocations<0, -1> = Location
|
||||
Next Location
|
||||
|
||||
* If @User4 EQ 'DANIEL_ST' then
|
||||
* debug
|
||||
* Material_Track(RptColumns, RptLocations)
|
||||
* TaskID = RTI_TASK_SUBMIT('', 'MATERIAL_TRACK', RptColumns, RptLocations)
|
||||
* If TaskID NE 0 then
|
||||
* Done = False$
|
||||
* TaskResponse = ''
|
||||
* Loop
|
||||
* Status = RTI_Task_Status(TaskID, TaskResponse)
|
||||
* If (Status EQ 'COMPLETED') OR (Status EQ 'ERROR') then Done = True$
|
||||
* Until Done
|
||||
* Repeat
|
||||
* end else
|
||||
* // Track if task id wasn't created at all.
|
||||
* end
|
||||
* StatusError = Get_Status(errCode)
|
||||
* If (Index(errCode, 'SHELLEXECUTE', 1)) NE 0 then StatusError = 0
|
||||
* end else
|
||||
Report_Services('GetMaterialTrackReport', RptColumns, RptLocations)
|
||||
* end
|
||||
|
||||
|
||||
end event
|
||||
|
||||
|
||||
Event PUB_SAVE_SETTINGS.CLICK()
|
||||
|
||||
RptConfigKey = 'MATERIAL_TRACK*':@User4
|
||||
If RowExists('REPORT_CONFIG', RptConfigKey) then
|
||||
UserSettings = Database_Services('ReadDataRow', 'REPORT_CONFIG', RptConfigKey)
|
||||
end else
|
||||
UserSettings = ''
|
||||
end
|
||||
|
||||
// Gather settings from form
|
||||
ColFltrArray = Get_Property(@Window:'.OLE_EDT_COL_FILTER', 'OLE.ARRAY')
|
||||
LocFltrArray = Get_Property(@Window:'.OLE_EDT_LOC_FILTER', 'OLE.ARRAY')
|
||||
|
||||
RptColumns = ''
|
||||
RptLocations = ''
|
||||
|
||||
Columns = ColFltrArray<1>
|
||||
Flags = ColFltrArray<2>
|
||||
For each Column in Columns using @VM setting vPos
|
||||
ColumnEnabled = Flags<0, vPos>
|
||||
If ColumnEnabled then RptColumns<0, -1> = Column
|
||||
Next Column
|
||||
UserSettings<REPORT_CONFIG.REPORT_COLUMNS$> = Flags
|
||||
|
||||
Locations = LocFltrArray<1>
|
||||
Flags = LocFltrArray<3>
|
||||
For each Location in Locations using @VM setting vPos
|
||||
LocationEnabled = Flags<0, vPos>
|
||||
If LocationEnabled then RptLocations<0, -1> = Location
|
||||
Next Location
|
||||
UserSettings<REPORT_CONFIG.LOCATION_FILTER$> = Flags
|
||||
|
||||
Database_Services('WriteDataRow', 'REPORT_CONFIG', RptConfigKey, UserSettings, True$, False$, True$)
|
||||
Set_Property(CtrlEntID, 'ENABLED', False$)
|
||||
|
||||
end event
|
||||
|
||||
|
||||
Event OLE_EDT_COL_FILTER.OnCheckChanged(Cell, OldValue, NewValue)
|
||||
|
||||
GoSub EnableSaveButton
|
||||
GoSub EnableGenerateReportButton
|
||||
|
||||
end event
|
||||
|
||||
|
||||
Event OLE_EDT_LOC_FILTER.OnCheckChanged(Cell, OldValue, NewValue)
|
||||
|
||||
GoSub EnableReportColumns
|
||||
GoSub EnableSaveButton
|
||||
GoSub EnableGenerateReportButton
|
||||
|
||||
end event
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Setup_OLE_Controls:
|
||||
|
||||
// Report Columns
|
||||
RptCols = ''
|
||||
RptCols<1, 1> = 'React No'
|
||||
RptCols<1, 2> = 'React Type'
|
||||
RptCols<1, 3> = 'WO No'
|
||||
RptCols<1, 4> = 'SAP Prod No'
|
||||
RptCols<1, 5> = 'Sub Part No'
|
||||
RptCols<1, 6> = 'Epi Part No'
|
||||
RptCols<1, 7> = 'WO Qty'
|
||||
RptCols<1, 8> = 'RX Qty'
|
||||
RptCols<1, 9> = 'UnRel Qty'
|
||||
RptCols<1, 10> = 'Kit Location'
|
||||
RptCols<1, 11> = 'Kit Qty'
|
||||
RptCols<1, 12> = '+/-'
|
||||
RptCols<1, 13> = 'Kit RO'
|
||||
RptCols<1, 14> = 'PTI RO'
|
||||
RptCols<1, 15> = 'Load'
|
||||
RptCols<1, 16> = 'Comments'
|
||||
|
||||
RptColsEnabled = ''
|
||||
If UserSettings NE '' then
|
||||
RptColsEnabled = UserSettings<REPORT_CONFIG.REPORT_COLUMNS$>
|
||||
end else
|
||||
For each Col in RptCols using @VM setting vPos
|
||||
RptColsEnabled<0, -1> = True$
|
||||
Next Col
|
||||
end
|
||||
|
||||
RptColsArray = RptCols:@FM:RptColsEnabled
|
||||
|
||||
// Location Filters
|
||||
LocFilters = ''
|
||||
LocFilters<1, 1> = 'SR*KTR]'
|
||||
LocFilters<1, 2> = '1K*PTI'
|
||||
LocFilters<1, 3> = 'CR*BE'
|
||||
LocFilters<1, 4> = 'CR*BO'
|
||||
LocFilters<1, 5> = 'CR*TUN'
|
||||
LocFilters<1, 6> = 'CR*EPR'
|
||||
LocFilters<1, 7> = 'CR*FE'
|
||||
LocFilters<1, 8> = 'CR*FEH'
|
||||
LocFilters<1, 9> = 'CR*FO'
|
||||
LocFilters<1, 10> = 'CR*FOH'
|
||||
|
||||
LocDescriptions = ''
|
||||
LocsEnabled = ''
|
||||
If UserSettings NE '' then
|
||||
LocsEnabled = UserSettings<REPORT_CONFIG.LOCATION_FILTER$>
|
||||
For each Loc in LocFilters using @VM setting vPos
|
||||
If vPos GT 1 then
|
||||
LocDescriptions<0, -1> = Xlate('LOCATION', Loc, 'DESC', 'X')
|
||||
end else
|
||||
LocDescriptions<0, -1> = 'All Kit Racks'
|
||||
end
|
||||
Next Loc
|
||||
end else
|
||||
For each Loc in LocFilters using @VM setting vPos
|
||||
LocsEnabled<0, -1> = True$
|
||||
If vPos GT 1 then
|
||||
LocDescriptions<0, -1> = Xlate('LOCATION', Loc, 'DESC', 'X')
|
||||
end else
|
||||
LocDescriptions<0, -1> = 'All Kit Racks'
|
||||
end
|
||||
Next Loc
|
||||
end
|
||||
|
||||
LocFltrArray = LocFilters:@FM:LocDescriptions:@FM:LocsEnabled
|
||||
|
||||
ColFltrCtrl = @Window:'.OLE_EDT_COL_FILTER'
|
||||
LocFltrCtrl = @Window:'.OLE_EDT_LOC_FILTER'
|
||||
|
||||
// Qualify OLE events that we want to intercept
|
||||
Qualifier = ''
|
||||
Qualifier<1> = 1
|
||||
Qualifier<4> = 0 ; * process synchronously (i.e. immediately)
|
||||
Send_Message(ColFltrCtrl, 'QUALIFY_EVENT', 'OLE.OnCheckChanged', Qualifier)
|
||||
Send_Message(LocFltrCtrl, 'QUALIFY_EVENT', 'OLE.OnCheckChanged', Qualifier)
|
||||
|
||||
NumColFltrCols = 2
|
||||
NumColFltrRows = DCount(RptCols, @VM)
|
||||
NumLocFltrCols = 3
|
||||
NumLocFltrRows = DCount(LocFilters, @VM)
|
||||
|
||||
HeaderFontArray = 'Segoe UI':@SVM:8:@SVM:700
|
||||
ColFltrDimArray = NumColFltrCols : @FM : NumColFltrRows
|
||||
LocFltrDimArray = NumLocFltrCols : @FM : NumLocFltrRows
|
||||
DataColArray = ''
|
||||
DataColArray<4> = True$ ; // Autosize column
|
||||
|
||||
HeaderTitles = 'Column':@VM:'Enabled'
|
||||
Set_Property(ColFltrCtrl, "OLE.TitleList", HeaderTitles)
|
||||
Set_Property(ColFltrCtrl, "OLE.CellFont[All; All]", 'Segoe UI':@SVM:8)
|
||||
Set_Property(ColFltrCtrl, "OLE.Dimension", ColFltrDimArray)
|
||||
Set_Property(ColFltrCtrl, "OLE.HeaderFont[All; 1]", HeaderFontArray)
|
||||
Set_Property(ColFltrCtrl, "OLE.HeaderColumn[1]", '':@FM:False$:@FM)
|
||||
Set_Property(ColFltrCtrl, "OLE.HeaderAlignment[All; 1]", "Top":@FM:"Center":@FM:"Center")
|
||||
Set_Property(ColFltrCtrl, "OLE.HeaderColors[All; 1]", @FM:"{200, 200, 200}")
|
||||
Set_Property(ColFltrCtrl, "OLE.CellType[2; All]", "Check Box")
|
||||
Set_Property(ColFltrCtrl, "OLE.CellAlignment[2; All]", "Top":@FM:"Center":@FM:"Center")
|
||||
Set_Property(ColFltrCtrl, "OLE.DataColumn[1]", DataColArray)
|
||||
Set_Property(ColFltrCtrl, "OLE.ARRAY", RptColsArray)
|
||||
Set_Property(ColFltrCtrl, "OLE.CellCheckEnabled[2; 1-3]", False)
|
||||
CellColorArray = 'None':@FM:"{240, 240, 240}"
|
||||
Set_Property(ColFltrCtrl, "OLE.CellColors[All; 1-3]", CellColorArray)
|
||||
Set_Property(ColFltrCtrl, "OLE.CellProtection[All; 1-3]", 'FUL')
|
||||
|
||||
|
||||
HeaderTitles = 'Location':@VM:'Description':@VM:'Enabled'
|
||||
Set_Property(LocFltrCtrl, "OLE.TitleList", HeaderTitles)
|
||||
Set_Property(LocFltrCtrl, "OLE.CellFont[All; All]", 'Segoe UI':@SVM:8)
|
||||
Set_Property(LocFltrCtrl, "OLE.Dimension", LocFltrDimArray)
|
||||
Set_Property(LocFltrCtrl, "OLE.LIST", '')
|
||||
Set_Property(LocFltrCtrl, "OLE.HeaderFont[All; 1]", HeaderFontArray)
|
||||
Set_Property(LocFltrCtrl, "OLE.HeaderColumn[1]", '':@FM:False$:@FM)
|
||||
Set_Property(LocFltrCtrl, "OLE.HeaderAlignment[All; 1]", "Top":@FM:"Center":@FM:"Center")
|
||||
Set_Property(LocFltrCtrl, "OLE.HeaderColors[All; 1]", @FM:"{200, 200, 200}")
|
||||
Set_Property(LocFltrCtrl, "OLE.CellType[3; All]", "Check Box")
|
||||
Set_Property(LocFltrCtrl, "OLE.DataColumn[2]", DataColArray)
|
||||
Set_Property(LocFltrCtrl, "OLE.CellAlignment[3; All]", "Top":@FM:"Center":@FM:"Center")
|
||||
Set_Property(LocFltrCtrl, "OLE.ARRAY", LocFltrArray)
|
||||
|
||||
return
|
||||
|
||||
|
||||
EnableSaveButton:
|
||||
|
||||
// Enable save settings button if necessary
|
||||
RptConfigKey = 'MATERIAL_TRACK*':@User4
|
||||
If RowExists('REPORT_CONFIG', RptConfigKey) then
|
||||
UserSettings = Database_Services('ReadDataRow', 'REPORT_CONFIG', RptConfigKey)
|
||||
end else
|
||||
UserSettings = ''
|
||||
end
|
||||
|
||||
// Gather settings from form
|
||||
ColFltrArray = Get_Property(@Window:'.OLE_EDT_COL_FILTER', 'OLE.ARRAY')
|
||||
LocFltrArray = Get_Property(@Window:'.OLE_EDT_LOC_FILTER', 'OLE.ARRAY')
|
||||
|
||||
NewColFlags = ColFltrArray<2>
|
||||
CurrColFlags = UserSettings<REPORT_CONFIG.REPORT_COLUMNS$>
|
||||
|
||||
NewLocFlags = LocFltrArray<3>
|
||||
CurrLocFlags = UserSettings<REPORT_CONFIG.LOCATION_FILTER$>
|
||||
|
||||
ChangeDetected = ( (NewColFlags NE CurrColFlags) or (NewLocFlags NE CurrLocFlags) )
|
||||
Set_Property(@Window:'.PUB_SAVE_SETTINGS', 'ENABLED', ChangeDetected)
|
||||
|
||||
return
|
||||
|
||||
|
||||
EnableGenerateReportButton:
|
||||
|
||||
// Gather settings from form
|
||||
LocFltrArray = Get_Property(@Window:'.OLE_EDT_LOC_FILTER', 'OLE.ARRAY')
|
||||
LocFlags = LocFltrArray<3>
|
||||
ButtonEnabled = (Sum(LocFlags) GT 0)
|
||||
Set_Property(@Window:'.PUB_GEN_REPORT', 'ENABLED', ButtonEnabled)
|
||||
|
||||
return
|
||||
|
||||
|
||||
EnableReportColumns:
|
||||
|
||||
ColFltrCtrl = @Window:'.OLE_EDT_COL_FILTER'
|
||||
LocFltrCtrl = @Window:'.OLE_EDT_LOC_FILTER'
|
||||
|
||||
// Gather settings from form
|
||||
LocFltrArray = Get_Property(LocFltrCtrl, 'OLE.ARRAY')
|
||||
|
||||
LocFlags = LocFltrArray<3>
|
||||
KitRackFlag = LocFlags<0, 1>
|
||||
PTIRackFlag = LocFlags<0, 2>
|
||||
LoadedFlags = Field(LocFlags, @VM , 3, 8)
|
||||
LoadedColEnabled = (Sum(LoadedFlags) GT 0)
|
||||
EnabledCellColorArray = 'None':@FM:'None'
|
||||
DisabledCellColorArray = 'None':@FM:"{240, 240, 240}"
|
||||
If KitRackFlag EQ True$ then
|
||||
Set_Property(ColFltrCtrl, "OLE.CellCheck[2; 10-12]", True$)
|
||||
Set_Property(ColFltrCtrl, "OLE.CellColors[All; 10-12]", EnabledCellColorArray)
|
||||
Set_Property(ColFltrCtrl, "OLE.CellProtection[All; 10-12]", 'SEL')
|
||||
Set_Property(ColFltrCtrl, "OLE.CellCheckEnabled[2; 10-12]", True$)
|
||||
end else
|
||||
Set_Property(ColFltrCtrl, "OLE.CellCheck[2; 10-12]", False$)
|
||||
Set_Property(ColFltrCtrl, "OLE.CellColors[All; 10-12]", DisabledCellColorArray)
|
||||
Set_Property(ColFltrCtrl, "OLE.CellProtection[All; 10-12]", 'FUL')
|
||||
Set_Property(ColFltrCtrl, "OLE.CellCheckEnabled[2; 10-12]", False$)
|
||||
end
|
||||
If PTIRackFlag EQ True$ then
|
||||
Set_Property(ColFltrCtrl, "OLE.CellCheck[2; 13]", True$)
|
||||
Set_Property(ColFltrCtrl, "OLE.CellColors[All; 13]", EnabledCellColorArray)
|
||||
Set_Property(ColFltrCtrl, "OLE.CellProtection[All; 13]", 'SEL')
|
||||
Set_Property(ColFltrCtrl, "OLE.CellCheckEnabled[2; 13]", True$)
|
||||
end else
|
||||
Set_Property(ColFltrCtrl, "OLE.CellCheck[2; 13]", False$)
|
||||
Set_Property(ColFltrCtrl, "OLE.CellColors[All; 13]", DisabledCellColorArray)
|
||||
Set_Property(ColFltrCtrl, "OLE.CellProtection[All; 13]", 'FUL')
|
||||
Set_Property(ColFltrCtrl, "OLE.CellCheckEnabled[2; 13]", False$)
|
||||
end
|
||||
If LoadedColEnabled EQ True$ then
|
||||
Set_Property(ColFltrCtrl, "OLE.CellCheck[2; 14]", True$)
|
||||
Set_Property(ColFltrCtrl, "OLE.CellColors[All; 14]", EnabledCellColorArray)
|
||||
Set_Property(ColFltrCtrl, "OLE.CellProtection[All; 14]", 'SEL')
|
||||
Set_Property(ColFltrCtrl, "OLE.CellCheckEnabled[2; 14]", True$)
|
||||
end else
|
||||
Set_Property(ColFltrCtrl, "OLE.CellCheck[2; 14]", False$)
|
||||
Set_Property(ColFltrCtrl, "OLE.CellColors[All; 14]", DisabledCellColorArray)
|
||||
Set_Property(ColFltrCtrl, "OLE.CellProtection[All; 14]", 'FUL')
|
||||
Set_Property(ColFltrCtrl, "OLE.CellCheckEnabled[2; 14]", False$)
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
|
@ -189,7 +189,13 @@ UpdateHALItem:
|
||||
|
||||
Begin Case
|
||||
Case ReportID = 'materialtrack'
|
||||
Error_Services('Add', 'Unsupported report')
|
||||
Body = HTTP_Services('GetHTTPPostString')
|
||||
If (Body NE '') then
|
||||
// The POST string will have been encoded so use percent (URL) decoding.
|
||||
RepJSON = HTTP_Services('DecodePercentString', Body)
|
||||
Report_Services('UpdateMaterialTrackData', RepJSON)
|
||||
end
|
||||
|
||||
Case ReportID = 'dailyperformance'
|
||||
ReportDate = Http_Services('GetQueryField', 'reportDate')
|
||||
// The resource will have been put into the POST string.
|
||||
@ -225,3 +231,4 @@ API reports.GET
|
||||
HTTP_Resource_Services('LoremIpsum')
|
||||
|
||||
end api
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,552 +0,0 @@
|
||||
Compile function Report_Services_Dev(@Service, @Params)
|
||||
/***********************************************************************************************************************
|
||||
|
||||
Name : Report_Services
|
||||
|
||||
Description : Handler program for all Report services.
|
||||
|
||||
Notes : Application errors should be logged using the Error Services module. There are a few methodological
|
||||
assumptions built into way errors are managed which are important to understand in order to properly
|
||||
work with Error Services:
|
||||
|
||||
- The term 'top' refers to the originating procedure of a call stack and the term 'bottom' refers to
|
||||
the last routine (or the current routine) within a call stack. Within the OpenInsight Debugger
|
||||
this will appear backwards since the originating procedure always appears at the bottom of the
|
||||
list and the current routine appears at the top of the list. We are using this orientation because
|
||||
it is common to refer to the process of calling other procedures as 'drilling down'.
|
||||
|
||||
- The reason for defining the orientation of the call stack is because Error_Services allows for
|
||||
multiple error conditions to be appended to an original error. In most cases this will happen when
|
||||
a procedure at the bottom of the stack generates an error condition and then returns to its
|
||||
calling procedure. This higher level procedure can optionally add more information relevant to
|
||||
itself. This continues as the call stack 'bubbles' its way back to the top to where the
|
||||
originating procedure is waiting.
|
||||
|
||||
- Native OpenInsight commands that handle errors (e.g., Set_Status, Set_FSError, Set_EventStatus)
|
||||
preserve their error state until explicitly cleared. This can hinder the normal execution of code
|
||||
since subsequent procedures (usually SSPs) will fail if a pre-existing error condition exists.
|
||||
Our philosophy is that error conditions should automatically be cleared before a new procedure
|
||||
is executed to avoid this problem. However, the nature of Basic+ does not make this easy to
|
||||
automate for any given stored procedure. Therefore, if a stored procedure wants to conform to our
|
||||
philosophy then it should include a call into the 'Clear' service request at the top of the
|
||||
program. Alternatively this can be done through a common insert (see SERVICE_SETUP for example.)
|
||||
|
||||
- Service modules will use the SERVICE_SETUP insert and therefore automatically clear out any
|
||||
error conditions that were set before.
|
||||
|
||||
Parameters :
|
||||
Service [in] -- Name of the service being requested
|
||||
Param1-10 [in/out] -- Additional request parameter holders
|
||||
Response [out] -- Response to be sent back to the Controller (MCP) or requesting procedure
|
||||
|
||||
Metadata :
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
07/28/21 djs Copied original source code from Report_Services. Modified GetMaterialTrackReport
|
||||
to use the SCHED_DET_NG table (i.e. Scheduler 2.0) instead of the SCHED_DET table.
|
||||
|
||||
|
||||
***********************************************************************************************************************/
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
$Insert SERVICE_SETUP
|
||||
$Insert LOGICAL
|
||||
$Insert OIPRINT_EQUATES
|
||||
$Insert SCHED_DET_NG_EQUATES
|
||||
$Insert WO_LOG_EQUATES
|
||||
$Insert APPCOLORS
|
||||
$Insert MSG_EQUATES
|
||||
$Insert SCHEDULE_EQU
|
||||
$Insert LOCATION_EQUATES
|
||||
$Insert RLIST_EQUATES
|
||||
|
||||
Declare subroutine Utility, ErrMsg, Set_Status, Set_Printer, RList, SRP_Stopwatch, Btree.Extract, Error_Services, V119
|
||||
Declare subroutine Push.Select, Pop.Select
|
||||
Declare function Set_Printer, Get_Printer, Msg, Get_Status, Printer_Select, obj_Install, Dialog_Box, obj_Location
|
||||
Declare function Error_Services, Location_Services, SRP_Array, Signature_Services
|
||||
Declare function Epi_Part_Services, SRP_Math, Datetime, MemberOf
|
||||
|
||||
Equ TAB$ TO \09\
|
||||
|
||||
GoToService
|
||||
|
||||
Return Response or ""
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// SERVICES
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Service GetMaterialTrackReport(RptColumns, LocationFilter, NoMatFlag)
|
||||
|
||||
// All Possible Report Columns
|
||||
AllRptColumns = ''
|
||||
AllRptColumns<1, 1> = 'React No'
|
||||
AllRptColumns<1, 2> = 'React Type'
|
||||
AllRptColumns<1, 3> = 'WO No'
|
||||
AllRptColumns<1, 4> = 'SAP Prod No'
|
||||
AllRptColumns<1, 5> = 'Sub Part No'
|
||||
AllRptColumns<1, 6> = 'Epi Part No'
|
||||
AllRptColumns<1, 7> = 'WO Qty'
|
||||
AllRptColumns<1, 8> = 'RX Qty'
|
||||
AllRptColumns<1, 9> = 'UnRel Qty'
|
||||
AllRptColumns<1, 10> = 'Kit Location'
|
||||
AllRptColumns<1, 11> = 'Kit Qty'
|
||||
AllRptColumns<1, 12> = '+/-'
|
||||
AllRptColumns<1, 13> = 'Kit RO'
|
||||
AllRptColumns<1, 14> = 'PTI RO'
|
||||
AllRptColumns<1, 15> = 'Load'
|
||||
AllRptColumns<1, 16> = 'Comments'
|
||||
|
||||
If Index(RptColumns, 'Comments', 1) then
|
||||
AllColFmt = ''
|
||||
AllColFmt<1, 1> = '+^720'
|
||||
AllColFmt<1, 2> = '+<720'
|
||||
AllColFmt<1, 3> = '+^1000'
|
||||
AllColFmt<1, 4> = '+^1100'
|
||||
AllColFmt<1, 5> = '+^1300'
|
||||
AllColFmt<1, 6> = '+^1200'
|
||||
AllColFmt<1, 7> = '+>720'
|
||||
AllColFmt<1, 8> = '+>720'
|
||||
AllColFmt<1, 9> = '+>720'
|
||||
AllColFmt<1, 10> = '+^1260'
|
||||
AllColFmt<1, 11> = '+^720'
|
||||
AllColFmt<1, 12> = '+^500'
|
||||
AllColFmt<1, 13> = '+^1300'
|
||||
AllColFmt<1, 14> = '+^1300'
|
||||
AllColFmt<1, 15> = '+^700'
|
||||
AllColFmt<1, 16> = '+^1300'
|
||||
end else
|
||||
AllColFmt = ''
|
||||
AllColFmt<1, 1> = '+^720'
|
||||
AllColFmt<1, 2> = '+<720'
|
||||
AllColFmt<1, 3> = '+^1000'
|
||||
AllColFmt<1, 4> = '+^1100'
|
||||
AllColFmt<1, 5> = '+^1300'
|
||||
AllColFmt<1, 6> = '+^1200'
|
||||
AllColFmt<1, 7> = '+>720'
|
||||
AllColFmt<1, 8> = '+>720'
|
||||
AllColFmt<1, 9> = '+>720'
|
||||
AllColFmt<1, 10> = '+^1260'
|
||||
AllColFmt<1, 11> = '+^720'
|
||||
AllColFmt<1, 12> = '+^500'
|
||||
AllColFmt<1, 13> = '+^1800'
|
||||
AllColFmt<1, 14> = '+^1800'
|
||||
AllColFmt<1, 15> = '+^1100'
|
||||
AllColFmt<1, 16> = ''
|
||||
end
|
||||
|
||||
ErrorTitle = 'Error in service ':Service
|
||||
ErrCode = ''
|
||||
ErrorMsg = ''
|
||||
|
||||
OPEN 'SCHED_DET_NG' TO SchedDetTable then
|
||||
OPEN 'DICT.SCHED_DET_NG' TO @DICT then
|
||||
Today = Datetime()
|
||||
|
||||
ReactList = ''
|
||||
WOList = ''
|
||||
SchedDetKeys = ''
|
||||
PrevReactNo = ''
|
||||
PrevWO = ''
|
||||
|
||||
SelectSent = 'SELECT SCHED_DET_NG WITH STOP_DTM GE ':Today:' BY REACT_NO'
|
||||
|
||||
RList(SelectSent,TARGET_ACTIVELIST$,'','','')
|
||||
IF Get_Status(errCode) THEN
|
||||
ErrMsg(errCode)
|
||||
RETURN
|
||||
END
|
||||
|
||||
Done = 0
|
||||
@ID = ''
|
||||
LOOP
|
||||
PrevSchedDetKey = @ID
|
||||
READNEXT @ID ELSE Done = 1
|
||||
UNTIL Done
|
||||
READ SchedDetRec FROM SchedDetTable,@ID THEN
|
||||
ReactNo = SchedDetRec<SCHED_DET_NG.REACT_NO$>
|
||||
WONo = SchedDetRec<SCHED_DET_NG.WO_NO$>
|
||||
If ReactNo NE '' then
|
||||
LOCATE ReactNo IN ReactList BY 'AR' USING @FM SETTING Pos ELSE
|
||||
ReactList = INSERT(ReactList,Pos,0,0,ReactNo)
|
||||
END
|
||||
END
|
||||
If WONo NE '' then
|
||||
LOCATE WONo IN WOList<Pos> USING @VM SETTING WPos ELSE
|
||||
WOList = INSERT(WOList,Pos,-1,0,WONo)
|
||||
SchedDetKeys = INSERT(SchedDetKeys,-1,0,0,@ID)
|
||||
END
|
||||
END
|
||||
END
|
||||
|
||||
REPEAT
|
||||
|
||||
CALL Make.List(0,SchedDetKeys,SchedDetTable,@DICT)
|
||||
|
||||
Header = "'D'":@VM:obj_Install('Get_Prop','CompTitle'):' Material Tracking by Reactor':@VM:"Page 'P'"
|
||||
MinDemand = 0
|
||||
Set_Status(0)
|
||||
|
||||
* Start of printing process
|
||||
FileName = 'Print Material Demand'
|
||||
Title = 'Printing Material Demand'
|
||||
|
||||
TopMargin = 1.0
|
||||
BottomMargin = 0.75
|
||||
LeftMargin = 0.25
|
||||
RightMargin = 0.25
|
||||
|
||||
Margins = LeftMargin:@FM:TopMargin:@FM:RightMargin:@FM:BottomMargin
|
||||
|
||||
PageSetup = '1' ;* LandScape
|
||||
PrintSetup = '2' ;* Preview Normal
|
||||
PrintSetup<1,2> = '0' ;* All buttons
|
||||
PrintSetup<1,5> = '1' ;* Page Range
|
||||
PrintSetup<1,6> = 7 ;* full mouse and keyboard support
|
||||
|
||||
PrintPath = ''
|
||||
stat = Set_Printer('INIT',FileName,Title,Margins,PageSetup,PrintSetup,PrintPath)
|
||||
|
||||
IF stat < 0 THEN
|
||||
ErrorMsg = 'Stat = ' : Stat : ', PrintPath = ' : PrintPath
|
||||
GOTO OIPrintErr
|
||||
end
|
||||
DateRange = 'Effective ':OCONV(Date(),'D4')
|
||||
|
||||
Header<-1> = "'T'"
|
||||
Header<-1> = '' ;* Blank line following heading
|
||||
|
||||
font = 'Arial'
|
||||
font<2> = '10'
|
||||
font<4> = '0' ;* Bold
|
||||
|
||||
stat = Set_Printer('FONTHEADFOOT',font) ; IF stat < 0 THEN GOTO OIPrintErr
|
||||
stat = Set_Printer('HEADER',Header) ; IF stat < 0 THEN GOTO OIPrintErr
|
||||
|
||||
Footer = " 'D' 'T'":@VM:@VM:"Page: 'P'"
|
||||
stat = Set_Printer('FOOTER',Footer) ; IF stat < 0 THEN GOTO OIPrintErr
|
||||
|
||||
@RECCOUNT = 0
|
||||
FirstPass = 1
|
||||
LastRecord = 0
|
||||
FirstLine = 1
|
||||
fontSpacing = 100
|
||||
|
||||
* Make Column Heading
|
||||
ColHead = ''
|
||||
ColFmt = ''
|
||||
|
||||
For each Column in RptColumns using @VM setting rcPos
|
||||
Locate Column in AllRptColumns using @VM setting dataPos then
|
||||
ColHead<0, -1> = Column
|
||||
ColFmt<0, -1> = AllColFmt<0, dataPos>
|
||||
end
|
||||
Next Column
|
||||
|
||||
* Zero Accumulators For Each Break
|
||||
|
||||
Prev.ReactNo = ''
|
||||
Last.ReactNo.Break = 1
|
||||
|
||||
GoTo ReadRecord
|
||||
|
||||
end else
|
||||
ErrorMsg = 'Unable to open "SCHED_DET_NG" table.'
|
||||
ErrMsg(ErrorTitle:@SVM:ErrorMsg)
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Unable to open "SCHED_DET_NG" table.'
|
||||
ErrMsg(ErrorTitle:@SVM:ErrorMsg)
|
||||
end
|
||||
|
||||
End Service
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ReadRecord:
|
||||
|
||||
* Zero Break Flags To False
|
||||
|
||||
ReactNo.Break=0
|
||||
|
||||
READNEXT @ID, Which.Value ELSE
|
||||
LastRecord = 1
|
||||
ReactNo.Break = 1
|
||||
ReactNo = Prev.ReactNo
|
||||
END
|
||||
|
||||
S.ATID = @ID
|
||||
|
||||
IF FirstPass AND LastRecord THEN
|
||||
GOTO Bail
|
||||
END
|
||||
|
||||
IF LastRecord THEN GOTO BREAKS
|
||||
|
||||
READO @RECORD FROM SchedDetTable,@ID ELSE
|
||||
GOTO ReadRecord
|
||||
END
|
||||
|
||||
@RECCOUNT += 1
|
||||
|
||||
* Calculate Value(s) For Column(s)
|
||||
|
||||
S.ATID = {@ID}
|
||||
I.ATID = S.ATID
|
||||
S.ReactNo = {REACT_NO}
|
||||
I.ReactNo = S.ReactNo
|
||||
S.WoNo = {WO_NO}
|
||||
I.WoNo = S.WoNo
|
||||
S.SubPartNo = XLATE('WO_LOG', S.WoNo, 'ORD_SUB_PART_NO', 'X')
|
||||
I.SubPartNo = S.SubPartNo
|
||||
S.EpiPartNo = XLATE('WO_LOG', S.WoNo, WO_LOG_EPI_PART_NO$, 'X')
|
||||
I.EpiPartNo = S.EpiPartNo
|
||||
S.WO_Qty = Xlate('WO_LOG', {WO_NO}, WO_LOG_WO_QTY$, 'X')
|
||||
I.WO_Qty = S.WO_Qty
|
||||
S.WO_RX_Qty = Xlate('WO_LOG', {WO_NO}, 'RX_QTY', 'X')
|
||||
I.WO_RX_Qty = S.WO_RX_Qty
|
||||
S.WO_UnRel_QTY = Xlate('WO_LOG', {WO_NO}, 'UNREL_QTY', 'X')
|
||||
I.WO_UnRel_QTY = S.WO_UnRel_QTY
|
||||
S.REACT_TYPE = Xlate('WO_LOG', {WO_NO}, 'REACT_TYPE', 'X')
|
||||
S.ProdOrdNo = Xlate('WO_LOG', {WO_NO}, 'PROD_ORD_NO', 'X')
|
||||
|
||||
Locate 'SR*KTR]' in LocationFilter using @VM setting vPos then
|
||||
KitData = Location_Services('GetLocationCassInfo', S.WONo, 'SR*KTR]')
|
||||
SWAP CRLF$ WITH @VM IN KitData
|
||||
end else
|
||||
KitData = ''
|
||||
end
|
||||
|
||||
S.KitLocation = KitData<1>
|
||||
I.KitLocation = S.KitLocation
|
||||
|
||||
S.KitQty = OCONV(SUM(KitData<2>) * 25,'MD0,Z')
|
||||
I.KitQty = S.KitQty
|
||||
|
||||
S.KitCassCnt = COUNT(KitData<3>,',') + (KitData<3> NE '')
|
||||
I.KitCassCnt = S.KitCassCnt
|
||||
|
||||
KitCassList = KitData<3>
|
||||
|
||||
Locate '1K*PTI' in LocationFilter using @VM setting vPos then
|
||||
PTIData = Location_Services('GetLocationCassInfo', S.WONo, '1K*PTI')
|
||||
SWAP CRLF$ WITH @VM IN PTIData
|
||||
end else
|
||||
PTIData = ''
|
||||
end
|
||||
PTICassList = PTIData<3>
|
||||
|
||||
CRLocs = ''
|
||||
CRLocs<0, -1> = 'CR*BE'
|
||||
CRLocs<0, -1> = 'CR*BO'
|
||||
CRLocs<0, -1> = 'CR*TUN'
|
||||
CRLocs<0, -1> = 'CR*EPR'
|
||||
CRLocs<0, -1> = 'CR*FE'
|
||||
CRLocs<0, -1> = 'CR*FEH'
|
||||
CRLocs<0, -1> = 'CR*FO'
|
||||
CRLocs<0, -1> = 'CR*FOH'
|
||||
|
||||
LoadedData = ''
|
||||
LocQueryList = ''
|
||||
For each Loc in CRLocs using @VM setting crPos
|
||||
Locate Loc in LocationFilter using @VM setting vPos then
|
||||
LocQueryList<0, -1> = Loc
|
||||
end
|
||||
Next Loc
|
||||
|
||||
LoadedCassList = ''
|
||||
ReactType = Xlate('WO_LOG', S.WONo, 'REACT_TYPE', 'X')
|
||||
If ReactType NE 'EPP' then
|
||||
If LocQueryList NE '' then
|
||||
LoadedData = Location_Services('GetLocationCassInfo', S.WONo, LocQueryList)
|
||||
Swap CRLF$ with @VM in LoadedData
|
||||
CassList = LoadedData<3>
|
||||
Swap @VM with ',' in CassList
|
||||
For each CassNo in CassList using ','
|
||||
If ( (S.WONo NE '') and (CassNo NE '') ) then
|
||||
WOMatKey = S.WONo:'*':CassNo
|
||||
UnloadSigComp = Signature_Services('CheckSignature', WOMatKey, 'UNLOAD')
|
||||
OnHold = Xlate('WO_MAT', WOMatKey, 'HOLD', 'X')
|
||||
CurrStatus = Xlate('WO_MAT', WOMatKey, 'CURR_STATUS', 'X')
|
||||
If Not(UnloadSigComp or OnHold or (CurrStatus EQ 'REJ') ) then
|
||||
LoadedCassList<0, -1> = CassNo
|
||||
end
|
||||
end
|
||||
Next CassNo
|
||||
end
|
||||
end
|
||||
|
||||
* TEST FOR CONTROL BREAK(S)
|
||||
|
||||
IF (S.ReactNo NE Prev.ReactNo) OR ReactNo.Break THEN
|
||||
ReactNo = Prev.ReactNo
|
||||
Prev.ReactNo = S.ReactNo
|
||||
ReactNo.Break += 1
|
||||
END
|
||||
|
||||
IF FirstPass THEN
|
||||
FirstPass=0
|
||||
GOTO DETAIL
|
||||
END
|
||||
|
||||
|
||||
BREAKS:
|
||||
|
||||
* Print Break Total(s) And Accumulate Total(s)
|
||||
IF ReactNo.Break THEN stat = Set_Printer('TEXT')
|
||||
|
||||
* Perform Last Record Output If Done
|
||||
IF LastRecord THEN
|
||||
colData = ''
|
||||
GOTO Bail
|
||||
END
|
||||
|
||||
|
||||
DETAIL:
|
||||
|
||||
* Do Conversion If Any
|
||||
|
||||
IF S.REACTNO NE "" THEN S.REACTNO = OCONV(S.REACTNO,"MD0,")
|
||||
IF S.WONO NE "" THEN S.WONO = OCONV(S.WONO,"MD0")
|
||||
IF S.WO_QTY NE "" THEN S.WO_QTY = OCONV(S.WO_QTY,"MD0,")
|
||||
IF S.WO_RX_QTY NE "" THEN S.WO_RX_QTY = OCONV(S.WO_RX_QTY,"MD0,")
|
||||
IF S.WO_UNREL_QTY NE "" THEN S.WO_UNREL_QTY = OCONV(S.WO_UNREL_QTY,"MD0,")
|
||||
|
||||
* PRINT DETAIL LINE
|
||||
|
||||
COLDATA = ''
|
||||
RowNumber = 0
|
||||
|
||||
/* ascending sort */
|
||||
Convert @VM to ',' in KitCassList
|
||||
Convert @VM to ',' in PTICassList
|
||||
Convert @VM to ',' in LoadedCassList
|
||||
KitCassList = SRP_Array('SortSimpleList', KitCassList, 'AscendingNumbers', ',')
|
||||
PTICassList = SRP_Array('SortSimpleList', PTICassList, 'AscendingNumbers', ',')
|
||||
LoadedCassList = SRP_Array('SortSimpleList', LoadedCassList, 'AscendingNumbers', ',')
|
||||
|
||||
Convert ',' to @VM in KitCassList
|
||||
Convert ',' to @VM in PTICassList
|
||||
Convert ',' to @VM in LoadedCassList
|
||||
|
||||
NumKitCass = DCount(KitCassList, @VM)
|
||||
If NumKitCass GT 4 then
|
||||
For CassIndex = 4 to NumKitCass Step 4
|
||||
CassNo = KitCassList<0, CassIndex>
|
||||
CassNo := CRLF$
|
||||
KitCassList<0, CassIndex> = CassNo
|
||||
Next CassIndex
|
||||
end
|
||||
NumPTICass = DCount(PTICassList, @VM)
|
||||
If NumPTICass GT 4 then
|
||||
For CassIndex = 4 to NumPTICass Step 4
|
||||
CassNo = PTICassList<0, CassIndex>
|
||||
CassNo := CRLF$
|
||||
PTICassList<0, CassIndex> = CassNo
|
||||
Next CassIndex
|
||||
end
|
||||
NumLoadedCass = DCount(LoadedCassList, @VM)
|
||||
If NumLoadedCass GT 2 then
|
||||
For CassIndex = 2 to NumLoadedCass Step 2
|
||||
CassNo = LoadedCassList<0, CassIndex>
|
||||
CassNo := CRLF$
|
||||
LoadedCassList<0, CassIndex> = CassNo
|
||||
Next CassIndex
|
||||
end
|
||||
Convert @VM to ',' in KitCassList
|
||||
Convert @VM to ',' in PTICassList
|
||||
Convert @VM to ',' in LoadedCassList
|
||||
|
||||
CassNeeded = ''
|
||||
EpiPartNo = Xlate('WO_LOG', S.WONo, 'EPI_PART_NO', 'X')
|
||||
If EpiPartNo NE '' then
|
||||
WPDAdjusted = Epi_Part_Services('GetAdjustedWafersPerDayScheduler', EpiPartNo, S.React_Type)
|
||||
If WPDAdjusted NE '' then
|
||||
CPDAdjusted = SRP_Math('CEILING', (WPDAdjusted/25) )
|
||||
CassInCR = DCount(KittCassList, ',') + DCount(PTICassList, ',') + DCount(LoadedCassList, ',')
|
||||
CassNeeded = CassInCR - CPDAdjusted
|
||||
end
|
||||
end
|
||||
|
||||
Swap '.1' with '' in S.ProdOrdNo
|
||||
AllReportData = ''
|
||||
AllReportData<1> = S.ReactNo
|
||||
AllReportData<2> = S.React_Type
|
||||
AllReportData<3> = S.WONo
|
||||
AllReportData<4> = S.ProdOrdNo
|
||||
AllReportData<5> = S.SubPartNo
|
||||
AllReportData<6> = S.EpiPartNo
|
||||
AllReportData<7> = S.WO_Qty
|
||||
AllReportData<8> = S.WO_RX_Qty
|
||||
AllReportData<9> = S.WO_UnRel_Qty
|
||||
AllReportData<10> = S.KitLocation
|
||||
AllReportData<11> = S.KitQty
|
||||
AllReportData<12> = CassNeeded
|
||||
AllReportData<13> = KitCassList
|
||||
AllReportData<14> = PTICassList
|
||||
AllReportData<15> = LoadedCassList
|
||||
AllReportData<16> = ''
|
||||
|
||||
If ( (KitCassList NE '') or (PTICassList NE '') or (LoadedCassList NE '') or (NoMatFlag EQ True$) ) then
|
||||
RowNumber += 1
|
||||
For each RptColumn in RptColumns using @VM setting rcPos
|
||||
Locate RptColumn in AllRptColumns using @VM setting dataPos then
|
||||
COLDATA<RowNumber,rcPos> = AllReportData<dataPos>
|
||||
end
|
||||
Next RptColumn
|
||||
If COLDATA NE '' then GoSub PrintTable
|
||||
END
|
||||
|
||||
GOTO ReadRecord
|
||||
|
||||
Bail:
|
||||
|
||||
stat = Set_Printer('TERM',1)
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
OIPrintErr:
|
||||
|
||||
ErrMsg(ErrorTitle:@SVM:ErrorMsg)
|
||||
ErrMsg(ErrorTitle:@SVM:'Set_Printer returned errorcode ':stat)
|
||||
stat = Set_Printer('TERM',1)
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
PrintTable:
|
||||
|
||||
PageHeight = Get_Printer('PAGESIZE')<2>
|
||||
PrintableHeight = PageHeight - TopMargin - BottomMargin
|
||||
PrinterHeight = Get_Printer('POS')<2>
|
||||
stat = Set_Printer('CALCTABLE',ColFmt:@FM:ColData)
|
||||
TableSize = Get_Printer('CALCTABLE')
|
||||
TableHeight = TableSize<2>
|
||||
fontSpacing = 120
|
||||
|
||||
IF ( TableHeight + PrinterHeight >= PrintableHeight ) OR FirstLine THEN
|
||||
IF NOT(FirstLine) THEN
|
||||
stat = Set_Printer('PAGEBREAK')
|
||||
END
|
||||
FirstLine = 0
|
||||
font<2> = 10
|
||||
font<4> = 1 ;* Bold
|
||||
stat = Set_Printer('FONT',font,'100')
|
||||
stat = Set_Printer('ADDTABLE',colFmt,colHead,'',LTGREY$,'',0,TB_ALL)
|
||||
font<4> = 0
|
||||
stat = Set_Printer('FONT',font,fontSpacing)
|
||||
stat = Set_Printer('ADDTABLE',colFmt,'',colData,LTGREY$,'',0,7)
|
||||
END ELSE
|
||||
font<2> = 10
|
||||
font<4> = 0
|
||||
stat = Set_Printer('FONT',font,fontSpacing)
|
||||
stat = Set_Printer('ADDTABLE',colFmt,'',colData,LTGREY$,'',1,TB_ALL)
|
||||
END
|
||||
|
||||
RETURN
|
||||
|
||||
|
@ -1,589 +0,0 @@
|
||||
Compile function Report_Services_Dev2(@Service, @Params)
|
||||
/***********************************************************************************************************************
|
||||
|
||||
Name : Report_Services
|
||||
|
||||
Description : Handler program for all Report services.
|
||||
|
||||
Notes : Application errors should be logged using the Error Services module. There are a few methodological
|
||||
assumptions built into way errors are managed which are important to understand in order to properly
|
||||
work with Error Services:
|
||||
|
||||
- The term 'top' refers to the originating procedure of a call stack and the term 'bottom' refers to
|
||||
the last routine (or the current routine) within a call stack. Within the OpenInsight Debugger
|
||||
this will appear backwards since the originating procedure always appears at the bottom of the
|
||||
list and the current routine appears at the top of the list. We are using this orientation because
|
||||
it is common to refer to the process of calling other procedures as 'drilling down'.
|
||||
|
||||
- The reason for defining the orientation of the call stack is because Error_Services allows for
|
||||
multiple error conditions to be appended to an original error. In most cases this will happen when
|
||||
a procedure at the bottom of the stack generates an error condition and then returns to its
|
||||
calling procedure. This higher level procedure can optionally add more information relevant to
|
||||
itself. This continues as the call stack 'bubbles' its way back to the top to where the
|
||||
originating procedure is waiting.
|
||||
|
||||
- Native OpenInsight commands that handle errors (e.g., Set_Status, Set_FSError, Set_EventStatus)
|
||||
preserve their error state until explicitly cleared. This can hinder the normal execution of code
|
||||
since subsequent procedures (usually SSPs) will fail if a pre-existing error condition exists.
|
||||
Our philosophy is that error conditions should automatically be cleared before a new procedure
|
||||
is executed to avoid this problem. However, the nature of Basic+ does not make this easy to
|
||||
automate for any given stored procedure. Therefore, if a stored procedure wants to conform to our
|
||||
philosophy then it should include a call into the 'Clear' service request at the top of the
|
||||
program. Alternatively this can be done through a common insert (see SERVICE_SETUP for example.)
|
||||
|
||||
- Service modules will use the SERVICE_SETUP insert and therefore automatically clear out any
|
||||
error conditions that were set before.
|
||||
|
||||
Parameters :
|
||||
Service [in] -- Name of the service being requested
|
||||
Param1-10 [in/out] -- Additional request parameter holders
|
||||
Response [out] -- Response to be sent back to the Controller (MCP) or requesting procedure
|
||||
|
||||
Metadata :
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
07/28/21 djs Copied original source code from Report_Services. Modified GetMaterialTrackReport
|
||||
to use the SCHED_DET_NG table (i.e. Scheduler 2.0) instead of the SCHED_DET table.
|
||||
|
||||
|
||||
***********************************************************************************************************************/
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
$Insert SERVICE_SETUP
|
||||
$Insert LOGICAL
|
||||
$Insert OIPRINT_EQUATES
|
||||
$Insert SCHED_DET_NG_EQUATES
|
||||
$Insert WO_LOG_EQUATES
|
||||
$Insert APPCOLORS
|
||||
$Insert MSG_EQUATES
|
||||
$Insert SCHEDULE_EQU
|
||||
$Insert LOCATION_EQUATES
|
||||
$Insert RLIST_EQUATES
|
||||
|
||||
Declare subroutine Utility, ErrMsg, Set_Status, Set_Printer, RList, SRP_Stopwatch, Btree.Extract, Error_Services, V119
|
||||
Declare subroutine Push.Select, Pop.Select
|
||||
Declare function Set_Printer, Get_Printer, Msg, Get_Status, Printer_Select, obj_Install, Dialog_Box, obj_Location
|
||||
Declare function Error_Services, Location_Services, SRP_Array, Signature_Services
|
||||
Declare function Epi_Part_Services, SRP_Math, Datetime
|
||||
|
||||
Equ TAB$ TO \09\
|
||||
|
||||
GoToService
|
||||
|
||||
Return Response or ""
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// SERVICES
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Service GetMaterialTrackReport(RptColumns, LocationFilter, NoMatFlag)
|
||||
|
||||
// All Possible Report Columns
|
||||
AllRptColumns = ''
|
||||
AllRptColumns<1, 1> = 'React No'
|
||||
AllRptColumns<1, 2> = 'React Type'
|
||||
AllRptColumns<1, 3> = 'WO No'
|
||||
AllRptColumns<1, 4> = 'SAP Prod No'
|
||||
AllRptColumns<1, 5> = 'Sub Part No'
|
||||
AllRptColumns<1, 6> = 'Epi Part No'
|
||||
AllRptColumns<1, 7> = 'WO Qty'
|
||||
AllRptColumns<1, 8> = 'RX Qty'
|
||||
AllRptColumns<1, 9> = 'UnRel Qty'
|
||||
AllRptColumns<1, 10> = 'Kit Location'
|
||||
AllRptColumns<1, 11> = 'Kit Qty'
|
||||
AllRptColumns<1, 12> = '+/-'
|
||||
AllRptColumns<1, 13> = 'Kit RO'
|
||||
AllRptColumns<1, 14> = 'PTI RO'
|
||||
AllRptColumns<1, 15> = 'Load'
|
||||
AllRptColumns<1, 16> = 'Comments'
|
||||
|
||||
If Index(RptColumns, 'Comments', 1) then
|
||||
AllColFmt = ''
|
||||
AllColFmt<1, 1> = '+^720'
|
||||
AllColFmt<1, 2> = '+<720'
|
||||
AllColFmt<1, 3> = '+^1000'
|
||||
AllColFmt<1, 4> = '+^1100'
|
||||
AllColFmt<1, 5> = '+^1300'
|
||||
AllColFmt<1, 6> = '+^1200'
|
||||
AllColFmt<1, 7> = '+>720'
|
||||
AllColFmt<1, 8> = '+>720'
|
||||
AllColFmt<1, 9> = '+>720'
|
||||
AllColFmt<1, 10> = '+^1260'
|
||||
AllColFmt<1, 11> = '+^720'
|
||||
AllColFmt<1, 12> = '+^500'
|
||||
AllColFmt<1, 13> = '+^1300'
|
||||
AllColFmt<1, 14> = '+^1300'
|
||||
AllColFmt<1, 15> = '+^700'
|
||||
AllColFmt<1, 16> = '+^1300'
|
||||
end else
|
||||
AllColFmt = ''
|
||||
AllColFmt<1, 1> = '+^720'
|
||||
AllColFmt<1, 2> = '+<720'
|
||||
AllColFmt<1, 3> = '+^1000'
|
||||
AllColFmt<1, 4> = '+^1100'
|
||||
AllColFmt<1, 5> = '+^1300'
|
||||
AllColFmt<1, 6> = '+^1200'
|
||||
AllColFmt<1, 7> = '+>720'
|
||||
AllColFmt<1, 8> = '+>720'
|
||||
AllColFmt<1, 9> = '+>720'
|
||||
AllColFmt<1, 10> = '+^1260'
|
||||
AllColFmt<1, 11> = '+^720'
|
||||
AllColFmt<1, 12> = '+^500'
|
||||
AllColFmt<1, 13> = '+^1800'
|
||||
AllColFmt<1, 14> = '+^1800'
|
||||
AllColFmt<1, 15> = '+^1100'
|
||||
AllColFmt<1, 16> = ''
|
||||
end
|
||||
|
||||
ErrorTitle = 'Error in service ':Service
|
||||
ErrCode = ''
|
||||
ErrorMsg = ''
|
||||
|
||||
OPEN 'SCHED_DET_NG' TO SchedDetTable then
|
||||
OPEN 'DICT.SCHED_DET_NG' TO @DICT then
|
||||
Today = Datetime() - 30
|
||||
|
||||
ReactList = ''
|
||||
WOList = ''
|
||||
SchedDetKeys = ''
|
||||
PrevReactNo = ''
|
||||
PrevWO = ''
|
||||
|
||||
SelectSent = 'SELECT SCHED_DET_NG WITH STOP_DTM GE ':Today:' BY REACT_NO'
|
||||
|
||||
RList(SelectSent,TARGET_ACTIVELIST$,'','','')
|
||||
IF Get_Status(errCode) THEN
|
||||
ErrMsg(errCode)
|
||||
RETURN
|
||||
END
|
||||
|
||||
Done = 0
|
||||
@ID = ''
|
||||
LOOP
|
||||
PrevSchedDetKey = @ID
|
||||
READNEXT @ID ELSE Done = 1
|
||||
UNTIL Done
|
||||
READ SchedDetRec FROM SchedDetTable,@ID THEN
|
||||
ReactNo = SchedDetRec<SCHED_DET_NG.REACT_NO$>
|
||||
WONo = SchedDetRec<SCHED_DET_NG.WO_NO$>
|
||||
If ReactNo NE '' then
|
||||
LOCATE ReactNo IN ReactList BY 'AR' USING @FM SETTING Pos ELSE
|
||||
ReactList = INSERT(ReactList,Pos,0,0,ReactNo)
|
||||
END
|
||||
END
|
||||
If WONo NE '' then
|
||||
LOCATE WONo IN WOList<Pos> USING @VM SETTING WPos ELSE
|
||||
WOList = INSERT(WOList,Pos,-1,0,WONo)
|
||||
SchedDetKeys = INSERT(SchedDetKeys,-1,0,0,@ID)
|
||||
END
|
||||
END
|
||||
END
|
||||
|
||||
REPEAT
|
||||
|
||||
CALL Make.List(0,SchedDetKeys,SchedDetTable,@DICT)
|
||||
|
||||
Header = "'D'":@VM:obj_Install('Get_Prop','CompTitle'):' Material Tracking by Reactor':@VM:"Page 'P'"
|
||||
MinDemand = 0
|
||||
Set_Status(0)
|
||||
|
||||
* Start of printing process
|
||||
FileName = 'Print Material Demand'
|
||||
Title = 'Printing Material Demand'
|
||||
|
||||
TopMargin = 1.0
|
||||
BottomMargin = 0.75
|
||||
LeftMargin = 0.25
|
||||
RightMargin = 0.25
|
||||
|
||||
Margins = LeftMargin:@FM:TopMargin:@FM:RightMargin:@FM:BottomMargin
|
||||
|
||||
PageSetup = '1' ;* LandScape
|
||||
PrintSetup = '2' ;* Preview Normal
|
||||
PrintSetup<1,2> = '0' ;* All buttons
|
||||
PrintSetup<1,5> = '1' ;* Page Range
|
||||
PrintSetup<1,6> = 7 ;* full mouse and keyboard support
|
||||
|
||||
PrintPath = ''
|
||||
stat = Set_Printer('INIT',FileName,Title,Margins,PageSetup,PrintSetup,PrintPath)
|
||||
|
||||
IF stat < 0 THEN
|
||||
ErrorMsg = 'Stat = ' : Stat : ', PrintPath = ' : PrintPath
|
||||
GOTO OIPrintErr
|
||||
end
|
||||
DateRange = 'Effective ':OCONV(Date(),'D4')
|
||||
|
||||
Header<-1> = "'T'"
|
||||
Header<-1> = '' ;* Blank line following heading
|
||||
|
||||
font = 'Arial'
|
||||
font<2> = '10'
|
||||
font<4> = '0' ;* Bold
|
||||
|
||||
stat = Set_Printer('FONTHEADFOOT',font) ; IF stat < 0 THEN GOTO OIPrintErr
|
||||
stat = Set_Printer('HEADER',Header) ; IF stat < 0 THEN GOTO OIPrintErr
|
||||
|
||||
Footer = " 'D' 'T'":@VM:@VM:"Page: 'P'"
|
||||
stat = Set_Printer('FOOTER',Footer) ; IF stat < 0 THEN GOTO OIPrintErr
|
||||
|
||||
@RECCOUNT = 0
|
||||
FirstPass = 1
|
||||
LastRecord = 0
|
||||
FirstLine = 1
|
||||
fontSpacing = 100
|
||||
|
||||
* Make Column Heading
|
||||
ColHead = ''
|
||||
ColFmt = ''
|
||||
|
||||
For each Column in RptColumns using @VM setting rcPos
|
||||
Locate Column in AllRptColumns using @VM setting dataPos then
|
||||
ColHead<0, -1> = Column
|
||||
ColFmt<0, -1> = AllColFmt<0, dataPos>
|
||||
end
|
||||
Next Column
|
||||
|
||||
* Zero Accumulators For Each Break
|
||||
|
||||
Prev.ReactNo = ''
|
||||
Last.ReactNo.Break = 1
|
||||
|
||||
GoTo ReadRecord
|
||||
|
||||
end else
|
||||
ErrorMsg = 'Unable to open "SCHED_DET_NG" table.'
|
||||
ErrMsg(ErrorTitle:@SVM:ErrorMsg)
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Unable to open "SCHED_DET_NG" table.'
|
||||
ErrMsg(ErrorTitle:@SVM:ErrorMsg)
|
||||
end
|
||||
|
||||
End Service
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ReadRecord:
|
||||
|
||||
* Zero Break Flags To False
|
||||
|
||||
ReactNo.Break=0
|
||||
|
||||
READNEXT @ID, Which.Value ELSE
|
||||
LastRecord = 1
|
||||
ReactNo.Break = 1
|
||||
ReactNo = Prev.ReactNo
|
||||
END
|
||||
|
||||
S.ATID = @ID
|
||||
|
||||
IF FirstPass AND LastRecord THEN
|
||||
GOTO Bail
|
||||
END
|
||||
|
||||
IF LastRecord THEN GOTO BREAKS
|
||||
|
||||
READO @RECORD FROM SchedDetTable,@ID ELSE
|
||||
GOTO ReadRecord
|
||||
END
|
||||
|
||||
@RECCOUNT += 1
|
||||
|
||||
* Calculate Value(s) For Column(s)
|
||||
|
||||
S.ATID = {@ID}
|
||||
I.ATID = S.ATID
|
||||
S.ReactNo = {REACT_NO}
|
||||
I.ReactNo = S.ReactNo
|
||||
S.WoNo = {WO_NO}
|
||||
I.WoNo = S.WoNo
|
||||
S.SubPartNo = XLATE('WO_LOG', S.WoNo, 'ORD_SUB_PART_NO', 'X')
|
||||
I.SubPartNo = S.SubPartNo
|
||||
S.EpiPartNo = XLATE('WO_LOG', S.WoNo, WO_LOG_EPI_PART_NO$, 'X')
|
||||
I.EpiPartNo = S.EpiPartNo
|
||||
S.WO_Qty = Xlate('WO_LOG', {WO_NO}, WO_LOG_WO_QTY$, 'X')
|
||||
I.WO_Qty = S.WO_Qty
|
||||
S.WO_RX_Qty = Xlate('WO_LOG', {WO_NO}, 'RX_QTY', 'X')
|
||||
I.WO_RX_Qty = S.WO_RX_Qty
|
||||
S.WO_UnRel_QTY = Xlate('WO_LOG', {WO_NO}, 'UNREL_QTY', 'X')
|
||||
I.WO_UnRel_QTY = S.WO_UnRel_QTY
|
||||
S.REACT_TYPE = Xlate('WO_LOG', {WO_NO}, 'REACT_TYPE', 'X')
|
||||
S.ProdOrdNo = Xlate('WO_LOG', {WO_NO}, 'PROD_ORD_NO', 'X')
|
||||
|
||||
Locate 'SR*KTR]' in LocationFilter using @VM setting vPos then
|
||||
KitData = Location_Services('GetLocationCassInfo', S.WONo, 'SR*KTR]')
|
||||
SWAP CRLF$ WITH @VM IN KitData
|
||||
end else
|
||||
KitData = ''
|
||||
end
|
||||
|
||||
KitCassList = KitData<3>
|
||||
NewKitData = ''
|
||||
|
||||
Swap ',' with @VM in KitData
|
||||
|
||||
// Filter out cassettes on hold
|
||||
NewKitData<1> = KitData<1>
|
||||
Swap @VM with ',' in KitCassList
|
||||
For each Cass in KitCassList using ',' setting cPos
|
||||
Key = S.WONo:'*':Cass
|
||||
OnHold = Xlate('WO_MAT', Key, 'HOLD', 'X')
|
||||
If OnHold NE True$ then
|
||||
NewKitData<3, -1> = KitData<3, cPos>
|
||||
end
|
||||
Next Cass
|
||||
|
||||
NewKitData<2> = DCount(NewKitData<3>, @VM) ; // Update cassette count
|
||||
KitData = NewKitData
|
||||
|
||||
Swap @VM with ',' in KitData
|
||||
|
||||
S.KitLocation = KitData<1>
|
||||
I.KitLocation = S.KitLocation
|
||||
|
||||
S.KitQty = OCONV(SUM(KitData<2>) * 25,'MD0,Z')
|
||||
I.KitQty = S.KitQty
|
||||
|
||||
S.KitCassCnt = COUNT(KitData<3>,',') + (KitData<3> NE '')
|
||||
I.KitCassCnt = S.KitCassCnt
|
||||
|
||||
KitCassList = KitData<3>
|
||||
|
||||
Locate '1K*PTI' in LocationFilter using @VM setting vPos then
|
||||
PTIData = Location_Services('GetLocationCassInfo', S.WONo, '1K*PTI')
|
||||
SWAP CRLF$ WITH @VM IN PTIData
|
||||
end else
|
||||
PTIData = ''
|
||||
end
|
||||
PTICassList = PTIData<3>
|
||||
NewPTIData = ''
|
||||
|
||||
Swap ',' with @VM in PTIData
|
||||
// Filter out cassettes on hold
|
||||
NewPTIData<1> = PTIData<1>
|
||||
Swap @VM with ',' in PTICassList
|
||||
For each Cass in PTICassList using ',' setting cPos
|
||||
Key = S.WONo:'*':Cass
|
||||
OnHold = Xlate('WO_MAT', Key, 'HOLD', 'X')
|
||||
If OnHold NE True$ then
|
||||
NewPTIData<3, -1> = PTIData<3, cPos>
|
||||
end
|
||||
Next Cass
|
||||
NewPTIData<2> = DCount(NewPTIData<3>, @VM) ; // Update cassette count
|
||||
PTIData = NewPTIData
|
||||
|
||||
Swap @VM with ',' in PTIData
|
||||
PTICassList = PTIData<3>
|
||||
|
||||
CRLocs = ''
|
||||
CRLocs<0, -1> = 'CR*BE'
|
||||
CRLocs<0, -1> = 'CR*BO'
|
||||
CRLocs<0, -1> = 'CR*TUN'
|
||||
CRLocs<0, -1> = 'CR*EPR'
|
||||
CRLocs<0, -1> = 'CR*FE'
|
||||
CRLocs<0, -1> = 'CR*FEH'
|
||||
CRLocs<0, -1> = 'CR*FO'
|
||||
CRLocs<0, -1> = 'CR*FOH'
|
||||
|
||||
LoadedData = ''
|
||||
LocQueryList = ''
|
||||
For each Loc in CRLocs using @VM setting crPos
|
||||
Locate Loc in LocationFilter using @VM setting vPos then
|
||||
LocQueryList<0, -1> = Loc
|
||||
end
|
||||
Next Loc
|
||||
LoadedCassList = ''
|
||||
ReactType = Xlate('WO_LOG', S.WONo, 'REACT_TYPE', 'X')
|
||||
If ReactType NE 'EPP' then
|
||||
If LocQueryList NE '' then
|
||||
LoadedData = Location_Services('GetLocationCassInfo', S.WONo, LocQueryList)
|
||||
Swap CRLF$ with @VM in LoadedData
|
||||
CassList = LoadedData<3>
|
||||
Swap @VM with ',' in CassList
|
||||
For each CassNo in CassList using ','
|
||||
If ( (S.WONo NE '') and (CassNo NE '') ) then
|
||||
WOMatKey = S.WONo:'*':CassNo
|
||||
UnloadSigComp = Signature_Services('CheckSignature', WOMatKey, 'UNLOAD')
|
||||
OnHold = Xlate('WO_MAT', WOMatKey, 'HOLD', 'X')
|
||||
If Not(UnloadSigComp or OnHold) then
|
||||
LoadedCassList<0, -1> = CassNo
|
||||
end
|
||||
end
|
||||
Next CassNo
|
||||
end
|
||||
end
|
||||
|
||||
* TEST FOR CONTROL BREAK(S)
|
||||
|
||||
IF (S.ReactNo NE Prev.ReactNo) OR ReactNo.Break THEN
|
||||
ReactNo = Prev.ReactNo
|
||||
Prev.ReactNo = S.ReactNo
|
||||
ReactNo.Break += 1
|
||||
END
|
||||
|
||||
IF FirstPass THEN
|
||||
FirstPass=0
|
||||
GOTO DETAIL
|
||||
END
|
||||
|
||||
|
||||
BREAKS:
|
||||
|
||||
* Print Break Total(s) And Accumulate Total(s)
|
||||
IF ReactNo.Break THEN stat = Set_Printer('TEXT')
|
||||
|
||||
* Perform Last Record Output If Done
|
||||
IF LastRecord THEN
|
||||
colData = ''
|
||||
GOTO Bail
|
||||
END
|
||||
|
||||
|
||||
DETAIL:
|
||||
|
||||
* Do Conversion If Any
|
||||
|
||||
IF S.REACTNO NE "" THEN S.REACTNO = OCONV(S.REACTNO,"MD0,")
|
||||
IF S.WONO NE "" THEN S.WONO = OCONV(S.WONO,"MD0")
|
||||
IF S.WO_QTY NE "" THEN S.WO_QTY = OCONV(S.WO_QTY,"MD0,")
|
||||
IF S.WO_RX_QTY NE "" THEN S.WO_RX_QTY = OCONV(S.WO_RX_QTY,"MD0,")
|
||||
IF S.WO_UNREL_QTY NE "" THEN S.WO_UNREL_QTY = OCONV(S.WO_UNREL_QTY,"MD0,")
|
||||
|
||||
* PRINT DETAIL LINE
|
||||
|
||||
COLDATA = ''
|
||||
RowNumber = 0
|
||||
|
||||
/* ascending sort */
|
||||
Convert @VM to ',' in KitCassList
|
||||
Convert @VM to ',' in PTICassList
|
||||
Convert @VM to ',' in LoadedCassList
|
||||
KitCassList = SRP_Array('SortSimpleList', KitCassList, 'AscendingNumbers', ',')
|
||||
PTICassList = SRP_Array('SortSimpleList', PTICassList, 'AscendingNumbers', ',')
|
||||
LoadedCassList = SRP_Array('SortSimpleList', LoadedCassList, 'AscendingNumbers', ',')
|
||||
|
||||
Convert ',' to @VM in KitCassList
|
||||
Convert ',' to @VM in PTICassList
|
||||
Convert ',' to @VM in LoadedCassList
|
||||
|
||||
NumKitCass = DCount(KitCassList, @VM)
|
||||
If NumKitCass GT 4 then
|
||||
For CassIndex = 4 to NumKitCass Step 4
|
||||
CassNo = KitCassList<0, CassIndex>
|
||||
CassNo := CRLF$
|
||||
KitCassList<0, CassIndex> = CassNo
|
||||
Next CassIndex
|
||||
end
|
||||
NumPTICass = DCount(PTICassList, @VM)
|
||||
If NumPTICass GT 4 then
|
||||
For CassIndex = 4 to NumPTICass Step 4
|
||||
CassNo = PTICassList<0, CassIndex>
|
||||
CassNo := CRLF$
|
||||
PTICassList<0, CassIndex> = CassNo
|
||||
Next CassIndex
|
||||
end
|
||||
NumLoadedCass = DCount(LoadedCassList, @VM)
|
||||
If NumLoadedCass GT 2 then
|
||||
For CassIndex = 2 to NumLoadedCass Step 2
|
||||
CassNo = LoadedCassList<0, CassIndex>
|
||||
CassNo := CRLF$
|
||||
LoadedCassList<0, CassIndex> = CassNo
|
||||
Next CassIndex
|
||||
end
|
||||
Convert @VM to ',' in KitCassList
|
||||
Convert @VM to ',' in PTICassList
|
||||
Convert @VM to ',' in LoadedCassList
|
||||
|
||||
CassNeeded = ''
|
||||
EpiPartNo = Xlate('WO_LOG', S.WONo, 'EPI_PART_NO', 'X')
|
||||
If EpiPartNo NE '' then
|
||||
WPDAdjusted = Epi_Part_Services('GetAdjustedWafersPerDayScheduler', EpiPartNo, S.React_Type)
|
||||
If WPDAdjusted NE '' then
|
||||
CPDAdjusted = SRP_Math('CEILING', (WPDAdjusted/25) )
|
||||
CassInCR = DCount(KittCassList, ',') + DCount(PTICassList, ',') + DCount(LoadedCassList, ',')
|
||||
CassNeeded = CassInCR - CPDAdjusted
|
||||
end
|
||||
end
|
||||
|
||||
Swap '.1' with '' in S.ProdOrdNo
|
||||
AllReportData = ''
|
||||
AllReportData<1> = S.ReactNo
|
||||
AllReportData<2> = S.React_Type
|
||||
AllReportData<3> = S.WONo
|
||||
AllReportData<4> = S.ProdOrdNo
|
||||
AllReportData<5> = S.SubPartNo
|
||||
AllReportData<6> = S.EpiPartNo
|
||||
AllReportData<7> = S.WO_Qty
|
||||
AllReportData<8> = S.WO_RX_Qty
|
||||
AllReportData<9> = S.WO_UnRel_Qty
|
||||
AllReportData<10> = S.KitLocation
|
||||
AllReportData<11> = S.KitQty
|
||||
AllReportData<12> = CassNeeded
|
||||
AllReportData<13> = KitCassList
|
||||
AllReportData<14> = PTICassList
|
||||
AllReportData<15> = LoadedCassList
|
||||
AllReportData<16> = ''
|
||||
|
||||
If ( (KitCassList NE '') or (PTICassList NE '') or (LoadedCassList NE '') or (NoMatFlag EQ True$) ) then
|
||||
RowNumber += 1
|
||||
For each RptColumn in RptColumns using @VM setting rcPos
|
||||
Locate RptColumn in AllRptColumns using @VM setting dataPos then
|
||||
COLDATA<RowNumber,rcPos> = AllReportData<dataPos>
|
||||
end
|
||||
Next RptColumn
|
||||
If COLDATA NE '' then GoSub PrintTable
|
||||
END
|
||||
|
||||
GOTO ReadRecord
|
||||
|
||||
Bail:
|
||||
|
||||
stat = Set_Printer('TERM',1)
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
OIPrintErr:
|
||||
|
||||
ErrMsg(ErrorTitle:@SVM:ErrorMsg)
|
||||
ErrMsg(ErrorTitle:@SVM:'Set_Printer returned errorcode ':stat)
|
||||
stat = Set_Printer('TERM',1)
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
PrintTable:
|
||||
|
||||
PageHeight = Get_Printer('PAGESIZE')<2>
|
||||
PrintableHeight = PageHeight - TopMargin - BottomMargin
|
||||
PrinterHeight = Get_Printer('POS')<2>
|
||||
stat = Set_Printer('CALCTABLE',ColFmt:@FM:ColData)
|
||||
TableSize = Get_Printer('CALCTABLE')
|
||||
TableHeight = TableSize<2>
|
||||
fontSpacing = 120
|
||||
|
||||
IF ( TableHeight + PrinterHeight >= PrintableHeight ) OR FirstLine THEN
|
||||
IF NOT(FirstLine) THEN
|
||||
stat = Set_Printer('PAGEBREAK')
|
||||
END
|
||||
FirstLine = 0
|
||||
font<2> = 10
|
||||
font<4> = 1 ;* Bold
|
||||
stat = Set_Printer('FONT',font,'100')
|
||||
stat = Set_Printer('ADDTABLE',colFmt,colHead,'',LTGREY$,'',0,TB_ALL)
|
||||
font<4> = 0
|
||||
stat = Set_Printer('FONT',font,fontSpacing)
|
||||
stat = Set_Printer('ADDTABLE',colFmt,'',colData,LTGREY$,'',0,7)
|
||||
END ELSE
|
||||
font<2> = 10
|
||||
font<4> = 0
|
||||
stat = Set_Printer('FONT',font,fontSpacing)
|
||||
stat = Set_Printer('ADDTABLE',colFmt,'',colData,LTGREY$,'',1,TB_ALL)
|
||||
END
|
||||
|
||||
RETURN
|
||||
|
||||
|
@ -1,468 +0,0 @@
|
||||
Compile function Report_Services_Dev3(@Service, @Params)
|
||||
/***********************************************************************************************************************
|
||||
|
||||
Name : Report_Services
|
||||
|
||||
Description : Handler program for all Report services.
|
||||
|
||||
Notes : Application errors should be logged using the Error Services module. There are a few methodological
|
||||
assumptions built into way errors are managed which are important to understand in order to properly
|
||||
work with Error Services:
|
||||
|
||||
- The term 'top' refers to the originating procedure of a call stack and the term 'bottom' refers to
|
||||
the last routine (or the current routine) within a call stack. Within the OpenInsight Debugger
|
||||
this will appear backwards since the originating procedure always appears at the bottom of the
|
||||
list and the current routine appears at the top of the list. We are using this orientation because
|
||||
it is common to refer to the process of calling other procedures as 'drilling down'.
|
||||
|
||||
- The reason for defining the orientation of the call stack is because Error_Services allows for
|
||||
multiple error conditions to be appended to an original error. In most cases this will happen when
|
||||
a procedure at the bottom of the stack generates an error condition and then returns to its
|
||||
calling procedure. This higher level procedure can optionally add more information relevant to
|
||||
itself. This continues as the call stack 'bubbles' its way back to the top to where the
|
||||
originating procedure is waiting.
|
||||
|
||||
- Native OpenInsight commands that handle errors (e.g., Set_Status, Set_FSError, Set_EventStatus)
|
||||
preserve their error state until explicitly cleared. This can hinder the normal execution of code
|
||||
since subsequent procedures (usually SSPs) will fail if a pre-existing error condition exists.
|
||||
Our philosophy is that error conditions should automatically be cleared before a new procedure
|
||||
is executed to avoid this problem. However, the nature of Basic+ does not make this easy to
|
||||
automate for any given stored procedure. Therefore, if a stored procedure wants to conform to our
|
||||
philosophy then it should include a call into the 'Clear' service request at the top of the
|
||||
program. Alternatively this can be done through a common insert (see SERVICE_SETUP for example.)
|
||||
|
||||
- Service modules will use the SERVICE_SETUP insert and therefore automatically clear out any
|
||||
error conditions that were set before.
|
||||
|
||||
Parameters :
|
||||
Service [in] -- Name of the service being requested
|
||||
Param1-10 [in/out] -- Additional request parameter holders
|
||||
Response [out] -- Response to be sent back to the Controller (MCP) or requesting procedure
|
||||
|
||||
Metadata :
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
07/28/21 djs Copied original source code from Report_Services. Modified GetMaterialTrackReport
|
||||
to use the SCHED_DET_NG table (i.e. Scheduler 2.0) instead of the SCHED_DET table.
|
||||
|
||||
|
||||
***********************************************************************************************************************/
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
$Insert SERVICE_SETUP
|
||||
$Insert LOGICAL
|
||||
$Insert OIPRINT_EQUATES
|
||||
$Insert SCHED_DET_NG_EQUATES
|
||||
$Insert WO_LOG_EQUATES
|
||||
$Insert APPCOLORS
|
||||
$Insert MSG_EQUATES
|
||||
$Insert SCHEDULE_EQU
|
||||
$Insert LOCATION_EQUATES
|
||||
$Insert RLIST_EQUATES
|
||||
|
||||
Declare subroutine Utility, ErrMsg, Set_Status, Set_Printer, RList, SRP_Stopwatch, Btree.Extract, Error_Services, V119
|
||||
Declare subroutine Push.Select, Pop.Select, SRP_Stopwatch, Database_Services
|
||||
Declare function Set_Printer, Get_Printer, Msg, Get_Status, Printer_Select, obj_Install, Dialog_Box, obj_Location
|
||||
Declare function Error_Services, Location_Services, SRP_Array, Signature_Services
|
||||
Declare function Epi_Part_Services, SRP_Math, Datetime, Database_Services
|
||||
|
||||
Equ TAB$ TO \09\
|
||||
|
||||
GoToService
|
||||
|
||||
Return Response or ""
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// SERVICES
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Service CalculateMaterialTrackData(RptColumns, LocationFilter, NoMatFlag)
|
||||
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
|
||||
Lock hSysLists, ServiceKeyID then
|
||||
|
||||
NoMatFlag = True$
|
||||
|
||||
LocationFilter = ''
|
||||
LocationFilter<1, 1> = 'SR*KTR]'
|
||||
LocationFilter<1, 2> = '1K*PTI'
|
||||
LocationFilter<1, 3> = 'CR*BE'
|
||||
LocationFilter<1, 4> = 'CR*BO'
|
||||
LocationFilter<1, 5> = 'CR*TUN'
|
||||
LocationFilter<1, 6> = 'CR*EPR'
|
||||
LocationFilter<1, 7> = 'CR*FE'
|
||||
LocationFilter<1, 8> = 'CR*FEH'
|
||||
LocationFilter<1, 9> = 'CR*FO'
|
||||
LocationFilter<1, 10> = 'CR*FOH'
|
||||
|
||||
|
||||
// All Possible Report Columns
|
||||
AllRptColumns = ''
|
||||
AllRptColumns<1, 1> = 'React No'
|
||||
AllRptColumns<1, 2> = 'React Type'
|
||||
AllRptColumns<1, 3> = 'WO No'
|
||||
AllRptColumns<1, 4> = 'SAP Prod No'
|
||||
AllRptColumns<1, 5> = 'Sub Part No'
|
||||
AllRptColumns<1, 6> = 'Epi Part No'
|
||||
AllRptColumns<1, 7> = 'WO Qty'
|
||||
AllRptColumns<1, 8> = 'RX Qty'
|
||||
AllRptColumns<1, 9> = 'UnRel Qty'
|
||||
AllRptColumns<1, 10> = 'Kit Location'
|
||||
AllRptColumns<1, 11> = 'Kit Qty'
|
||||
AllRptColumns<1, 12> = '+/-'
|
||||
AllRptColumns<1, 13> = 'Kit RO'
|
||||
AllRptColumns<1, 14> = 'PTI RO'
|
||||
AllRptColumns<1, 15> = 'Load'
|
||||
AllRptColumns<1, 16> = 'Comments'
|
||||
|
||||
RptColumns = AllRptColumns
|
||||
|
||||
ErrorTitle = 'Error in service ':Service
|
||||
ErrCode = ''
|
||||
ErrorMsg = ''
|
||||
|
||||
OPEN 'SCHED_DET_NG' TO SchedDetTable then
|
||||
OPEN 'DICT.SCHED_DET_NG' TO @DICT then
|
||||
Today = Datetime()
|
||||
|
||||
ReactList = ''
|
||||
WOList = ''
|
||||
SchedDetKeys = ''
|
||||
PrevReactNo = ''
|
||||
PrevWO = ''
|
||||
|
||||
SelectSent = 'SELECT SCHED_DET_NG WITH STOP_DTM GE "':OCONV(Today, 'DT'):'" BY REACT_NO'
|
||||
|
||||
RList(SelectSent,TARGET_ACTIVELIST$,'','','')
|
||||
IF Get_Status(errCode) THEN
|
||||
ErrMsg(errCode)
|
||||
Unlock hSysLists, ServiceKeyID else Null
|
||||
RETURN
|
||||
END
|
||||
|
||||
Done = 0
|
||||
@ID = ''
|
||||
LOOP
|
||||
PrevSchedDetKey = @ID
|
||||
READNEXT @ID ELSE Done = 1
|
||||
UNTIL Done
|
||||
READ SchedDetRec FROM SchedDetTable,@ID THEN
|
||||
ReactNo = SchedDetRec<SCHED_DET_NG.REACT_NO$>
|
||||
WONo = SchedDetRec<SCHED_DET_NG.WO_NO$>
|
||||
If ReactNo NE '' then
|
||||
LOCATE ReactNo IN ReactList BY 'AR' USING @FM SETTING Pos ELSE
|
||||
ReactList = INSERT(ReactList,Pos,0,0,ReactNo)
|
||||
END
|
||||
END
|
||||
If WONo NE '' then
|
||||
LOCATE WONo IN WOList<Pos> USING @VM SETTING WPos ELSE
|
||||
WOList = INSERT(WOList,Pos,-1,0,WONo)
|
||||
SchedDetKeys = INSERT(SchedDetKeys,-1,0,0,@ID)
|
||||
END
|
||||
END
|
||||
END
|
||||
|
||||
REPEAT
|
||||
|
||||
CALL Make.List(0,SchedDetKeys,SchedDetTable,@DICT)
|
||||
|
||||
DateRange = 'Effective ':OCONV(Date(),'D4')
|
||||
|
||||
RowIndex = 0
|
||||
AllReportData = ''
|
||||
@RECCOUNT = 0
|
||||
FirstPass = 1
|
||||
LastRecord = 0
|
||||
FirstLine = 1
|
||||
fontSpacing = 100
|
||||
|
||||
* Zero Accumulators For Each Break
|
||||
|
||||
Prev.ReactNo = ''
|
||||
Last.ReactNo.Break = 1
|
||||
|
||||
GoTo ReadRecord
|
||||
|
||||
end else
|
||||
ErrorMsg = 'Unable to open "SCHED_DET_NG" table.'
|
||||
ErrMsg(ErrorTitle:@SVM:ErrorMsg)
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Unable to open "SCHED_DET_NG" table.'
|
||||
ErrMsg(ErrorTitle:@SVM:ErrorMsg)
|
||||
end
|
||||
Unlock hSysLists, ServiceKeyID else Null
|
||||
end
|
||||
|
||||
End Service
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ReadRecord:
|
||||
|
||||
* Zero Break Flags To False
|
||||
|
||||
ReactNo.Break=0
|
||||
|
||||
READNEXT @ID, Which.Value ELSE
|
||||
LastRecord = 1
|
||||
ReactNo.Break = 1
|
||||
ReactNo = Prev.ReactNo
|
||||
END
|
||||
|
||||
S.ATID = @ID
|
||||
|
||||
IF FirstPass AND LastRecord THEN
|
||||
GOTO Bail
|
||||
END
|
||||
|
||||
IF LastRecord THEN GOTO BREAKS
|
||||
|
||||
READO @RECORD FROM SchedDetTable,@ID ELSE
|
||||
GOTO ReadRecord
|
||||
END
|
||||
|
||||
@RECCOUNT += 1
|
||||
|
||||
* Calculate Value(s) For Column(s)
|
||||
|
||||
S.ATID = {@ID}
|
||||
I.ATID = S.ATID
|
||||
S.ReactNo = {REACT_NO}
|
||||
I.ReactNo = S.ReactNo
|
||||
S.WoNo = {WO_NO}
|
||||
I.WoNo = S.WoNo
|
||||
S.SubPartNo = XLATE('WO_LOG', S.WoNo, 'ORD_SUB_PART_NO', 'X')
|
||||
I.SubPartNo = S.SubPartNo
|
||||
S.EpiPartNo = XLATE('WO_LOG', S.WoNo, WO_LOG_EPI_PART_NO$, 'X')
|
||||
I.EpiPartNo = S.EpiPartNo
|
||||
S.WO_Qty = Xlate('WO_LOG', {WO_NO}, WO_LOG_WO_QTY$, 'X')
|
||||
I.WO_Qty = S.WO_Qty
|
||||
S.WO_RX_Qty = Xlate('WO_LOG', {WO_NO}, 'RX_QTY', 'X')
|
||||
I.WO_RX_Qty = S.WO_RX_Qty
|
||||
S.WO_UnRel_QTY = Xlate('WO_LOG', {WO_NO}, 'UNREL_QTY', 'X')
|
||||
I.WO_UnRel_QTY = S.WO_UnRel_QTY
|
||||
S.REACT_TYPE = Xlate('WO_LOG', {WO_NO}, 'REACT_TYPE', 'X')
|
||||
S.ProdOrdNo = Xlate('WO_LOG', {WO_NO}, 'PROD_ORD_NO', 'X')
|
||||
|
||||
Locate 'SR*KTR]' in LocationFilter using @VM setting vPos then
|
||||
KitData = Location_Services('GetLocationCassInfo', S.WONo, 'SR*KTR]')
|
||||
SWAP CRLF$ WITH @VM IN KitData
|
||||
end else
|
||||
KitData = ''
|
||||
end
|
||||
|
||||
KitCassList = KitData<3>
|
||||
NewKitData = ''
|
||||
|
||||
Swap ',' with @VM in KitData
|
||||
|
||||
// Filter out cassettes on hold
|
||||
NewKitData<1> = KitData<1>
|
||||
Swap @VM with ',' in KitCassList
|
||||
For each Cass in KitCassList using ',' setting cPos
|
||||
Key = S.WONo:'*':Cass
|
||||
OnHold = Xlate('WO_MAT', Key, 'HOLD', 'X')
|
||||
If OnHold NE True$ then
|
||||
NewKitData<3, -1> = KitData<3, cPos>
|
||||
end
|
||||
Next Cass
|
||||
|
||||
LocInfo = ''
|
||||
LocInfo<1> = NewKitData<1>
|
||||
LocInfo<2> = DCount(NewKitData<3>, @VM)
|
||||
LocInfo<3> = NewKitData<3>
|
||||
Database_Services('WriteDataRow', 'WO_LOC', S.WONo:'*':'SR*KTR]', LocInfo)
|
||||
|
||||
NewKitData<2> = DCount(NewKitData<3>, @VM) ; // Update cassette count
|
||||
KitData = NewKitData
|
||||
|
||||
Swap @VM with ',' in KitData
|
||||
|
||||
S.KitLocation = KitData<1>
|
||||
I.KitLocation = S.KitLocation
|
||||
|
||||
* S.KitQty = OCONV(SUM(KitData<2>) * 25,'MD0,Z')
|
||||
|
||||
|
||||
S.KitCassCnt = COUNT(KitData<3>,',') + (KitData<3> NE '')
|
||||
I.KitCassCnt = S.KitCassCnt
|
||||
|
||||
KitCassList = KitData<3>
|
||||
S.KitQty = 0
|
||||
For each CassNo in KitCassList using ','
|
||||
S.KitQty += Xlate('WO_MAT', S.WONo:'*':CassNo, 'WAFER_QTY', 'X')
|
||||
Next CassNo
|
||||
I.KitQty = S.KitQty
|
||||
|
||||
Locate '1K*PTI' in LocationFilter using @VM setting vPos then
|
||||
PTIData = Location_Services('GetLocationCassInfo', S.WONo, '1K*PTI')
|
||||
SWAP CRLF$ WITH @VM IN PTIData
|
||||
end else
|
||||
PTIData = ''
|
||||
end
|
||||
PTICassList = PTIData<3>
|
||||
NewPTIData = ''
|
||||
|
||||
Swap ',' with @VM in PTIData
|
||||
// Filter out cassettes on hold
|
||||
NewPTIData<1> = PTIData<1>
|
||||
Swap @VM with ',' in PTICassList
|
||||
For each Cass in PTICassList using ',' setting cPos
|
||||
Key = S.WONo:'*':Cass
|
||||
OnHold = Xlate('WO_MAT', Key, 'HOLD', 'X')
|
||||
If OnHold NE True$ then
|
||||
NewPTIData<3, -1> = PTIData<3, cPos>
|
||||
end
|
||||
Next Cass
|
||||
|
||||
LocInfo = ''
|
||||
LocInfo<1> = '1K*PTI'
|
||||
LocInfo<2> = DCount(NewPTIData<3>, @VM)
|
||||
LocInfo<3> = NewPTIData<3>
|
||||
Database_Services('WriteDataRow', 'WO_LOC', S.WONo:'*':'1K*PTI', LocInfo)
|
||||
|
||||
NewPTIData<2> = DCount(NewPTIData<3>, @VM) ; // Update cassette count
|
||||
PTIData = NewPTIData
|
||||
|
||||
Swap @VM with ',' in PTIData
|
||||
PTICassList = PTIData<3>
|
||||
|
||||
CRLocs = ''
|
||||
CRLocs<0, -1> = 'CR*BE'
|
||||
CRLocs<0, -1> = 'CR*BO'
|
||||
CRLocs<0, -1> = 'CR*TUN'
|
||||
CRLocs<0, -1> = 'CR*EPR'
|
||||
CRLocs<0, -1> = 'CR*FE'
|
||||
CRLocs<0, -1> = 'CR*FEH'
|
||||
CRLocs<0, -1> = 'CR*FO'
|
||||
CRLocs<0, -1> = 'CR*FOH'
|
||||
|
||||
LoadedData = ''
|
||||
LocQueryList = ''
|
||||
For each Loc in CRLocs using @VM setting crPos
|
||||
Locate Loc in LocationFilter using @VM setting vPos then
|
||||
LocQueryList<0, -1> = Loc
|
||||
end
|
||||
Next Loc
|
||||
LoadedCassList = ''
|
||||
ReactType = Xlate('WO_LOG', S.WONo, 'REACT_TYPE', 'X')
|
||||
|
||||
If ReactType NE 'EPP' then
|
||||
If LocQueryList NE '' then
|
||||
For each CRLoc in LocQueryList using @VM
|
||||
CRLocCassList = ''
|
||||
LoadedData = Location_Services('GetLocationCassInfo', S.WONo, CRLoc)
|
||||
Swap CRLF$ with @VM in LoadedData
|
||||
CassList = LoadedData<3>
|
||||
Swap @VM with ',' in CassList
|
||||
For each CassNo in CassList using ','
|
||||
If ( (S.WONo NE '') and (CassNo NE '') ) then
|
||||
WOMatKey = S.WONo:'*':CassNo
|
||||
UnloadSigComp = Signature_Services('CheckSignature', WOMatKey, 'UNLOAD')
|
||||
OnHold = Xlate('WO_MAT', WOMatKey, 'HOLD', 'X')
|
||||
CurrStatus = Xlate('WO_MAT', WOMatKey, 'CURR_STATUS', 'X')
|
||||
If Not(UnloadSigComp or OnHold or (CurrStatus EQ 'REJ') ) then
|
||||
CRLocCassList<0, -1> = CassNo
|
||||
Locate CassNo in LoadedCassList using @VM setting vPos else
|
||||
LoadedCassList<0, -1> = CassNo
|
||||
end
|
||||
end
|
||||
end
|
||||
Next CassNo
|
||||
LocInfo = ''
|
||||
LocInfo<3> = CRLocCassList
|
||||
Database_Services('WriteDataRow', 'WO_LOC', S.WONo:'*':CRLoc, LocInfo)
|
||||
Next CRLoc
|
||||
end
|
||||
end
|
||||
|
||||
* TEST FOR CONTROL BREAK(S)
|
||||
|
||||
IF (S.ReactNo NE Prev.ReactNo) OR ReactNo.Break THEN
|
||||
ReactNo = Prev.ReactNo
|
||||
Prev.ReactNo = S.ReactNo
|
||||
ReactNo.Break += 1
|
||||
END
|
||||
|
||||
IF FirstPass THEN
|
||||
FirstPass=0
|
||||
GOTO DETAIL
|
||||
END
|
||||
|
||||
|
||||
BREAKS:
|
||||
|
||||
* Perform Last Record Output If Done
|
||||
IF LastRecord THEN
|
||||
colData = ''
|
||||
GOTO Bail
|
||||
END
|
||||
|
||||
|
||||
DETAIL:
|
||||
|
||||
* Do Conversion If Any
|
||||
|
||||
IF S.REACTNO NE "" THEN S.REACTNO = OCONV(S.REACTNO,"MD0,")
|
||||
IF S.WONO NE "" THEN S.WONO = OCONV(S.WONO,"MD0")
|
||||
IF S.WO_QTY NE "" THEN S.WO_QTY = OCONV(S.WO_QTY,"MD0,")
|
||||
IF S.WO_RX_QTY NE "" THEN S.WO_RX_QTY = OCONV(S.WO_RX_QTY,"MD0,")
|
||||
IF S.WO_UNREL_QTY NE "" THEN S.WO_UNREL_QTY = OCONV(S.WO_UNREL_QTY,"MD0,")
|
||||
|
||||
* PRINT DETAIL LINE
|
||||
|
||||
COLDATA = ''
|
||||
RowNumber = 0
|
||||
|
||||
/* ascending sort */
|
||||
Convert @VM to ',' in KitCassList
|
||||
Convert @VM to ',' in PTICassList
|
||||
Convert @VM to ',' in LoadedCassList
|
||||
KitCassList = SRP_Array('SortSimpleList', KitCassList, 'AscendingNumbers', ',')
|
||||
PTICassList = SRP_Array('SortSimpleList', PTICassList, 'AscendingNumbers', ',')
|
||||
LoadedCassList = SRP_Array('SortSimpleList', LoadedCassList, 'AscendingNumbers', ',')
|
||||
|
||||
CassNeeded = ''
|
||||
EpiPartNo = Xlate('WO_LOG', S.WONo, 'EPI_PART_NO', 'X')
|
||||
If EpiPartNo NE '' then
|
||||
WPDAdjusted = Epi_Part_Services('GetAdjustedWafersPerDayScheduler', EpiPartNo, S.React_Type)
|
||||
If WPDAdjusted NE '' then
|
||||
CPDAdjusted = SRP_Math('CEILING', (WPDAdjusted/25) )
|
||||
CassInCR = DCount(KitCassList, ',') + DCount(PTICassList, ',') + DCount(LoadedCassList, ',')
|
||||
CassNeeded = CassInCR - CPDAdjusted
|
||||
end
|
||||
end
|
||||
|
||||
RowIndex += 1
|
||||
Swap '.1' with '' in S.ProdOrdNo
|
||||
|
||||
AllReportData<RowIndex, 1> = S.ReactNo
|
||||
AllReportData<RowIndex, 2> = S.React_Type
|
||||
AllReportData<RowIndex, 3> = S.WONo
|
||||
AllReportData<RowIndex, 4> = S.ProdOrdNo
|
||||
AllReportData<RowIndex, 5> = S.SubPartNo
|
||||
AllReportData<RowIndex, 6> = S.EpiPartNo
|
||||
AllReportData<RowIndex, 7> = S.WO_Qty
|
||||
AllReportData<RowIndex, 8> = S.WO_RX_Qty
|
||||
AllReportData<RowIndex, 9> = S.WO_UnRel_Qty
|
||||
AllReportData<RowIndex, 10> = S.KitLocation
|
||||
AllReportData<RowIndex, 11> = S.KitQty
|
||||
AllReportData<RowIndex, 12> = CassNeeded
|
||||
AllReportData<RowIndex, 13> = KitCassList
|
||||
AllReportData<RowIndex, 14> = PTICassList
|
||||
AllReportData<RowIndex, 15> = LoadedCassList
|
||||
AllReportData<RowIndex, 16> = ''
|
||||
|
||||
GOTO ReadRecord
|
||||
|
||||
Bail:
|
||||
|
||||
Unlock hSysLists, ServiceKeyID else Null
|
||||
Database_Services('WriteDataRow', 'SYSLISTS', 'MAT_REPORT', AllReportData)
|
||||
|
||||
RETURN
|
||||
|
||||
|
@ -1,402 +0,0 @@
|
||||
Compile function Report_Services_Dev4(@Service, @Params)
|
||||
/***********************************************************************************************************************
|
||||
|
||||
Name : Report_Services
|
||||
|
||||
Description : Handler program for all Report services.
|
||||
|
||||
Notes : Application errors should be logged using the Error Services module. There are a few methodological
|
||||
assumptions built into way errors are managed which are important to understand in order to properly
|
||||
work with Error Services:
|
||||
|
||||
- The term 'top' refers to the originating procedure of a call stack and the term 'bottom' refers to
|
||||
the last routine (or the current routine) within a call stack. Within the OpenInsight Debugger
|
||||
this will appear backwards since the originating procedure always appears at the bottom of the
|
||||
list and the current routine appears at the top of the list. We are using this orientation because
|
||||
it is common to refer to the process of calling other procedures as 'drilling down'.
|
||||
|
||||
- The reason for defining the orientation of the call stack is because Error_Services allows for
|
||||
multiple error conditions to be appended to an original error. In most cases this will happen when
|
||||
a procedure at the bottom of the stack generates an error condition and then returns to its
|
||||
calling procedure. This higher level procedure can optionally add more information relevant to
|
||||
itself. This continues as the call stack 'bubbles' its way back to the top to where the
|
||||
originating procedure is waiting.
|
||||
|
||||
- Native OpenInsight commands that handle errors (e.g., Set_Status, Set_FSError, Set_EventStatus)
|
||||
preserve their error state until explicitly cleared. This can hinder the normal execution of code
|
||||
since subsequent procedures (usually SSPs) will fail if a pre-existing error condition exists.
|
||||
Our philosophy is that error conditions should automatically be cleared before a new procedure
|
||||
is executed to avoid this problem. However, the nature of Basic+ does not make this easy to
|
||||
automate for any given stored procedure. Therefore, if a stored procedure wants to conform to our
|
||||
philosophy then it should include a call into the 'Clear' service request at the top of the
|
||||
program. Alternatively this can be done through a common insert (see SERVICE_SETUP for example.)
|
||||
|
||||
- Service modules will use the SERVICE_SETUP insert and therefore automatically clear out any
|
||||
error conditions that were set before.
|
||||
|
||||
Parameters :
|
||||
Service [in] -- Name of the service being requested
|
||||
Param1-10 [in/out] -- Additional request parameter holders
|
||||
Response [out] -- Response to be sent back to the Controller (MCP) or requesting procedure
|
||||
|
||||
Metadata :
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
07/28/21 djs Copied original source code from Report_Services. Modified GetMaterialTrackReport
|
||||
to use the SCHED_DET_NG table (i.e. Scheduler 2.0) instead of the SCHED_DET table.
|
||||
|
||||
|
||||
***********************************************************************************************************************/
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
$Insert SERVICE_SETUP
|
||||
$Insert LOGICAL
|
||||
$Insert OIPRINT_EQUATES
|
||||
$Insert SCHED_DET_NG_EQUATES
|
||||
$Insert WO_LOG_EQUATES
|
||||
$Insert APPCOLORS
|
||||
$Insert MSG_EQUATES
|
||||
$Insert SCHEDULE_EQU
|
||||
$Insert LOCATION_EQUATES
|
||||
$Insert RLIST_EQUATES
|
||||
|
||||
Declare subroutine Utility, ErrMsg, Set_Status, Set_Printer, RList, SRP_Stopwatch, Btree.Extract, Error_Services, V119
|
||||
Declare subroutine Push.Select, Pop.Select, SRP_Stopwatch, Database_Services
|
||||
Declare function Set_Printer, Get_Printer, Msg, Get_Status, Printer_Select, obj_Install, Dialog_Box, obj_Location
|
||||
Declare function Error_Services, Location_Services, SRP_Array, Signature_Services
|
||||
Declare function Epi_Part_Services, SRP_Math, Datetime, Database_Services
|
||||
|
||||
Equ TAB$ TO \09\
|
||||
|
||||
GoToService
|
||||
|
||||
Return Response or ""
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// SERVICES
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Service GetMaterialTrackReport(RptColumns, LocationFilter, NoMatFlag)
|
||||
|
||||
SRP_Stopwatch('Reset')
|
||||
SRP_Stopwatch('Start', 'Select')
|
||||
NoMatFlag = False$
|
||||
|
||||
LocationFilter = ''
|
||||
LocationFilter<1, 1> = 'SR*KTR]'
|
||||
LocationFilter<1, 2> = '1K*PTI'
|
||||
LocationFilter<1, 3> = 'CR*BE'
|
||||
LocationFilter<1, 4> = 'CR*BO'
|
||||
LocationFilter<1, 5> = 'CR*TUN'
|
||||
LocationFilter<1, 6> = 'CR*EPR'
|
||||
LocationFilter<1, 7> = 'CR*FE'
|
||||
LocationFilter<1, 8> = 'CR*FEH'
|
||||
LocationFilter<1, 9> = 'CR*FO'
|
||||
LocationFilter<1, 10> = 'CR*FOH'
|
||||
|
||||
|
||||
// All Possible Report Columns
|
||||
AllRptColumns = ''
|
||||
AllRptColumns<1, 1> = 'React No'
|
||||
AllRptColumns<1, 2> = 'React Type'
|
||||
AllRptColumns<1, 3> = 'WO No'
|
||||
AllRptColumns<1, 4> = 'SAP Prod No'
|
||||
AllRptColumns<1, 5> = 'Sub Part No'
|
||||
AllRptColumns<1, 6> = 'Epi Part No'
|
||||
AllRptColumns<1, 7> = 'WO Qty'
|
||||
AllRptColumns<1, 8> = 'RX Qty'
|
||||
AllRptColumns<1, 9> = 'UnRel Qty'
|
||||
AllRptColumns<1, 10> = 'Kit Location'
|
||||
AllRptColumns<1, 11> = 'Kit Qty'
|
||||
AllRptColumns<1, 12> = '+/-'
|
||||
AllRptColumns<1, 13> = 'Kit RO'
|
||||
AllRptColumns<1, 14> = 'PTI RO'
|
||||
AllRptColumns<1, 15> = 'Load'
|
||||
AllRptColumns<1, 16> = 'Comments'
|
||||
|
||||
RptColumns = AllRptColumns
|
||||
|
||||
ErrorTitle = 'Error in service ':Service
|
||||
ErrCode = ''
|
||||
ErrorMsg = ''
|
||||
|
||||
OPEN 'SCHED_DET_NG' TO SchedDetTable then
|
||||
OPEN 'DICT.SCHED_DET_NG' TO @DICT then
|
||||
Today = Datetime() - 45
|
||||
|
||||
ReactList = ''
|
||||
WOList = ''
|
||||
SchedDetKeys = ''
|
||||
PrevReactNo = ''
|
||||
PrevWO = ''
|
||||
|
||||
SelectSent = 'SELECT SCHED_DET_NG WITH STOP_DTM GE ':Today:' BY REACT_NO'
|
||||
|
||||
RList(SelectSent,TARGET_ACTIVELIST$,'','','')
|
||||
IF Get_Status(errCode) THEN
|
||||
ErrMsg(errCode)
|
||||
RETURN
|
||||
END
|
||||
|
||||
Done = 0
|
||||
@ID = ''
|
||||
LOOP
|
||||
PrevSchedDetKey = @ID
|
||||
READNEXT @ID ELSE Done = 1
|
||||
UNTIL Done
|
||||
READ SchedDetRec FROM SchedDetTable,@ID THEN
|
||||
ReactNo = SchedDetRec<SCHED_DET_NG.REACT_NO$>
|
||||
WONo = SchedDetRec<SCHED_DET_NG.WO_NO$>
|
||||
If ReactNo NE '' then
|
||||
LOCATE ReactNo IN ReactList BY 'AR' USING @FM SETTING Pos ELSE
|
||||
ReactList = INSERT(ReactList,Pos,0,0,ReactNo)
|
||||
END
|
||||
END
|
||||
If WONo NE '' then
|
||||
LOCATE WONo IN WOList<Pos> USING @VM SETTING WPos ELSE
|
||||
WOList = INSERT(WOList,Pos,-1,0,WONo)
|
||||
SchedDetKeys = INSERT(SchedDetKeys,-1,0,0,@ID)
|
||||
END
|
||||
END
|
||||
END
|
||||
|
||||
REPEAT
|
||||
|
||||
CALL Make.List(0,SchedDetKeys,SchedDetTable,@DICT)
|
||||
|
||||
DateRange = 'Effective ':OCONV(Date(),'D4')
|
||||
|
||||
RowIndex = 0
|
||||
AllReportData = ''
|
||||
@RECCOUNT = 0
|
||||
FirstPass = 1
|
||||
LastRecord = 0
|
||||
FirstLine = 1
|
||||
fontSpacing = 100
|
||||
|
||||
* Zero Accumulators For Each Break
|
||||
|
||||
Prev.ReactNo = ''
|
||||
Last.ReactNo.Break = 1
|
||||
|
||||
GoTo ReadRecord
|
||||
|
||||
end else
|
||||
ErrorMsg = 'Unable to open "SCHED_DET_NG" table.'
|
||||
ErrMsg(ErrorTitle:@SVM:ErrorMsg)
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Unable to open "SCHED_DET_NG" table.'
|
||||
ErrMsg(ErrorTitle:@SVM:ErrorMsg)
|
||||
end
|
||||
|
||||
End Service
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ReadRecord:
|
||||
|
||||
* Zero Break Flags To False
|
||||
|
||||
ReactNo.Break=0
|
||||
|
||||
READNEXT @ID, Which.Value ELSE
|
||||
LastRecord = 1
|
||||
ReactNo.Break = 1
|
||||
ReactNo = Prev.ReactNo
|
||||
END
|
||||
|
||||
S.ATID = @ID
|
||||
|
||||
IF FirstPass AND LastRecord THEN
|
||||
GOTO Bail
|
||||
END
|
||||
|
||||
IF LastRecord THEN GOTO BREAKS
|
||||
|
||||
READO @RECORD FROM SchedDetTable,@ID ELSE
|
||||
GOTO ReadRecord
|
||||
END
|
||||
|
||||
@RECCOUNT += 1
|
||||
|
||||
* Calculate Value(s) For Column(s)
|
||||
SRP_Stopwatch('Start', 'Read Record 1.1')
|
||||
S.ATID = {@ID}
|
||||
I.ATID = S.ATID
|
||||
S.ReactNo = {REACT_NO}
|
||||
I.ReactNo = S.ReactNo
|
||||
S.WoNo = {WO_NO}
|
||||
I.WoNo = S.WoNo
|
||||
S.SubPartNo = XLATE('WO_LOG', S.WoNo, 'ORD_SUB_PART_NO', 'X')
|
||||
I.SubPartNo = S.SubPartNo
|
||||
S.EpiPartNo = XLATE('WO_LOG', S.WoNo, WO_LOG_EPI_PART_NO$, 'X')
|
||||
I.EpiPartNo = S.EpiPartNo
|
||||
S.WO_Qty = Xlate('WO_LOG', {WO_NO}, WO_LOG_WO_QTY$, 'X')
|
||||
I.WO_Qty = S.WO_Qty
|
||||
S.WO_RX_Qty = Xlate('WO_LOG', {WO_NO}, 'RX_QTY', 'X')
|
||||
I.WO_RX_Qty = S.WO_RX_Qty
|
||||
S.WO_UnRel_QTY = Xlate('WO_LOG', {WO_NO}, 'UNREL_QTY', 'X')
|
||||
I.WO_UnRel_QTY = S.WO_UnRel_QTY
|
||||
S.REACT_TYPE = Xlate('WO_LOG', {WO_NO}, 'REACT_TYPE', 'X')
|
||||
S.ProdOrdNo = Xlate('WO_LOG', {WO_NO}, 'PROD_ORD_NO', 'X')
|
||||
SRP_Stopwatch('Stop', 'Read Record 1.1')
|
||||
SRP_Stopwatch('Start', 'Read Record 1.2.1')
|
||||
Locate 'SR*KTR]' in LocationFilter using @VM setting vPos then
|
||||
KitData = Database_Services('ReadDataRow', 'WO_LOC', S.WONo:'*':'SR*KTR]')
|
||||
end else
|
||||
KitData = ''
|
||||
end
|
||||
SRP_Stopwatch('Stop', 'Read Record 1.2.1')
|
||||
SRP_Stopwatch('Start', 'Read Record 1.2.2')
|
||||
|
||||
Swap @VM with ',' in KitData
|
||||
|
||||
S.KitLocation = KitData<1>
|
||||
I.KitLocation = S.KitLocation
|
||||
|
||||
S.KitQty = OCONV(SUM(KitData<2>) * 25,'MD0,Z')
|
||||
I.KitQty = S.KitQty
|
||||
|
||||
S.KitCassCnt = KitData<2>
|
||||
I.KitCassCnt = S.KitCassCnt
|
||||
|
||||
KitCassList = KitData<3>
|
||||
|
||||
SRP_Stopwatch('Stop', 'Read Record 1.2.2')
|
||||
SRP_Stopwatch('Start', 'Read Record 1.2.3')
|
||||
|
||||
Locate '1K*PTI' in LocationFilter using @VM setting vPos then
|
||||
PTIData = Database_Services('ReadDataRow', 'WO_LOC', S.WONo:'*':'1K*PTI')
|
||||
end else
|
||||
PTIData = ''
|
||||
end
|
||||
|
||||
SRP_Stopwatch('Stop', 'Read Record 1.2.3')
|
||||
SRP_Stopwatch('Start', 'Read Record 1.3.1')
|
||||
|
||||
Swap @VM with ',' in PTIData
|
||||
|
||||
PTICassList = PTIData<3>
|
||||
|
||||
CRLocs = ''
|
||||
CRLocs<0, -1> = 'CR*BE'
|
||||
CRLocs<0, -1> = 'CR*BO'
|
||||
CRLocs<0, -1> = 'CR*TUN'
|
||||
CRLocs<0, -1> = 'CR*EPR'
|
||||
CRLocs<0, -1> = 'CR*FE'
|
||||
CRLocs<0, -1> = 'CR*FEH'
|
||||
CRLocs<0, -1> = 'CR*FO'
|
||||
CRLocs<0, -1> = 'CR*FOH'
|
||||
|
||||
LoadedData = ''
|
||||
LocQueryList = ''
|
||||
For each Loc in CRLocs using @VM setting crPos
|
||||
Locate Loc in LocationFilter using @VM setting vPos then
|
||||
LocQueryList<0, -1> = Loc
|
||||
end
|
||||
Next Loc
|
||||
LoadedCassList = ''
|
||||
ReactType = Xlate('WO_LOG', S.WONo, 'REACT_TYPE', 'X')
|
||||
SRP_Stopwatch('Stop', 'Read Record 1.3.1')
|
||||
SRP_Stopwatch('Start', 'Read Record 1.3.2')
|
||||
If ReactType NE 'EPP' then
|
||||
If LocQueryList NE '' then
|
||||
For each CRLoc in LocQueryList using @VM
|
||||
CRLocInfo = Database_Services('ReadDataRow', 'WO_LOC', S.WONo:'*':CRLoc)
|
||||
CRLocCassList = CRLocInfo<3>
|
||||
LoadedCassList = SRP_Array('Join', LoadedCassList, CRLocCassList, 'OR', @VM)
|
||||
Next CRLoc
|
||||
end
|
||||
end
|
||||
|
||||
LoadedCassList = SRP_Array('Clean', LoadedCassList, 'TrimAndMakeUnique', @VM)
|
||||
* TEST FOR CONTROL BREAK(S)
|
||||
|
||||
IF (S.ReactNo NE Prev.ReactNo) OR ReactNo.Break THEN
|
||||
ReactNo = Prev.ReactNo
|
||||
Prev.ReactNo = S.ReactNo
|
||||
ReactNo.Break += 1
|
||||
END
|
||||
SRP_Stopwatch('Stop', 'Read Record 1.3.2')
|
||||
IF FirstPass THEN
|
||||
FirstPass=0
|
||||
GOTO DETAIL
|
||||
END
|
||||
|
||||
|
||||
BREAKS:
|
||||
|
||||
* Perform Last Record Output If Done
|
||||
IF LastRecord THEN
|
||||
colData = ''
|
||||
GOTO Bail
|
||||
END
|
||||
|
||||
|
||||
DETAIL:
|
||||
SRP_Stopwatch('Start', 'Detail')
|
||||
* Do Conversion If Any
|
||||
|
||||
IF S.REACTNO NE "" THEN S.REACTNO = OCONV(S.REACTNO,"MD0,")
|
||||
IF S.WONO NE "" THEN S.WONO = OCONV(S.WONO,"MD0")
|
||||
IF S.WO_QTY NE "" THEN S.WO_QTY = OCONV(S.WO_QTY,"MD0,")
|
||||
IF S.WO_RX_QTY NE "" THEN S.WO_RX_QTY = OCONV(S.WO_RX_QTY,"MD0,")
|
||||
IF S.WO_UNREL_QTY NE "" THEN S.WO_UNREL_QTY = OCONV(S.WO_UNREL_QTY,"MD0,")
|
||||
|
||||
* PRINT DETAIL LINE
|
||||
|
||||
COLDATA = ''
|
||||
RowNumber = 0
|
||||
|
||||
/* ascending sort */
|
||||
Convert @VM to ',' in KitCassList
|
||||
Convert @VM to ',' in PTICassList
|
||||
Convert @VM to ',' in LoadedCassList
|
||||
KitCassList = SRP_Array('SortSimpleList', KitCassList, 'AscendingNumbers', ',')
|
||||
PTICassList = SRP_Array('SortSimpleList', PTICassList, 'AscendingNumbers', ',')
|
||||
LoadedCassList = SRP_Array('SortSimpleList', LoadedCassList, 'AscendingNumbers', ',')
|
||||
|
||||
CassNeeded = ''
|
||||
EpiPartNo = Xlate('WO_LOG', S.WONo, 'EPI_PART_NO', 'X')
|
||||
If EpiPartNo NE '' then
|
||||
WPDAdjusted = Epi_Part_Services('GetAdjustedWafersPerDayScheduler', EpiPartNo, S.React_Type)
|
||||
If WPDAdjusted NE '' then
|
||||
CPDAdjusted = SRP_Math('CEILING', (WPDAdjusted/25) )
|
||||
CassInCR = DCount(KittCassList, ',') + DCount(PTICassList, ',') + DCount(LoadedCassList, ',')
|
||||
CassNeeded = CassInCR - CPDAdjusted
|
||||
end
|
||||
end
|
||||
|
||||
RowIndex += 1
|
||||
Swap '.1' with '' in S.ProdOrdNo
|
||||
|
||||
AllReportData<RowIndex, 1> = S.ReactNo
|
||||
AllReportData<RowIndex, 2> = S.React_Type
|
||||
AllReportData<RowIndex, 3> = S.WONo
|
||||
AllReportData<RowIndex, 4> = S.ProdOrdNo
|
||||
AllReportData<RowIndex, 5> = S.SubPartNo
|
||||
AllReportData<RowIndex, 6> = S.EpiPartNo
|
||||
AllReportData<RowIndex, 7> = S.WO_Qty
|
||||
AllReportData<RowIndex, 8> = S.WO_RX_Qty
|
||||
AllReportData<RowIndex, 9> = S.WO_UnRel_Qty
|
||||
AllReportData<RowIndex, 10> = S.KitLocation
|
||||
AllReportData<RowIndex, 11> = S.KitQty
|
||||
AllReportData<RowIndex, 12> = CassNeeded
|
||||
AllReportData<RowIndex, 13> = KitCassList
|
||||
AllReportData<RowIndex, 14> = PTICassList
|
||||
AllReportData<RowIndex, 15> = LoadedCassList
|
||||
AllReportData<RowIndex, 16> = ''
|
||||
SRP_Stopwatch('Stop', 'Detail')
|
||||
GOTO ReadRecord
|
||||
|
||||
Bail:
|
||||
|
||||
SRP_Stopwatch('ShowAll')
|
||||
|
||||
RETURN
|
||||
|
||||
|
@ -1,547 +0,0 @@
|
||||
Compile function Report_Services_Dev5(@Service, @Params)
|
||||
/***********************************************************************************************************************
|
||||
|
||||
Name : Report_Services
|
||||
|
||||
Description : Handler program for all Report services.
|
||||
|
||||
Notes : Application errors should be logged using the Error Services module. There are a few methodological
|
||||
assumptions built into way errors are managed which are important to understand in order to properly
|
||||
work with Error Services:
|
||||
|
||||
- The term 'top' refers to the originating procedure of a call stack and the term 'bottom' refers to
|
||||
the last routine (or the current routine) within a call stack. Within the OpenInsight Debugger
|
||||
this will appear backwards since the originating procedure always appears at the bottom of the
|
||||
list and the current routine appears at the top of the list. We are using this orientation because
|
||||
it is common to refer to the process of calling other procedures as 'drilling down'.
|
||||
|
||||
- The reason for defining the orientation of the call stack is because Error_Services allows for
|
||||
multiple error conditions to be appended to an original error. In most cases this will happen when
|
||||
a procedure at the bottom of the stack generates an error condition and then returns to its
|
||||
calling procedure. This higher level procedure can optionally add more information relevant to
|
||||
itself. This continues as the call stack 'bubbles' its way back to the top to where the
|
||||
originating procedure is waiting.
|
||||
|
||||
- Native OpenInsight commands that handle errors (e.g., Set_Status, Set_FSError, Set_EventStatus)
|
||||
preserve their error state until explicitly cleared. This can hinder the normal execution of code
|
||||
since subsequent procedures (usually SSPs) will fail if a pre-existing error condition exists.
|
||||
Our philosophy is that error conditions should automatically be cleared before a new procedure
|
||||
is executed to avoid this problem. However, the nature of Basic+ does not make this easy to
|
||||
automate for any given stored procedure. Therefore, if a stored procedure wants to conform to our
|
||||
philosophy then it should include a call into the 'Clear' service request at the top of the
|
||||
program. Alternatively this can be done through a common insert (see SERVICE_SETUP for example.)
|
||||
|
||||
- Service modules will use the SERVICE_SETUP insert and therefore automatically clear out any
|
||||
error conditions that were set before.
|
||||
|
||||
Parameters :
|
||||
Service [in] -- Name of the service being requested
|
||||
Param1-10 [in/out] -- Additional request parameter holders
|
||||
Response [out] -- Response to be sent back to the Controller (MCP) or requesting procedure
|
||||
|
||||
Metadata :
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
07/28/21 djs Copied original source code from Report_Services. Modified GetMaterialTrackReport
|
||||
to use the SCHED_DET_NG table (i.e. Scheduler 2.0) instead of the SCHED_DET table.
|
||||
|
||||
|
||||
***********************************************************************************************************************/
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
$Insert SERVICE_SETUP
|
||||
$Insert LOGICAL
|
||||
$Insert OIPRINT_EQUATES
|
||||
$Insert SCHED_DET_NG_EQUATES
|
||||
$Insert WO_LOG_EQUATES
|
||||
$Insert APPCOLORS
|
||||
$Insert MSG_EQUATES
|
||||
$Insert SCHEDULE_EQU
|
||||
$Insert LOCATION_EQUATES
|
||||
$Insert RLIST_EQUATES
|
||||
|
||||
Declare subroutine Utility, ErrMsg, Set_Status, Set_Printer, RList, Btree.Extract, Error_Services, V119
|
||||
Declare subroutine Push.Select, Pop.Select
|
||||
Declare function Set_Printer, Get_Printer, Msg, Get_Status, Printer_Select, obj_Install, Dialog_Box, obj_Location
|
||||
Declare function Error_Services, Location_Services, SRP_Array, Signature_Services
|
||||
Declare function Epi_Part_Services, SRP_Math, Datetime, Database_Services
|
||||
|
||||
Equ TAB$ TO \09\
|
||||
|
||||
GoToService
|
||||
|
||||
Return Response or ""
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// SERVICES
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Service GetMaterialTrackReport(RptColumns, LocationFilter, NoMatFlag)
|
||||
|
||||
// All Possible Report Columns
|
||||
AllRptColumns = ''
|
||||
AllRptColumns<1, 1> = 'React No'
|
||||
AllRptColumns<1, 2> = 'React Type'
|
||||
AllRptColumns<1, 3> = 'WO No'
|
||||
AllRptColumns<1, 4> = 'SAP Prod No'
|
||||
AllRptColumns<1, 5> = 'Sub Part No'
|
||||
AllRptColumns<1, 6> = 'Epi Part No'
|
||||
AllRptColumns<1, 7> = 'WO Qty'
|
||||
AllRptColumns<1, 8> = 'RX Qty'
|
||||
AllRptColumns<1, 9> = 'UnRel Qty'
|
||||
AllRptColumns<1, 10> = 'Kit Location'
|
||||
AllRptColumns<1, 11> = 'Kit Qty'
|
||||
AllRptColumns<1, 12> = '+/-'
|
||||
AllRptColumns<1, 13> = 'Kit RO'
|
||||
AllRptColumns<1, 14> = 'PTI RO'
|
||||
AllRptColumns<1, 15> = 'Load'
|
||||
AllRptColumns<1, 16> = 'Comments'
|
||||
|
||||
If Index(RptColumns, 'Comments', 1) then
|
||||
AllColFmt = ''
|
||||
AllColFmt<1, 1> = '+^720'
|
||||
AllColFmt<1, 2> = '+<720'
|
||||
AllColFmt<1, 3> = '+^1000'
|
||||
AllColFmt<1, 4> = '+^1100'
|
||||
AllColFmt<1, 5> = '+^1300'
|
||||
AllColFmt<1, 6> = '+^1200'
|
||||
AllColFmt<1, 7> = '+>720'
|
||||
AllColFmt<1, 8> = '+>720'
|
||||
AllColFmt<1, 9> = '+>720'
|
||||
AllColFmt<1, 10> = '+^1260'
|
||||
AllColFmt<1, 11> = '+^720'
|
||||
AllColFmt<1, 12> = '+^500'
|
||||
AllColFmt<1, 13> = '+^1300'
|
||||
AllColFmt<1, 14> = '+^1300'
|
||||
AllColFmt<1, 15> = '+^700'
|
||||
AllColFmt<1, 16> = '+^1300'
|
||||
end else
|
||||
AllColFmt = ''
|
||||
AllColFmt<1, 1> = '+^720'
|
||||
AllColFmt<1, 2> = '+<720'
|
||||
AllColFmt<1, 3> = '+^1000'
|
||||
AllColFmt<1, 4> = '+^1100'
|
||||
AllColFmt<1, 5> = '+^1300'
|
||||
AllColFmt<1, 6> = '+^1200'
|
||||
AllColFmt<1, 7> = '+>720'
|
||||
AllColFmt<1, 8> = '+>720'
|
||||
AllColFmt<1, 9> = '+>720'
|
||||
AllColFmt<1, 10> = '+^1260'
|
||||
AllColFmt<1, 11> = '+^720'
|
||||
AllColFmt<1, 12> = '+^500'
|
||||
AllColFmt<1, 13> = '+^1800'
|
||||
AllColFmt<1, 14> = '+^1800'
|
||||
AllColFmt<1, 15> = '+^1100'
|
||||
AllColFmt<1, 16> = ''
|
||||
end
|
||||
|
||||
ErrorTitle = 'Error in service ':Service
|
||||
ErrCode = ''
|
||||
ErrorMsg = ''
|
||||
|
||||
OPEN 'SCHED_DET_NG' TO SchedDetTable then
|
||||
OPEN 'DICT.SCHED_DET_NG' TO @DICT then
|
||||
Today = Datetime()
|
||||
|
||||
ReactList = ''
|
||||
WOList = ''
|
||||
SchedDetKeys = ''
|
||||
PrevReactNo = ''
|
||||
PrevWO = ''
|
||||
|
||||
SelectSent = 'SELECT SCHED_DET_NG WITH STOP_DTM GE "':OCONV(Today, 'DT'):'" BY REACT_NO'
|
||||
|
||||
RList(SelectSent,TARGET_ACTIVELIST$,'','','')
|
||||
IF Get_Status(errCode) THEN
|
||||
ErrMsg(errCode)
|
||||
RETURN
|
||||
END
|
||||
|
||||
Done = 0
|
||||
@ID = ''
|
||||
LOOP
|
||||
PrevSchedDetKey = @ID
|
||||
READNEXT @ID ELSE Done = 1
|
||||
UNTIL Done
|
||||
READ SchedDetRec FROM SchedDetTable,@ID THEN
|
||||
ReactNo = SchedDetRec<SCHED_DET_NG.REACT_NO$>
|
||||
WONo = SchedDetRec<SCHED_DET_NG.WO_NO$>
|
||||
If ReactNo NE '' then
|
||||
LOCATE ReactNo IN ReactList BY 'AR' USING @FM SETTING Pos ELSE
|
||||
ReactList = INSERT(ReactList,Pos,0,0,ReactNo)
|
||||
END
|
||||
END
|
||||
If WONo NE '' then
|
||||
LOCATE WONo IN WOList<Pos> USING @VM SETTING WPos ELSE
|
||||
WOList = INSERT(WOList,Pos,-1,0,WONo)
|
||||
SchedDetKeys = INSERT(SchedDetKeys,-1,0,0,@ID)
|
||||
END
|
||||
END
|
||||
END
|
||||
|
||||
REPEAT
|
||||
|
||||
CALL Make.List(0,SchedDetKeys,SchedDetTable,@DICT)
|
||||
|
||||
Header = "'D'":@VM:obj_Install('Get_Prop','CompTitle'):' Material Tracking by Reactor':@VM:"Page 'P'"
|
||||
MinDemand = 0
|
||||
Set_Status(0)
|
||||
|
||||
* Start of printing process
|
||||
FileName = 'Print Material Demand'
|
||||
Title = 'Printing Material Demand'
|
||||
|
||||
TopMargin = 1.0
|
||||
BottomMargin = 0.75
|
||||
LeftMargin = 0.25
|
||||
RightMargin = 0.25
|
||||
|
||||
Margins = LeftMargin:@FM:TopMargin:@FM:RightMargin:@FM:BottomMargin
|
||||
|
||||
PageSetup = '1' ;* LandScape
|
||||
PrintSetup = '2' ;* Preview Normal
|
||||
PrintSetup<1,2> = '0' ;* All buttons
|
||||
PrintSetup<1,5> = '1' ;* Page Range
|
||||
PrintSetup<1,6> = 7 ;* full mouse and keyboard support
|
||||
|
||||
PrintPath = ''
|
||||
stat = Set_Printer('INIT',FileName,Title,Margins,PageSetup,PrintSetup,PrintPath)
|
||||
|
||||
IF stat < 0 THEN
|
||||
ErrorMsg = 'Stat = ' : Stat : ', PrintPath = ' : PrintPath
|
||||
GOTO OIPrintErr
|
||||
end
|
||||
DateRange = 'Effective ':OCONV(Date(),'D4')
|
||||
|
||||
Header<-1> = "'T'"
|
||||
Header<-1> = '' ;* Blank line following heading
|
||||
|
||||
font = 'Arial'
|
||||
font<2> = '10'
|
||||
font<4> = '0' ;* Bold
|
||||
|
||||
stat = Set_Printer('FONTHEADFOOT',font) ; IF stat < 0 THEN GOTO OIPrintErr
|
||||
stat = Set_Printer('HEADER',Header) ; IF stat < 0 THEN GOTO OIPrintErr
|
||||
|
||||
Footer = " 'D' 'T'":@VM:@VM:"Page: 'P'"
|
||||
stat = Set_Printer('FOOTER',Footer) ; IF stat < 0 THEN GOTO OIPrintErr
|
||||
|
||||
@RECCOUNT = 0
|
||||
FirstPass = 1
|
||||
LastRecord = 0
|
||||
FirstLine = 1
|
||||
fontSpacing = 100
|
||||
|
||||
* Make Column Heading
|
||||
ColHead = ''
|
||||
ColFmt = ''
|
||||
|
||||
For each Column in RptColumns using @VM setting rcPos
|
||||
Locate Column in AllRptColumns using @VM setting dataPos then
|
||||
ColHead<0, -1> = Column
|
||||
ColFmt<0, -1> = AllColFmt<0, dataPos>
|
||||
end
|
||||
Next Column
|
||||
|
||||
* Zero Accumulators For Each Break
|
||||
|
||||
Prev.ReactNo = ''
|
||||
Last.ReactNo.Break = 1
|
||||
|
||||
GoTo ReadRecord
|
||||
|
||||
end else
|
||||
ErrorMsg = 'Unable to open "SCHED_DET_NG" table.'
|
||||
ErrMsg(ErrorTitle:@SVM:ErrorMsg)
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Unable to open "SCHED_DET_NG" table.'
|
||||
ErrMsg(ErrorTitle:@SVM:ErrorMsg)
|
||||
end
|
||||
|
||||
End Service
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ReadRecord:
|
||||
|
||||
* Zero Break Flags To False
|
||||
|
||||
ReactNo.Break=0
|
||||
|
||||
READNEXT @ID, Which.Value ELSE
|
||||
LastRecord = 1
|
||||
ReactNo.Break = 1
|
||||
ReactNo = Prev.ReactNo
|
||||
END
|
||||
|
||||
S.ATID = @ID
|
||||
|
||||
IF FirstPass AND LastRecord THEN
|
||||
GOTO Bail
|
||||
END
|
||||
|
||||
IF LastRecord THEN GOTO BREAKS
|
||||
|
||||
READO @RECORD FROM SchedDetTable,@ID ELSE
|
||||
GOTO ReadRecord
|
||||
END
|
||||
|
||||
@RECCOUNT += 1
|
||||
|
||||
* Calculate Value(s) For Column(s)
|
||||
|
||||
S.ATID = {@ID}
|
||||
I.ATID = S.ATID
|
||||
S.ReactNo = {REACT_NO}
|
||||
I.ReactNo = S.ReactNo
|
||||
S.WoNo = {WO_NO}
|
||||
I.WoNo = S.WoNo
|
||||
S.SubPartNo = XLATE('WO_LOG', S.WoNo, 'ORD_SUB_PART_NO', 'X')
|
||||
I.SubPartNo = S.SubPartNo
|
||||
S.EpiPartNo = XLATE('WO_LOG', S.WoNo, WO_LOG_EPI_PART_NO$, 'X')
|
||||
I.EpiPartNo = S.EpiPartNo
|
||||
S.WO_Qty = Xlate('WO_LOG', {WO_NO}, WO_LOG_WO_QTY$, 'X')
|
||||
I.WO_Qty = S.WO_Qty
|
||||
S.WO_RX_Qty = Xlate('WO_LOG', {WO_NO}, 'RX_QTY', 'X')
|
||||
I.WO_RX_Qty = S.WO_RX_Qty
|
||||
S.WO_UnRel_QTY = Xlate('WO_LOG', {WO_NO}, 'UNREL_QTY', 'X')
|
||||
I.WO_UnRel_QTY = S.WO_UnRel_QTY
|
||||
S.REACT_TYPE = Xlate('WO_LOG', {WO_NO}, 'REACT_TYPE', 'X')
|
||||
S.ProdOrdNo = Xlate('WO_LOG', {WO_NO}, 'PROD_ORD_NO', 'X')
|
||||
|
||||
Locate 'SR*KTR]' in LocationFilter using @VM setting vPos then
|
||||
KitData = Database_Services('ReadDataRow', 'WO_LOC', S.WONo:'*':'SR*KTR]')
|
||||
end else
|
||||
KitData = ''
|
||||
end
|
||||
|
||||
Swap @VM with ',' in KitData
|
||||
|
||||
S.KitLocation = KitData<1>
|
||||
I.KitLocation = S.KitLocation
|
||||
|
||||
S.KitCassCnt = COUNT(KitData<3>,',') + (KitData<3> NE '')
|
||||
I.KitCassCnt = S.KitCassCnt
|
||||
|
||||
KitCassList = KitData<3>
|
||||
S.KitQty = 0
|
||||
For each CassNo in KitCassList using ','
|
||||
S.KitQty += Xlate('WO_MAT', S.WONo:'*':CassNo, 'WAFER_QTY', 'X')
|
||||
Next CassNo
|
||||
I.KitQty = S.KitQty
|
||||
|
||||
Locate '1K*PTI' in LocationFilter using @VM setting vPos then
|
||||
PTIData = Database_Services('ReadDataRow', 'WO_LOC', S.WONo:'*':'1K*PTI')
|
||||
end else
|
||||
PTIData = ''
|
||||
end
|
||||
PTICassList = PTIData<3>
|
||||
|
||||
Swap @VM with ',' in PTIData
|
||||
PTICassList = PTIData<3>
|
||||
|
||||
CRLocs = ''
|
||||
CRLocs<0, -1> = 'CR*BE'
|
||||
CRLocs<0, -1> = 'CR*BO'
|
||||
CRLocs<0, -1> = 'CR*TUN'
|
||||
CRLocs<0, -1> = 'CR*EPR'
|
||||
CRLocs<0, -1> = 'CR*FE'
|
||||
CRLocs<0, -1> = 'CR*FEH'
|
||||
CRLocs<0, -1> = 'CR*FO'
|
||||
CRLocs<0, -1> = 'CR*FOH'
|
||||
|
||||
LoadedData = ''
|
||||
LocQueryList = ''
|
||||
For each Loc in CRLocs using @VM setting crPos
|
||||
Locate Loc in LocationFilter using @VM setting vPos then
|
||||
LocQueryList<0, -1> = Loc
|
||||
end
|
||||
Next Loc
|
||||
LoadedCassList = ''
|
||||
ReactType = Xlate('WO_LOG', S.WONo, 'REACT_TYPE', 'X')
|
||||
If ReactType NE 'EPP' then
|
||||
If LocQueryList NE '' then
|
||||
For each CRLoc in LocQueryList using @VM
|
||||
CRLocInfo = Database_Services('ReadDataRow', 'WO_LOC', S.WONo:'*':CRLoc)
|
||||
CRLocCassList = CRLocInfo<3>
|
||||
LoadedCassList = SRP_Array('Join', LoadedCassList, CRLocCassList, 'OR', @VM)
|
||||
Next CRLoc
|
||||
end
|
||||
end
|
||||
|
||||
LoadedCassList = SRP_Array('Clean', LoadedCassList, 'TrimAndMakeUnique', @VM)
|
||||
* TEST FOR CONTROL BREAK(S)
|
||||
|
||||
IF (S.ReactNo NE Prev.ReactNo) OR ReactNo.Break THEN
|
||||
ReactNo = Prev.ReactNo
|
||||
Prev.ReactNo = S.ReactNo
|
||||
ReactNo.Break += 1
|
||||
END
|
||||
|
||||
IF FirstPass THEN
|
||||
FirstPass=0
|
||||
GOTO DETAIL
|
||||
END
|
||||
|
||||
|
||||
BREAKS:
|
||||
|
||||
* Print Break Total(s) And Accumulate Total(s)
|
||||
IF ReactNo.Break THEN stat = Set_Printer('TEXT')
|
||||
|
||||
* Perform Last Record Output If Done
|
||||
IF LastRecord THEN
|
||||
colData = ''
|
||||
GOTO Bail
|
||||
END
|
||||
|
||||
|
||||
DETAIL:
|
||||
|
||||
* Do Conversion If Any
|
||||
|
||||
IF S.REACTNO NE "" THEN S.REACTNO = OCONV(S.REACTNO,"MD0,")
|
||||
IF S.WONO NE "" THEN S.WONO = OCONV(S.WONO,"MD0")
|
||||
IF S.WO_QTY NE "" THEN S.WO_QTY = OCONV(S.WO_QTY,"MD0,")
|
||||
IF S.WO_RX_QTY NE "" THEN S.WO_RX_QTY = OCONV(S.WO_RX_QTY,"MD0,")
|
||||
IF S.WO_UNREL_QTY NE "" THEN S.WO_UNREL_QTY = OCONV(S.WO_UNREL_QTY,"MD0,")
|
||||
|
||||
* PRINT DETAIL LINE
|
||||
|
||||
COLDATA = ''
|
||||
RowNumber = 0
|
||||
|
||||
/* ascending sort */
|
||||
Convert @VM to ',' in KitCassList
|
||||
Convert @VM to ',' in PTICassList
|
||||
Convert @VM to ',' in LoadedCassList
|
||||
KitCassList = SRP_Array('SortSimpleList', KitCassList, 'AscendingNumbers', ',')
|
||||
PTICassList = SRP_Array('SortSimpleList', PTICassList, 'AscendingNumbers', ',')
|
||||
LoadedCassList = SRP_Array('SortSimpleList', LoadedCassList, 'AscendingNumbers', ',')
|
||||
|
||||
Convert ',' to @VM in KitCassList
|
||||
Convert ',' to @VM in PTICassList
|
||||
Convert ',' to @VM in LoadedCassList
|
||||
|
||||
NumKitCass = DCount(KitCassList, @VM)
|
||||
If NumKitCass GT 4 then
|
||||
For CassIndex = 4 to NumKitCass Step 4
|
||||
CassNo = KitCassList<0, CassIndex>
|
||||
CassNo := CRLF$
|
||||
KitCassList<0, CassIndex> = CassNo
|
||||
Next CassIndex
|
||||
end
|
||||
NumPTICass = DCount(PTICassList, @VM)
|
||||
If NumPTICass GT 4 then
|
||||
For CassIndex = 4 to NumPTICass Step 4
|
||||
CassNo = PTICassList<0, CassIndex>
|
||||
CassNo := CRLF$
|
||||
PTICassList<0, CassIndex> = CassNo
|
||||
Next CassIndex
|
||||
end
|
||||
NumLoadedCass = DCount(LoadedCassList, @VM)
|
||||
If NumLoadedCass GT 2 then
|
||||
For CassIndex = 2 to NumLoadedCass Step 2
|
||||
CassNo = LoadedCassList<0, CassIndex>
|
||||
CassNo := CRLF$
|
||||
LoadedCassList<0, CassIndex> = CassNo
|
||||
Next CassIndex
|
||||
end
|
||||
Convert @VM to ',' in KitCassList
|
||||
Convert @VM to ',' in PTICassList
|
||||
Convert @VM to ',' in LoadedCassList
|
||||
|
||||
CassNeeded = ''
|
||||
EpiPartNo = Xlate('WO_LOG', S.WONo, 'EPI_PART_NO', 'X')
|
||||
If EpiPartNo NE '' then
|
||||
WPDAdjusted = Epi_Part_Services('GetAdjustedWafersPerDayScheduler', EpiPartNo, S.React_Type)
|
||||
If WPDAdjusted NE '' then
|
||||
CPDAdjusted = SRP_Math('CEILING', (WPDAdjusted/25) )
|
||||
CassInCR = DCount(KitCassList, ',') + DCount(PTICassList, ',') + DCount(LoadedCassList, ',')
|
||||
CassNeeded = CassInCR - CPDAdjusted
|
||||
end
|
||||
end
|
||||
|
||||
Swap '.1' with '' in S.ProdOrdNo
|
||||
AllReportData = ''
|
||||
AllReportData<1> = S.ReactNo
|
||||
AllReportData<2> = S.React_Type
|
||||
AllReportData<3> = S.WONo
|
||||
AllReportData<4> = S.ProdOrdNo
|
||||
AllReportData<5> = S.SubPartNo
|
||||
AllReportData<6> = S.EpiPartNo
|
||||
AllReportData<7> = S.WO_Qty
|
||||
AllReportData<8> = S.WO_RX_Qty
|
||||
AllReportData<9> = S.WO_UnRel_Qty
|
||||
AllReportData<10> = S.KitLocation
|
||||
AllReportData<11> = S.KitQty
|
||||
AllReportData<12> = CassNeeded
|
||||
AllReportData<13> = KitCassList
|
||||
AllReportData<14> = PTICassList
|
||||
AllReportData<15> = LoadedCassList
|
||||
AllReportData<16> = ''
|
||||
|
||||
If ( (KitCassList NE '') or (PTICassList NE '') or (LoadedCassList NE '') or (NoMatFlag EQ True$) ) then
|
||||
RowNumber += 1
|
||||
For each RptColumn in RptColumns using @VM setting rcPos
|
||||
Locate RptColumn in AllRptColumns using @VM setting dataPos then
|
||||
COLDATA<RowNumber,rcPos> = AllReportData<dataPos>
|
||||
end
|
||||
Next RptColumn
|
||||
If COLDATA NE '' then GoSub PrintTable
|
||||
END
|
||||
|
||||
GOTO ReadRecord
|
||||
|
||||
Bail:
|
||||
|
||||
stat = Set_Printer('TERM',1)
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
OIPrintErr:
|
||||
|
||||
ErrMsg(ErrorTitle:@SVM:ErrorMsg)
|
||||
ErrMsg(ErrorTitle:@SVM:'Set_Printer returned errorcode ':stat)
|
||||
stat = Set_Printer('TERM',1)
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
PrintTable:
|
||||
|
||||
PageHeight = Get_Printer('PAGESIZE')<2>
|
||||
PrintableHeight = PageHeight - TopMargin - BottomMargin
|
||||
PrinterHeight = Get_Printer('POS')<2>
|
||||
stat = Set_Printer('CALCTABLE',ColFmt:@FM:ColData)
|
||||
TableSize = Get_Printer('CALCTABLE')
|
||||
TableHeight = TableSize<2>
|
||||
fontSpacing = 120
|
||||
|
||||
IF ( TableHeight + PrinterHeight >= PrintableHeight ) OR FirstLine THEN
|
||||
IF NOT(FirstLine) THEN
|
||||
stat = Set_Printer('PAGEBREAK')
|
||||
END
|
||||
FirstLine = 0
|
||||
font<2> = 10
|
||||
font<4> = 1 ;* Bold
|
||||
stat = Set_Printer('FONT',font,'100')
|
||||
stat = Set_Printer('ADDTABLE',colFmt,colHead,'',LTGREY$,'',0,TB_ALL)
|
||||
font<4> = 0
|
||||
stat = Set_Printer('FONT',font,fontSpacing)
|
||||
stat = Set_Printer('ADDTABLE',colFmt,'',colData,LTGREY$,'',0,7)
|
||||
END ELSE
|
||||
font<2> = 10
|
||||
font<4> = 0
|
||||
stat = Set_Printer('FONT',font,fontSpacing)
|
||||
stat = Set_Printer('ADDTABLE',colFmt,'',colData,LTGREY$,'',1,TB_ALL)
|
||||
END
|
||||
|
||||
RETURN
|
||||
|
||||
|
Reference in New Issue
Block a user