project QadFinancials > class BTaxRegister > method UpdateTaxRegisterFinalPrint

Description

This method is used to update Tax Register fields when user final print Italian reports.


Parameters


icPKeysinputcharacter
iiTaxRegNextPageinputinteger
ilTaxRegFirstTimeinputlogicalFirst time print tax reg
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BVATReport.CalculatePaging
method BVATReport.ITARVATReg
method BVATReport.ITVATRegSusp


program code (program7/btaxregister.p)

if icPKeys = "":U or
   icPKeys = "?":U or
   icPKeys = ?
then return.

<M-1 run DataLoad
   (input  ? (icRowids), 
    input  icPKeys (icPkeys), 
    input  ? (icObjectIds), 
    input  '' (icFreeform), 
    input  false (ilKeepPrevious), 
    output viFcReturnSuper (oiReturnStatus)) in BTaxRegister>
if viFcReturnSuper <> 0
then do:    
    assign oiReturnStatus = viFcReturnSuper.
    return.
end.

for each tTaxReg:
    /* if it is printed first time, then update TaxRegIsFinal */
    if ilTaxRegFirstTime = true
    then assign tTaxReg.TaxRegIsFinal = true.
    assign tTaxReg.TaxRegNextPage = iiTaxRegNextPage
           tTaxReg.tc_Status      = "C":U.
end. /* for each tTaxReg */

<M-4 run ValidateBC  (output viFcReturnSuper (oiReturnStatus)) in BTaxRegister>
if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0)
then assign oiReturnStatus = viFcReturnSuper.
if oiReturnStatus < 0 then return.

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

<M-3 run DataSave  (output viFcReturnSuper (oiReturnStatus)) in BTaxRegister>
if viFcReturnSuper <> 0
then do:    
    assign oiReturnStatus = viFcReturnSuper.
    return.
end.