pre cutover push
This commit is contained in:
@ -27,6 +27,7 @@ Function NDW_Add_Supplement_Events(CtrlEntId, Event, @PARAMS)
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
05/24/18 djs Created initial commuter module.
|
||||
06/13/24 djm Modify for new stage-specific supplement system.
|
||||
|
||||
***********************************************************************************************************************/
|
||||
|
||||
@ -36,8 +37,12 @@ Function NDW_Add_Supplement_Events(CtrlEntId, Event, @PARAMS)
|
||||
$insert APP_INSERTS
|
||||
$insert EVENT_SETUP
|
||||
$insert MSG_EQUATES
|
||||
$Insert SUPPLEMENTS_EQUATES
|
||||
|
||||
Declare subroutine SRP_Show_Window
|
||||
Declare subroutine SRP_Show_Window, Supplement_Services
|
||||
Declare function SRP_Array, Supplement_Services
|
||||
|
||||
CRLF = \0D0A\
|
||||
|
||||
SubclassInfo = Form_Services('FindSubclassControl')
|
||||
Subclass = SubclassInfo<1>
|
||||
@ -69,12 +74,14 @@ Event WINDOW.CREATE(CreateParam)
|
||||
Result = ''
|
||||
SupplInst = ''
|
||||
GoSub Setup_OLE_Controls
|
||||
|
||||
If CreateParam NE '' then
|
||||
Set_Property(@Window : '.EDL_SUPPL_INST', 'TEXT', CreateParam)
|
||||
Set_Property(@Window : '.PUB_OK', 'ENABLED', True$)
|
||||
Gosub PopulateStages
|
||||
Set_Property(@Window : '.CMB_STAGE', 'LIST', StageList)
|
||||
Set_Property(@Window : '.CMB_STAGE', 'SELPOS', 1)
|
||||
Set_Property(@Window : '.PUB_OK', 'ENABLED', True$)
|
||||
end
|
||||
|
||||
|
||||
Gosub CheckForSupplements
|
||||
SRP_Show_Window(@Window, '', 'C', 'C', 1, '', False$, False$, FormSize)
|
||||
|
||||
end event
|
||||
@ -88,11 +95,15 @@ Event WINDOW.CLOSE(CancelFlag)
|
||||
|
||||
end event
|
||||
|
||||
Event CMB_STAGE.CHANGED(CreateParam)
|
||||
|
||||
Gosub CheckForSupplements
|
||||
|
||||
end event
|
||||
|
||||
Event EDL_SUPPL_INST.CHAR(VirtCode, ScanCode, CtrlKey, ShiftKey, AltKey)
|
||||
|
||||
SupplInst = Get_Property(CtrlEntId, 'TEXT')
|
||||
|
||||
If SupplInst NE '' then
|
||||
Set_Property(@Window : '.PUB_OK', 'ENABLED', True$)
|
||||
end else
|
||||
@ -103,13 +114,14 @@ end event
|
||||
|
||||
|
||||
Event PUB_OK.CLICK()
|
||||
|
||||
|
||||
Result = ''
|
||||
SupplInst = Get_Property(@Window : '.EDL_SUPPL_INST', 'TEXT')
|
||||
StageSel = Get_Property(@Window : '.CMB_STAGE', 'TEXT')
|
||||
StageReturn = Field(StageSel, '-', 2)
|
||||
|
||||
Result<1> = True$
|
||||
Result<2> = SupplInst
|
||||
|
||||
Result<1> = True$
|
||||
Result<2> = StageReturn :': ': SupplInst
|
||||
End_Dialog(@Window, Result)
|
||||
|
||||
end event
|
||||
@ -136,3 +148,72 @@ Setup_OLE_Controls:
|
||||
|
||||
return
|
||||
|
||||
PopulateStages:
|
||||
|
||||
DraftStageList = ''
|
||||
PlainTextStages = ''
|
||||
RDSList = SRP_Array("Rotate", CreateParam)
|
||||
@ReCur1 = RDSList<5>
|
||||
@ReCur2 = RDSList<15>
|
||||
|
||||
For Each RDSKey in @ReCur1 Using @VM
|
||||
RDSStageList = Supplement_Services('GetStagesForLot', 'RDS', RDSKey)
|
||||
RDSStageList2 = RDSStageList<2> :@FM: RDSStageList<1>
|
||||
RDSStageList3 = SRP_Array("Rotate", RDSStageList2)
|
||||
If DraftStageList EQ '' then
|
||||
DraftStageList = RDSStageList3 :@FM
|
||||
end else
|
||||
DraftStageList = SRP_Array("Join", DraftStageList, RDSStageList3, "AND", @FM)
|
||||
end
|
||||
Next RDSKey
|
||||
Swap @VM with ' -' in DraftStageList
|
||||
StageList = SRP_Array('Clean', DraftStageList, "TrimAndMakeUnique", @FM)
|
||||
return
|
||||
|
||||
CheckForSupplements:
|
||||
|
||||
SuppFound = False$
|
||||
SuppText = ''
|
||||
StageSel = Get_Property(@Window : '.CMB_STAGE', 'TEXT')
|
||||
Stage = Field(StageSel, '-', 2)
|
||||
For Each RDSKey in @ReCur1 Using @VM Setting Pos
|
||||
If @Recur2<pos> NE '' then
|
||||
Supps = @Recur2<pos>
|
||||
Swap CRLF with @VM in Supps
|
||||
For Each Supp in Supps Using @VM Setting SuppPos
|
||||
If Field(Supp, ':', 1) EQ Stage then
|
||||
SuppText = Field(Supp, ":", 2)
|
||||
SuppText = TrimF(SuppText)
|
||||
SuppFound = True$
|
||||
end
|
||||
Until SuppFound NE False$
|
||||
Next Supp
|
||||
If SuppText EQ '' then SuppFound = Supplement_Services('GetSupplementsForLot', 'RDS', RDSKey, Stage)
|
||||
end else
|
||||
SuppFound = Supplement_Services('GetSupplementsForLot', 'RDS', RDSKey, Stage)
|
||||
end
|
||||
Until SuppFound NE False$
|
||||
Next RDSKey
|
||||
If SuppFound NE False$ then
|
||||
If SuppText EQ '' then
|
||||
SuppText = Xlate('SUPPLEMENTS', SuppFound, SUPPLEMENTS_SUPPL_TEXT$, 'X', '')
|
||||
end
|
||||
If SuppText NE '' then
|
||||
Set_Property(@Window : '.EDL_SUPPL_INST', 'TEXT', SuppText)
|
||||
Set_Property(@Window : '.PUB_OK', 'ENABLED', True$)
|
||||
end else
|
||||
Set_Property(@Window : '.EDL_SUPPL_INST', 'TEXT', '')
|
||||
Set_Property(@Window : '.PUB_OK', 'ENABLED', False$)
|
||||
end
|
||||
end else
|
||||
Set_Property(@Window : '.EDL_SUPPL_INST', 'TEXT', '')
|
||||
Set_Property(@Window : '.PUB_OK', 'ENABLED', False$)
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user