project QadFinancials > class BDInvoice > method ValPeriodId

validation procedure

Description

Validate the Period : only open GL Periods and Periods open for Sales Ledger are allowed.


Parameters


iiTargetFieldinputintegerValue 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.
icPeriodStatusinputcharacterPeriod Status
ilIsPostingSalesAllowedinputlogicalIs Posting Sales Allowed
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BDInvoice.DefaultValuesValidate


program code (program5/bdinvoice.p)

if icPeriodStatus <> {&PERIODSTATUS-OPEN}
    then do:
        assign vcMessage      = trim(#T-3'You can only use open GL periods.':150(1095)t-3#)
               oiReturnStatus = -1.
        <M-1 run SetMessage (input  vcMessage (icMessage),
                     input  '':U (icArguments),
                     input  icTargetFieldName (icFieldName),
                     input  string(iiTargetField) (icFieldValue),
                     input  'E':U (icType),
                     input  3 (iiSeverity),
                     input  icRowid (icRowid),
                     input  'QADFIN-409':U (icFcMsgNumber),
                     input  '' (icFcExplanation),
                     input  '' (icFcIdentification),
                     input  '' (icFcContext),
                     output viFcReturnSuper (oiReturnStatus)) in BDInvoice>
    end.
    
/* BDInvoice.ValPeriodId (ModularityFlag will be checked only in BPosting.ValPeriod)        
    if not ilIsPostingSalesAllowed
    then do:
        assign vcMessage      = trim("Only Accounting Periods open for Sales Ledger are allowed":L150)
               oiReturnStatus = -1.
        <M-2 run SetMessage (input  vcMessage (icMessage),
                     input  '':U (icArguments),
                     input  icTargetFieldName (icFieldName),
                     input  string(iiTargetField) (icFieldValue),
                     input  'E':U (icType),
                     input  3 (iiSeverity),
                     input  icRowid (icRowid),
                     input  'QADFIN-410':U (icFcMsgNumber),
                     input  '' (icFcExplanation),
                     input  '' (icFcIdentification),
                     input  '' (icFcContext),
                     output viFcReturnSuper (oiReturnStatus)) in BDInvoice>
    end.
*/