From 2ac8bd4e1629f27e5f5c745ade6db6f0b3933fd3 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 17 Sep 2019 11:59:58 +0200 Subject: [PATCH 1/5] FIX : If we share invoice, we need to see discount created from a deposit on each entity --- htdocs/core/class/discount.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 2e99a83ec42..d464e986c32 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -91,7 +91,7 @@ class DiscountAbsolute $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as sr"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON sr.fk_facture_source = f.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fsup ON sr.fk_invoice_supplier_source = fsup.rowid"; - $sql.= " WHERE sr.entity = " . $conf->entity; + $sql.= " WHERE sr.entity IN (".getEntity('invoice').")"; if ($rowid) $sql.= " AND sr.rowid=".$rowid; if ($fk_facture_source) $sql.= " AND sr.fk_facture_source=".$fk_facture_source; if ($fk_invoice_supplier_source) $sql.= " AND sr.fk_invoice_supplier_source=".$fk_invoice_supplier_source; From d40534e8fadf0a11034010bb27b53b8b70290294 Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 19 Sep 2019 15:21:52 +0200 Subject: [PATCH 2/5] FIX : change product type must be allowed if we activate hidden conf --- htdocs/product/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 1e6995fff35..f03a6db0e17 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1597,7 +1597,9 @@ else { // TODO change for compatibility with edit in place $typeformat='select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service"); - print ''.$form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat).''; + print ''; + print (!empty($conf->global->MAIN_ALLOW_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type'); + print ''; print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat); print ''; } From 2167e7ed98b2b5085e1cb7d9ef6fc677ba3dbde6 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 1 Oct 2019 09:12:51 +0200 Subject: [PATCH 3/5] FIX : hidden conf to prevent from changing product_type --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index f03a6db0e17..406fb970016 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1598,7 +1598,7 @@ else // TODO change for compatibility with edit in place $typeformat='select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service"); print ''; - print (!empty($conf->global->MAIN_ALLOW_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type'); + print (empty($conf->global->MAIN_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type'); print ''; print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat); print ''; From d448998762dce672c082d95286095b440e34bd11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Oct 2019 14:41:25 +0200 Subject: [PATCH 4/5] Update card.php --- htdocs/product/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 406fb970016..244f8cd4c63 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -12,7 +12,6 @@ * Copyright (C) 2014 Cédric Gross * Copyright (C) 2014-2015 Ferran Marcet * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Charlie Benke * Copyright (C) 2016 Meziane Sof * @@ -1598,7 +1597,7 @@ else // TODO change for compatibility with edit in place $typeformat='select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service"); print ''; - print (empty($conf->global->MAIN_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type'); + print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type'); print ''; print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat); print ''; From ae01bd8f07e43dbcbb8fc5278a0d682e0ef5177e Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 3 Oct 2019 17:23:16 +0200 Subject: [PATCH 5/5] FIX missing begin() --- htdocs/fourn/class/fournisseur.commande.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index f32d9d24c01..eed1bbf9eda 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3363,6 +3363,8 @@ class CommandeFournisseurLigne extends CommonOrderLine $error=0; + $this->db->begin(); + // Mise a jour ligne en base $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; $sql.= " description='".$this->db->escape($this->desc)."'";