Module Invoice Discounts and Charges: Difference between revisions

(New page: Invoice Discounts and Charges module)
 
(Added French Translation)
Tag: 2017 source edit
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
{| class="wikitable"
{| class="wikitable"
|-
|-
!Editor
! Editor
|Dolibarr User Australia
| Dolibarr User Australia
|-
|-
!Module ID
! Module ID
|491730
| 491730
|-
|-
!Version
! Version
|1.0.0
| 1.0.2
|-
|-
!Dolibarr
! Dolibarr
|24
| 23, 24
|-
|-
!Where to get it
! Where to get it
|[https://www.dolistore.com DoliStore] (Invoice Discounts and Charges, free)
| [https://www.dolistore.com/product.php?id=3689&title=invoice-discounts-and-charges DoliStore] (Invoice Discounts and Charges, free)
|-
|-
!Support
! Support
|[mailto:dolibarruseraustralia@gmail.com dolibarruseraustralia@gmail.com]
| [mailto:dolibarruseraustralia@gmail.com dolibarruseraustralia@gmail.com]
|-
|-
!Licence
! Licence
|GPL v3 or later
| 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.
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==
== Named discounts and charges ==


*'''Percentage or amount''', e.g. "Large order 5%", "Loyal customer 2.5%", "Delivery fee $15", "Fuel levy 1.5%".
* '''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.
* '''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.
* '''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.
* '''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.
* '''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.
* '''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==
== Early payment discount ==


*E.g. 2.5% if paid within 7 days: shown on the document and its PDF ("pay by …, pay …, save …").
* 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.
* 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==
== 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.
* 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.
* 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==
== On your PDFs ==


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


==For the administrator==
== 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 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.
* 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…).
* Works with Multicurrency; the tax wording follows the company's country (GST, VAT…).
*A command-line test suite is included (<code>test/run_all.php</code>, every change rolled back).
* A command-line test suite is included (<code>test/run_all.php</code>, every change rolled back).


==Installation==
== 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).
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==
== Compatibility ==


*Dolibarr 24, verified on 24.0.1 (clean install and a production system).
* Dolibarr 23 and 24: verified on 23.0.4 (clean install) and 24.0.1 (clean install and a production system). On Dolibarr 23, an early payment credit keeps the VAT split but not local taxes (Spain's RE / IRPF): Dolibarr 23 has no local tax on customer credits.
*PHP 8.1 or later (tested on 8.3), MySQL / MariaDB.
* PHP 8.1 or later (tested on 8.3), MySQL / MariaDB.
*English. Translations welcome.
* * English and French (French name: Remises et frais sur factures). Translations welcome.


==Screenshots==
== Screenshots ==
<gallery mode="packed" heights="220px">
<gallery mode="packed" heights="220px">
File:DolibarrUserAustralia-InvoiceDiscounts-invoice.png|An invoice: discounts and a charge in the totals box, then the early payment and late fee terms
File:DolibarrUserAustralia-InvoiceDiscounts-invoice.png|An invoice: discounts and a charge in the totals box, then the early payment and late fee terms

Latest revision as of 21:15, 31 October 2026


DolibarrUserAustralia-InvoiceDiscounts-logo.png
Editor Dolibarr User Australia
Module ID 491730
Version 1.0.2
Dolibarr 23, 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 23 and 24: verified on 23.0.4 (clean install) and 24.0.1 (clean install and a production system). On Dolibarr 23, an early payment credit keeps the VAT split but not local taxes (Spain's RE / IRPF): Dolibarr 23 has no local tax on customer credits.
  • PHP 8.1 or later (tested on 8.3), MySQL / MariaDB.
  • * English and French (French name: Remises et frais sur factures). Translations welcome.

Screenshots