project QadFinancials > class BDInvoice > method ValidateInvoiceDate
validation procedure
Description
This method validates the invoice date of the debtor invoice.
If the Invoice Date is situated after posting date , then a warning must be given.(except for prepayments)
Parameters
itDinvoiceInvoiceDate | input | date | Invoice date of the debtor invoice |
icRowid | input | character | Contents of field tc_Rowid, if the target field is a field of a component temp-table. |
itDInvoicePostingDate | input | date | posting date of the debtor invoice |
icDInvoiceType | input | character | DInvoice Type |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program5/bdinvoice.p)
if (icDInvoiceType = {&INVOICETYPE-INVOICE} or
icDInvoiceType = {&INVOICETYPE-FINANCECHARGE} or
icDInvoiceType = {&INVOICETYPE-CREDITNOTE} or
icDInvoiceType = {&INVOICETYPE-INVOICECORRECTION} or
icDInvoiceType = {&INVOICETYPE-CREDITNOTECORRECTION}) and
itDinvoiceInvoiceDate > itDInvoicePostingDate
then do:
assign vcDatetemp1 = <M-77 DisplayDate (input itDinvoiceInvoiceDate (itDate)) in BDInvoice>
vcDatetemp2 = <M-18 DisplayDate (input itDInvoicePostingDate (itDate)) in BDInvoice>.
assign vcMessage = trim(substitute(#T-2'The invoice date (&1) is after the posting date (&2).':150(69262)T-2#, vcDatetemp1, vcDatetemp2))
oiReturnStatus = +1.
<M-1 run SetMessage
(input vcMessage (icMessage),
input '':U (icArguments),
input 'tDInvoice.DinvoiceDate':U (icFieldName),
input vcDatetemp1 (icFieldValue),
input 'W':U (icType),
input 3 (iiSeverity),
input icRowid (icRowid),
input 'QADFIN-418':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BDInvoice>
end.