Skip to content

[19.0][ADD] account_supplier_early_payment_discount: early payment discount of the supplier settled by a credit note - #11

Merged
alan196 merged 1 commit into
Jarsa:19.0from
Jarsa-dev:19.0-add-account_supplier_early_payment_discount
Sep 17, 2026
Merged

alan196 merged 1 commit into
Jarsa:19.0from
Jarsa-dev:19.0-add-account_supplier_early_payment_discount

Conversation

@alan196

@alan196 alan196 commented Sep 15, 2026

Copy link
Copy Markdown

New module account_supplier_early_payment_discount.

Suppliers often grant a discount when their bills are paid within a few days, and many of them settle it with a credit note of their own that reaches the company weeks later, if ever. This module keeps that discount on the supplier and on its bills, takes it when the bill is paid in time, and follows up the credit note the supplier owes.

  • Early payment terms on the supplier: up to two chained discounts (2 % and then 1 % take 2.98 %, not 3 %), the days to pay within, and whether they count from the invoice date or from the receipt of the goods.
  • On the vendor bill: the last day to pay to earn the discount and what the discount takes off.
  • Apply Early Payment: posts an internal credit note for the discount (a proportional reversal, so taxes follow) and reconciles it with the bill, so what is left to pay is the net amount.
  • Follow-up: the internal credit note raises a to-do for the Early Payment Credit Notes activity team (mail_activity_team), made of the users of the new group Follow Up Early Payment Credit Notes, until the credit note of the supplier arrives. Accounting managers have the group by default.
  • account.move._early_payment_pay_date() gives the business day the discount is paid on (the business day before when the date falls on a weekend or a holiday of the working calendar of the company). The payment order integration is a separate module, account_payment_order_early_payment_discount, proposed in OCA/bank-payment.

Why not the native early payment discount of the payment terms? It knows a single discount counted from the invoice date and books it as a write-off when the payment is registered. Here there are two chained discounts, a base on the receipt date, a credit note because the supplier issues one, and someone chasing it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U2vJWgfX8LRMaFnszPEhC5

@jarsabot

Copy link
Copy Markdown
    **WARNING**: Could not link to Odoo task. Record ID not found in the title of the MR, supported formats:
{ record type }#{ number }

Available types: 'task#', 't#' (case insensitive)

Examples:

  • task#123

  • i#123

@codecov-commenter

codecov-commenter commented Sep 15, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 95.85799% with 7 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (19.0@5804fc1). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...lier_early_payment_discount/models/account_move.py 91.80% 3 Missing and 2 partials ⚠️
...plier_early_payment_discount/models/res_company.py 89.47% 1 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             19.0      #11   +/-   ##
=======================================
  Coverage        ?   91.25%           
=======================================
  Files           ?       78           
  Lines           ?     2035           
  Branches        ?      230           
=======================================
  Hits            ?     1857           
  Misses          ?       89           
  Partials        ?       89           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alan196
alan196 force-pushed the 19.0-add-account_supplier_early_payment_discount branch 2 times, most recently from 6275d30 to cb336d1 Compare September 15, 2026 22:52
… of the supplier settled by a credit note

Up to two chained discounts on the supplier, days counted from the invoice
or from the receipt, the last day to pay and the discount on the vendor
bill, an internal credit note reconciled with the bill when the discount is
taken, and a to-do for the follow-up team until the credit note of the
supplier arrives.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U2vJWgfX8LRMaFnszPEhC5
@alan196
alan196 force-pushed the 19.0-add-account_supplier_early_payment_discount branch from cb336d1 to e726700 Compare September 17, 2026 17:01
@alan196
alan196 merged commit 635eee7 into Jarsa:19.0 Sep 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants