diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e933c9d82f7..1aba76fe2c2 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6848,6 +6848,9 @@ 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); }); diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index d4b4016a564..62cd73a073c 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1910,6 +1910,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'; diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index e6cbad245d9..e4686310f82 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -214,6 +214,9 @@ 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); }); diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 2e14d0c7f47..5a3081e0e8c 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; } } diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 7693ef9a4de..362d66047f0 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -366,11 +366,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'); - $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 '