project QadFinancials > class BDebtor > method GetDebtorBillData

Description

This method is used to retrieve the data for the 'Bills' tab of Customer Activity Dashboard.
The main logic will execute one query.


Parameters


iiDebtor_IDinputinteger
tDInvoiceBilloutputtemp-table
icCompanyIdinputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program3/bdebtor.p)

empty temp-table tDInvoiceBill.

<Q-61 run BillByDebtorId (all) (Read) (NoCache)
   (input int(icCompanyId), (CompanyId)
    input iiDebtor_ID, (Debtor_ID)
    output dataset tqBillByDebtorId) in BBill>
for each tqBillByDebtorId:
    create tDInvoiceBill.
    buffer-copy tqBillByDebtorId 
         except tqBillByDebtorId.tiBillNumber 
             to tDInvoiceBill.

    viBillNumberLength = length(string(tqBillByDebtorId.tiBillNumber),'CHARACTER').
    vcBillNumber = string(tqBillByDebtorId.tiBillNumber).
    do while viBillNumberLength < 9:
        vcBillNumber = '0' + vcBillNumber .
        viBillNumberLength = viBillNumberLength + 1.
    end.
    assign tDInvoiceBill.tcBillNumber = vcBillNumber.

    if tDInvoiceBill.tcBillStatus = {&BILLSTATUS-INITIAL} then
        tDInvoiceBill.tcBillStatus = {&BILLSTATUS-INITIAL-TR}.
    else if tqBillByDebtorId.tcBillStatus = {&BILLSTATUS-CONFIRM} then
        tDInvoiceBill.tcBillStatus = {&BILLSTATUS-CONFIRM-TR}.       
end.