Added in Current Step Calculation, Current Step Action Validation, User Permission validation, additional TODO logging, code cleanup
This commit is contained in:
parent
29f0cb1c10
commit
8f4048a68a
@ -4,7 +4,7 @@ Compile function RETURN_TO_FAB_Services(@Service, @Params)
|
|||||||
Declare subroutine Error_Services, Database_Services, Btree.Extract, Logging_Services, SRP_JSON
|
Declare subroutine Error_Services, Database_Services, Btree.Extract, Logging_Services, SRP_JSON
|
||||||
|
|
||||||
Declare function Rti_Createguid, Database_Services, Return_To_Fab_Services, Datetime, Error_Services
|
Declare function Rti_Createguid, Database_Services, Return_To_Fab_Services, Datetime, Error_Services
|
||||||
Declare function Logging_Services, Environment_Services, SRP_JSON
|
Declare function Logging_Services, Environment_Services, SRP_JSON, MemberOf
|
||||||
Declare subroutine obj_notes, SRP_Run_Command
|
Declare subroutine obj_notes, SRP_Run_Command
|
||||||
|
|
||||||
$insert LOGICAL
|
$insert LOGICAL
|
||||||
@ -123,38 +123,10 @@ Service CreateReturnToFabRecord(CassId, UserId)
|
|||||||
end
|
end
|
||||||
End Service
|
End Service
|
||||||
|
|
||||||
Service GetReturnToFabReasonOptions()
|
|
||||||
ErrorMessage = ''
|
|
||||||
RTFReasons = ''
|
|
||||||
RTFReasonKeys = ''
|
|
||||||
|
|
||||||
table = "RETURN_TO_FAB_REASON"
|
|
||||||
Open "DICT ":table To @DICT Else
|
|
||||||
ErrorMessage = 'Error opening RETURN_TO_FAB_REASON dictionary'
|
|
||||||
End
|
|
||||||
If ErrorMessage EQ '' then
|
|
||||||
srch_strng = "ACTIVE":@VM:True$:@FM
|
|
||||||
option = ""
|
|
||||||
flag = ""
|
|
||||||
Btree.Extract(srch_strng, table, @DICT, RTFReasonKeys, option, flag)
|
|
||||||
for each RTFReasonID in RTFReasonKeys using @VM setting rPos
|
|
||||||
RTFReasons<1, rPos> = RTFReasonId
|
|
||||||
ReasonDesc = Database_Services('ReadDataColumn', table, RTFReasonID, RETURN_TO_FAB_REASON_REASON_DESCRIPTION$, True$, 0, False$)
|
|
||||||
RTFReasons<2, rPos> = ReasonDesc
|
|
||||||
Next RTFReasonID
|
|
||||||
end
|
|
||||||
If ErrorMessage EQ '' then
|
|
||||||
Response = RTFReasons
|
|
||||||
end else
|
|
||||||
Error_Services('Add', ErrorMessage)
|
|
||||||
end
|
|
||||||
end service
|
|
||||||
|
|
||||||
Service GetReturnToFabResultOptions()
|
Service GetReturnToFabResultOptions()
|
||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
RTFResultOptions = ''
|
RTFResultOptions = ''
|
||||||
RTFResultOptionKeys = ''
|
RTFResultOptionKeys = ''
|
||||||
|
|
||||||
table = "RETURN_TO_FAB_RESULT_OPTION"
|
table = "RETURN_TO_FAB_RESULT_OPTION"
|
||||||
Open "DICT ":table To @DICT Else
|
Open "DICT ":table To @DICT Else
|
||||||
ErrorMessage = 'Error opening RETURN_TO_FAB_RESULT_OPTION dictionary'
|
ErrorMessage = 'Error opening RETURN_TO_FAB_RESULT_OPTION dictionary'
|
||||||
@ -173,15 +145,17 @@ Service GetReturnToFabResultOptions()
|
|||||||
If ErrorMessage EQ '' then
|
If ErrorMessage EQ '' then
|
||||||
Response = RTFResultOptions
|
Response = RTFResultOptions
|
||||||
end else
|
end else
|
||||||
//Todo Log error message
|
LogData = ''
|
||||||
|
LogData<1> = LoggingDTM;//Defined at entry of subroutine
|
||||||
|
LogData<2> = ''
|
||||||
|
LogData<3> = ''
|
||||||
|
LogData<4> = ''
|
||||||
|
LogData<5> = ErrorMessage
|
||||||
|
Logging_Services('AppendLog', objReturnToFabLog, LogData, @RM, @FM, False$)
|
||||||
Error_Services('Add', ErrorMessage)
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
end service
|
end service
|
||||||
|
|
||||||
Service GetReturnToFabRecordById(RTFId)
|
|
||||||
|
|
||||||
end service
|
|
||||||
|
|
||||||
Service ConvertReturnToFabRecordToJSON(RTFId)
|
Service ConvertReturnToFabRecordToJSON(RTFId)
|
||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
JsonString = ''
|
JsonString = ''
|
||||||
@ -212,6 +186,8 @@ Service ConvertReturnToFabRecordToJSON(RTFId)
|
|||||||
SRP_JSON(objRTF, 'SetValue', 'Completed', RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED$>, 'Boolean')
|
SRP_JSON(objRTF, 'SetValue', 'Completed', RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED$>, 'Boolean')
|
||||||
SRP_JSON(objRTF, 'SetValue', 'CompletedDtm', OConv(RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED_DTM$>,'DT'))
|
SRP_JSON(objRTF, 'SetValue', 'CompletedDtm', OConv(RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED_DTM$>,'DT'))
|
||||||
SRP_JSON(objRTF, 'SetValue', 'Reason', RTFRecord<RETURN_TO_FAB_LOTS_REASON$>)
|
SRP_JSON(objRTF, 'SetValue', 'Reason', RTFRecord<RETURN_TO_FAB_LOTS_REASON$>)
|
||||||
|
CurrStepId = Return_To_Fab_Services('GetRTFCurrStep', RTFId)
|
||||||
|
SRP_Json(objRTF, 'SetValue', 'CurrStepId', CurrStepId, 'Number')
|
||||||
Notes = RTFRecord<RETURN_TO_FAB_LOTS_NOTES$>
|
Notes = RTFRecord<RETURN_TO_FAB_LOTS_NOTES$>
|
||||||
NotesUser = RTFRecord<RETURN_TO_FAB_LOTS_NOTES_USER$>
|
NotesUser = RTFRecord<RETURN_TO_FAB_LOTS_NOTES_USER$>
|
||||||
If Notes NE '' then
|
If Notes NE '' then
|
||||||
@ -248,6 +224,16 @@ Service ConvertReturnToFabRecordToJSON(RTFId)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error Converting RTF record to JSON. RTFId not found in database.'
|
ErrorMessage = 'Error Converting RTF record to JSON. RTFId not found in database.'
|
||||||
end
|
end
|
||||||
|
If ErrorMessage NE '' then
|
||||||
|
LogData = ''
|
||||||
|
LogData<1> = LoggingDTM;//Defined at entry of subroutine
|
||||||
|
LogData<2> = ''
|
||||||
|
LogData<3> = ''
|
||||||
|
LogData<4> = ''
|
||||||
|
LogData<5> = ErrorMessage
|
||||||
|
Logging_Services('AppendLog', objReturnToFabLog, LogData, @RM, @FM, False$)
|
||||||
|
Error_Services('Add', ErrorMessage)
|
||||||
|
end
|
||||||
Response = JsonString
|
Response = JsonString
|
||||||
end service
|
end service
|
||||||
|
|
||||||
@ -282,6 +268,8 @@ Service CreateReturnToFabReportJson(ShowOpenReport)
|
|||||||
SRP_JSON(hRTFJsonSingle, 'SetValue', 'FinalCompleteDtm', OConv(RTFRecord<RETURN_TO_FAB_LOTS_FINAL_COMPLETE_DTM$>, 'DT'))
|
SRP_JSON(hRTFJsonSingle, 'SetValue', 'FinalCompleteDtm', OConv(RTFRecord<RETURN_TO_FAB_LOTS_FINAL_COMPLETE_DTM$>, 'DT'))
|
||||||
SRP_JSON(hRTFJsonSingle, 'SetValue', 'Completed', RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED$>, 'Boolean')
|
SRP_JSON(hRTFJsonSingle, 'SetValue', 'Completed', RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED$>, 'Boolean')
|
||||||
SRP_JSON(hRTFJsonSingle, 'SetValue', 'CompletedDtm', OConv(RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED_DTM$>,'DT'))
|
SRP_JSON(hRTFJsonSingle, 'SetValue', 'CompletedDtm', OConv(RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED_DTM$>,'DT'))
|
||||||
|
CurrStepId = Return_To_Fab_Services('GetRTFCurrStep', RTFId)
|
||||||
|
SRP_Json(hRTFJsonSingle, 'SetValue', 'CurrStepId', CurrStepId, 'Number')
|
||||||
SRP_Json(objReturnToFabReport, 'Add', hRTFJsonSingle)
|
SRP_Json(objReturnToFabReport, 'Add', hRTFJsonSingle)
|
||||||
SRP_Json(hRTFJsonSingle, 'Release')
|
SRP_Json(hRTFJsonSingle, 'Release')
|
||||||
end
|
end
|
||||||
@ -297,6 +285,16 @@ Service CreateReturnToFabReportJson(ShowOpenReport)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error creating root JSON object.'
|
ErrorMessage = 'Error creating root JSON object.'
|
||||||
end
|
end
|
||||||
|
If ErrorMessage NE '' then
|
||||||
|
LogData = ''
|
||||||
|
LogData<1> = LoggingDTM;//Defined at entry of subroutine
|
||||||
|
LogData<2> = ''
|
||||||
|
LogData<3> = ''
|
||||||
|
LogData<4> = ''
|
||||||
|
LogData<5> = ErrorMessage
|
||||||
|
Logging_Services('AppendLog', objReturnToFabLog, LogData, @RM, @FM, False$)
|
||||||
|
Error_Services('Add', ErrorMessage)
|
||||||
|
end
|
||||||
Response = JsonString
|
Response = JsonString
|
||||||
end service
|
end service
|
||||||
|
|
||||||
@ -320,6 +318,13 @@ Service GetReturnToFabRecordIdByCassId(CassId)
|
|||||||
If ErrorMessage EQ '' then
|
If ErrorMessage EQ '' then
|
||||||
Response = RTFRecords
|
Response = RTFRecords
|
||||||
end else
|
end else
|
||||||
|
LogData = ''
|
||||||
|
LogData<1> = LoggingDTM;//Defined at entry of subroutine
|
||||||
|
LogData<2> = CassId
|
||||||
|
LogData<3> = ''
|
||||||
|
LogData<4> = ''
|
||||||
|
LogData<5> = ErrorMessage
|
||||||
|
Logging_Services('AppendLog', objReturnToFabLog, LogData, @RM, @FM, False$)
|
||||||
Error_Services('Add', ErrorMessage)
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
End Service
|
End Service
|
||||||
@ -343,6 +348,13 @@ Service GetAllReturnToFabRecords(ShowOnlyOpen)
|
|||||||
If ErrorMessage EQ '' then
|
If ErrorMessage EQ '' then
|
||||||
Response = RTFRecords
|
Response = RTFRecords
|
||||||
end else
|
end else
|
||||||
|
LogData = ''
|
||||||
|
LogData<1> = LoggingDTM;//Defined at entry of subroutine
|
||||||
|
LogData<2> = ''
|
||||||
|
LogData<3> = ''
|
||||||
|
LogData<4> = ''
|
||||||
|
LogData<5> = ErrorMessage
|
||||||
|
Logging_Services('AppendLog', objReturnToFabLog, LogData, @RM, @FM, False$)
|
||||||
Error_Services('Add', ErrorMessage)
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
end service
|
end service
|
||||||
@ -367,6 +379,13 @@ Service GetOpenReturnToFabRecordIdByCassId(CassId)
|
|||||||
If ErrorMessage EQ '' then
|
If ErrorMessage EQ '' then
|
||||||
Response = OpenRTFRecords
|
Response = OpenRTFRecords
|
||||||
end else
|
end else
|
||||||
|
LogData = ''
|
||||||
|
LogData<1> = LoggingDTM;//Defined at entry of subroutine
|
||||||
|
LogData<2> = ''
|
||||||
|
LogData<3> = ''
|
||||||
|
LogData<4> = ''
|
||||||
|
LogData<5> = ErrorMessage
|
||||||
|
Logging_Services('AppendLog', objReturnToFabLog, LogData, @RM, @FM, False$)
|
||||||
Error_Services('Add', ErrorMessage)
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
End Service
|
End Service
|
||||||
@ -375,6 +394,8 @@ Service SetReasonForReturn(RTFId, UserId, Reason)
|
|||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
If RTFId NE '' then
|
If RTFId NE '' then
|
||||||
If RowExists('RETURN_TO_FAB_LOTS', RTFId) then
|
If RowExists('RETURN_TO_FAB_LOTS', RTFId) then
|
||||||
|
RTFCurrStep = Return_To_Fab_Services('GetRTFCurrStep', RTFId)
|
||||||
|
If RTFCurrStep EQ LE 3 AND RTFCurrStep GE 1 then
|
||||||
RTFRecord = Database_Services('ReadDataRow', 'RETURN_TO_FAB_LOTS', RTFId, True$, 0, False$)
|
RTFRecord = Database_Services('ReadDataRow', 'RETURN_TO_FAB_LOTS', RTFId, True$, 0, False$)
|
||||||
RTFRecordComplete = RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED$>
|
RTFRecordComplete = RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED$>
|
||||||
If RTFRecordComplete NE True$ then
|
If RTFRecordComplete NE True$ then
|
||||||
@ -395,10 +416,12 @@ Service SetReasonForReturn(RTFId, UserId, Reason)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting return to fab reason. User ID was null.'
|
ErrorMessage = 'Error setting return to fab reason. User ID was null.'
|
||||||
end
|
end
|
||||||
|
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting return to fab reason. Return to fab record has already been completed.'
|
ErrorMessage = 'Error setting return to fab reason. Return to fab record has already been completed.'
|
||||||
end
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error setting Return To Fab reason. Form is currently at step ': RTFCurrStep :'.'
|
||||||
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting return to fab reason. Return to fab record did not exists'
|
ErrorMessage = 'Error setting return to fab reason. Return to fab record did not exists'
|
||||||
end
|
end
|
||||||
@ -429,11 +452,14 @@ Service SetBinToBin(RTFId, MHUserId)
|
|||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
If RTFId NE '' then
|
If RTFId NE '' then
|
||||||
If RowExists('RETURN_TO_FAB_LOTS', RTFId) then
|
If RowExists('RETURN_TO_FAB_LOTS', RTFId) then
|
||||||
|
RTFCurrStep = Return_To_Fab_Services('GetRTFCurrStep', RTFId)
|
||||||
|
If RTFCurrStep EQ 3 then
|
||||||
RTFRecord = Database_Services('ReadDataRow', 'RETURN_TO_FAB_LOTS', RTFId, True$, 0, False$)
|
RTFRecord = Database_Services('ReadDataRow', 'RETURN_TO_FAB_LOTS', RTFId, True$, 0, False$)
|
||||||
RTFRecordComplete = RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED$>
|
RTFRecordComplete = RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED$>
|
||||||
If RTFRecordComplete NE True$ then
|
If RTFRecordComplete NE True$ then
|
||||||
If MHUserId NE '' then
|
If MHUserId NE '' then
|
||||||
If RowExists('LSL_USERS', MHUserId) then
|
If RowExists('LSL_USERS', MHUserId) then
|
||||||
|
If MemberOf(MHUserId, 'MATERIAL HANDLER') then
|
||||||
RTFRecord<RETURN_TO_FAB_LOTS_MH_INIT_USER_ID$> = MHUserId
|
RTFRecord<RETURN_TO_FAB_LOTS_MH_INIT_USER_ID$> = MHUserId
|
||||||
RTFRecord<RETURN_TO_FAB_LOTS_MH_INIT_DTM$> = Datetime()
|
RTFRecord<RETURN_TO_FAB_LOTS_MH_INIT_DTM$> = Datetime()
|
||||||
Database_Services('WriteDataRow', 'RETURN_TO_FAB_LOTS', RTFId, RTFRecord, True$, False$, False$)
|
Database_Services('WriteDataRow', 'RETURN_TO_FAB_LOTS', RTFId, RTFRecord, True$, False$, False$)
|
||||||
@ -445,7 +471,6 @@ Service SetBinToBin(RTFId, MHUserId)
|
|||||||
Message := 'Initial Bin to Bin has been marked as completed.' : CRLF$
|
Message := 'Initial Bin to Bin has been marked as completed.' : CRLF$
|
||||||
Message := 'Link to Return To Fab form: https://goto.infineon.com/oiwizard/ReturnToFab'
|
Message := 'Link to Return To Fab form: https://goto.infineon.com/oiwizard/ReturnToFab'
|
||||||
Recipients = XLATE('NOTIFICATION','SHIPPING',NOTIFICATION_USER_ID$,'X')
|
Recipients = XLATE('NOTIFICATION','SHIPPING',NOTIFICATION_USER_ID$,'X')
|
||||||
|
|
||||||
Recipients<1, -1> = RTFOrigUser
|
Recipients<1, -1> = RTFOrigUser
|
||||||
SentFrom = 'OI_ADMIN'
|
SentFrom = 'OI_ADMIN'
|
||||||
Subject = 'Return To Fab Form Updated'
|
Subject = 'Return To Fab Form Updated'
|
||||||
@ -457,16 +482,21 @@ Service SetBinToBin(RTFId, MHUserId)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = Error_Services('GetMessage')
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
end
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. User does not have permissions to perform this function. User must be apart of OI Security Group "MATERIAL HANDLER"'
|
||||||
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. Material Handler User ID was not found in OpenInsight.'
|
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. Material Handler User ID was not found in OpenInsight.'
|
||||||
end
|
end
|
||||||
|
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. Material Handler User ID was null.'
|
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. Material Handler User ID was null.'
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. Return to fab record has already been completed.'
|
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. Return to fab record has already been completed.'
|
||||||
end
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. Form is currently at step ': RTFCurrStep :'.'
|
||||||
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. Return to fab record did not exists'
|
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. Return to fab record did not exists'
|
||||||
end
|
end
|
||||||
@ -527,7 +557,6 @@ Service SetRTFCompleted(RTFId, CompleteUserId)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting Return To Fab form as complete. User ID was not found in OpenInsight.'
|
ErrorMessage = 'Error setting Return To Fab form as complete. User ID was not found in OpenInsight.'
|
||||||
end
|
end
|
||||||
|
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting Return To Fab form as complete. User ID was null.'
|
ErrorMessage = 'Error setting Return To Fab form as complete. User ID was null.'
|
||||||
end
|
end
|
||||||
@ -564,6 +593,8 @@ Service SetEvalInfo(RTFId, EvalUserId, ResultId)
|
|||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
If RTFId NE '' then
|
If RTFId NE '' then
|
||||||
if RowExists('RETURN_TO_FAB_LOTS', RTFId) then
|
if RowExists('RETURN_TO_FAB_LOTS', RTFId) then
|
||||||
|
RTFCurrStep = Return_To_Fab_Services('GetRTFCurrStep', RTFId)
|
||||||
|
If RTFCurrStep EQ 4 AND RTFCurrStep LE 5 then
|
||||||
If EvalUserId NE '' then
|
If EvalUserId NE '' then
|
||||||
if RowExists('LSL_USERS', EvalUserId) then
|
if RowExists('LSL_USERS', EvalUserId) then
|
||||||
If ResultId NE '' then
|
If ResultId NE '' then
|
||||||
@ -612,6 +643,9 @@ Service SetEvalInfo(RTFId, EvalUserId, ResultId)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting Eval. info. Evaluation user id was null.'
|
ErrorMessage = 'Error setting Eval. info. Evaluation user id was null.'
|
||||||
end
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error setting Eval. info. Form is currently at step ': RTFCurrStep :'.'
|
||||||
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting Eval. info. Return to fab record was not found.'
|
ErrorMessage = 'Error setting Eval. info. Return to fab record was not found.'
|
||||||
end
|
end
|
||||||
@ -642,34 +676,41 @@ Service SetFinalBinToBin(RTFId, MHUserId)
|
|||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
If RTFId NE '' then
|
If RTFId NE '' then
|
||||||
If RowExists('RETURN_TO_FAB_LOTS', RTFId) then
|
If RowExists('RETURN_TO_FAB_LOTS', RTFId) then
|
||||||
|
RTFCurrStep = Return_To_Fab_Services('GetRTFCurrStep', RTFId)
|
||||||
|
If RTFCurrStep EQ 5 then
|
||||||
RTFRecord = Database_Services('ReadDataRow', 'RETURN_TO_FAB_LOTS', RTFId, True$, 0, False$)
|
RTFRecord = Database_Services('ReadDataRow', 'RETURN_TO_FAB_LOTS', RTFId, True$, 0, False$)
|
||||||
RTFRecordComplete = RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED$>
|
RTFRecordComplete = RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED$>
|
||||||
If RTFRecordComplete NE True$ then
|
If RTFRecordComplete NE True$ then
|
||||||
If MHUserId NE '' then
|
If MHUserId NE '' then
|
||||||
If RowExists('LSL_USERS', MHUserId) then
|
If RowExists('LSL_USERS', MHUserId) then
|
||||||
|
If MemberOf(MHUserId, 'MATERIAL HANDLER') then
|
||||||
RTFRecord<RETURN_TO_FAB_LOTS_FINAL_COMPLETE_USER_ID$> = MHUserId
|
RTFRecord<RETURN_TO_FAB_LOTS_FINAL_COMPLETE_USER_ID$> = MHUserId
|
||||||
RTFRecord<RETURN_TO_FAB_LOTS_FINAL_COMPLETE_DTM$> = Datetime()
|
RTFRecord<RETURN_TO_FAB_LOTS_FINAL_COMPLETE_DTM$> = Datetime()
|
||||||
* RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED$> = True$
|
|
||||||
* RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED_DTM$> = Datetime()
|
|
||||||
Database_Services('WriteDataRow', 'RETURN_TO_FAB_LOTS', RTFId, RTFRecord, True$, False$, False$)
|
Database_Services('WriteDataRow', 'RETURN_TO_FAB_LOTS', RTFId, RTFRecord, True$, False$, False$)
|
||||||
If Error_Services('HasError') then
|
If Error_Services('HasError') then
|
||||||
ErrorMessage = Error_Services('GetMessage')
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. Material Handler User ID was not found in OpenInsight.'
|
ErrorMessage = 'Error setting Final SAP Bin-to-Bin. User does not have permissions to perform this function. User must be apart of OI Security Group "MATERIAL HANDLER"'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error setting Final SAP Bin-to-Bin. Material Handler User ID was not found in OpenInsight.'
|
||||||
end
|
end
|
||||||
|
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. Material Handler User ID was null.'
|
ErrorMessage = 'Error setting Final SAP Bin-to-Bin. Material Handler User ID was null.'
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. Return to fab record has already been completed.'
|
ErrorMessage = 'Error setting Final SAP Bin-to-Bin. Return to fab record has already been completed.'
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. Return to fab record did not exists'
|
ErrorMessage = 'Error setting Final SAP Bin-to-Bin. Form is currently at step ': RTFCurrStep :'.'
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. Return to fab record id was null'
|
ErrorMessage = 'Error setting Final SAP Bin-to-Bin. Return to fab record did not exists'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error setting Final SAP Bin-to-Bin. Return to fab record id was null'
|
||||||
end
|
end
|
||||||
If ErrorMessage EQ '' then
|
If ErrorMessage EQ '' then
|
||||||
LogData = ''
|
LogData = ''
|
||||||
@ -709,7 +750,6 @@ Service AddMiscNote(RTFId, Note, UserId)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error adding note to RTF Record. User ID was not found in OpenInsight.'
|
ErrorMessage = 'Error adding note to RTF Record. User ID was not found in OpenInsight.'
|
||||||
end
|
end
|
||||||
|
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error adding note to RTF Record. User ID was null.'
|
ErrorMessage = 'Error adding note to RTF Record. User ID was null.'
|
||||||
end
|
end
|
||||||
@ -742,6 +782,28 @@ Service AddMiscNote(RTFId, Note, UserId)
|
|||||||
end
|
end
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
Service GetRTFCurrStep(RTFId)
|
||||||
|
CurrStep = 0
|
||||||
|
RTFRecord = Database_Services('ReadDataRow', 'RETURN_TO_FAB_LOTS', RTFId, True$, 0, False$)
|
||||||
|
If RTFRecord NE '' then
|
||||||
|
CurrStep = 1
|
||||||
|
If RTFRecord<RETURN_TO_FAB_LOTS_REASON$> NE '' then
|
||||||
|
//Skip 2 because step 2 is an adhoc step(printing a label)
|
||||||
|
CurrStep = 3
|
||||||
|
If RTFRecord<RETURN_TO_FAB_LOTS_MH_INIT_USER_ID$> NE '' then
|
||||||
|
CurrStep = 4
|
||||||
|
If RTFRecord<RETURN_TO_FAB_LOTS_EVAL_RESULT_ID$> NE '' AND RTFRecord<RETURN_TO_FAB_LOTS_EVAL_RESULT_ID$> NE 0 then
|
||||||
|
CurrStep = 5
|
||||||
|
If RTFRecord<RETURN_TO_FAB_LOTS_FINAL_COMPLETE_USER_ID$> NE '' then
|
||||||
|
CurrStep = 6
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Response = CurrStep
|
||||||
|
end service
|
||||||
|
|
||||||
Service OpenOIWizardReturnToFabInBrowser(RTFId)
|
Service OpenOIWizardReturnToFabInBrowser(RTFId)
|
||||||
Command = 'explorer https://goto.infineon.com/oiwizard/returntofab/' : RTFId
|
Command = 'explorer https://goto.infineon.com/oiwizard/returntofab/' : RTFId
|
||||||
SRP_Run_Command(Command)
|
SRP_Run_Command(Command)
|
||||||
@ -750,3 +812,4 @@ end service
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user