From b953d2c4665bd0eb0e8c769189669da6191e7d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 29 Aug 2015 19:42:51 +0200 Subject: [PATCH 1/2] FIX [ bug #3426 ] Unable to create an invoice from a contract with extrafields Close #3426 --- ChangeLog | 1 + htdocs/core/class/commonobject.class.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index f62facbdc36..cf99ec9012f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ FIX: Not showing task extrafields when creating from left menu FIX [ bug #3288 ] Tasks box is not properly drawn FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights +FIX [ bug #3426 ] Unable to create an invoice from a contract with extrafields NEW: Created new ContratLigne::insert function diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4bbe7b3aa98..2b9ad1b20c0 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3375,6 +3375,11 @@ abstract class CommonObject { if (empty($rowid)) $rowid=$this->id; + //To avoid SQL errors. Probably not the better solution though + if (!$this->table_element) { + return 0; + } + if (! is_array($optionsArray)) { // optionsArray not already loaded, so we load it From cf38b17e88f75ed54ffb478ce8d1dde1b8b91fe8 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Mon, 31 Aug 2015 09:18:37 +0200 Subject: [PATCH 2/2] FIX: Bad visualization of suppliers name on Incomes-Expenses mode --- htdocs/compta/resultat/clientfourn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index f389b380b99..b5aab7090d6 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -304,7 +304,7 @@ if ($modecompta == 'CREANCES-DETTES') } else { - $sql = "SELECT s.nom, s.rowid as socid, sum(pf.amount) as amount_ttc"; + $sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p"; $sql.= ", ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f";