Description
Method to calculate proper due date based on the registration date and the payment condition.
Parameters
icPaymentConditionCode | input | character | |
itPostingDate | input | date | |
otDueDate | output | date | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program6/bexpensenote.p)
assign vhFcComponent = ?.
<M-5 run CalculateDueDiscountDate
(input ? (iiPaymentConditionID),
input icPaymentConditionCode (icPaymentConditionCode),
input itPostingDate (itInvoiceDate),
output otDueDate (otDueDate),
output vtDiscountDueDate (otDiscountDate),
output viFcReturnSuper (oiReturnStatus)) in BPaymentCondition>
if viFcReturnSuper <> 0 then
assign oiReturnStatus = min(-1, viFcReturnSuper).
if otDueDate = ?
then do:
<M-3 run SetMessage
(input #T-4'The system cannot calculate the due date based on the specified credit terms code ($1).':100(1932)t-4# (icMessage),
input icPaymentConditionCode (icArguments),
input '':U (icFieldName),
input '':U (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input '':U (icRowid),
input 'QADFIN-2991':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BExpenseNote>
assign oiReturnStatus = -1.
return.
end.