project QadFinancials > class BDInvoice > method ValidateComponentAllPostPostingDate

validation procedure

Description

This method is a submethod of ValidateComponentAllPost.

Posting date must be situated between the start and the end date of the GL period.


Parameters


itDInvoicePostingDateinputdateValue of the business field to validate.
icRowidinputcharacterContents of field tc_Rowid, if the target field is a field of a component temp-table.
iiPeriodIdinputintegerPeriod ID
iiPeriodYearinputintegerYear of the accounting period
iiPeriodPeriodinputintegerPeriod of the accounting period
blstartPerByPerStartEndDateinput-outputlogicalIs query tqPeriodByPeriodStartEndDate already started or not ?
iiInvoiceCompanyIdinputintegerCompany ID of the Debtor Invoice
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BDInvoice.ValidateComponentAllPost


program code (program5/bdinvoice.p)

if iiPeriodId = ? then assign iiPeriodId = 0.
    if iiPeriodYear = ? then assign iiPeriodYear = 0.
    if iiPeriodPeriod = ? then assign iiPeriodPeriod = 0.
    
   <Q-2 assign vlFcQueryRecordsAvailable = PeriodByPeriodStartEndDate (NoCache)
      (input iiInvoiceCompanyId, (CompanyId)
       input itDInvoicePostingDate, (Date)
       input iiPeriodId, (PeriodId)
       input if iiPeriodId = 0 then iiPeriodYear else 0, (PeriodYear)
       input if iiPeriodId = 0 then iiPeriodPeriod else 0, (PeriodPeriod)) in BPeriod >

    if vlFcQueryRecordsAvailable = false
    then do:
        assign vcMessage      = trim(substitute(#T-1'The posting date must be between the start and end date of the GL period (&1/&2).':150(65539)T-1#, string(iiPeriodYear, "9999":U), string(iiPeriodPeriod, "99":U)))
               oiReturnStatus = -1.
        vcDatetemp =  <M-80 DisplayDate  (input  (itdinvoicePostingDate) (itDate)) in BDInvoice>.
        <M-3 run SetMessage
           (input  vcMessage (icMessage), 
            input  '':U (icArguments), 
            input  'tDInvoice.DInvoicePostingDate':U (icFieldName), 
            input  vcDatetemp (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  icRowid (icRowid), 
            input  'QadFin-7913':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BDInvoice>
    end.