From 86ce4315be47810bb50e2167ef002abd49c56e62 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Mon, 7 Sep 2020 15:19:58 +0200 Subject: [PATCH 1/8] FIX load default linked options for linked sellist extra fields --- htdocs/core/class/commonobject.class.php | 1 + htdocs/core/tpl/extrafields_view.tpl.php | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 103d704a546..ba99831c5b1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6571,6 +6571,7 @@ abstract class CommonObject $("select[name=\""+parent_list+"\"]").change(function() { showOptions(child_list, parent_list); }); + showOptions(child_list, parent_list); }); } diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index a34308432e4..2618b1e12b4 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -199,6 +199,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] $("select[name=\""+parent_list+"\"]").change(function() { showOptions(child_list, parent_list); }); + showOptions(child_list, parent_list); }); } setListDependencies(); From f2fafe04b67958cf095fb76fc129630beabd1656 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 17 Oct 2020 18:16:03 +0200 Subject: [PATCH 2/8] Update doc --- htdocs/core/class/commonobject.class.php | 4 +++- htdocs/core/tpl/extrafields_view.tpl.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ba99831c5b1..afb6909c340 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6568,10 +6568,12 @@ abstract class CommonObject var parent = $(this).find("option[parent]:first").attr("parent"); var infos = parent.split(":"); var parent_list = infos[0]; + showOptions(child_list, parent_list); + + /* Activate the handler to call showOptions on each future change */ $("select[name=\""+parent_list+"\"]").change(function() { showOptions(child_list, parent_list); }); - showOptions(child_list, parent_list); }); } diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 2618b1e12b4..7ee3e624e58 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -196,10 +196,12 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] var parent = $(this).find("option[parent]:first").attr("parent"); var infos = parent.split(":"); var parent_list = infos[0]; + showOptions(child_list, parent_list); + + /* Activate the handler to call showOptions on each future change */ $("select[name=\""+parent_list+"\"]").change(function() { showOptions(child_list, parent_list); }); - showOptions(child_list, parent_list); }); } setListDependencies(); From 529dfb8dfb0a1ca65a656e10db5d9aae29e57659 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Tue, 20 Oct 2020 16:37:15 +0200 Subject: [PATCH 3/8] FIX 9.0 - supplier proposals as linked objects of events are not correctly fetched --- htdocs/core/lib/functions2.lib.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 37bc6c1cd5e..739370298c0 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1872,6 +1872,12 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='') $classpath = 'fourn/class'; $module='fournisseur'; } + elseif ($objecttype == 'supplier_proposal') { + $classfile = 'supplier_proposal'; + $classname = 'SupplierProposal'; + $classpath = 'supplier_proposal/class'; + $module = 'supplier_proposal'; + } elseif ($objecttype == 'stock') { $classpath = 'product/stock/class'; $classfile='entrepot'; From a232a19e7d7fe0f97cf2288a58d6d23cfe99b8a8 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Thu, 22 Oct 2020 15:16:33 +0200 Subject: [PATCH 4/8] FIX: virtual products: supplier discount was not applied in component list --- htdocs/product/composition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index a3b444db6b7..a22b34d5f6f 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -365,7 +365,7 @@ if ($id > 0 || ! empty($ref)) $total+=$totalline; print ''; - print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($fourn_unitprice, '', '', 0, 0, -1, $conf->currency)); + print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($totalline, '', '', 0, 0, -1, $conf->currency)); print ''; // Best selling price From c2ad40043f88598f803f4eb07acef1cced49326f Mon Sep 17 00:00:00 2001 From: Got2be Date: Thu, 22 Oct 2020 16:10:47 +0200 Subject: [PATCH 5/8] FIX : WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING must not consider services while STOCK_SUPPORTS_SERVICES is empty --- .../triggers/interface_20_modWorkflow_WorkflowManager.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 3af9319c7fa..ca0c4d1f0fc 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -299,6 +299,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers //Build array of quantity ordered by product if (is_array($order->lines) && count($order->lines)>0) { foreach($order->lines as $orderline) { + if(empty($conf->global->STOCK_SUPPORTS_SERVICES) && $orderline->product_type > 0) continue; $qtyordred[$orderline->fk_product]+=$orderline->qty; } } From a9117fe864ffef5a754890d1d145acbe01276697 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2020 16:18:00 +0200 Subject: [PATCH 6/8] Update interface_20_modWorkflow_WorkflowManager.class.php --- .../triggers/interface_20_modWorkflow_WorkflowManager.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index ca0c4d1f0fc..bbdbc06fd76 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -299,7 +299,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers //Build array of quantity ordered by product if (is_array($order->lines) && count($order->lines)>0) { foreach($order->lines as $orderline) { - if(empty($conf->global->STOCK_SUPPORTS_SERVICES) && $orderline->product_type > 0) continue; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES) && $orderline->product_type > 0) continue; $qtyordred[$orderline->fk_product]+=$orderline->qty; } } From 34dd486b6cfb947cada1e1318a99736551a5ab9a Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Thu, 22 Oct 2020 16:18:37 +0200 Subject: [PATCH 7/8] FIX: virtual products: displayed value is by unit --- htdocs/product/composition/card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index a22b34d5f6f..0445844c7ce 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -361,11 +361,12 @@ if ($id > 0 || ! empty($ref)) $fourn_remise_percent = (!empty($product_fourn->fourn_remise_percent)?$product_fourn->fourn_remise_percent:0); $fourn_remise = (!empty($product_fourn->fourn_remise)?$product_fourn->fourn_remise:0); - $totalline=price2num($value['nb'] * ($fourn_unitprice * (1 - $fourn_remise_percent/100) - $fourn_remise), 'MT'); + $unitline = price2num(($fourn_unitprice * (1 - $fourn_remise_percent/100) - $fourn_remise), 'MT'); + $totalline = $value['nb'] * $unitline; $total+=$totalline; print ''; - print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($totalline, '', '', 0, 0, -1, $conf->currency)); + print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($unitline, '', '', 0, 0, -1, $conf->currency)); print ''; // Best selling price From 3369379ba17d80de3adf4922180133378d4143a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Oct 2020 16:34:23 +0200 Subject: [PATCH 8/8] Update card.php --- htdocs/product/composition/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 0445844c7ce..2183fcb3121 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -361,9 +361,9 @@ if ($id > 0 || ! empty($ref)) $fourn_remise_percent = (!empty($product_fourn->fourn_remise_percent)?$product_fourn->fourn_remise_percent:0); $fourn_remise = (!empty($product_fourn->fourn_remise)?$product_fourn->fourn_remise:0); - $unitline = price2num(($fourn_unitprice * (1 - $fourn_remise_percent/100) - $fourn_remise), 'MT'); - $totalline = $value['nb'] * $unitline; - $total+=$totalline; + $unitline = price2num(($fourn_unitprice * (1 - $fourn_remise_percent/100) - $fourn_remise), 'MU'); + $totalline = price2num($value['nb'] * ($fourn_unitprice * (1 - $fourn_remise_percent/100) - $fourn_remise), 'MT'); + $total += $totalline; print ''; print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($unitline, '', '', 0, 0, -1, $conf->currency));