project QadFinancials > class BBill > method ConfirmPrint

Description

For Billing Print report. if it's a Confirm Print, will invoke this method to store Highest DInvoiceMovement_ID and ConfirmDate to Bill table.


Parameters


tBillConfirmedTableForSaveinputtemp-table
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BBillReport.BillReportDInvoice


program code (program1/bbill.p)

for each tBillConfirmedTableForSave:
    vcBillIdList = vcBillIdList + string(tBillConfirmedTableForSave.tiBill_ID) + chr(4).
end.
vcBillIdList = trim(vcBillIdList, chr(4)).

<M-20 run DataLoad
   (input  ? (icRowids), 
    input  vcBillIdList (icPkeys), 
    input  ? (icObjectIds), 
    input  ? (icFreeform), 
    input  false (ilKeepPrevious), 
    output oiReturnStatus (oiReturnStatus)) in BBill>
if oiReturnStatus < 0 then return.

for each tBill where tBill.BillStatus = {&BILLSTATUS-INITIAL} no-lock:

    assign tBill.BillStatus = {&BILLSTATUS-CONFIRM}
           tBill.BillConfirmDate = date(today)
           tBill.tc_Status = 'C':U.

    find first tBillConfirmedTableForSave where tBillConfirmedTableForSave.tiBill_ID = tBill.Bill_ID no-lock no-error.
    if available tBillConfirmedTableForSave then

    assign tBill.BillClosingBalanceTC  = tBillConfirmedTableForSave.tdBillPay
           tBill.DInvoiceMovement_ID = tBillConfirmedTableForSave.tiDInvoiceMovement_ID
          tBill.BillPaymentAmt = tBillConfirmedTableForSave.tdPaymentAmt
           tBill.BillTaxAmtTC = tBillConfirmedTableForSave.tdSalesTax
           tBill.BillSalesAmt = tBillConfirmedTableForSave.tdSalesTotalAmt
           tBill.BillOpeningBalanceTC = tBillConfirmedTableForSave.tdPreviousBalance.
end.
   
<M-60 run ValidateBC  (output oiReturnStatus (oiReturnStatus)) in BBill>
if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0) then
   assign oiReturnStatus = viFcReturnSuper.
if oiReturnStatus < 0 then
return.

<M-34 run AdditionalUpdates  (output viFcReturnSuper (oiReturnStatus)) in BBill>
if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0) then
   assign oiReturnStatus = viFcReturnSuper.
if oiReturnStatus < 0 then
return.

<M-54 run DataSave  (output viFcReturnSuper (oiReturnStatus)) in BBill>
if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0) then
   assign oiReturnStatus = viFcReturnSuper.