open-insight/LSL2/OIEVENT/WRITE/ANNUAL_CONTRACTS..json
2024-03-25 15:12:53 -07:00

11 lines
1.3 KiB
JSON

{
"header": {
"version": 1,
"type": "record"
},
"body": {
"record1": {
"<1>": "declare function rowexists, msg\r\ndeclare subroutine create_note\r\n$insert msg_equates\r\n$insert quote_sigs_equ\r\n\r\nif rowexists( 'ANNUAL_CONTRACTS', .contract_no->text ) else\r\n .entry_id->text = @user4\r\nend\r\nTotRelAmt = iconv( .tot_rel_amount->text, 'MD2' )\r\nTotContractAmt = iconv( .tot_contract_amount->text, 'MD2' )\r\nDiff = TotContractAmt - TotRelAmt\r\nMinBalance = iconv( .min_balance->text, 'MD2' )\r\nif MinBalance then\r\n ValToCheck = MinBalance\r\nend else\r\n ValToCheck = 100100\r\nend\r\nif Diff < ValToCheck then\r\n ContractNo = .contract_no->text\r\n Message = 'The annual contract balance for ':.cust_name->text:' contract # '\r\n Message:= ContractNo:' is currently at ':oconv( Diff, 'MD2,$' )\r\n SendTo = xlate( 'CONFIG', 'QUOTE_SIGS', ACReminder$, 'X' )\r\n create_note( SendTo, 'System', 'Annual Contract Balance', Message, 'ANNUAL_CONTRACTS', ContractNo )\r\nend\r\nif ( @@window->savewarn ) and ( .status->value = 'C' ) then\r\n MsgInfo = ''\r\n MsgInfo<mtext$> = 'The status of this contract is currently closed...please verify that you should be using this contract.'\r\n MsgInfo<micon$> = '!'\r\n Void = msg( '', MsgInfo )\r\nend\r\nreturn 1"
}
}
}