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_Id | input | integer | |
otPreBillDate | output | date | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
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.