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
itDInvoicePostingDate | input | date | Value of the business field to validate. |
icRowid | input | character | Contents of field tc_Rowid, if the target field is a field of a component temp-table. |
iiPeriodId | input | integer | Period ID |
iiPeriodYear | input | integer | Year of the accounting period |
iiPeriodPeriod | input | integer | Period of the accounting period |
blstartPerByPerStartEndDate | input-output | logical | Is query tqPeriodByPeriodStartEndDate already started or not ? |
iiInvoiceCompanyId | input | integer | Company ID of the Debtor Invoice |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
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.