[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 13/33: Compute.php it happens that the argume
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 13/33: Compute.php it happens that the argument are not numeric |
Date: |
Thu, 11 Nov 2021 06:02:46 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 9556840daeac1a9a1d2f321093aec513b54e095b
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sat Oct 2 16:49:16 2021 +0200
Compute.php it happens that the argument are not numeric
---
html/compute.php | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/html/compute.php b/html/compute.php
index f6f0880..c75b708 100644
--- a/html/compute.php
+++ b/html/compute.php
@@ -48,6 +48,10 @@ foreach (array('t','c','p','q','n','gDossier') as $a)
}
}
+// sometime number uses coma instead of dot for dec
+$p=str_replace(",",".",$p);
+$q=str_replace(",",".",$q);
+
$cn=Dossier::connect();
$User=new User($cn);
$User->Check();
@@ -69,7 +73,11 @@ if ( $t != -1 && isNumber($t) == 1 )
$total=new Acc_Compute();
bcscale(4);
-$amount=round(bcmul($p,$q),2);
+if ( isNUmber($p) && isNumber($q)) {
+ $amount=round(bcmul($p,$q,4),2);
+} else {
+ $amount = 0;
+}
$total->set_parameter('amount',$amount);
if ( $t != -1 && isNumber($t) == 1 )
{
- [Noalyss-commit] [noalyss] 09/33: Rounded for currency, (continued)
- [Noalyss-commit] [noalyss] 09/33: Rounded for currency, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 08/33: Operation details : calcul correctement la différence avec les opérations extournées, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 12/33: Button close for new card, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 06/33: Bug rounded : show amount in currency with 4 dec., Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 10/33: For Misc Operation in currency , show the currency amount / row, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 11/33: Bug for reversed operation when currency are used, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 03/33: Improve HttpInput::extract , the array is set and not passed anymore, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 05/33: Bug : pour non-assujetti , pas de calcul en devise, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 07/33: Bug for reversed operation when currency are used, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 14/33: Typo, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 13/33: Compute.php it happens that the argument are not numeric,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 16/33: Documentation, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 15/33: Bug #2079 : 0002079: Recherche de carte : guillement ne passe pas, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 21/33: Cosmetic #2082 : OD parfois ajout différence de change, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 18/33: Bug : currency_id was nullable script compatible PSQL 10, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 20/33: Cosmetic #0002080 : NOT-FOUND, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 22/33: Cosmetic #0002081: PRINTTVA : l'export PDF de la TVA, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 23/33: Fix : date before 2000 throws an exception, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 25/33: Improve ACC_LEDGER compute internal ledger code in base 36, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 27/33: Operation ANC : Bug with decimal, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 28/33: Bug #2085: Comptabilité analytique : erreur dans les balances croisées, Dany De Bontridder, 2021/11/11