{
    "header": {
        "version": 1,
        "type": "record"
    },
    "body": {
        "record1": {
            "<1>": "declare subroutine btree.extract, update_index, rlist, end_dialog\r\ndeclare function msg, key_sort, utility\r\n$insert lsl_users_equ\r\n$insert msg_equates\r\n\r\nopen 'DICT.WAFER_INV' to DictWaferInvTable else\r\n   Void = msg( '', 'Unable to open DICT.WAFER_INV...' )\r\n   return 0\r\nend\r\nSearchStr = ''\r\nCustIds       = .customer_info->array<1>\r\nOpen          = .open_check->check\r\nClosed        = .closed_check->check\r\nPackListNos   = .pack_list_nos->array\r\nMfgSlsOrd     = .mfg_sales_ord->array\r\nMfgLotNo      = .mfg_lot_no->text\r\nLslWo         = .lsl_wo->array\r\nLslInvNo      = .lsl_inv_no->array\r\nswap @vm:@vm with '' in MfgSlsOrd\r\nif MfgSlsOrd[-1,1] = @vm then MfgSlsOrd[-1,1] = ''\r\nswap @vm:@vm with '' in MfgLotNo\r\nif MfgLotNo[-1,1] = @vm then MfgLotNo[-1,1] = ''\r\nswap @vm:@vm with '' in LslWo\r\nif LslWo[-1,1] = @vm then LslWo[-1,1] = ''\r\nswap @vm:@vm with '' in LslInvNo\r\nif LslInvNo[-1,1] = @vm then LslInvNo[-1,1] = ''\r\nswap @vm:@vm with '' in CustIds\r\nif CustIds[-1,1] = @vm then CustIds[-1,1] = ''\r\nswap @vm:@vm with '' in PackListNos\r\nif PackListNos[-1,1] = @vm then PackListNos[-1,1] = ''\r\nif MfgSlsOrd then\r\n   SearchStr<-1> = 'MFG_SALES_ORD':@vm:MfgSlsOrd\r\nend\r\nif MfgLotNo then\r\n   SearchStr<-1> = 'MFG_LOT_NO':@vm:MfgLotNo\r\nend\r\nif LslWo then\r\n   SearchStr<-1> = 'LSL_WO':@vm:LslWo\r\nend\r\nif LslInvNo then\r\n   SearchStr<-1> = 'LSL_INVOICE_NO':@vm:LslInvNo\r\nend\r\nif CustIds then\r\n    SearchStr<-1> = 'CUST_NO':@vm:CustIds\r\nend \r\nStatusVar = ''\r\nif Open then\r\n    StatusVar<1,-1> = 'O'\r\nend\r\nif Closed then\r\n    StatusVar<1,-1> = 'C'\r\nend\r\nif StatusVar then\r\n   SearchStr<-1> = 'STATUS':@vm:StatusVar\r\nend\r\nif PackListNos then\r\n    SearchStr<-1> = 'PACKING_NO':@vm:PackListNos\r\nend\r\nif SearchStr then\r\n    SearchStr := @fm\r\n    Void = utility( 'CURSOR', 'H' )\r\n    * do a btree.extract\r\n    btree.extract( SearchStr, 'WAFER_INV', DictWaferInvTable, Keys, '', Flag )\r\n    if Flag <> 0 then\r\n       Void = msg( '', 'Error while extracting WAFER_INV records...' )\r\n       return 0\r\n    end\r\n    if Keys then\r\n       convert @vm to @fm in Keys\r\n       Keys = key_sort( Keys, 'WAFER_INV', 'CUST_NAME':@fm:'#ENTRY_DATE', 1 )\r\n       end_dialog( @window, Keys )\r\n    end else\r\n       MsgInfo = ''\r\n       MsgInfo<mtext$> = 'No records found meeting your criteria...' \r\n       MsgInfo<micon$> = '!'\r\n       Void = msg( '', MsgInfo )\r\n    end\r\n    Void = utility( 'CURSOR', 'A' )\r\nend else\r\n    MsgInfo = ''\r\n    MsgInfo<mtext$> = 'You have not entered any search criteria...' \r\n    MsgInfo<micon$> = '!'\r\n    Void = msg( '', MsgInfo )\r\nend\r\nreturn 0\r\n\r\n"
        }
    }
}