replaced supplement RList calls with Btree.Extract

This commit is contained in:
Infineon\StieberD 2024-09-16 15:17:40 -07:00 committed by Stieber Daniel (IT FI MES)
parent 6fbc512eac
commit 293d01a2c0
6 changed files with 3993 additions and 1895 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -22313,10 +22313,10 @@
"<2>": { "<2>": {
"<2,1>": { "<2,1>": {
"<2,1,1>": { "<2,1,1>": {
"<2,1,1,1>": "SEND_MESSAGE.MESSAGE_W/ATTACHMENT", "<2,1,1,1>": "UNLOAD/LOAD_EXTRA.SIGNATURE_INFO",
"<2,1,1,2>": "PRINT.CUSTOMER_RDS", "<2,1,1,2>": "PRINT.FACTORY_LABELS",
"<2,1,1,3>": "PRINT.FACTORY_LABELS", "<2,1,1,3>": "PRINT.CUSTOMER_RDS",
"<2,1,1,4>": "UNLOAD/LOAD_EXTRA.SIGNATURE_INFO" "<2,1,1,4>": "SEND_MESSAGE.MESSAGE_W/ATTACHMENT"
} }
}, },
"<2,2>": { "<2,2>": {

View File

@ -49,15 +49,15 @@ Subclass = SubclassInfo<1>
// Update the arguments so that the OpenInsight OLE event will treate the ActiveX event as a native event handler. // Update the arguments so that the OpenInsight OLE event will treate the ActiveX event as a native event handler.
If Event EQ 'OLE' then If Event EQ 'OLE' then
Transfer Event to OIEvent Transfer Event to OIEvent
Transfer Param1 to Event Transfer Param1 to Event
Transfer Param2 to Param1 Transfer Param2 to Param1
Transfer Param3 to Param2 Transfer Param3 to Param2
* Transfer Param4 to Param3 Transfer Param4 to Param3
* Transfer Param5 to Param4 Transfer Param5 to Param4
* Transfer Param6 to Param5 Transfer Param6 to Param5
* Transfer Param7 to Param6 Transfer Param7 to Param6
* Transfer Param8 to Param7 Transfer Param8 to Param7
end end
GoToEvent Event for CtrlEntID GoToEvent Event for CtrlEntID
@ -71,67 +71,69 @@ Return EventFlow else EVENT_CONTINUE$
Event WINDOW.CREATE(CreateParam) Event WINDOW.CREATE(CreateParam)
Result = '' Result = ''
SupplInst = '' SupplInst = ''
GoSub Setup_OLE_Controls GoSub Setup_OLE_Controls
If CreateParam NE '' then If CreateParam NE '' then
Gosub PopulateStages Gosub PopulateStages
Set_Property(@Window : '.CMB_STAGE', 'LIST', StageList) Set_Property(@Window : '.CMB_STAGE', 'LIST', StageList)
Set_Property(@Window : '.CMB_STAGE', 'SELPOS', 1) Set_Property(@Window : '.CMB_STAGE', 'SELPOS', 1)
Set_Property(@Window : '.PUB_OK', 'ENABLED', True$) Set_Property(@Window : '.PUB_OK', 'ENABLED', True$)
end end
Gosub CheckForSupplements Gosub CheckForSupplements
SRP_Show_Window(@Window, '', 'C', 'C', 1, '', False$, False$, FormSize) SRP_Show_Window(@Window, '', 'C', 'C', 1, '', False$, False$, FormSize)
end event end event
Event WINDOW.CLOSE(CancelFlag) Event WINDOW.CLOSE(CancelFlag)
Result = '' Result = ''
Result<1> = False$ Result<1> = False$
End_Dialog(@Window, Result) End_Dialog(@Window, Result)
end event end event
Event CMB_STAGE.CHANGED(CreateParam) Event CMB_STAGE.CHANGED(CreateParam)
Gosub CheckForSupplements Gosub CheckForSupplements
end event end event
Event EDL_SUPPL_INST.CHAR(VirtCode, ScanCode, CtrlKey, ShiftKey, AltKey) Event EDL_SUPPL_INST.CHAR(VirtCode, ScanCode, CtrlKey, ShiftKey, AltKey)
SupplInst = Get_Property(CtrlEntId, 'TEXT') SupplInst = Get_Property(CtrlEntId, 'TEXT')
If SupplInst NE '' then If SupplInst NE '' then
Set_Property(@Window : '.PUB_OK', 'ENABLED', True$) Set_Property(@Window : '.PUB_OK', 'ENABLED', True$)
end else end else
Set_Property(@Window : '.PUB_OK', 'ENABLED', False$) Set_Property(@Window : '.PUB_OK', 'ENABLED', False$)
end end
end event end event
Event PUB_OK.CLICK() Event PUB_OK.CLICK()
Result = '' Result = ''
SupplInst = Get_Property(@Window : '.EDL_SUPPL_INST', 'TEXT') SupplInst = Get_Property(@Window : '.EDL_SUPPL_INST', 'TEXT')
StageSel = Get_Property(@Window : '.CMB_STAGE', 'TEXT') StageSel = Get_Property(@Window : '.CMB_STAGE', 'TEXT')
StageReturn = Field(StageSel, '-', 2) StageReturn = Field(StageSel, '-', 2)
Result<1> = True$ Result<1> = True$
Result<2> = StageReturn :': ': SupplInst Result<2> = StageReturn :': ': SupplInst
End_Dialog(@Window, Result) End_Dialog(@Window, Result)
end event end event
Event PUB_CANCEL.CLICK() Event PUB_CANCEL.CLICK()
Result = '' Result = ''
Result<1> = False$ Result<1> = False$
End_Dialog(@Window, Result) End_Dialog(@Window, Result)
end event end event
@ -142,9 +144,9 @@ end event
Setup_OLE_Controls: Setup_OLE_Controls:
Qualify = '' Qualify = ''
Qualify<1> = 1 Qualify<1> = 1
Qualify<4> = 0 Qualify<4> = 0
return return
@ -155,7 +157,6 @@ PopulateStages:
RDSList = SRP_Array("Rotate", CreateParam) RDSList = SRP_Array("Rotate", CreateParam)
@ReCur1 = RDSList<5> @ReCur1 = RDSList<5>
@ReCur2 = RDSList<15> @ReCur2 = RDSList<15>
For Each RDSKey in @ReCur1 Using @VM For Each RDSKey in @ReCur1 Using @VM
RDSStageList = Supplement_Services('GetStagesForLot', 'RDS', RDSKey) RDSStageList = Supplement_Services('GetStagesForLot', 'RDS', RDSKey)
RDSStageList2 = RDSStageList<2> :@FM: RDSStageList<1> RDSStageList2 = RDSStageList<2> :@FM: RDSStageList<1>
@ -168,14 +169,16 @@ PopulateStages:
Next RDSKey Next RDSKey
Swap @VM with ' -' in DraftStageList Swap @VM with ' -' in DraftStageList
StageList = SRP_Array('Clean', DraftStageList, "TrimAndMakeUnique", @FM) StageList = SRP_Array('Clean', DraftStageList, "TrimAndMakeUnique", @FM)
return return
CheckForSupplements: CheckForSupplements:
SuppFound = False$ SuppFound = False$
SuppText = '' SuppText = ''
StageSel = Get_Property(@Window : '.CMB_STAGE', 'TEXT') StageSel = Get_Property(@Window : '.CMB_STAGE', 'TEXT')
Stage = Field(StageSel, '-', 2) Stage = Field(StageSel, '-', 2)
For Each RDSKey in @ReCur1 Using @VM Setting Pos For Each RDSKey in @ReCur1 Using @VM Setting Pos
If @Recur2<pos> NE '' then If @Recur2<pos> NE '' then
Supps = @Recur2<pos> Supps = @Recur2<pos>
@ -186,7 +189,7 @@ CheckForSupplements:
SuppText = TrimF(SuppText) SuppText = TrimF(SuppText)
SuppFound = True$ SuppFound = True$
end end
Until SuppFound NE False$ Until SuppFound NE False$
Next Supp Next Supp
If SuppText EQ '' then SuppFound = Supplement_Services('GetSupplementsForLot', 'RDS', RDSKey, Stage) If SuppText EQ '' then SuppFound = Supplement_Services('GetSupplementsForLot', 'RDS', RDSKey, Stage)
end else end else
@ -212,8 +215,3 @@ CheckForSupplements:
return return

View File

@ -46,6 +46,7 @@ Compile function Supplement_Services(@Service, @Params)
***********************************************************************************************************************/ ***********************************************************************************************************************/
#pragma precomp SRP_PreCompiler #pragma precomp SRP_PreCompiler
$insert APP_INSERTS $insert APP_INSERTS
$Insert SERVICE_SETUP $Insert SERVICE_SETUP
$Insert SUPPLEMENTS_EQUATES $Insert SUPPLEMENTS_EQUATES
@ -54,7 +55,8 @@ Equ COMMA$ to ','
Declare function Database_Services, Supplement_Services, Rti_Createguid, SRP_Array, Datetime, Signature_Services Declare function Database_Services, Supplement_Services, Rti_Createguid, SRP_Array, Datetime, Signature_Services
Declare function Environment_Services, Logging_Services, Select_Into Declare function Environment_Services, Logging_Services, Select_Into
Declare subroutine Database_Services, RList, Rds_Services, Supplement_Services, Logging_Services, Set_Status, SRP_Stopwatch Declare subroutine Database_Services, Rds_Services, Supplement_Services, Logging_Services, Set_Status, SRP_Stopwatch
Declare subroutine Btree.Extract
GoToService else GoToService else
Error_Services('Add', Service : ' is not a valid service request within the ' : ServiceModule : ' module.') Error_Services('Add', Service : ' is not a valid service request within the ' : ServiceModule : ' module.')
@ -71,9 +73,9 @@ Options LOTTYPES = 'RDS', 'WO_MAT'
Options STAGES = 'VER', 'PREC','PREI', 'PRES', 'LOAD', 'FWII', 'FWIS', 'UNLOAD', 'LWII', 'LWIS', 'PSTC', 'PSTI', 'PSTS', 'QA', 'POST' Options STAGES = 'VER', 'PREC','PREI', 'PRES', 'LOAD', 'FWII', 'FWIS', 'UNLOAD', 'LWII', 'LWIS', 'PSTC', 'PSTI', 'PSTS', 'QA', 'POST'
//----------------------------------------------------------------------------- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SERVICES // SERVICES
//----------------------------------------------------------------------------- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
@ -152,39 +154,38 @@ End Service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service GetStagesWithSupplements(LotType=LOTTYPES, LotID) Service GetStagesWithSupplements(LotType=LOTTYPES, LotID)
If LotType NE '' and LotID NE '' then StageList = ''
Response = False$
Statement = 'SELECT SUPPLEMENTS WITH LOT_TYPE EQ ' :Quote(LotType): ' AND WITH LOT_ID EQ ' :Quote(LotID) If ( (LotType NE '') and (LotID NE '') ) then
ClearSelect KeyList = ''
Rlist(Statement, 5, '', '', '') Query = ''
If @RecCount NE 0 and @List_Active EQ 3 then Query<1> = 'LOT_TYPE' : @VM : LotType
StageList = '' Query<2> = 'LOT_ID' : @VM : LotID : @FM
Cursor = '' Flag = ''
Done = 0 Open 'DICT.SUPPLEMENTS' to hDict then
Open 'SUPPLEMENTS' To FileVar then Btree.Extract(Query, 'SUPPLEMENTS', hDict, KeyList, 'E', Flag)
Loop If (Flag EQ 0) then
ReadNext Key Using Cursor Else Done = True$ If KeyList NE '' then
Until Done do Open 'SUPPLEMENTS' to hTable then
Read SuppRec from FileVar, Key then For each Key in KeyList using @VM setting vPos
StageList<-1> = SuppRec<SUPPLEMENTS_STAGE$> Read SuppRec from hTable, Key then StageList<-1> = SuppRec<SUPPLEMENTS_STAGE$>
end Next Key
Repeat end else
End Error_Services('Add', 'Error in ':Service:' service. Error opening SUPPLEMENTS table.')
If StageList NE '' then end
Response = StageList end
end else end else
Response = False$ Error_Services('Add', 'Error in ':Service:' service. Error calling Btree.Extract')
end end
end else end else
Set_Status(0) Error_Services('Add', 'Error in ':Service:' service. Error opening SUPPLEMENTS dictionary.')
Response = FALSE$ end
end
end else end else
Response = FALSE$
Error_Services('Add', 'LotType or LotID was missing in the ' : Service : ' service.') Error_Services('Add', 'LotType or LotID was missing in the ' : Service : ' service.')
end end
If StageList NE '' then Response = StageList
end service end service
@ -198,20 +199,36 @@ end service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service GetLotsWithSupplements(LotType) Service GetLotsWithSupplements(LotType)
ClearSelect KeyList = ''
Statement = 'LIST SUPPLEMENTS WITH LOT_TYPE EQ ' :Quote(LotType): ' BY LOT_ID LOT_ID' LotList = ''
Lots = Select_Into(Statement, 'EDT') Response = False$
If Lots NE '' then If (LotType NE '') then
FlipLots = SRP_Array('Rotate',Lots) KeyList = ''
Lots = FlipLots<2> Query = 'LOT_TYPE' : @VM : LotType : @FM
Response = SRP_Array('Clean', Lots, "TrimAndMakeUnique", @VM) Flag = ''
Open 'DICT.SUPPLEMENTS' to hDict then
Btree.Extract(Query, 'SUPPLEMENTS', hDict, KeyList, 'E', Flag)
If (Flag EQ 0) then
If KeyList NE '' then
LotList = Xlate('SUPPLEMENTS', KeyList, 'LOT_ID', 'X')
LotList = SRP_Array('Clean', LotList, 'TrimAndMakeUnique', @VM)
LotList = SRP_Array("SortSimpleList", LotList, 'AscendingNumbers', @VM)
end
end else
Error_Services('Add', 'Error in ':Service:' service. Error calling Btree.Extract')
end
end else
Error_Services('Add', 'Error in ':Service:' service. Error opening SUPPLEMENTS dictionary.')
end
end else end else
Response = FALSE$ Error_Services('Add', 'LotType or LotID was missing in the ' : Service : ' service.')
Set_Status(0)
end end
If LotList NE '' then Response = LotList
end service end service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
// GetSupplementsForLot // GetSupplementsForLot
// //
@ -224,58 +241,52 @@ end service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service GetSupplementsForLot(LotType=LOTTYPES, LotID, Stage=STAGES) Service GetSupplementsForLot(LotType=LOTTYPES, LotID, Stage=STAGES)
If LotType NE '' and LotID NE '' then Response = False$
If Stage EQ '' then If ( (LotType NE '') and (LotID NE '') ) then
Statement = 'SELECT SUPPLEMENTS WITH LOT_TYPE EQ ' :Quote(LotType): ' AND WITH LOT_ID EQ ' :Quote(LotID) If (Stage EQ '') then
ClearSelect KeyList = ''
Rlist(Statement, 5, '', '', '') Query = ''
If @RecCount NE 0 and @List_Active EQ 3 then Query<1> = 'LOT_TYPE' : @VM : LotType
SupplementList = '' Query<2> = 'LOT_ID' : @VM : LotID : @FM
Stages = Supplement_Services('GetStagesForLot', LotType, LotID) Flag = ''
StageCount = Dcount(Stages<1>, @VM) Open 'DICT.SUPPLEMENTS' to hDict then
For I = 1 to StageCount Btree.Extract(Query, 'SUPPLEMENTS', hDict, KeyList, 'E', Flag)
SupplementStage = Supplement_Services('GetSupplementsForLot', LotType, LotID, Stages<1,I>) If (Flag EQ 0) then
If SupplementStage NE False$ then SupplementList<-1> = SupplementStage If (KeyList NE '') then
Next I SupplementList = ''
If SupplementList NE '' then Stages = Supplement_Services('GetStagesForLot', LotType, LotID)
Response = SupplementList StageCount = Dcount(Stages<1>, @VM)
end else For I = 1 to StageCount
Response = False$ SupplementStage = Supplement_Services('GetSupplementsForLot', LotType, LotID, Stages<1,I>)
end If SupplementStage NE False$ then SupplementList<-1> = SupplementStage
end else Next I
Set_Status(0) If SupplementList NE '' then Response = SupplementList
Response = FALSE$ end
end end else
Error_Services('Add', 'Error in ':Service:' service. Error calling Btree.Extract')
end
end else
Error_Services('Add', 'Error in ':Service:' service. Error opening SUPPLEMENTS dictionary.')
end
end else end else
StageSupplementList = '' StageSupplementList = ''
Statement = 'SELECT SUPPLEMENTS WITH LOT_TYPE EQ ' :Quote(LotType): ' AND WITH LOT_ID EQ ' :Quote(LotID) Query = ''
Statement2 = 'SELECT SUPPLEMENTS WITH STAGE EQ ' :Quote(Stage) Query<1> = 'LOT_TYPE' : @VM : LotType
ClearSelect Query<2> = 'LOT_ID' : @VM : LotID
Rlist(Statement, 5, '', '', '') Query<3> = 'STAGE' : @VM : Stage : @FM
Rlist(Statement2, 5, '', '', '') Flag = ''
Open 'DICT.SUPPLEMENTS' to hDict then
If @RecCount NE 0 and @List_Active EQ 3 then Btree.Extract(Query, 'SUPPLEMENTS', hDict, StageSupplementList, 'E', Flag)
Cursor = '' If (Flag EQ 0) then
Done = 0 If StageSupplementList NE '' then Response = StageSupplementList
Open 'SUPPLEMENTS' To FileVar then end else
Loop Error_Services('Add', 'Error in ':Service:' service. Error calling Btree.Extract')
ReadNext Key Using Cursor Else Done = True$ end
Until Done
StageSupplementList<-1> = Key
Repeat
End
If StageSupplementList NE '' then
Response = StageSupplementList
end else
Response = False$
end
end else end else
Set_Status(0) Error_Services('Add', 'Error in ':Service:' service. Error opening SUPPLEMENTS dictionary.')
Response = FALSE$
end end
end end
end else end else
Response = FALSE$
Error_Services('Add', 'LotType or LotID was missing in the ' : Service : ' service.') Error_Services('Add', 'LotType or LotID was missing in the ' : Service : ' service.')
end end
@ -294,32 +305,31 @@ end service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service UpdateSupplementText(SupplID, NewText, EntryUser) Service UpdateSupplementText(SupplID, NewText, EntryUser)
If SupplID NE '' And NewText NE '' then Response = False$
If ( (SupplID NE '') and (NewText NE '') ) then
OldRec = Xlate('SUPPLEMENTS', SupplID, '', 'X', '') OldRec = Xlate('SUPPLEMENTS', SupplID, '', 'X', '')
If OldRec NE '' then If OldRec NE '' then
NewRec = OldRec NewRec = OldRec
NewRec<SUPPLEMENTS_SUPPL_TEXT$> = NewText NewRec<SUPPLEMENTS_SUPPL_TEXT$> = NewText
NewRec<SUPPLEMENTS_ENTRY_USER$> = EntryUser NewRec<SUPPLEMENTS_ENTRY_USER$> = EntryUser
NewRec<SUPPLEMENTS_ENTRY_DATETIME$> = Datetime() NewRec<SUPPLEMENTS_ENTRY_DATETIME$> = Datetime()
Database_Services('WriteDataRow', 'SUPPLEMENTS', SupplID, NewRec, True$, False$, False$) Database_Services('WriteDataRow', 'SUPPLEMENTS', SupplID, NewRec, True$, False$, False$)
If Error_Services('NoError') then If Error_Services('NoError') then
Response = SupplID Response = SupplID
Supplement_Services('LogSupplementChange', OldRec, 'Edited', EntryUser) Supplement_Services('LogSupplementChange', OldRec, 'Edited', EntryUser)
end else end else
Response = FALSE$
Error_Services('Add', 'Error editing Supplement record.') Error_Services('Add', 'Error editing Supplement record.')
end end
end else end else
Response = FALSE$
Error_Services('Add', 'Record does not exist.') Error_Services('Add', 'Record does not exist.')
end end
end else end else
Response = FALSE$
Error_Services('Add', 'SupplID or NewText was missing in the ' : Service : ' service.') Error_Services('Add', 'SupplID or NewText was missing in the ' : Service : ' service.')
end end
end service end service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
// DeleteSupplementByByLotStage // DeleteSupplementByByLotStage
// //
@ -333,7 +343,8 @@ end service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service DeleteSupplementByLotStage(EntryUser, LotType=LOTTYPES, LotID, Stage=STAGES) Service DeleteSupplementByLotStage(EntryUser, LotType=LOTTYPES, LotID, Stage=STAGES)
If LotType NE '' and LotID NE '' and Stage NE '' and EntryUser NE '' then Response = False$
If ( (LotType NE '') and (LotID NE '') and (Stage NE '') and (EntryUser NE '') ) then
ExistingSupps = Supplement_Services('GetSupplementsForLot', LotType, LotID, Stage) ExistingSupps = Supplement_Services('GetSupplementsForLot', LotType, LotID, Stage)
If ExistingSupps NE '' then If ExistingSupps NE '' then
For Each SupplID in ExistingSupps using @VM For Each SupplID in ExistingSupps using @VM
@ -343,16 +354,13 @@ Service DeleteSupplementByLotStage(EntryUser, LotType=LOTTYPES, LotID, Stage=STA
Supplement_Services('LogSupplementChange', SupplRec, 'Deleted', EntryUser) Supplement_Services('LogSupplementChange', SupplRec, 'Deleted', EntryUser)
Response = TRUE$ Response = TRUE$
end else end else
Response = FALSE$
Error_Services('Add', 'Error deleting Supplement record.') Error_Services('Add', 'Error deleting Supplement record.')
end end
Next SupplID Next SupplID
end else end else
Response = FALSE$
Error_Services('Add', 'Record does not exist.') Error_Services('Add', 'Record does not exist.')
end end
end else end else
Response = FALSE$
Error_Services('Add', 'SupplID was missing in the ' : Service : ' service.') Error_Services('Add', 'SupplID was missing in the ' : Service : ' service.')
end end
@ -370,23 +378,20 @@ end service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service DeleteSupplementByID(SupplID, EntryUser) Service DeleteSupplementByID(SupplID, EntryUser)
Response = False$
If SupplID NE '' then If SupplID NE '' then
TestRec = Xlate('SUPPLEMENTS', SupplID, '', 'X', '') If RowExists('SUPPLEMENTS', SupplID) then
If TestRec NE '' then
Database_Services('DeleteDataRow', 'SUPPLEMENTS', SupplID, True$, False$) Database_Services('DeleteDataRow', 'SUPPLEMENTS', SupplID, True$, False$)
If Error_Services('NoError') then If Error_Services('NoError') then
Supplement_Services('LogSupplementChange', TestRec, 'Deleted', EntryUser) Supplement_Services('LogSupplementChange', TestRec, 'Deleted', EntryUser)
Response = TRUE$ Response = TRUE$
end else end else
Response = FALSE$
Error_Services('Add', 'Error deleting Supplement record.') Error_Services('Add', 'Error deleting Supplement record.')
end end
end else end else
Response = FALSE$
Error_Services('Add', 'Record does not exist.') Error_Services('Add', 'Record does not exist.')
end end
end else end else
Response = FALSE$
Error_Services('Add', 'SupplID was missing in the ' : Service : ' service.') Error_Services('Add', 'SupplID was missing in the ' : Service : ' service.')
end end
@ -404,7 +409,7 @@ end service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service GetStagesForLot(LotType=LOTTYPES, LotID) Service GetStagesForLot(LotType=LOTTYPES, LotID)
If LotType NE '' AND LotID NE '' then If ( (LotType NE '') and (LotID NE '') ) then
Stages = '' Stages = ''
Begin Case Begin Case
Case LotType EQ 'WO_MAT' Case LotType EQ 'WO_MAT'
@ -434,7 +439,7 @@ end service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service TranslateStages(ValidStages) Service TranslateStages(ValidStages)
If ValidStages NE '' And ValidStages NE False$ And Error_Services('NoError') then If ( (ValidStages NE '') and (ValidStages NE False$) and ( Error_Services('NoError') ) ) then
ValidStageArray = '' ValidStageArray = ''
ValidStageArray<1> = ValidStages ValidStageArray<1> = ValidStages
AllStages = XLATE('SYSREPOSPOPUPS','LSL2**SIG_PROF_KEYS',8,'X') AllStages = XLATE('SYSREPOSPOPUPS','LSL2**SIG_PROF_KEYS',8,'X')
@ -468,7 +473,7 @@ end service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service AcknowledgeSupplement(SupplID, EntryUser) Service AcknowledgeSupplement(SupplID, EntryUser)
If SupplID NE '' And EntryUser NE '' then If ( (SupplID NE '') and (EntryUser NE '') ) then
OldRec = Xlate('SUPPLEMENTS', SupplID, '', 'X', '') OldRec = Xlate('SUPPLEMENTS', SupplID, '', 'X', '')
If OldRec NE '' then If OldRec NE '' then
NewRec = OldRec NewRec = OldRec
@ -507,37 +512,40 @@ end service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service UnacknowledgedSupplementCheck(LotType=LOTTYPES, LotID, Stage=STAGES) Service UnacknowledgedSupplementCheck(LotType=LOTTYPES, LotID, Stage=STAGES)
If LotType NE '' and LotID NE '' and Stage NE '' then UnackList = ''
Response = '' Response = False$
Statement = 'SELECT SUPPLEMENTS WITH LOT_TYPE EQ ' :Quote(LotType): ' AND WITH LOT_ID EQ ' :Quote(LotID) If ( (LotType NE '') and (LotID NE '') and (Stage NE '') ) then
Statement2 = 'SELECT SUPPLEMENTS WITH STAGE EQ ' :Quote(Stage) KeyList = ''
ClearSelect Query = ''
Rlist(Statement, 5, '', '', '') Query<1> = 'LOT_TYPE' : @VM : LotType
Rlist(Statement2, 5, '', '', '') Query<2> = 'LOT_ID' : @VM : LotID
If @RecCount NE 0 and @List_Active EQ 3 then Query<3> = 'STAGE' : @VM : Stage : @FM
Unacknowledged = False$ Flag = ''
Cursor = '' Open 'DICT.SUPPLEMENTS' to hDict then
Done = 0 Btree.Extract(Query, 'SUPPLEMENTS', hDict, KeyList, 'E', Flag)
Open 'SUPPLEMENTS' To FileVar then If (Flag EQ 0) then
Loop If KeyList NE '' then
ReadNext Key Using Cursor Else Done = True$ Open 'SUPPLEMENTS' to hTable then
Until Done For each Key in KeyList using @VM setting vPos
AckField = Xlate('SUPPLEMENTS', Key, 'SUPPL_ACK', 'X', '') AckField = Xlate('SUPPLEMENTS', Key, 'SUPPL_ACK', 'X', '')
If AckField NE True$ then Unacknowledged = True$ If AckField NE True$ then UnackList<-1> = Key
If Unacknowledged EQ True$ then Response<-1> = Key Next Key
Repeat end else
If Response EQ '' then Response = FALSE$ Error_Services('Add', 'Error in ':Service:' service. Error opening SUPPLEMENTS table.')
End end
end
end else end else
Response = FALSE$ Error_Services('Add', 'Error in ':Service:' service. Error calling Btree.Extract')
Set_Status(0) end
end end else
Error_Services('Add', 'Error in ':Service:' service. Error opening SUPPLEMENTS dictionary.')
end
end else end else
Response = FALSE$
Error_Services('Add', 'LotType, LotID, or Stage was missing in the ' : Service : ' service.') Error_Services('Add', 'LotType, LotID, or Stage was missing in the ' : Service : ' service.')
end end
If UnackList NE '' then Response = UnackList
end service end service
@ -553,7 +561,7 @@ end service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service LogSupplementChange(SupplementRec, EditEvent, EntryUser) Service LogSupplementChange(SupplementRec, EditEvent, EntryUser)
If SupplementRec NE '' and EditEvent NE '' and EntryUser NE '' then If ( (SupplementRec NE '') and (EditEvent NE '') and (EntryUser NE '') ) then
SupplementText = SupplementRec<SUPPLEMENTS_SUPPL_TEXT$> SupplementText = SupplementRec<SUPPLEMENTS_SUPPL_TEXT$>
LotType = SupplementRec<SUPPLEMENTS_LOT_TYPE$> LotType = SupplementRec<SUPPLEMENTS_LOT_TYPE$>
LotID = SupplementRec<SUPPLEMENTS_LOT_ID$> LotID = SupplementRec<SUPPLEMENTS_LOT_ID$>
@ -595,7 +603,3 @@ Service FileLogSuccessfulSupp(LogText, EntryUser, EditEvent)
end service end service