Functional Description
Purpose
This function is used to calculate the Due Date and Discount Due Date of a document when advanced
payment terms are used. Typically, this function should be called from B0000163, after it has been
determined that advanced payment terms were used for a specific document. If advanced payment terms were not
used, the Default Due Date (B0400037) function should be used instead.
Setup Notes and Prerequisites
Valid values for Due Date Rule, Discount Due Date, Document Date, GL Date, and Service Tax Date are
required by this function.
Special Logic
The function uses the "based on date" parameter retrieved from F00142 to decide which of the three
dates passed into the function (Document Date, GL Date, or Service Tax Date) to use for the new due date
calculations.
Technical Specification
Parameters
Item DescriptionI/OReq?Notes
DDRLszDueDateRuleIYThe due date rule.
DDDRszDiscountDueDateRuleIYThe discount due date rule.
DDJjdDiscountDueDateONNew discount due date.
DDJjdNetDueDateONNew due date.
DIVJjdDateInvoiceJIYDocument date.
DGJjdDateForGLandVoucherJULIIYDocument GL date.
DSVJjdServiceTaxDateIYDocument service tax date.
Related Tables
F00142Due Date Rules
F00143Due Date Rules Day Range
Related Functions
B0000149Is Date A Work Date
B0000150Advance Work Days
Processing
Initialize return values.
Validate required parameters.
Open F00142 table.
If table open failed,
Set error.
Else,
Open F00143 table.
If open table failed,
Set error.
Endif.
Endif.
If open table was successful,
Execute CalculateDueDate to calculate Net Due Date.
If CalculateDueDate run successfully,
Execute CalculateDueDate to calculate Discount Due Date.
Endif.
Close tables.
Endif.
Perform function clean-up.
CalculateDueDate
Retrieve the F00142 record for the given date rule.
If retrieval failed,
Set error.
Else,
Load transaction date from the based on date.
If transaction date loaded successfully,
Load date rule parameters.
Execute PerformDateRule to perform date rule calculation.
If PerformDateRule run successfully,
Execute RetrieveDateRange.
Endif.
Perform work day rule calculation by calling B0000149 or
B0000150.
Endif.
Endif.
PerformDateRule
Determine date rule case.
Switch (date rule case),
Case 1: No date rules specified.
Case 2: Fixed days only.
Case 3: Days to add only.
Case 4: Months to add only.
Case 5: Fixed days and months to add.
Case 6: Days to add and months to add.
End Switch.
RetrieveDateRange
Initialize return values.
Validate required parameters.
If validation failed,
Set error.
Else,
Perform data selection on the F00143 table for the given date rule.
If selection failed,
Set error.
Else,
Calculate date range.
Endif.
Endif.
D03021 - New Due Date Calculation
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
szDueDateRule | DDRL | char | NONE | NONE |
A code that specifies how the system calculates either the discount due date or the net due date, depending on how it is assigned to the
| ||||
szDiscountDueDateRule | DDDR | char | NONE | NONE |
The rule that the system uses to calculate the discount due date of a voucher or invoice. | ||||
jdDiscountDueDate | 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
| ||||
jdNetDueDate | 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
| ||||
jdDateInvoiceJ | DIVJ | JDEDATE | NONE | NONE |
The date that either you or the system assigns to an invoice or voucher. This can be either the date of the supplier's invoice to you or the
| ||||
jdDateForGLandVoucherJULIA | DGJ | JDEDATE | NONE | NONE |
A date that identifies the financial period to which the transaction will be posted. You define financial periods for a date pattern code that you
| ||||
jdServiceTaxDate | DSVJ | JDEDATE | NONE | NONE |
A date that indicates when you purchased goods or services, or when you incurred a tax liability. |
B0000149 Is Date A Work Date | ||||
B0000150 Advance Work Days |
F00142 Due Date Rules | ||||
F00143 Due Date Rules Day Range |