From a529d6fd01c6da6b54891c39825d62194e5ef37f Mon Sep 17 00:00:00 2001 From: Kristof Bernaert Date: Mon, 10 Aug 2026 20:21:04 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20add=20dlv=5Faccount=5Freconciliation=5F?= =?UTF-8?q?rest=5Famount=20=E2=80=94=20show=20rest=20amount=20on=20bank=20?= =?UTF-8?q?reconciliation=20screen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CHANGELOG.md | 14 +++++ .../README.md | 46 ++++++++++++++++ .../ROADMAP.md | 16 ++++++ .../__init__.py | 0 .../__manifest__.py | 29 ++++++++++ .../src/js/reconciliation_rest_amount.js | 55 +++++++++++++++++++ .../src/xml/reconciliation_rest_amount.xml | 18 ++++++ 7 files changed, 178 insertions(+) create mode 100644 dlv_account_reconciliation_rest_amount/CHANGELOG.md create mode 100644 dlv_account_reconciliation_rest_amount/README.md create mode 100644 dlv_account_reconciliation_rest_amount/ROADMAP.md create mode 100644 dlv_account_reconciliation_rest_amount/__init__.py create mode 100644 dlv_account_reconciliation_rest_amount/__manifest__.py create mode 100644 dlv_account_reconciliation_rest_amount/static/src/js/reconciliation_rest_amount.js create mode 100644 dlv_account_reconciliation_rest_amount/static/src/xml/reconciliation_rest_amount.xml diff --git a/dlv_account_reconciliation_rest_amount/CHANGELOG.md b/dlv_account_reconciliation_rest_amount/CHANGELOG.md new file mode 100644 index 0000000..aca6ef9 --- /dev/null +++ b/dlv_account_reconciliation_rest_amount/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.0.0] - 2026-08-10 + +### Added +- Initial release. +- Show the rest (still open) amount in parentheses on the bank + reconciliation screen, for both the bank movement line and any partially + used added invoice/bill line. diff --git a/dlv_account_reconciliation_rest_amount/README.md b/dlv_account_reconciliation_rest_amount/README.md new file mode 100644 index 0000000..8898626 --- /dev/null +++ b/dlv_account_reconciliation_rest_amount/README.md @@ -0,0 +1,46 @@ +# dlv_account_reconciliation_rest_amount + +## Overview + +`dlv_account_reconciliation_rest_amount` extends the standard bank +reconciliation screen (Accounting → Reconciliation) so the still-open +("rest") amount of a line is shown in parentheses next to its total. + +On the reconciliation screen, when a proposed line (the bank movement itself, +or an added invoice/bill) is only partially used to close the statement line, +Odoo shows the full amount struck through and the partial amount used above +it — but not what remains unmatched on that line. This addon adds that +missing number, e.g.: + +``` +€ 1.899,97 +€ 4.486,35 (€ 2.586,38) +``` + +so the user immediately sees that €2.586,38 of that invoice is still +outstanding, without having to search for it elsewhere. + +## How it works + +- `static/src/js/reconciliation_rest_amount.js` patches + `account.ReconciliationRenderer`'s `ManualLineRenderer.update()`. Before + every render, it walks `state.reconciliation_proposition` and, for any line + where `partial_amount` differs from `amount`, computes and formats the + difference as `line.rest_amount_str`. +- `static/src/xml/reconciliation_rest_amount.xml` inherits the shared + `reconciliation.line.mv_line.amount` template (from `account_accountant`) + via xpath and prints `line.rest_amount_str` between parentheses, right + after the existing amount. + +Because both the bank movement (liquidity line) and any added invoice/bill +proposition are rendered through the same loop and template, this single +patch covers both cases. + +## Dependencies + +- `account_accountant` + +## Installation + +Standard addon install/update. No configuration or data is added; the change +is purely visual on the existing reconciliation widget. diff --git a/dlv_account_reconciliation_rest_amount/ROADMAP.md b/dlv_account_reconciliation_rest_amount/ROADMAP.md new file mode 100644 index 0000000..627f96f --- /dev/null +++ b/dlv_account_reconciliation_rest_amount/ROADMAP.md @@ -0,0 +1,16 @@ +# Roadmap + +Planned extensions to the reconciliation rest-amount addon. Items are grouped +by target release and are subject to change. + +## v1.1 — Suggest matching entries by rest amount + +- When a line's rest amount matches (exactly, or within a small tolerance) + another open entry for the same partner, surface it as a suggested match + in the "Match with existing entries" tab instead of requiring the user to + find it manually. + +## Future — Configurable tolerance / rounding + +- Allow a small configurable rounding tolerance when comparing rest amounts, + to account for currency rounding differences. diff --git a/dlv_account_reconciliation_rest_amount/__init__.py b/dlv_account_reconciliation_rest_amount/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/dlv_account_reconciliation_rest_amount/__manifest__.py b/dlv_account_reconciliation_rest_amount/__manifest__.py new file mode 100644 index 0000000..ec6637f --- /dev/null +++ b/dlv_account_reconciliation_rest_amount/__manifest__.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +{ + "name": "Reconciliation Rest Amount", + "summary": "Toon het restbedrag tussen haakjes op het afletterscherm " + "(bank reconciliatie)", + "description": """ +Voegt het restbedrag (verschil tussen het oorspronkelijke bedrag en het reeds +afgeletterde/toegewezen bedrag) tussen haakjes toe aan het bank-afletterscherm, +zowel bij de regel van het bankafschrift (liquidity-line) als bij de +voorgestelde afletteringsregels (bestaande boekingen) die niet volledig +worden ingezet. +""", + "author": "bv Domus La Vila", + "website": "https://domuslavila.eu", + "category": "Accounting/Accounting", + "version": "16.0.1.0.0", + "license": "LGPL-3", + "depends": ["account_accountant"], + "data": [], + "assets": { + "web.assets_backend": [ + "dlv_account_reconciliation_rest_amount/static/src/js/*.js", + "dlv_account_reconciliation_rest_amount/static/src/xml/*.xml", + ], + }, + "installable": True, + "application": False, + "auto_install": False, +} diff --git a/dlv_account_reconciliation_rest_amount/static/src/js/reconciliation_rest_amount.js b/dlv_account_reconciliation_rest_amount/static/src/js/reconciliation_rest_amount.js new file mode 100644 index 0000000..ee080bd --- /dev/null +++ b/dlv_account_reconciliation_rest_amount/static/src/js/reconciliation_rest_amount.js @@ -0,0 +1,55 @@ +odoo.define('dlv_account_reconciliation_rest_amount.reconciliation_renderer', function (require) { +"use strict"; + +/** + * Toont het restbedrag (het verschil tussen het volledige bedrag van een + * regel en het bedrag dat effectief wordt ingezet om af te letteren) tussen + * haakjes op het afletterscherm. + * + * Dit geldt zowel voor de bankbeweging zelf (de liquidity-line) als voor een + * toegevoegde boeking (bv. een aankoopfactuur) waarvan niet het volledige + * bedrag wordt gebruikt (line.partial_amount != line.amount). + */ + +var ReconciliationRenderer = require('account.ReconciliationRenderer'); +var field_utils = require('web.field_utils'); + +ReconciliationRenderer.ManualLineRenderer.include({ + + /** + * @override + */ + update: function (state) { + this._computeRestAmounts(state); + return this._super.apply(this, arguments); + }, + + /** + * Berekent, voor elke regel in de afletteringsvoorstellen die slechts + * gedeeltelijk wordt ingezet, het nog resterende (niet-afgeletterde) + * bedrag en formatteert dit als rest_amount_str. + * + * @private + * @param {Object} state + */ + _computeRestAmounts: function (state) { + var format_options = {currency_id: state.st_line.currency_id}; + _.each(state.reconciliation_proposition, function (line) { + if (!line) { + return; + } + var hasPartialAmount = line.partial_amount && Math.abs(line.partial_amount) !== Math.abs(line.amount); + if (hasPartialAmount) { + var rest = Math.abs(line.amount) - Math.abs(line.partial_amount); + line.rest_amount = rest; + line.rest_amount_str = field_utils.format.monetary(rest, {}, format_options); + } else { + delete line.rest_amount; + delete line.rest_amount_str; + } + }); + }, + +}); + +}); diff --git a/dlv_account_reconciliation_rest_amount/static/src/xml/reconciliation_rest_amount.xml b/dlv_account_reconciliation_rest_amount/static/src/xml/reconciliation_rest_amount.xml new file mode 100644 index 0000000..94dbba3 --- /dev/null +++ b/dlv_account_reconciliation_rest_amount/static/src/xml/reconciliation_rest_amount.xml @@ -0,0 +1,18 @@ + + + + + + () + + +