From 96e26100f03bf91ed2338b66b0c456251754256b Mon Sep 17 00:00:00 2001 From: John Date: Wed, 11 Apr 2018 11:06:40 +0200 Subject: [PATCH 1/2] Add extrafield entity query filter --- htdocs/core/class/extrafields.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 9758bb4466b..f5acd43e9d9 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -944,6 +944,10 @@ class ExtraFields $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0]; if (!empty($InfoFieldList[4])) { + // can use curent entity filter + if (strpos($InfoFieldList[4], '$ENTITY$')!==false) { + $InfoFieldList[4]=str_replace('$ENTITY$',$conf->entity,$InfoFieldList[4]); + } // can use SELECT request if (strpos($InfoFieldList[4], '$SEL$')!==false) { $InfoFieldList[4]=str_replace('$SEL$','SELECT',$InfoFieldList[4]); From 6f526eb78087b02ef3617b249e3e4a6b5072b1a1 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Wed, 11 Apr 2018 16:40:59 +0200 Subject: [PATCH 2/2] Fix wrong amount for situation invoice in sellsjournal --- htdocs/accountancy/journal/sellsjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 2d5d65607e2..1186123b194 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -164,7 +164,7 @@ if ($result) { // Situation invoices handling $line = new FactureLigne($db); $line->fetch($obj->fdid); - $prev_progress = $line->get_prev_progress($obj->fdid); + $prev_progress = $line->get_prev_progress($obj->rowid); if ($obj->type == Facture::TYPE_SITUATION) { // Avoid divide by 0 if ($obj->situation_percent == 0) {