Functional Description
Purpose
This function computes the Due Date for transactions based on the payment terms.
Setup Notes and Prerequisites
None
Special Logic
None
Technical Specification
Parameters
ItemDescriptionI/OReq?Notes
PTCszPaymentTermsCodeIYPayment Term
DDNJjdDateDiscountDueJulianINThe julian date after
Which the discount is
No longer applicable
DDJjdDateNetDueJulianONThe date on which the
Net balance is due
TRDJjdTransDateIYDate Order/Transaction
Occurred.
Related Tables
F0014 - Payment Terms
Related Functions
None
Processing
If jdTransactionDate is null
IdReturnValue = ER_ERROR
Else
Open the F0014 table
If F0014 not opened
IdReturnValue = ER_ERROR
Else
Fetch the F0014 record for the given payment term
If the fetch is unsuccessful
IdReturnValue = ER_ERROR
Else
Call the internal function I0302_CalculateNetDueDate
To calculate the net due date.
I0302_CalculateDiscountDueDate to calculate the
discount due date.
Close the F0014 table
Internal Function I0302_CalculateNetDueDate - This function takes a date and performs the
calculations to derive the net due date.
Set mnZero = 0
If Net Days to pay is > 0
Perform net days to pay calculation
Else if Discount Payment terms is > 0
Perform discount days to pay calculation
Else if Due Date is not null
Perform due date calculation
Else if ProxDateMonth != 0 or ProxDateDay != 0
Perform prox date calculations
If the due date is over 1 month away
Add number of months between
Else
If the due date is passed the fixed day
jdDateNetDueJulian = jdTransactionDate
If the fixed day is past the end of the month
Due date = last day
Else
Perform transaction date calculations
Return IdReturnValue
Internal Function I0302_CalculateDiscountDueDate - This function takes a date and performs the
calculations to derive the discount due date.
Set mnZero = 0
If DiscountPaymentTerms > 0
Perform discount days to pay calculation
Else
Perform net due date calculation
Return IdReturnValue
D0400290 - Compute Due Date
^
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
szPaymentTermsCode | PTC | char | NONE | NONE |
A code that specifies the terms of payment, including the percentage of discount available if the invoice is paid by the discount due date.
| ||||
jdDateDiscountDueJulian | DDNJ | JDEDATE | NONE | NONE |
In the Accounts Receivable system, the date that the invoice must be paid to receive the discount. The system calculates the discount due
| ||||
jdDateNetDueJulian | DDJ | JDEDATE | NONE | NONE |
In Accounts Receivable, the date that the net payment is due.
In Accounts Payable, the date that the payment is due to receive a discount
| ||||
jdTransactionDate | TRDJ | JDEDATE | NONE | NONE |
The date that an order was entered into the system. This date determines which effective level the system uses for inventory pricing. |
None |
F0014 Payment Terms |