11 lines
5.6 KiB
JSON
11 lines
5.6 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 quote_equ\r\n$insert prod_spec_equ\r\n$insert wafer_inv_equ\r\n$insert msg_equates\r\n\r\nbegin case\r\n case Message = 'PSN'\r\n\tListId = 'PROD_SPEC*':@station\r\n\tProdSpecKey = xlate( 'SYSLISTS', ListId, 1, 'X' )\r\n\tif ProdSpecKey then\r\n\t * check to see if released for this customer\r\n\t ProdSpecRec = xlate( 'PROD_SPEC', ProdSpecKey, '', 'X' )\r\n\t CustNo = .cust_no->text\r\n\t WrongCust = false$\r\n\t ErrMsg = ''\r\n\t if ProdSpecRec<prod_spec_cust_id$> <> CustNo then\r\n\t ErrMsg:= 'Product Specification ':ProdSpecKey:' is for ':oconv( ProdSpecRec<prod_spec_cust_id$>, '[XLATE_CONV,COMPANY*CO_NAME]' )\r\n\t ErrMsg:= ' not ':oconv( CustNo, '[XLATE_CONV,COMPANY*CO_NAME]' )\r\n\t WrongCust = true$\r\n\t end\r\n\t if ( WrongCust = false$ ) then\r\n\t \tSelPos = .order_detail->selpos\r\n\t \tCol = SelPos<1>\r\n\t \tRow = SelPos<2>\r\n\t ColData = get_property( @window:'.ORDER_DETAIL', 'COLDATA' )\r\n\t ColData<1,Row> = ProdSpecKey\r\n\t Void = set_property( @window:'.ORDER_DETAIL', 'COLDATA', ColData )\r\n\t\t open 'SYSLISTS' to SysListsTable else\r\n\t\t Void = msg( '', 'Unable to open SYSLISTS...' )\r\n\t\t return 0\r\n\t\t end\r\n\t\t record_lock( SysListsTable, 'SysLists', ListId )\r\n\t\t delete SysListsTable, ListId else\r\n\t\t Void = msg( '', 'Unable to delete ':ListId:' from SYSLISTS...' )\r\n\t\t return 0\r\n\t\t end\r\n\t\t unlock SysListsTable, ListId else\r\n\t\t Void = msg( '', 'Unable to unlock SYSLISTS ':ListId )\r\n\t\t return 0\r\n\t\t end\r\n\t\tend else\r\n\t\t MsgInfo = ''\r\n\t\t MsgInfo<mtext$> = ErrMsg\r\n\t\t MsgInfo<micon$> = '!'\r\n\t\t Void = msg( '', MsgInfo )\r\n\t\tend\r\n\tend\r\n case Message = 'WAFER_INV'\r\n\tListId = 'WAFER_INV*':@station\r\n\tWafInvKey = xlate( 'SYSLISTS', ListId, 1, 'X' )\r\n\tif WafInvKey then\r\n\t * check to see if released for this customer\r\n\t WafInvRec = xlate( 'WAFER_INV', WafInvKey, '', 'X' )\r\n\t CustNo = .cust_no->text\r\n\t WrongCust = false$\r\n\t ErrMsg = ''\r\n\t if WafInvRec<wafer_inv_cust_no$> <> CustNo then\r\n\t ErrMsg:= 'Wafer Inventory ':WafInvKey:' is for ':oconv( WafInvRec<wafer_inv_cust_no$>, '[XLATE_CONV,COMPANY*CO_NAME]' )\r\n\t ErrMsg:= ' not ':oconv( CustNo, '[XLATE_CONV,COMPANY*CO_NAME]' )\r\n\t WrongCust = true$\r\n\t end\r\n\t if ( WrongCust = false$ ) then\r\n\t \tSelPos = .order_detail->selpos\r\n\t \tCol = SelPos<1>\r\n\t \tRow = SelPos<2>\r\n\t ColData = get_property( @window:'.ORDER_DETAIL', 'COLDATA' )\r\n\t ColData<1,Row> = WafInvKey\r\n\t Void = set_property( @window:'.ORDER_DETAIL', 'COLDATA', ColData )\r\n\t\t open 'SYSLISTS' to SysListsTable else\r\n\t\t Void = msg( '', 'Unable to open SYSLISTS...' )\r\n\t\t return 0\r\n\t\t end\r\n\t\t record_lock( SysListsTable, 'SysLists', ListId )\r\n\t\t delete SysListsTable, ListId else\r\n\t\t Void = msg( '', 'Unable to delete ':ListId:' from SYSLISTS...' )\r\n\t\t return 0\r\n\t\t end\r\n\t\t unlock SysListsTable, ListId else\r\n\t\t Void = msg( '', 'Unable to unlock SYSLISTS ':ListId )\r\n\t\t return 0\r\n\t\t end\r\n\t\tend else\r\n\t\t MsgInfo = ''\r\n\t\t MsgInfo<mtext$> = ErrMsg\r\n\t\t MsgInfo<micon$> = '!'\r\n\t\t Void = msg( '', MsgInfo )\r\n\t\tend\r\n\tend\r\n case otherwise$\r\n\tListId = 'QUOTE_ID*':@station\r\n\tQuoteKey = xlate( 'SYSLISTS', ListId, 1, 'X' )\r\n\tif QuoteKey then\r\n\t * check to see if open for this customer\r\n\t QuoteRec = xlate( 'QUOTE', QuoteKey, '', 'X' )\r\n\t CustNo = .cust_no->text\r\n\t WrongCust = false$\r\n\t ErrMsg = ''\r\n\t if QuoteRec<quote_cust_no$> <> CustNo then\r\n\t ErrMsg:= 'Quote ':QuoteKey:' is a quote for ':oconv( QuoteRec<quote_cust_no$>, '[XLATE_CONV,COMPANY*CO_NAME]' )\r\n\t ErrMsg:= ' not ':oconv( CustNo, '[XLATE_CONV,COMPANY*CO_NAME]' )\r\n\t WrongCust = true$\r\n\t end\r\n\t WrongStat = false$\r\n\t if QuoteRec<quote_status$> <> 'O' then\r\n\t if ErrMsg then\r\n\t ErrMsg:= ' and is not OPEN'\r\n\t end else\r\n\t ErrMsg:= 'Quote ':QuoteKey:' is not OPEN'\r\n\t end\r\n\t WrongStat = true$\r\n\t end\r\n\t if ( WrongCust = false$ ) and ( WrongStat = false$ ) then\r\n\t\t Selpos = .order_detail->selpos\r\n\t\t Column = SelPos<1>\r\n\t\t Row = SelPos<2>\r\n\t\t ColData = get_property( @window:'.ORDER_DETAIL', 'COLDATA' )\r\n\t\t ColData<1,Row> = QuoteKey\r\n\t\t Void = set_property( @window:'.ORDER_DETAIL', 'COLDATA', ColData )\r\n\t\t open 'SYSLISTS' to SysListsTable else\r\n\t\t Void = msg( '', 'Unable to open SYSLISTS...' )\r\n\t\t return 0\r\n\t\t end\r\n\t\t record_lock( SysListsTable, 'SysLists', ListId )\r\n\t\t delete SysListsTable, ListId else\r\n\t\t Void = msg( '', 'Unable to delete ':ListId:' from SYSLISTS...' )\r\n\t\t return 0\r\n\t\t end\r\n\t\t unlock SysListsTable, ListId else\r\n\t\t Void = msg( '', 'Unable to unlock SYSLISTS ':ListId )\r\n\t\t return 0\r\n\t\t end\r\n\t\tend else\r\n\t\t MsgInfo = ''\r\n\t\t MsgInfo<mtext$> = ErrMsg\r\n\t\t MsgInfo<micon$> = '!'\r\n\t\t Void = msg( '', MsgInfo )\r\n\t\tend\r\n\tend\r\nend case\r\nRETURN 0"
|
|
}
|
|
}
|
|
} |