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

11 lines
3.7 KiB
JSON

{
"header": {
"version": 1,
"type": "record"
},
"body": {
"record1": {
"<1>": "declare function entid, repository, start_window, msg, key_sort, rowexists, send_event\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 keys for customer\r\n\t* row four = call popup allowing choice\r\n\tCurProdSpecID = .prod_spec_id->text\r\n\tif CurProdSpecID then\r\n\t if rowexists( 'WO_LOG', .wo_no->text ) else\r\n\t Tvar = iconv( CurProdSpecID, '[WIN_PROD_SPEC_NUM_VALID]' )\r\n\t if status() then\r\n\t .prod_spec_id->text = ''\r\n\t end\r\n\t end\r\n\tend\r\n\tPopupId = entid( @appid<1>, 'POPUP', '', 'PROD_SPEC_LOOKUP_OPTS' )\r\n\tChoosenRow = repository( 'EXECUTE', PopupId, @window, '' )\r\n\tif ChoosenRow = 1 then\r\n\t ;* go view current prod spec\r\n\t if CurProdSpecID then\r\n\t RetVal = start_window( 'PROD_SPEC', @window, CurProdSpecID:'*Choosing*WO-Log**CENTER', '', '' ) \r\n\t\tend else\r\n\t\t MsgInfo = ''\r\n\t\t Text = 'You have not entered a product specification 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 customer prod spec window\r\n\t\t\tRetVal = start_window( 'PROD_SPEC', @window, '*Choosing*WO-Log*':CustNo:'*CENTER', '', '' )\r\n\t\tend else\r\n\t\t if ChoosenRow = 3 then\r\n\t\t * call product specification window with all\r\n\t\t\t\tOpenKeys = xlate( 'COMPANY', CustNo, 'PROD_SPEC_KEYS', 'X' )\r\n\t\t\t\tif OpenKeys then\r\n\t\t\t\t\tconvert @vm to @fm in OpenKeys\r\n\t\t\t OpenKeys = key_sort( OpenKeys, 'PROD_SPEC', '#ENTRY_DATE', 1 )\t\t\t\t\t\r\n\t\t\t convert @fm to @vm in OpenKeys\r\n\t\t RetVal = start_window( 'PROD_SPEC', @window, OpenKeys:'*Choosing*WO-Log**CENTER', '', '' )\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, 'PROD_SPEC_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\t OpenKeys = key_sort( OpenKeys, 'PROD_SPEC', '#ENTRY_DATE', 1 )\t\t\t\r\n\t\t\t \tmake.list( 0, OpenKeys, '', '' )\r\n\t\t \t\tPopupId = entid( @appid<1>, 'POPUP', '', 'PROD_SPEC_SINGLE' )\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 .prod_spec_id->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\nVoid = send_event( @window:'.PROD_SPEC_ID', 'LOSTFOCUS' )\r\nRETURN 0\r\n*===========================================================================*\r\nCustErr:\r\n Text = 'There are currently no Product Specifications 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*===========================================================================*"
}
}
}