From 8b2bf7e76eb45fcb8291db7b3e0fc6547f8b1d57 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Tue, 8 Nov 2022 15:11:30 +0100 Subject: [PATCH 1/3] Fixe issue in htdocs/core/boxes/box_services_contracts.php --- htdocs/core/boxes/box_services_contracts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 3d1e640f34b..433db55a515 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -124,7 +124,7 @@ class box_services_contracts extends ModeleBoxes $contractlinestatic->label = $objp->label; $contractlinestatic->description = $objp->description; $contractlinestatic->type = $objp->type; - $contractlinestatic->product_id = $objp->product_id; + $contractlinestatic->fk_product = $objp->product_id; $contractlinestatic->product_ref = $objp->product_ref; $contractlinestatic->product_type = $objp->product_type; $contractlinestatic->statut = $objp->contractline_status; From 4881688aa6c18b2d41b664b8714de31a303b118e Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Wed, 9 Nov 2022 19:13:44 +0100 Subject: [PATCH 2/3] fix type of variable from string to object --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index feb27715da2..cb984736b66 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1942,7 +1942,7 @@ class ExtraFields * Return HTML string to print separator extrafield * * @param string $key Key of attribute - * @param string $object Object + * @param object $object Object * @param int $colspan Value of colspan to use (it must includes the first column with title) * @param string $display_type "card" for form display, "line" for document line display (extrafields on propal line, order line, etc...) * @param string $mode Show output ('view') or input ('create' or 'edit') for extrafield From 8f9828ad392026a62c5b894a4bc77726a511e709 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 10 Nov 2022 09:59:25 +0100 Subject: [PATCH 3/3] NEW can sort and preselected best supplier price --- htdocs/core/class/html.form.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 13c99dea052..4a11fb1b0d5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3679,7 +3679,11 @@ class Form $sql .= " AND p.tobuy = 1"; $sql .= " AND s.fournisseur = 1"; $sql .= " AND p.rowid = ".((int) $productid); - $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; + if (empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED)) { + $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; + } else { + $sql .= " ORDER BY pfp.unitprice ASC"; + } dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); $result = $this->db->query($sql); @@ -3701,7 +3705,7 @@ class Form $opt = '