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

11 lines
3.3 KiB
JSON

{
"header": {
"version": 1,
"type": "record"
},
"body": {
"record1": {
"<1>": "declare function entid, repository, start_window, msg, key_sort, rowexists\r\ndeclare subroutine make.list\r\n$insert msg_equates\r\n\r\nCustNo = .cust_no->text\r\nif CustNo then\r\n * row one = call window with current key\r\n\t* row two = call window with no keys\r\n\t* row three = call window with all active keys for customer\r\n\t* row four = call popup allowing choice\r\n\tCurQuote = .quote_num->text\r\n\tif CurQuote then\r\n\t if rowexists( 'ANNUAL_CONTRACTS', .contract_no->text ) else\r\n\t Tvar = iconv( CurQuote, '[WIN_QUOTE_NUM_VALID]' )\r\n\t if status() then\r\n\t .quote_num->text = ''\r\n\t end\r\n\t end\r\n\tend\r\n\tPopupId = entid( @appid<1>, 'POPUP', '', 'QUOTE_LOOKUP_OPTS' )\r\n\tChoosenRow = repository( 'EXECUTE', PopupId, @window, '' )\r\n\tif ChoosenRow = 1 then\r\n\t ;* go view current quote\r\n\t if CurQuote then\r\n\t RetVal = start_window( 'QUOTE', @window, CurQuote:'*CENTER', '', '' ) \r\n\t\tend else\r\n\t\t MsgInfo = ''\r\n\t\t Text = 'You have not entered a quote number...' \r\n\t\t MsgInfo<mtext$> = Text\r\n\t\t MsgInfo<micon$> = 'H'\r\n\t\t Void = msg( '', MsgInfo )\r\n\t\t return 0\r\n end\r\n end else\r\n if ChoosenRow = 2 then\r\n\t * call quote window\r\n\t\t\tRetVal = start_window( 'QUOTE', @window, '*Choosing*Annual Contracts', '', '' )\r\n\t\tend else\r\n\t\t if ChoosenRow = 3 then\r\n\t\t * call quote window with all active\r\n\t\t\t\tOpenKeys = xlate( 'COMPANY', CustNo, 'OPEN_QUOTE_KEYS', 'X' )\r\n\t\t\t\tif OpenKeys then\r\n\t\t RetVal = start_window( 'QUOTE', @window, OpenKeys:'*Choosing*Annual Contracts', '', '' )\r\n\t\t\t\tend else\r\n\t\t\t\t gosub CustErr\r\n\t\t\t\t return 0\r\n\t\t\t\tend\r\n\t\t\tend else\r\n\t\t\t if ChoosenRow = 4 then\r\n\t\t\t ;* show all open in popup allowing choice\r\n\t\t \t\t\tOpenKeys = xlate( 'COMPANY', CustNo, 'OPEN_QUOTE_KEYS', 'X' )\r\n\t\t\t\t\tif OpenKeys then\r\n\t\t\t\t\t convert @vm to @fm in OpenKeys\r\n\t\t\t \tOpenKeys = key_sort( OpenKeys, 'QUOTE', '#ENTRY_DATE', 1, '', '' )\r\n\t\t\t \tmake.list( 0, OpenKeys, '', '' )\r\n\t\t \t\tPopupId = entid( @appid<1>, 'POPUP', '', 'SHOW_QUOTES' )\r\n\t\t \t \t\tChoosenRow = repository( 'EXECUTE', PopupId, @window, '' )\r\n\t\t \t \t\tif ChoosenRow then\r\n\t\t \t \t\t .quote_num->text = ChoosenRow\r\n\t\t end\r\n\t\t \tend else\r\n\t\t\t\t\t gosub CustErr\r\n\t\t\t\t\t return 0\r\n\t\t\t\t\tend\r\n\t\t\t end ;* user canceled\r\n\t\t end\r\n\t end\r\n end \r\nend else\r\n MsgRec = ''\r\n MsgRec<mtext$> = 'You must enter a customer first...' \r\n MsgRec<micon$> = 'H'\r\n Void = msg( '', MsgRec ) \r\nend\r\nRETURN 0\r\n*===========================================================================*\r\nCustErr:\r\n Text = 'There are currently no OPEN quotes for '\t\t \r\n Text:= oconv( CustNo, '[XLATE_CONV,COMPANY*CO_NAME]' ) \r\n MsgInfo = ''\r\n MsgInfo<mtext$> = Text\r\n MsgInfo<micon$> = 'H'\r\n Void = msg( '', MsgInfo )\r\nreturn 0\r\n*===========================================================================*"
}
}
}