Files
open-insight/LSL2/OIEVENT/OMNIEVENT/ORDER.AC_ID.json
2024-03-25 15:12:53 -07:00

11 lines
1.9 KiB
JSON

{
"header": {
"version": 1,
"type": "record"
},
"body": {
"record1": {
"<1>": "declare subroutine record_lock\r\ndeclare function msg\r\n$insert logical\r\n$insert annual_contracts_equ\r\n$insert msg_equates\r\n\r\nListId = 'AC_ID*':@station\r\nACKey = xlate( 'SYSLISTS', ListId, 1, 'X' )\r\nif ACKey then\r\n * check to see if open for this customer\r\n ACRec = xlate( 'ANNUAL_CONTRACTS', ACKey, '', 'X' )\r\n CustNo = .cust_no->text\r\n WrongCust = false$\r\n ErrMsg = ''\r\n if ACRec<annual_contracts_cust_no$> <> CustNo then\r\n ErrMsg:= 'Annual Contract ':ACKey:' is an Annual Contract for ':oconv( ACRRec<annual_contracts_cust_no$>, '[XLATE_CONV,COMPANY*CO_NAME]' )\r\n ErrMsg:= ' not ':oconv( CustNo, '[XLATE_CONV,COMPANY*CO_NAME]' )\r\n WrongCust = true$\r\n end\r\n WrongStat = false$\r\n if ACRec<annual_contracts_status$> <> 'O' then\r\n if ErrMsg then\r\n ErrMsg:= ' and is not OPEN'\r\n end else\r\n ErrMsg:= 'Annual Contract ':ACKey:' is not OPEN'\r\n end\r\n WrongStat = true$\r\n end\r\n if ( WrongCust = false$ ) and ( WrongStat = false$ ) then\r\n .ac_id->text = ACKey\r\n\t open 'SYSLISTS' to SysListsTable else\r\n\t Void = msg( '', 'Unable to open SYSLISTS...' )\r\n\t return 0\r\n\t end\r\n\t record_lock( SysListsTable, 'SysLists', ListId )\r\n\t delete SysListsTable, ListId else\r\n\t Void = msg( '', 'Unable to delete ':ListId:' from SYSLISTS...' )\r\n\t return 0\r\n\t end\r\n\t unlock SysListsTable, ListId else\r\n\t Void = msg( '', 'Unable to unlock SYSLISTS ':ListId )\r\n\t return 0\r\n\t end\r\n\tend else\r\n\t MsgInfo = ''\r\n\t MsgInfo<mtext$> = ErrMsg\r\n\t MsgInfo<micon$> = '!'\r\n\t Void = msg( '', MsgInfo )\r\n\tend\r\nend\r\nRETURN 0"
}
}
}