diff --git a/account_reconcile_oca/README.rst b/account_reconcile_oca/README.rst index 1609d9f6a1..1d5ac03fc3 100644 --- a/account_reconcile_oca/README.rst +++ b/account_reconcile_oca/README.rst @@ -1,9 +1,5 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - ===================== -Account Reconcile Oca +Account Reconcile OCA ===================== .. @@ -17,7 +13,7 @@ Account Reconcile Oca .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--reconcile-lightgray.png?logo=github diff --git a/account_reconcile_oca/__manifest__.py b/account_reconcile_oca/__manifest__.py index 151fe2ef51..e70b42d55a 100644 --- a/account_reconcile_oca/__manifest__.py +++ b/account_reconcile_oca/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { - "name": "Account Reconcile Oca", + "name": "Account Reconcile OCA", "summary": """ Reconcile addons for Odoo CE accounting""", "version": "16.0.2.4.8", diff --git a/account_reconcile_oca/static/description/index.html b/account_reconcile_oca/static/description/index.html index 8d120936a2..dc3af4769b 100644 --- a/account_reconcile_oca/static/description/index.html +++ b/account_reconcile_oca/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +Account Reconcile OCA -
+
+

Account Reconcile OCA

- - -Odoo Community Association - -
-

Account Reconcile Oca

-

Beta License: AGPL-3 OCA/account-reconcile Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/account-reconcile Translate me on Weblate Try me on Runboat

This addon allows to reconcile bank statements and account marked as reconcile.

Table of contents

@@ -396,14 +391,14 @@

Account Reconcile Oca

-

Usage

+

Usage

-

Bank reconcile

+

Bank reconcile

Access Invoicing / Dashboard with a user with Full Acounting capabilities. Select reconcile on the journal of your choice.

-

Account reconcile

+

Account reconcile

Access Invoicing / Accounting / Actions / Reconcile All the possible reconcile options will show and you will be able to reconcile properly. You can access the same widget from accounts and Partners.

@@ -413,14 +408,14 @@

Account reconcile

-

Known issues / Roadmap

+

Known issues / Roadmap

The following bugs are already detected:

  • Creation of activities on the chatter do show automatically
-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -428,26 +423,26 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • CreuBlanca
  • Dixmit
-

Contributors

+

Contributors

  • Enric Tobella
-

Other credits

+

Other credits

The system has been improved to handle currency amounts more effectively with the financial support of Sygel Technology.

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -462,6 +457,5 @@

Maintainers

-
diff --git a/account_reconcile_oca/static/src/js/widgets/reconcile_data_widget.esm.js b/account_reconcile_oca/static/src/js/widgets/reconcile_data_widget.esm.js index cd34592e90..c67e7966c4 100644 --- a/account_reconcile_oca/static/src/js/widgets/reconcile_data_widget.esm.js +++ b/account_reconcile_oca/static/src/js/widgets/reconcile_data_widget.esm.js @@ -1,6 +1,7 @@ /** @odoo-module **/ import fieldUtils from "web.field_utils"; +import {float_is_zero} from "web.utils"; import {registry} from "@web/core/registry"; import session from "web.session"; import {useService} from "@web/core/utils/hooks"; @@ -24,6 +25,10 @@ export class AccountReconcileDataWidget extends Component { } getReconcileLines() { var data = this.props.record.data[this.props.name].data; + const totals = {debit: 0, credit: 0}; + if (!data || !data.length) { + return {lines: [], totals}; + } for (var line in data) { data[line].amount_format = fieldUtils.format.monetary( data[line].amount, @@ -64,8 +69,26 @@ export class AccountReconcileDataWidget extends Component { data[line].date_format = fieldUtils.format.date( fieldUtils.parse.date(data[line].date, undefined, {isUTC: true}) ); + totals.debit += data[line].debit || 0; + totals.credit += data[line].credit || 0; + } + totals.balance = totals.debit - totals.credit; + const firstLine = Object.values(data)[0] || {}; + const currency = session.get_currency(firstLine.currency_id); + const decimals = currency.digits[1]; + const hasOpenBalance = !float_is_zero(totals.balance, decimals); + let openDebitFmt = null; + let openCreditFmt = null; + if (totals.balance < 0) { + openDebitFmt = fieldUtils.format.monetary(Math.abs(totals.balance), { + currency: currency, + }); + } else { + openCreditFmt = fieldUtils.format.monetary(totals.balance, { + currency: currency, + }); } - return data; + return {lines: data, hasOpenBalance, openDebitFmt, openCreditFmt}; } onTrashLine(ev, line) { ev.stopPropagation(); diff --git a/account_reconcile_oca/static/src/scss/reconcile.scss b/account_reconcile_oca/static/src/scss/reconcile.scss index 3096e1245d..350e90c102 100644 --- a/account_reconcile_oca/static/src/scss/reconcile.scss +++ b/account_reconcile_oca/static/src/scss/reconcile.scss @@ -88,6 +88,9 @@ &.selected { background-color: rgba($o-brand-primary, 0.2); } + &.suspense { + color: $o-gray-500; + } } } } diff --git a/account_reconcile_oca/static/src/xml/reconcile.xml b/account_reconcile_oca/static/src/xml/reconcile.xml index b6c6263412..d6b8d3597c 100644 --- a/account_reconcile_oca/static/src/xml/reconcile.xml +++ b/account_reconcile_oca/static/src/xml/reconcile.xml @@ -106,9 +106,10 @@ Credit + @@ -183,6 +184,12 @@ + + Open Balance + + + +