Module Invoice Discounts and Charges


DolibarrUserAustralia-InvoiceDiscounts-logo.png
Editor Dolibarr User Australia
Module ID 491730
Version 1.0.0
Dolibarr 24
Where to get it DoliStore (Invoice Discounts and Charges, free)
Support dolibarruseraustralia@gmail.com
Licence GPL v3 or later

Dolibarr has a discount per line, and one fixed percentage per customer. Many businesses need more: a discount for large orders, a loyalty or member discount, a delivery fee under a minimum order, a fuel levy, an early payment discount, a late fee. Invoice Discounts and Charges adds them to proposals, orders and invoices as named rules that apply themselves, with the tax worked out correctly.

Named discounts and charges

  • Percentage or amount, e.g. "Large order 5%", "Loyal customer 2.5%", "Delivery fee $15", "Fuel levy 1.5%".
  • Conditions: always, order total at least an amount, or order total under an amount.
  • Who gets it: all customers; customers you tick on their card (a "Discounts & charges" tab); or current members of a membership type (Members module). Optional valid from / to dates.
  • Automatic: applied to draft proposals, orders and invoices and kept up to date as lines are added or changed. Validated documents are never changed.
  • In the totals box: Subtotal, one row per discount or charge, with change / remove for that document only, and an "Add discount/charge" button for one-offs.
  • Tax done right: a discount is split by tax rate in proportion to the lines, so tax is reduced only on the taxed part (local taxes included, e.g. Spain RE/IRPF, India CGST/SGST). A charge carries the standard tax rate. Each rule can post to its own accounting account.

Early payment discount

  • E.g. 2.5% if paid within 7 days: shown on the document and its PDF ("pay by …, pay …, save …").
  • When the customer pays early, one click records the discount as a credit note (adjustment note), split by tax rate, to the expense and tax accounts chosen in the setup. Unlike "Classify paid partially", the tax reduction is backed by a document.

Late payment fee

  • Flat amount, % of the amount overdue, or interest per month or per year (worked out per day, as for statutory late payment interest), after a number of grace days.
  • Raised with a button on the overdue invoice or by a daily scheduled job, on a separate draft invoice or on the customer's next invoice. A "Late payment fees" list shows them all, with waive.

On your PDFs

  • The early payment and late fee terms are printed above the footer of any PDF template.
  • Or exactly where you want them, with substitution variables in the free text, notes, email templates or ODT templates: __DOCDISCOUNT_TERMS__, __DOCDISCOUNT_EARLY__, __DOCDISCOUNT_EARLY_DATE__, __DOCDISCOUNT_EARLY_TOTAL__, __DOCDISCOUNT_EARLY_SAVING__, __DOCDISCOUNT_EARLY_PERCENT__, __DOCDISCOUNT_LATE__.
  • Developers of custom PDF templates can call docdiscount_payment_terms() or docdiscount_terms_text() (see the README in the module).

For the administrator

  • One setup page: named discounts and charges, the early payment discount, the late fee, layout (each discount on its own lines or combined), base (amounts excluding or including tax), default accounting accounts.
  • One permission, "Record early payment discounts, raise and waive late payment fees", not given to new users by default. Adding and removing discounts on drafts only needs the right to create the document.
  • Works with Multicurrency; the tax wording follows the company's country (GST, VAT…).
  • A command-line test suite is included (test/run_all.php, every change rolled back).

Installation

Home → Setup → Modules/Applications → "Deploy/install external app/module", upload the zip, then enable "Invoice Discounts and Charges" (Financial modules) and open its setup (gear icon).

Compatibility

  • Dolibarr 24, verified on 24.0.1 (clean install and a production system).
  • PHP 8.1 or later (tested on 8.3), MySQL / MariaDB.
  • English. Translations welcome.

Screenshots