project QadFinancials > class BVATPeriod > method DataNewMultipleCreateManually

Description

method that is executed when you want to create a VAT year manually : default he will present calendar months


Parameters


iiVatYearinputintegerThe VAT Year that you want to create
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program1/bvatperiod.p)

if iiVatYear = 0
then do:
    assign vcMessage      = trim(#T-3'Enter the tax year you want to create.':255(3861)T-3#)
           oiReturnStatus = -1.
           
    <M-1 run SetMessage (input  vcMessage (icMessage),
                     input  '':U (icArguments),
                     input  '':U (icFieldName),
                     input  '':U (icFieldValue),
                     input  'E':U (icType),
                     input  3 (iiSeverity),
                     input  '':U (icRowid),
                     input  'QADFIN-220':U (icFcMsgNumber),
                     input  '' (icFcExplanation),
                     input  '' (icFcIdentification),
                     input  '' (icFcContext),
                     output viFcReturnSuper (oiReturnStatus)) in BVATPeriod>
                     
    return.
end.

do viCount = 1 to 12:
    <M-2 run AddDetailLine (input  'VatPeriod':U (icTable), 
                        input  '':U (icParentRowid), 
                        output viFcReturnSuper (oiReturnStatus)) in BVATPeriod>
                        
    if viFcReturnSuper <> 0
    then do:
        assign oiReturnStatus = viFcReturnSuper.
        return.
    end.
    
    assign tVatPeriod.VatPeriodYear       = iiVatYear
           tVatPeriod.VatPeriodPeriod     = viCount
           tVatPeriod.VatPeriodYearPeriod = (iiVatYear * 100) + viCount
           tVatPeriod.VatPeriodStartDate = date(viCount, 1, iiVatYear)
           tVatPeriod.VatPeriodEndDate   = if viCount = 12
                                           then date(12, 31, iiVatYear)
                                           else date(viCount + 1, 1, iiVatYear) - 1
           tVatPeriod.VatPeriodStatus    = {&VATPERIODSTATUS-OPEN}.
end.