From 37a901c061c343e68d7957e27b5bf39ee2d1b99d Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 25 Apr 2018 09:07:23 +0200 Subject: [PATCH] [FIX] account: reconciliation model with Tax 0 - Create the following reconciliation model: Line 1 is 50% of amount, tax is 20% Line 2 is 50% of amount, tax is 0% - Use this reconciliation model to reconcile an amount of 1000. 4 lines are created: - 2 lines for base amount (500) - 1 line for the 20% tax (100) - 1 line for the 0% tax (1000) Obviously, the last line is incorrect, and should be 0. opw-1837049 --- .../static/src/js/reconciliation/reconciliation_model.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/static/src/js/reconciliation/reconciliation_model.js b/addons/account/static/src/js/reconciliation/reconciliation_model.js index dd5c333bef7..796531e9a62 100644 --- a/addons/account/static/src/js/reconciliation/reconciliation_model.js +++ b/addons/account/static/src/js/reconciliation/reconciliation_model.js @@ -964,6 +964,7 @@ var StatementModel = BasicModel.extend({ var formatOptions = { currency_id: line.st_line.currency_id, }; + var amount = values.amount !== undefined ? values.amount : line.balance.amount; var prop = { 'id': _.uniqueId('createLine'), 'label': values.label || line.st_line.name, @@ -975,8 +976,7 @@ var StatementModel = BasicModel.extend({ 'debit': 0, 'credit': 0, 'base_amount': values.amount_type !== "percentage" ? - (values.amount || line.balance.amount) : - line.balance.amount * values.amount / 100, + (amount) : line.balance.amount * values.amount / 100, 'percent': values.amount_type === "percentage" ? values.amount : null, 'link': values.link, 'display': true,