Add monitoring for COC file generation and

transmission.

Commit to save progress.

Commit to save progress.

Finished ListDirectory service with full 'mls'
command functionality.

Final commit for COC availability checks.

Implement further changes requested by Daniel.
Add notifications to critical statuses and automatic status clearing.

Change Mona resource from dev to prod.
This commit is contained in:
Infineon\Mitchem
2024-11-04 15:49:55 -07:00
parent 8716caf86c
commit 8dce7988c6
8 changed files with 590 additions and 87 deletions

View File

@ -3,6 +3,7 @@ COMPILE FUNCTION obj_Shipment(Method,Parms)
Methods for Shipment (COC) table
02/02/2005 JCH - Initial Coding
11/13/2024 djm - Add MONA monitoring.
Properties:
@ -24,7 +25,7 @@ DECLARE FUNCTION Export_Coa, Export_Cds, Database_Services, Company_Services, RT
DECLARE FUNCTION Export_IR, Export_Tower_Met, obj_Calendar, Error_Services, Environment_Services, RTI_Task_Submit, RTI_Task_Status, SRP_Encode
DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, ErrMsg, obj_WO_Step, obj_WO_Log, obj_RDS, Btree.Extract, Yield, Print_Shipment, Print_Shipment_Dev
DECLARE SUBROUTINE obj_Vision, obj_WM_Out, obj_Post_Log, obj_WO_Mat, obj_Notes, obj_Post_Log, obj_Export, ErrMsg, obj_WO_Mat_Log, Error_Services
DECLARE SUBROUTINE obj_Shipment, Logging_Services, FTP_Services, Database_Services, Error_Services
DECLARE SUBROUTINE obj_Shipment, Logging_Services, FTP_Services, Database_Services, Error_Services, Mona_Services, Shipment_Services
$Insert LOGICAL
@ -121,11 +122,13 @@ SAPCreate:
OPEN 'DICT.WO_LOG' TO DictWO ELSE
ErrMsg("Unable to open DICT.WO_LOG' FOR Btree IN obj_SAP('Create' method")
Shipment_Services('SetMONACritical', 'FILE_GENERATION', "Unable to open DICT.WO_LOG' FOR Btree IN obj_SAP('Create' method")
RETURN
END
OPEN 'DICT.WO_MAT' TO DictWOMat ELSE
ErrMsg("Unable to open DICT.WO_MAT' FOR Btree IN obj_SAP('Create' method")
Shipment_Services('SetMONACritical', 'FILE_GENERATION', "Unable to open DICT.WO_MAT' FOR Btree IN obj_SAP('Create' method")
RETURN
End
@ -161,6 +164,7 @@ SAPCreate:
ErrFields<1,ErrCnt> = 'SAP_DEL_NO'
ErrDescs<1,ErrCnt> = 'Line ':I:' SAP_DEL_NO: ':SAPDeliveryNo:' PROD_ORD_NO: ':ProdOrdNo:' SAP_BATCH_NO: ':SAPBatchNo
ErrValues<1,ErrCnt> = '<null>'
Shipment_Services('SetMONACritical', 'FILE_GENERATION', 'Line ':I:' SAP_DEL_NO: ':SAPDeliveryNo:' PROD_ORD_NO: ':ProdOrdNo:' SAP_BATCH_NO: ':SAPBatchNo)
End
If ProdOrdNo = '' Then
@ -168,6 +172,7 @@ SAPCreate:
ErrFields<1,ErrCnt> = 'PROD_ORD_NO'
ErrDescs<1,ErrCnt> = 'Line ':I:' SAP_DEL_NO: ':SAPDeliveryNo:' PROD_ORD_NO: ':ProdOrdNo:' SAP_BATCH_NO: ':SAPBatchNo
ErrValues<1,ErrCnt> = '<null>'
Shipment_Services('SetMONACritical', 'FILE_GENERATION', 'Line ':I:' SAP_DEL_NO: ':SAPDeliveryNo:' PROD_ORD_NO: ':ProdOrdNo:' SAP_BATCH_NO: ':SAPBatchNo)
End
If Trim(ProdOrdNo) _EQC 'NA' then
@ -176,6 +181,7 @@ SAPCreate:
// the original problem will be resolved. - dmb - 01/22/2018
ProdOrdNo = SAPBatchNo[1, '.'] : '.1'
Error_Services('Add', 'SAP Delivery No #' : SAPDeliveryNo : 'imported with ProdOrderNo having a value of "NA".')
Shipment_Services('SetMONACritical', 'FILE_GENERATION', 'SAP Delivery No #' : SAPDeliveryNo : 'imported with ProdOrderNo having a value of "NA".')
end
If SAPBatchNo = '' Then
@ -183,6 +189,7 @@ SAPCreate:
ErrFields<1,ErrCnt> = 'SAP_BATCH_NO'
ErrDescs<1,ErrCnt> = 'Line ':I:' SAP_DEL_NO: ':SAPDeliveryNo:' PROD_ORD_NO: ':ProdOrdNo:' SAP_BATCH_NO: ':SAPBatchNo
ErrValues<1,ErrCnt> = '<null>'
Shipment_Services('SetMONACritical', 'FILE_GENERATION', 'Line ':I:' SAP_DEL_NO: ':SAPDeliveryNo:' PROD_ORD_NO: ':ProdOrdNo:' SAP_BATCH_NO: ':SAPBatchNo)
END
LOCATE ProdOrdNo IN WOMap<2> USING @VM SETTING WOPos THEN
@ -196,6 +203,7 @@ SAPCreate:
ErrFields<1,ErrCnt> = 'PROD_ORD_NO'
ErrDescs<1,ErrCnt> = "No Work Order found for ProdOrdNo. Line ":I:" SAP_DEL_NO: ":SAPDeliveryNo:" PROD_ORD_NO: ":ProdOrdNo:" SAP_BATCH_NO: ":SAPBatchNo
ErrValues<1,ErrCnt> = ProdOrdNo
Shipment_Services('SetMONACritical', 'FILE_GENERATION', "No Work Order found for ProdOrdNo. Line ":I:" SAP_DEL_NO: ":SAPDeliveryNo:" PROD_ORD_NO: ":ProdOrdNo:" SAP_BATCH_NO: ":SAPBatchNo)
END
IF INDEX(WONo,@VM,1) Then
@ -205,6 +213,7 @@ SAPCreate:
ErrFields<1,ErrCnt> = 'PROD_ORD_NO'
ErrDescs<1,ErrCnt> = "Multiple WO's found ( ":ErrWONos:" ) Line ":I:" SAP_DEL_NO: ":SAPDeliveryNo:" PROD_ORD_NO: ":ProdOrdNo:" SAP_BATCH_NO: ":SAPBatchNo
ErrValues<1,ErrCnt> = ProdOrdNo
Shipment_Services('SetMONACritical', 'FILE_GENERATION', "Multiple WO's found ( ":ErrWONos:" ) Line ":I:" SAP_DEL_NO: ":SAPDeliveryNo:" PROD_ORD_NO: ":ProdOrdNo:" SAP_BATCH_NO: ":SAPBatchNo)
END
WOMap = INSERT(WOMap,1,WOPos,0,WONo)
@ -225,6 +234,7 @@ SAPCreate:
ErrFields<1,ErrCnt> = 'SAP_BATCH_NO'
ErrDescs<1,ErrCnt> = "SAPBatchNo not in WO_MAT Batch Nos for WONo ":WONo:" Line ":I:" SAP_DEL_NO: ":SAPDeliveryNo:" PROD_ORD_NO: ":ProdOrdNo:" SAP_BATCH_NO: ":SAPBatchNo
ErrValues<1,ErrCnt> = SAPBatchNo
Shipment_Services('SetMONACritical', 'FILE_GENERATION', "SAPBatchNo not in WO_MAT Batch Nos for WONo ":WONo:" Line ":I:" SAP_DEL_NO: ":SAPDeliveryNo:" PROD_ORD_NO: ":ProdOrdNo:" SAP_BATCH_NO: ":SAPBatchNo)
END
IF CassNo NE '' THEN
@ -386,8 +396,8 @@ SAPCreate:
obj_Tables('WriteRec',OtParms)
IF Get_Status(errCode) THEN
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : '1. Error = ' : ErrCode, @RM, @FM, '', 'dstieber@srpcs.com,dan.crisp@infineon.com,jonathan.ouellette@infineon.com', LoggingDTM : ' ' : 'WONo = ' : WONo : ', ShipNo = ' : ShipNo : ', Error = ' : ErrCode)
Shipment_Services('SetMONACritical', 'FILE_GENERATION', ErrCode)
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : '1. Error = ' : ErrCode, @RM, @FM, '', 'Daniel.Stieber@infineon.com,jonathan.ouellette@infineon.com', LoggingDTM : ' ' : 'WONo = ' : WONo : ', ShipNo = ' : ShipNo : ', Error = ' : ErrCode)
obj_Tables('UnlockRec',OtParms)
END ELSE
@ -396,8 +406,8 @@ SAPCreate:
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : ' Updated COC Record : ' : ShipNo, @RM, @FM, '')
IF Get_Status(errCode) THEN
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : '1.1 Error = ' : ErrCode, @RM, @FM, '', 'dstieber@srpcs.com,dan.crisp@infineon.com,jonathan.ouellette@infineon.com', LoggingDTM : ' ' : 'WONo = ' : WONo : ', ShipNo = ' : ShipNo : ', Error = ' : ErrCode)
Shipment_Services('SetMONACritical', 'FILE_GENERATION', ErrCode)
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : '1.1 Error = ' : ErrCode, @RM, @FM, '', 'Daniel.Stieber@infineon.com,jonathan.ouellette@infineon.com', LoggingDTM : ' ' : 'WONo = ' : WONo : ', ShipNo = ' : ShipNo : ', Error = ' : ErrCode)
obj_Tables('UnlockRec',OtParms)
END ELSE
@ -414,9 +424,12 @@ SAPCreate:
obj_Tables('WriteRec',sqParms)
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : ' Updated SHIP_EMAIL_QUEUE Record : ' : ShipNo, @RM, @FM, '')
IF Get_Status(errCode) THEN
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : '2. Error = ' : ErrCode, @RM, @FM, '', 'dstieber@srpcs.com,dan.crisp@infineon.com,jonathan.ouellette@infineon.com', LoggingDTM : ' ' : 'WONo = ' : WONo : ', ShipNo = ' : ShipNo : ', Error = ' : ErrCode)
Shipment_Services('SetMONACritical', 'FILE_GENERATION', ErrCode)
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : '2. Error = ' : ErrCode, @RM, @FM, '', 'Daniel.Stieber@infineon.com,jonathan.ouellette@infineon.com', LoggingDTM : ' ' : 'WONo = ' : WONo : ', ShipNo = ' : ShipNo : ', Error = ' : ErrCode)
obj_Tables('UnlockRec',sqParms)
END
END else
Shipment_Services('ClearMONACritical', 'FILE_GENERATION')
end
If AutoDataFlag then
// This customer has the Auto Data flag set. This means the code to produce the data files
@ -441,11 +454,19 @@ SAPCreate:
TaskResponse = ''
Loop
Status = RTI_Task_Status(TaskID, TaskResponse)
If (Status EQ 'COMPLETED') OR (Status EQ 'ERROR') then Done = True$
If (Status EQ 'COMPLETED') OR (Status EQ 'ERROR') then
Done = True$
If Status EQ 'ERROR' then
Shipment_Services('SetMONACritical', 'FILE_GENERATION', 'Error generating file for shipment ' : ShipNo)
end else
Shipment_Services('ClearMONACritical', 'FILE_GENERATION')
end
end
Until Done
Repeat
end else
// Track if task id wasn't created at all.
Shipment_Services('SetMONACritical', 'FILE_GENERATION', 'Error generating file for shipment ' : ShipNo)
end
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : ' Finished PRINT_SHIPMENT_DEV Task. Status : ' : Status, @RM, @FM, '')
@ -462,10 +483,10 @@ SAPCreate:
obj_Tables('WriteOnlyRec',cocParms)
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : ' Updated COC Record : ' : ShipNo, @RM, @FM, '')
end else
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : '3. Error = ' : ErrCode, @RM, @FM, '', 'dstieber@srpcs.com,dan.crisp@infineon.com,jonathan.ouellette@infineon.com', LoggingDTM : ' ' : 'WONo = ' : WONo : ', ShipNo = ' : ShipNo : ', Error = ' : ErrCode)
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : '3. Error = ' : ErrCode, @RM, @FM, '', 'Daniel.Stieber@infineon.com,jonathan.ouellette@infineon.com', LoggingDTM : ' ' : 'WONo = ' : WONo : ', ShipNo = ' : ShipNo : ', Error = ' : ErrCode)
end
end else
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : '4. Error = ' : ErrCode, @RM, @FM, '', 'dstieber@srpcs.com,dan.crisp@infineon.com,jonathan.ouellette@infineon.com', LoggingDTM : ' ' : 'WONo = ' : WONo : ', ShipNo = ' : ShipNo : ', Error = ' : ErrCode)
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : '4. Error = ' : ErrCode, @RM, @FM, '', 'Daniel.Stieber@infineon.com,jonathan.ouellette@infineon.com', LoggingDTM : ' ' : 'WONo = ' : WONo : ', ShipNo = ' : ShipNo : ', Error = ' : ErrCode)
end
end
END
@ -503,9 +524,12 @@ SAPCreate:
obj_Tables('WriteRec',fpParms)
IF Get_Status(errCode) THEN
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : '5. Error = ' : ErrCode, @RM, @FM, '', 'dstieber@srpcs.com,dan.crisp@infineon.com,jonathan.ouellette@infineon.com', LoggingDTM : ' ' : 'WONo = ' : WONo : ', ShipNo = ' : ShipNo : ', Error = ' : ErrCode)
Shipment_Services('SetMONACritical', 'FILE_GENERATION', ErrCode)
Logging_Services('AppendLog', objLog, LoggingDTM : @FM : WONo : @FM: ShipNo : @FM : '5. Error = ' : ErrCode, @RM, @FM, '', 'Daniel.Stieber@infineon.com,jonathan.ouellette@infineon.com', LoggingDTM : ' ' : 'WONo = ' : WONo : ', ShipNo = ' : ShipNo : ', Error = ' : ErrCode)
obj_Tables('UnlockRec',fpParms)
END
END else
Shipment_Services('ClearMONACritical', 'FILE_GENERATION')
end
end
END ;* End of check for FTP_QUEUE flag in the COMPANY (Customer) table.
@ -1671,19 +1695,26 @@ SendTechnical:
FTPColumnWidths = 20 : @FM : 15 : @FM : 10 : @FM : 150
FTPobjLog = Logging_Services('NewLog', FTPLogPath, FTPLogFileName, CRLF$, ' ', FTPHeaders, FTPColumnWidths, False$, False$)
FTPLoggingDTM = FTPLogDate : ' ' : FTPLogTime ; // Logging DTM
IF Not(Assigned(ShipNo)) THEN
ShipNo = Parms[1,@RM]
AutoFlag = Parms[Col2() + 1, @RM]
END
IF ShipNo = '' THEN
ErrorMsg = 'Null parameter "ShipNo" passed to routine. (':Method:')'
ErrorMsg = 'Null parameter "ShipNo" passed to routine. (':Method:')'
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', ErrorMsg)
RETURN
END
OtParms = 'COC':@RM:ShipNo
ShipRec = obj_Tables('ReadOnlyRec',OtParms)
If ShipRec EQ '' then
ErrorMsg = 'Invalid "ShipNo" passed to routine. ShipRec does not exist. (':Method:')'
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', ErrorMsg)
RETURN
end
ShipDt = ShipRec<COC_SHIP_DT$>
If ShipDt NE '' then
SendDate = OCONV(ShipDt, 'D4-')
@ -1742,16 +1773,21 @@ SendTechnical:
IF FTPHost EQ '' then
LoggingErrMsg = 'Missing FTP Host in COMPANY record for ' : CustNo : '. Shipment #': ShipNo
Logging_Services('AppendLog', FTPobjLog, FTPLoggingDTM : @FM : CustNo : @FM: ShipNo : @FM : LoggingErrMsg, @RM, @FM, '')
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', LoggingErrMsg)
end
IF RemoteDirectory EQ '' then
LoggingErrMsg = 'Missing FTP Directory in COMPANY record for ' : CustNo : '. Shipment #': ShipNo
Logging_Services('AppendLog', FTPobjLog, FTPLoggingDTM : @FM : CustNo : @FM: ShipNo : @FM : LoggingErrMsg, @RM, @FM, '')
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', LoggingErrMsg)
end
IF RTI_OS_Directory( "EXISTS", CustPath ) NE True$ AND LoggingErrMsg EQ '' then
successful = RTI_OS_Directory("CREATE", CustPath)
If successful NE True$ then
LoggingErrMsg = 'Unable to create shipment directory for ' : CustNo : '. Shipment #': ShipNo
Logging_Services('AppendLog', FTPobjLog, FTPLoggingDTM : @FM : CustNo : @FM: ShipNo : @FM : LoggingErrMsg, @RM, @FM, '')
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', LoggingErrMsg)
end else
Shipment_Services('ClearMONACritical', 'FILE_TRANSMISSION')
end
end
IF LoggingErrMsg EQ '' then
@ -1779,14 +1815,19 @@ SendTechnical:
IF SRP_Path("Exists", LocalFile) then
FTP_Services('PostRequest', 'put', FTPHost, Server, LocalFile, '', Username, Password, CustPath, RemoteDirectory, RemoteFile, ScriptPath, DeleteScript, SSH, '', 3, False$)
If Error_Services('HasError') then
ErrorMsg = Error_Services('GetMessage')
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', ErrorMsg)
end
end else
LoggingErrMsg = 'Unable to send CSV COA via FTP for customer ' : CustNo : '. Shipment #': ShipNo :'. File was not found in the expected location'
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', LoggingErrMsg)
Logging_Services('AppendLog', FTPobjLog, FTPLoggingDTM : @FM : CustNo : @FM: ShipNo : @FM : LoggingErrMsg, @RM, @FM, '')
SentFlag = 0
Recipients = XLATE('NOTIFICATION','COC_DELIVERY',NOTIFICATION_USER_ID$,'X')
SendFrom = 'System'
Subject = 'COC Generation Failue.'
Subject = 'COC Generation Failure.'
AttachWindow = ''
AttachKey = ''
SendToGroup = ''
@ -1797,29 +1838,35 @@ SendTechnical:
If ReactType Eq 'EPP' then
IF SRP_Path("Exists", LocalFileCDS) then
FTP_Services('PostRequest', 'put', FTPHost, Server, LocalFileCDS, '', Username, Password, LocalDirectory, RemoteDirectory, RemoteFile, ScriptPath, DeleteScript, SSH, '', 3, False$)
If Error_Services('HasError') then
ErrorMsg = Error_Services('GetMessage')
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', ErrorMsg)
end
end else
LoggingErrMsg = 'Unable to send CSV COA CDS via FTP for customer ' : CustNo : '. Shipment #': ShipNo :'. File was not found in the expected location'
Logging_Services('AppendLog', FTPobjLog, FTPLoggingDTM : @FM : CustNo : @FM: ShipNo : @FM : LoggingErrMsg, @RM, @FM, '')
SentFlag = 0
Recipients = XLATE('NOTIFICATION','COC_DELIVERY',NOTIFICATION_USER_ID$,'X')
SendFrom = 'System'
Subject = 'COC Generation Failue.'
AttachWindow = ''
AttachKey = ''
SendToGroup = ''
MessageParms = Recipients:@RM:SendFrom:@RM:Subject:@RM:LoggingErrMsg:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
obj_Notes('Create',MessageParms)
LoggingErrMsg = 'Unable to send CSV COA CDS via FTP for customer ' : CustNo : '. Shipment #': ShipNo :'. File was not found in the expected location'
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', LoggingErrMsg)
Logging_Services('AppendLog', FTPobjLog, FTPLoggingDTM : @FM : CustNo : @FM: ShipNo : @FM : LoggingErrMsg, @RM, @FM, '')
SentFlag = 0
Recipients = XLATE('NOTIFICATION','COC_DELIVERY',NOTIFICATION_USER_ID$,'X')
SendFrom = 'System'
Subject = 'COC Generation Failure.'
AttachWindow = ''
AttachKey = ''
SendToGroup = ''
MessageParms = Recipients:@RM:SendFrom:@RM:Subject:@RM:LoggingErrMsg:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
obj_Notes('Create',MessageParms)
end
end
end else
LoggingErrMsg = 'Unable to send CSV COA via FTP for customer ' : CustNo : '. Shipment #': ShipNo
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', LoggingErrMsg)
Logging_Services('AppendLog', FTPobjLog, FTPLoggingDTM : @FM : CustNo : @FM: ShipNo : @FM : LoggingErrMsg, @RM, @FM, '')
SentFlag = 0
Recipients = XLATE('NOTIFICATION','COC_DELIVERY',NOTIFICATION_USER_ID$,'X')
SendFrom = 'System'
Subject = 'COC Generation Failue.'
Subject = 'COC Generation Failure.'
AttachWindow = ''
AttachKey = ''
SendToGroup = ''
@ -1838,6 +1885,7 @@ SendTechnical:
SentFlag = 1
IF KeyList = '' THEN
ErrorMsg = 'There are no RDS records attached to this shipment. No data will be sent to the customer. (EpiPRO process)'
Shipment_Services('SetMONACritical', 'FILE_GENERATION', ErrorMsg)
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = CustNo
@ -1869,14 +1917,19 @@ SendTechnical:
SSH = False$
IF SRP_Path("Exists", LocalFile) then
FTP_Services('PostRequest', 'put', Host, Server, LocalFile, '', Username, Password, LocalDirectory, RemoteDirectory, RemoteFile, ScriptPath, DeleteScript, SSH, '', 3, False$)
If Error_Services('HasError') then
ErrorMsg = Error_Services('GetMessage')
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', ErrorMsg)
end
end else
LoggingErrMsg = 'Unable to send CSV COA via FTP for customer ' : CustNo : '. Shipment #': ShipNo :'. File was not found in the expected location'
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', LoggingErrMsg)
Logging_Services('AppendLog', FTPobjLog, FTPLoggingDTM : @FM : CustNo : @FM: ShipNo : @FM : LoggingErrMsg, @RM, @FM, '')
SentFlag = 0
Recipients = XLATE('NOTIFICATION','COC_DELIVERY',NOTIFICATION_USER_ID$,'X')
SendFrom = 'System'
Subject = 'COC Generation Failue.'
Subject = 'COC Generation Failure.'
AttachWindow = ''
AttachKey = ''
SendToGroup = ''
@ -1889,6 +1942,7 @@ SendTechnical:
SentFlag = 1
IF KeyList = '' THEN
ErrorMsg = 'There are no RDS records attached to this shipment. No data will be sent to the customer. (EpiPRO process)'
Shipment_Services('SetMONACritical', 'FILE_GENERATION', ErrorMsg)
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = CustNo
@ -1905,6 +1959,8 @@ SendTechnical:
successful = RTI_OS_Directory("CREATE", CustPath)
If successful NE True$ then
null
end else
Shipment_Services('ClearMONACritical', 'FILE_TRANSMISSION')
end
end
DosTable = CustPath : ShipNo:'.csv'
@ -1926,14 +1982,19 @@ SendTechnical:
SSH = True$ = Error_Services('GetMessage')
IF SRP_Path("Exists", LocalFile) then
FTP_Services('PostRequest', 'put', Host, Server, LocalFile, '', Username, Password, LocalDirectory, RemoteDirectory, RemoteFile, ScriptPath, DeleteScript, SSH, '', 3, False$)
If Error_Services('HasError') then
ErrorMsg = Error_Services('GetMessage')
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', ErrorMsg)
end
end else
LoggingErrMsg = 'Unable to send CSV COA via FTP for customer ' : CustNo : '. Shipment #': ShipNo :'. File was not found in the expected location'
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', LoggingErrMsg)
Logging_Services('AppendLog', FTPobjLog, FTPLoggingDTM : @FM : CustNo : @FM: ShipNo : @FM : LoggingErrMsg, @RM, @FM, '')
SentFlag = 0
Recipients = XLATE('NOTIFICATION','COC_DELIVERY',NOTIFICATION_USER_ID$,'X')
SendFrom = 'System'
Subject = 'COC Generation Failue.'
Subject = 'COC Generation Failure.'
AttachWindow = ''
AttachKey = ''
SendToGroup = ''
@ -1943,12 +2004,13 @@ SendTechnical:
end else
LoggingErrMsg = 'Export ' : ExportID: ' does not exist for customer ' : CustNo : '. Shipment #': ShipNo
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', LoggingErrMsg)
Logging_Services('AppendLog', FTPobjLog, FTPLoggingDTM : @FM : CustNo : @FM: ShipNo : @FM : LoggingErrMsg, @RM, @FM, '')
SentFlag = 0
Recipients = XLATE('NOTIFICATION','COC_DELIVERY',NOTIFICATION_USER_ID$,'X')
SendFrom = 'System'
Subject = 'COC Generation Failue.'
Subject = 'COC Generation Failure.'
AttachWindow = ''
AttachKey = ''
SendToGroup = ''
@ -1962,6 +2024,7 @@ SendTechnical:
IF KeyList = '' THEN
ErrorMsg = 'There are no RDS records attached to this shipment. No data will be sent to the customer. (EpiPRO process)'
Shipment_Services('SetMONACritical', 'FILE_GENERATION', ErrorMsg)
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = CustNo
@ -1977,6 +2040,8 @@ SendTechnical:
successful = RTI_OS_Directory("CREATE", CustPath)
If successful NE True$ then
null
end else
Shipment_Services('ClearMONACritical', 'FILE_TRANSMISSION')
end
end
DosTable = CustPath :ShipNo:'.csv'
@ -1997,14 +2062,19 @@ SendTechnical:
SSH = True$
IF SRP_Path("Exists", LocalFile) then
FTP_Services('PostRequest', 'put', Host, Server, LocalFile, '', Username, Password, LocalDirectory, RemoteDirectory, RemoteFile, ScriptPath, DeleteScript, SSH, '', 3, False$)
If Error_Services('HasError') then
ErrorMsg = Error_Services('GetMessage')
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', ErrorMsg)
end
end else
LoggingErrMsg = 'Unable to send CSV COA via FTP for customer ' : CustNo : '. Shipment #': ShipNo :'. File was not found in the expected location'
Shipment_Services('SetMONACritical', 'FILE_GENERATION', LoggingErrMsg)
Logging_Services('AppendLog', FTPobjLog, FTPLoggingDTM : @FM : CustNo : @FM: ShipNo : @FM : LoggingErrMsg, @RM, @FM, '')
SentFlag = 0
Recipients = XLATE('NOTIFICATION','COC_DELIVERY',NOTIFICATION_USER_ID$,'X')
SendFrom = 'System'
Subject = 'COC Generation Failue.'
Subject = 'COC Generation Failure.'
AttachWindow = ''
AttachKey = ''
SendToGroup = ''
@ -2013,12 +2083,13 @@ SendTechnical:
end
end else
LoggingErrMsg = 'Export ' : ExportID: ' does not exist for customer ' : CustNo : '. Shipment #': ShipNo
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', LoggingErrMsg)
Logging_Services('AppendLog', FTPobjLog, FTPLoggingDTM : @FM : CustNo : @FM: ShipNo : @FM : LoggingErrMsg, @RM, @FM, '')
SentFlag = 0
Recipients = XLATE('NOTIFICATION','COC_DELIVERY',NOTIFICATION_USER_ID$,'X')
SendFrom = 'System'
Subject = 'COC Generation Failue.'
Subject = 'COC Generation Failure.'
AttachWindow = ''
AttachKey = ''
SendToGroup = ''
@ -2028,6 +2099,7 @@ SendTechnical:
Case 1
LoggingErrMsg = 'Shipment settings do not exist for customer ' : CustNo : '. Shipment #': ShipNo
Shipment_Services('SetMONACritical', 'FILE_TRANSMISSION', LoggingErrMsg)
Logging_Services('AppendLog', FTPobjLog, FTPLoggingDTM : @FM : CustNo : @FM: ShipNo : @FM : LoggingErrMsg, @RM, @FM, '')
SentFlag = 0
End Case
@ -2140,3 +2212,4 @@ RETURN