[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 21/33: Cosmetic #2082 : OD parfois ajout diff
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 21/33: Cosmetic #2082 : OD parfois ajout différence de change |
Date: |
Thu, 11 Nov 2021 06:02:48 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 0b248e54bab50b7204f08b2390b1807cd2cb0853
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Thu Oct 14 18:54:17 2021 +0200
Cosmetic #2082 : OD parfois ajout différence de change
---
include/class/acc_ledger.class.php | 12 +++++++++---
include/template/ledger_detail_misc.php | 2 +-
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/include/class/acc_ledger.class.php
b/include/class/acc_ledger.class.php
index 778eba8..a9cfcab 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -1394,8 +1394,13 @@ class Acc_Ledger extends jrn_def_sql
$operation_currency->insert();
$tot_amount=bcadd($tot_amount,round($acc_op->amount, 2));
- $tot_deb+=($acc_op->type=='d')?$acc_op->amount:0;
- $tot_cred+=($acc_op->type=='c')?$acc_op->amount:0;
+
+ if ( $acc_op->type == 'd') {
+ $tot_deb=bcadd($tot_deb, $acc_op->amount);
+ }elseif ( $acc_op->type == 'c') {
+ $tot_cred=bcadd($tot_cred,$acc_op->amount);
+ }
+
if ($g_parameter->MY_ANALYTIC!="nu")
{
if ($g_parameter->match_analytic( $poste)==TRUE)
@@ -1420,7 +1425,8 @@ class Acc_Ledger extends jrn_def_sql
}// loop for each item
$acc_end=new Acc_Operation($this->db);
// Check the balance
- if ( $tot_deb != $tot_cred ) {
+ if ( bcsub($tot_deb,$tot_cred,2) != 0 && $currency_code != 0)
+ {
$diff=bcsub($tot_cred, $tot_deb);
// store the difference in currency_rounded_delta
diff --git a/include/template/ledger_detail_misc.php
b/include/template/ledger_detail_misc.php
index d5b723a..46f94bd 100644
--- a/include/template/ledger_detail_misc.php
+++ b/include/template/ledger_detail_misc.php
@@ -192,7 +192,7 @@ $amount_idx=0; $sum_prod_currency=0;
if ( $obj->det->currency_id != 0 ) {
$cur_amount=$cn->get_value("select oc_amount from operation_currency
where j_id=$1",
[$q[$e]['j_id']]);
- $row.=td(nbm($cur_amount,4),' class="num" ');
+ $row.=td(nbm($cur_amount,2),' class="num" ');
}
echo tr($row,$class);
- [Noalyss-commit] [noalyss] 06/33: Bug rounded : show amount in currency with 4 dec., (continued)
- [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, 2021/11/11
- [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 <=
- [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
- [Noalyss-commit] [noalyss] 29/33: Task #0002087: Improve COMPTA/MENUFIN/FREC, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 30/33: Task #0002088: Export PDF de ANCBCC, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 17/33: Cosmetic bug : if no rows found , throw a warning, Dany De Bontridder, 2021/11/11