From 2a412f2c425ec2f69c8ab071f98f5752f87d5153 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 21 Jan 2015 20:48:58 +0100 Subject: [PATCH] =?UTF-8?q?Task=20#1082=20-=20S=C3=A9lection=20d'op=C3=A9r?= =?UTF-8?q?ation=20par=20montant=20impossible=20Test=20the=20amount=20of?= =?UTF-8?q?=20the=20operation=20+=20amount=20of=20details?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/class_acc_ledger.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php index 90d8ddb75..a137dc66b 100644 --- a/include/class_acc_ledger.php +++ b/include/class_acc_ledger.php @@ -2528,7 +2528,7 @@ class Acc_Ledger extends jrn_def_sql $bledger_param= str_replace('"', "'", $bledger_param); $bledger=new ISmallButton('l'); - $bledger->label="choix des journaux"; + $bledger->label=_("choix des journaux"); $bledger->javascript=" show_ledger_choice($bledger_param)"; $f_ledger=$bledger->input(); $hid_jrn=""; @@ -2839,8 +2839,17 @@ class Acc_Ledger extends jrn_def_sql $amount_min > 0 && bccomp($amount_min, $amount_max, 2) == 0) { - $fil_amount = $and . 'jr_grpt_id in ( select distinct j_grpt from jrnx where j_montant = ' . $amount_min . ')'; - $and = " and "; + $fil_amount = $and . ' ( '; + + // Look in detail + $fil_amount .= 'jr_grpt_id in ( select distinct j_grpt from jrnx where j_montant = ' . $amount_min . ') '; + + //and the total operation + $fil_amount .= ' or '; + $fil_amount .= ' jr_montant = '.$amount_min; + + $fil_amount .= ')'; + $and = " and "; } // date if (isset($date_start) && isDate($date_start) != null)