From d6a9da57e11d64ecb68f21437c50fd2e0c0e7d44 Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 1 Oct 2018 14:11:19 +0200 Subject: [PATCH 1/2] FIX : need to round with 2 decimals to avoid movements not correctly balanced --- htdocs/accountancy/bookkeeping/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 9dcb924779e..50af8a6855d 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -651,8 +651,8 @@ if ($action == 'create') print "\n"; } - $total_debit = price2num($total_debit); - $total_credit = price2num($total_credit); + $total_debit = price2num($total_debit, 2); + $total_credit = price2num($total_credit, 2); if ($total_debit != $total_credit) { From 2142ccee8a6490257e06135d87aef8a6f38b7f94 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 8 Feb 2019 15:17:40 +0100 Subject: [PATCH 2/2] FIX : better method --- htdocs/accountancy/bookkeeping/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 50af8a6855d..67217954467 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -651,8 +651,8 @@ if ($action == 'create') print "\n"; } - $total_debit = price2num($total_debit, 2); - $total_credit = price2num($total_credit, 2); + $total_debit = price2num($total_debit, 'MT'); + $total_credit = price2num($total_credit, 'MT'); if ($total_debit != $total_credit) {