diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 45b8d4bf0c1..8fe4c2c9cc9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7261,6 +7261,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 84670de46d2..1ccc4a2d1fb 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1911,6 +1911,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 f3a181f0b2e..71c561fd644 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -226,6 +226,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 09ae60a69b7..b40900dd6c7 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 547ebce73f8..f35d70be13b 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'); + $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($fourn_unitprice, '', '', 0, 0, -1, $conf->currency)); + print ($notdefined ? '' : ($value['nb'] > 1 ? $value['nb'].'x' : '').price($unitline, '', '', 0, 0, -1, $conf->currency)); print ''; // Best selling price