Payment Terms and Payment Discounts

Overview

The latest SOFT4Factoring developments in payment terms and payment discounts make discount handling more consistent with Business Central payment terms logic while preserving factoring-specific accounting rules. The feature is controlled by the global setting on the Factoring Setup page, and it can be applied to contacts, agreement debtor/vendor records, agreement records, and factoring invoices.

When the setting is enabled, SOFT4Factoring copies the payment terms setup into the appropriate factoring documents and calculates payment-discount dates automatically. This ensures due dates, discount windows, and discount amounts are calculated consistently across the factoring lifecycle. The system also distinguishes between discount allocation to reserve and discount allocation to balance so the customer and vendor accounting remains aligned with factual collection and release behavior.

Enablement and setup

The global switch is found on the Factoring Setup page and is called:

Use Payment Terms

When this option is enabled, payment terms logic is activated for factoring contacts, agreements, debtors, and invoices. The setup is not a standalone document feature; it acts as a central control that allows the rest of the process to work correctly.

 

FieldPurpose

 

Use Payment Terms

Global switch that enables discount logic and payment-term propagation across factoring documents.

 

Payment terms are defined in standard Business Central and then reused within SOFT4Factoring. The app does not replace the base payment terms engine; it extends it so that factoring-specific records inherit the correct values at the right time.

Defaulting and inheritance

Contact-level default

A contact can store a default payment terms code. This is exposed on the Contact card and is synchronized to the related Customer record when the factoring setup is active.

The field is:

Payment Terms Code

If the contact is updated, the customer record is synchronized automatically so the base customer setup remains aligned with the factoring contact data.

Agreement and debtor/vendor inheritance

The payment terms code can also be set on the agreement itself and on each debtor/vendor record linked to the agreement.

This creates a layered defaulting model:

  • Contact default
  • Agreement debtor/vendor record or agreement record
  • Invoice generated for the factoring agreement

Where the logic is applicable, the invoice inherits the proper payment terms code from the agreement debtor or agreement record itself. For example, a conventional or oil invoice inherits the debtor’s payment terms, while a reverse factoring invoice inherits the agreement’s payment terms.

The relevant fields are:

RecordField

 

Contact

Payment Terms Code

Agreement Debtor/Vendor

Payment Terms Code

Agreement

Payment Terms Code

Factoring Invoice

Payment Terms Code

 


Factoring invoice due date logic

On the factoring invoice, the payment terms are not only stored for reference; they are also used in the calculation of invoice timing and discount date behavior.

When the invoice has a valid payment terms code and a document date, the system evaluates the rules as follows:

  • If the invoice has a valid payment terms code
  • If the document date is filled in
  • If the entry is a receivable-style factored entry
  • If the payment terms setup is active

Then the system calculates:

Due Date

This logic is applied using the standard payment terms due  date calculation formula. 

Payment discount processing flow

A payment discount is granted to the debtor when the factoring invoice is paid within the discount period defined by its payment terms. From the user's perspective, the process consists of three steps: accept the invoice with payment terms, apply the debtor payment to the receivable, and review the resulting discount entries.

Prerequisites

  • Use Payment Terms is enabled on the Factoring Setup page.
  • The Payment Discount source code is filled in on the Source Code Setup page.
  • The payment terms code used has a Discount Date Calculation and Discount % defined.



 

Step 1 — Accept the factoring invoice with payment terms

  • Open the factoring invoice.
  • Make sure the Payment Terms Code field is filled in. It is inherited from the agreement debtor/vendor or agreement, but can be reviewed before acceptance.
  • Accept the invoice.

When the invoice is accepted, the receivable line created for the debtor inherits the payment discount conditions from the factoring invoice — Pmt. Discount Date and Payment Discount %. The resulting customer ledger entry therefore carries a possible payment discount amount and a discount date.

 

Step 2 — Apply the payment using entry application

  • Open the journal line with the debtor payment (collection).
  • Use Apply Entries to open the list of open customer ledger entries.
  • Select the receivable entry created from the factoring invoice. The Pmt. Discount Date and Remaining Pmt. Disc. Possible columns show whether a discount is still available.
  • Set the entry to apply and confirm.
  • Post the journal.

Step 3 — Discount is granted and entries are created

If the discount conditions are satisfied — the payment is posted on or before the Pmt. Discount Date and the payment covers the remaining amount less the possible discount — Business Central grants the payment discount during the application and creates the standard payment discount entries (detailed customer ledger entries with Entry Type = Payment Discount and the related G/L entries).

For each payment discount entry created by Business Central, SOFT4Factoring automatically creates a corresponding factoring entry, tagged with the S4LF Payment Discount source code. This keeps the discount visible in the factoring ledger and in factoring amount calculations.

If the payment is posted after the discount date, or the amount is insufficient, no discount is granted and the receivable is applied as a regular payment.

Allocation to reserve or balance

One of the latest and most important developments is how the system splits the payment discount between reserve and balance when it is posted against a customer payment.

Total discount amount

The system calculates a total discount amount from the customer ledger entry. This value can be positive or negative depending on whether the entry is being applied or unapplied.

The logic is handled in the payment discount calculation routine and can split the result into:

Reserve Discount

Balance Discount

Reserve allocation logic

If the total discount amount is negative during an application flow, the system checks how much reserve is currently available. It calculates the reserve side of the amount that can be absorbed and keeps the remainder for the balance side.

In practical terms:

  • If reserve is available, part of the discount is charged against reserve
  • The remaining amount is treated as balance impact
  • The discount is allocated only within the limit of the available reserve

This is especially relevant when the system is dealing with factoring entries of types such as:

Payable

Advance Payment

Reserve Release

Collection Payment

This prevents payment-discount entries from exceeding the actual available reserve or the current customer collection balance.

Balance allocation logic

If the total discount is positive during an unapplied flow, the system checks whether there are prior reserve release entries created under the payment discount source code and uses those values to determine how much of the total should be assigned to reserve. The remainder is then treated as a balance adjustment.

This ensures that payment discounts are not simply posted as a one-sided customer reduction; they are allocated according to the real structural balance between reserve and balance.

Journal posting behavior

When the system creates payment-discount journal lines, it uses a vendor payment-discount posting pattern with the proper account setup.

The routine:

creates a vendor journal line

  • validates the payment discount credit account
  • sets the source code to Payment Discount
  • fills the description with Payment Discount
  • posts the discount against the correct vendor account
  • applies the discount to the relevant document, agreement, or batch depending on the agreement’s accounting granularity

The posting logic varies by accounting granularity:

Accounting GranularityAllocation Behavior

 

Invoice

Applies to the invoice-level vendor ledger entry

Batch

Uses the batch-level applies-to ID

Agreement

Uses the agreement-level applies-to ID

 

This is important because SOFT4Factoring supports different accounting granularities and the payment-discount journal line must follow the same structure as the underlying invoice or agreement.

Strict accounting and payment tolerance

The project includes additional checks to ensure strict factoring accounting remains intact when payment discounts are involved.

A dedicated event handler checks the payment tolerance logic before the payment-discount calculation is accepted. If the agreement uses strict accounting, the system ensures that the factoring receivable logic is considered before a payment discount is allowed to pass through the standard payment tolerance process.

This is important because SOFT4Factoring deliberately restricts tolerance behavior, especially in receivable scenarios. The app uses a factoring-specific flow so that the payment discount is validated in the context of the factored receivable, not as a generic payment tolerance event.

In effect, strict accounting ensures that:

  • payment discount logic is not bypassed by default tolerance rules
  • factoring receivables are evaluated against the appropriate entry type
  • discount processing remains aligned to the invoice and agreement structure

User workflow

To enable payment terms for factoring

  • Open the Factoring Setup page.
  • Set Use Payment Terms to Yes.
  • Save the setup.

Ensure the relevant payment terms codes are defined in Business Central and assigned to the relevant contact, debtor, or agreement records.

To apply payment terms to a document

Open the contact, debtor/vendor, or agreement card.

  • Review the Payment Terms Code field.
  • Select the payment terms that match the customer’s credit and discount conditions.
  • Save the record.
  • Generate or validate the factoring invoice to ensure the payment terms are inherited correctly.

To review a payment discount

  • Open page Payment Application and check Pmt. Discount Date, Remaining Pmt. Discount Possible.
  • Open page Apply Customer Entries and check Pmt. Discount Date, Remaining Pmt. Discount Possible.

 

Field reference

Factoring Setup

FieldDescription

 

Use Payment Terms

Enables payment term handling in factoring contacts, debtors, agreements, and invoices.

 

Contact

FieldDescription

 

Payment Terms Code

Default payment terms for factoring documents created for the contact.

 

Agreement Debtor/Vendor

FieldDescription

 

Payment Terms Code

Debtor payment terms used when factoring invoices are created.

 

Agreement

FieldDescription

 

Payment Terms Code

Payment terms used for factoring sales invoices billed to the agreement client.

 

Factoring Invoice

FieldDescription

 

Payment Terms Code

Debtor payment terms used to calculate the factoring invoice due date and discount window.