project QadFinancials > class BBillReport > method GetPreBillDate

Description

If there’s no previous bill and current bill is the first bill in the same customer, currency, bill date and entity, so the earliest invoice posting date of all the invoices in current bill will be set as the mock previous bill date.


Parameters


iiBill_Idinputinteger
otPreBillDateoutputdate
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BBillReport.BillReportDInvoice


program code (program1/bbillreport.p)

<Q-4 run DInvoiceByIDForBill (all) (Read) (NoCache)
   (input ?, (CompanyId)
    input ?, (DInvoice_ID)
    input iiBill_Id, (Bill_ID)
    input {&MOVEMENTTYPE-INITIAL}, (MovementType)
    output dataset tqDInvoiceByIDForBill) in BDInvoice>

for each tqDInvoiceByIDForBill break by tqDInvoiceByIDForBill.ttDInvoiceDate:

    if first-of (tqDInvoiceByIDForBill.ttDInvoiceDate) then
    do:
        assign otPreBillDate = tqDInvoiceByIDForBill.ttDInvoiceDate - 1.
        leave.
    end.
end.