From 0b13cd17acf2b0f604f2fb386c30adf9b112d091 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Mar 2018 13:55:10 +0200 Subject: [PATCH] FIX Some report have data when several chart of accounts exists FIX Detail per account not visible when total < 0 --- htdocs/compta/resultat/clientfourn.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index f105c11160c..2967e31be76 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -255,6 +255,7 @@ if ($modecompta == 'BOOKKEEPING') $sql.= " WHERE f.numero_compte = aa.account_number"; //$sql.= " AND fk_statut in (1,2)"; $sql.= " AND ".$predefinedgroupwhere; + $sql.= " AND fk_pcg_version = '".$db->escape($charofaccountstring)."'"; $sql.= " AND f.entity = ".$conf->entity; if (! empty($date_start) && ! empty($date_end)) $sql.= " AND f.doc_date >= '".$db->idate($date_start)."' AND f.doc_date <= '".$db->idate($date_end)."'"; @@ -295,7 +296,7 @@ if ($modecompta == 'BOOKKEEPING') if ($showaccountdetail != 'no') { $tmppredefinedgroupwhere="pcg_type = '".$db->escape($objp->pcg_type)."' AND pcg_subtype = '".$db->escape($objp->pcg_subtype)."'"; - $tmppredefinedgroupwhere.= " AND fk_pcg_version = '".$charofaccountstring."'"; + $tmppredefinedgroupwhere.= " AND fk_pcg_version = '".$db->escape($charofaccountstring)."'"; //$tmppredefinedgroupwhere.= " AND thirdparty_code = '".$db->escape($objp->name)."'"; // Get cpts of category/group @@ -312,7 +313,7 @@ if ($modecompta == 'BOOKKEEPING') } - if ($showaccountdetail == 'all' || $resultN > 0) + if ($showaccountdetail == 'all' || $resultN <> 0) { print ''; print '';