project QadFinancials > class BPeriod > method ValIsPostingAllowed

validation procedure

Description

Invoices, Purchases and Sales are only allowed in this period when the period also allows GL Postings.


Parameters


icTargetFieldinputcharacterValue of the business field to validate.
icTargetFieldNameinputcharacterName of the business field to validate.
icRowidinputcharacterContents of field tc_Rowid, if the target field is a field of a component temp-table.
ilIsPostingGLAllowedinputlogicalIs Posting GL Allowed
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
validation on tPeriod.PeriodIsPostingInvAllowed
validation on tPeriod.PeriodIsPostingPCAllowed
validation on tPeriod.PeriodIsPostingPurchAllow
validation on tPeriod.PeriodIsPostingSalesAllow


program code (program3/bperiod.p)

/* In case Periodic Costing is disabled, skip the validation on the periodic costing flag */
if icTargetFieldName = "t_sPeriod.PeriodIsPostingPCAllowed":U 
then do:
    if vlPeriodicCostingModIsActive = ? 
    then do:
        <M-22 run PeriodicCostingModuleIsActive
           (input  vcDomainCode (icDomainCode), 
            output vlPeriodicCostingModIsActive (olPeriodicCostingModuleIsActive), 
            output viFcReturnSuper (oiReturnStatus)) in BPeriod>
    end.
    if not vlPeriodicCostingModIsActive then return.
end.
    
if not ilIsPostingGLAllowed and
    can-do("true,yes":U, icTargetField)
then do:
        assign vcMessage      = trim(#T-2'You cannot set this field to Open when GL posting is not allowed.':255(3081)T-2#)
               oiReturnStatus = -1.
        <M-1 run SetMessage (input  vcMessage (icMessage),
                     input  '':U (icArguments),
                     input  icTargetFieldName (icFieldName),
                     input  icTargetField (icFieldValue),
                     input  'E':U (icType),
                     input  3 (iiSeverity),
                     input  icRowid (icRowid),
                     input  'QADFIN-401':U (icFcMsgNumber),
                     input  '' (icFcExplanation),
                     input  '' (icFcIdentification),
                     input  '' (icFcContext),
                     output viFcReturnSuper (oiReturnStatus)) in BPeriod>
    end.