11 lines
3.5 KiB
JSON
11 lines
3.5 KiB
JSON
{
|
|
"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.CAR' to DictCARTable else\r\n Void = msg( '', 'Unable to open DICT.CAR...' )\r\n return 0\r\nend\r\nSearchStr = ''\r\nCustIds = .customer_info->array<1>\r\nIssDateFrom = .issue_date_from->text\r\nIssDateThru = .issue_date_thru->text\r\nRespIds = .resp_person_info->array<1>\r\n*\r\nComplaints = .carcomplaints->text\r\n* need to convert field to value markers as the text property will \r\n* be field mark delimited if more than one is choosen\r\nconvert @fm to @vm in Complaints\r\n\r\n* CAR status variables\r\nOpen = .open_check->check\r\nFormComplete = .form_complete_check->check\r\nCARInplace = .car_inplace_check->check\r\nVerified = .verified_check->check\r\nRMA = .rma->check\r\nConfirmed = .confirmed_check->check\r\nUnconfirmed = .unconfirmed_check->check\r\n* end of inquiry status variables\r\n\r\nswap @vm:@vm with '' in CustIds\r\nif CustIds[-1,1] = @vm then CustIds[-1,1] = ''\r\nswap @vm:@vm with '' in RespIds\r\nif RespIds[-1,1] = @vm then RespIds[-1,1] = ''\r\nif CustIds then\r\n SearchStr<-1> = 'CUST_ID':@vm:CustIds\r\nend\r\nif RespIds then\r\n SearchStr<-1> = 'RESP_USER_ID':@vm:RespIds\r\nend\r\n\r\nif IssDateFrom and IssDateThru then\r\n SearchStr<-1> = 'ISSUE_DATE':@vm:IssDateFrom:'...':IssDateThru\r\nend else\r\n\tif IssDateFrom then\r\n\t SearchStr<-1> = 'ISSUE_DATE':@vm:'>=':IssDateFrom\r\n\tend\r\n\tif IssDateThru then\r\n\t SearchStr<-1> = 'ISSUE_DATE':@vm:'<=':IssDateThru\r\n\tend \r\nend\r\n\r\n* CAR status\r\nCARStatusVar = ''\r\nif Open then\r\n CARStatusVar<1,-1> = 'O'\r\nend\r\nif FormComplete then\r\n CARStatusVar<1,-1> = 'F'\r\nend\r\nif CARInplace then\r\n CARStatusVar<1,-1> = 'C'\r\nend\r\nif Verified then\r\n CARStatusVar<1,-1> = 'V'\r\nend\r\nif CarStatusVar then\r\n SearchStr<-1> = 'STATUS':@vm:CARStatusVar\r\nend\r\n\r\n* CONFIRMATION status\r\nCONStatusVar = ''\r\nif Confirmed then\r\n CONStatusVar<1,-1> = 'C'\r\nend\r\nif UnConfirmed then\r\n CONStatusVar<1,-1> = 'U'\r\nend\r\nif CONStatusVar then\r\n SearchStr<-1> = 'CONFIRM_STATUS':@vm:CONStatusVar\r\nend\r\n\r\n* Complaint types\r\nif Complaints <> '' then\r\n SearchStr<-1> = 'COMPLAINT_TYPE':@vm:Complaints\r\nend\r\n\r\nif RMA then\r\n SearchStr<-1> = 'RMA_PROD_RET':@vm:'#':''\r\nend\r\n\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, 'CAR', DictCARTable, Keys, '', Flag )\r\n if Flag <> 0 then\r\n Void = msg( '', 'Error while extracting CAR 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, 'CAR', 'CUST_NAME':@fm:'#ISSUE_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"
|
|
}
|
|
}
|
|
} |