noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 01/01: Bug : Bank , no warning if balance inc


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 01/01: Bug : Bank , no warning if balance incorrect when the first amount is 0 Protect $_REQUEST , do no replace the first amount when it is corrected
Date: Mon, 22 Mar 2021 12:55:03 -0400 (EDT)

sparkyx pushed a commit to tag rel8101
in repository noalyss.

commit 0150e4e88d8b24e06155a0f3145a2ff011bc2f2c
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Wed Feb 24 13:37:19 2021 +0100

    Bug : Bank , no warning if balance incorrect when the first amount is 0
    Protect $_REQUEST , do no replace the first amount when it is corrected
---
 include/class/acc_ledger_fin.class.php | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/include/class/acc_ledger_fin.class.php 
b/include/class/acc_ledger_fin.class.php
index de48fcb..1aea14b 100644
--- a/include/class/acc_ledger_fin.class.php
+++ b/include/class/acc_ledger_fin.class.php
@@ -218,16 +218,23 @@ class Acc_Ledger_Fin extends Acc_Ledger
                        throw new Exception('Il n\'y a aucune opération', 12);
 
                /* Check if the last_saldo and first_saldo are correct */
-               if (strlen(trim($last_sold)) != 0 && isNumber($last_sold) &&
-                               strlen(trim($first_sold)) != 0 && 
isNumber($first_sold))
+               if (strlen(trim($last_sold)) != 0 
+                        && isNumber($last_sold) 
+                        && strlen(trim($first_sold)) != 0 
+                        && isNumber($first_sold)
+                    )
                {
                        $diff = $last_sold - $first_sold;
                        $diff = round($diff, 2) - round($tot_amount, 2);
-                       if ($first_sold != 0 && $last_sold != 0)
+                        $calc=bcadd($first_sold,$tot_amount,4);
+                       if ($first_sold != 0 || $last_sold != 0)
                        {
-                               if ($diff != 0)
-                                       throw new Exception('Le montant de 
l\'extrait est incorrect' .
-                                                       $tot_amount . ' extrait 
' . $diff, 13);
+                               if ($diff != 0) {
+                                       throw new Exception(sprintf( _('Le 
montant de l\'extrait [%s] est incorrect,'.
+                                                " solde calculé [%s] , 
différence de [%s]") ,
+                                                $last_sold,$calc,$diff),13);
+                                    
+                                }
                        }
                }
        }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]