{ "header": { "version": 1, "type": "record" }, "body": { "record1": { "<1>": "declare function entid, fieldcount, repository, start_window, security_check\r\ndeclare function send_event, msg\r\ndeclare subroutine security_err_msg\r\n$insert msg_equates\r\n$insert popup_equates\r\n$insert logical\r\n$insert security_rights_equ\r\n$insert lsl_common\r\nequ QuoteNo$ to 1\r\nequ SchedNo$ to 3\r\nequ Wo$ to 4\r\nequ PartNo$ to 5\r\nequ WafInv$ to 6\r\nequ SubPN$ to 7\r\nequ LotNo$ to 8\r\nequ Setup$ to 9\r\nequ Srp$ to 10\r\nequ Qty$ to 11\r\nequ Price$ to 12\r\nequ Amount$ to 13\r\nif security_check( 'Invoice', Write$ ) then\r\n *PopRec = entid( @appid<1>, 'POPUP', '', 'INVOICE_PLANT_OPTS' )\r\n *PlantCode = repository( 'EXECUTE', PopRec, @window, '' )\r\n *if PlantCode else\r\n * return 0 ;* user canceled\r\n *end \r\n\tPopRec = entid( @appid<1>, 'POPUP', '', 'ORDER_CREATE_INVOICE' )\r\n\tOrderDetail = .order_detail->array\r\n\tQuoteIds = OrderDetail\r\n\tExpData = ''\r\n\tQCnt = fieldcount( QuoteIds, @vm )\r\n\tfor i = 1 to QCnt\r\n\t ThisLine = ''\r\n\t for j = 1 to 13\r\n\t if j <> 2 and j <> 6 and j <> 7 then ;* DON'T SHOW THE PSN OR THE WAFER INVENTORY OR THE SUBSTRATE PART#\r\n\t ThisLine := OrderDetail:@svm\r\n\t end\r\n\t next j\r\n\t ThisLine[-1,1] = ''\r\n\t ExpData<1,-1> = ThisLine\r\n\tnext i\r\n\tExCnt = fieldcount( ExpData, @vm )\r\n\tNoMoreBlankRowOnEnd = false$\r\n\tfor i = ExCnt to 1 step -1\r\n\t if field( ExpData<1,i>, @svm, 1, 9 ) = str( @svm, 8 ) then\r\n\t ExpData = delete( ExpData, 1, i, 0 )\r\n\t end else\r\n\t NoMoreBlankRowOnEnd = true$\r\n\t end\r\n\t until NoMoreBlankRowOnEnd\r\n\tnext i\r\n\tif ExpData then\r\n\t\tOverRide = ''\r\n\t\tOverRide = ExpData\r\n\t\tOverRide = 'Choose order lines to include on the invoice'\r\n\t\tRetVal = repository( 'EXECUTE', PopRec, @window, OverRide )\r\n\t\tif RetVal then\r\n\t\t OrderNo = .order_no->text\r\n\t\t Void = send_event( @window, 'WRITE' )\r\n\t\t Void = start_window( 'INVOICE', @window, '*CREATE*':OrderNo:'*':RetVal, '', '' )\r\n \tend\r\n end else\r\n MsgInfo = ''\r\n MsgInfo = 'You must have at least one order detail line.'\r\n MsgInfo = '!' \r\n Void = msg( '', MsgInfo )\r\n end \r\nend else\r\n security_err_msg( 'Invoice', Write$ )\r\nend\r\nRETURN 0" } } }