From 4c56e36dbd0835b537e2064b57a8a1da11cc9e4a Mon Sep 17 00:00:00 2001 From: sparkyx Date: Fri, 29 Oct 2021 13:22:14 +0200 Subject: [PATCH] =?UTF-8?q?Bug=20#2085:=20Comptabilit=C3=A9=20analytique?= =?UTF-8?q?=20:=20erreur=20dans=20les=20balances=20crois=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/js/anc_script.js | 2 +- include/class/anc_balance_double.class.php | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/html/js/anc_script.js b/html/js/anc_script.js index ea88a6139..dfade1735 100644 --- a/html/js/anc_script.js +++ b/html/js/anc_script.js @@ -48,7 +48,7 @@ function add_row(p_table, p_seq) if (max < amount) { alert_box(content[48]+' '+content[56]+ ' '+max + content[57]+' '+ amount); - return; + } // For the detail view (modify_op) there is several form and then several time the // element diff --git a/include/class/anc_balance_double.class.php b/include/class/anc_balance_double.class.php index feec65727..0218840bc 100644 --- a/include/class/anc_balance_double.class.php +++ b/include/class/anc_balance_double.class.php @@ -151,13 +151,15 @@ class Anc_Balance_Double extends Anc_Print $r.=''.$row['dc'].''; $r.=''; } + $r.=''; $r.=td(''); $r.=td('total'); $r.=td(nbm($tot_deb),'class="num"'); $r.=td(nbm($tot_cred),'class="num"'); $solde=bcsub($tot_cred,$tot_deb); - $sign=($tot_cred<$tot_deb)?" - ":" + "; - $r.=td($sign.nbm($solde),'class="num" style="border:solid 1px blue;font-weight:bold"'); + $sign=($tot_cred<$tot_deb)?_("Débit"):_("Crédit"); + $r.=td(nbm($solde),'class="num" style="border:solid 1px blue;font-weight:bold"'); + $r.=td($sign); $r.=''; $r.=''; @@ -460,14 +462,16 @@ class Anc_Balance_Double extends Anc_Print pb.po_name as b_po_name, sum(a_oa_amount_c) as a_c, sum(a_oa_amount_d) as a_d - from (select + from (select a.j_id, a.po_id as a_po_id, b.po_id as b_po_id, case when a.oa_debit='t' then a.oa_amount else 0 end as a_oa_amount_d, case when a.oa_debit='f' then a.oa_amount else 0 end as a_oa_amount_c from - operation_analytique as a join operation_analytique as b on (a.oa_row=b.oa_row and a.oa_group=b.oa_group) + operation_analytique as a join operation_analytique as b on (a.oa_row=b.oa_row + and a.oa_group=b.oa_group + and a.j_id = b.j_id) join poste_analytique as poa on (a.po_id=poa.po_id) join poste_analytique as pob on (b.po_id=pob.po_id) where poa.pa_id= $1