diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php
index cd5b119cabf..53fef4892f5 100644
--- a/htdocs/bom/class/bom.class.php
+++ b/htdocs/bom/class/bom.class.php
@@ -1378,7 +1378,8 @@ class BOM extends CommonObject
if ($res > 0) {
$bom_child->calculateCosts();
$line->childBom[] = $bom_child;
- $this->total_cost += $bom_child->total_cost * $line->qty;
+ $this->total_cost += price2num($bom_child->total_cost * $line->qty, 'MT');
+ $this->total_cost += $line->total_cost;
} else {
$this->error = $bom_child->error;
return -2;
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index b7087b27288..f35d30963ba 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -261,11 +261,19 @@ if ($resql) {
}
// Qty
+ $label = $sub_bom_product->getLabelOfUnit('long');
if ($sub_bom_line->qty_frozen > 0) {
print '
'.price($sub_bom_line->qty, 0, '', 0, 0).' | ';
+ print '';
+ if ($label !== '') print $langs->trans($label);
+ print ' | ';
print ''.$langs->trans('Yes').' | ';
} else {
print ''.price($sub_bom_line->qty * $line->qty, 0, '', 0, 0).' | ';
+ print '';
+ if ($label !== '') print $langs->trans($label);
+ print ' | ';
+ print '';
print ' | ';
}
@@ -282,13 +290,13 @@ if ($resql) {
// Cost
if (!empty($sub_bom->id)) {
$sub_bom->calculateCosts();
- print ''.price($sub_bom->total_cost * $sub_bom_line->qty * $line->qty).' | ';
+ print ''.price(price2num($sub_bom->total_cost * $sub_bom_line->qty * $line->qty, 'MT')).' | ';
$total_cost+= $sub_bom->total_cost * $sub_bom_line->qty * $line->qty;
} elseif ($sub_bom_product->cost_price > 0) {
- print ''.price($sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty).' | ';
+ print ''.price(price2num($sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty, 'MT')).' | ';
$total_cost+= $sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty;
} elseif ($sub_bom_product->pmp > 0) { // PMP if cost price isn't defined
- print ''.price($sub_bom_product->pmp * $sub_bom_line->qty * $line->qty).' | ';
+ print ''.price(price2num($sub_bom_product->pmp * $sub_bom_line->qty * $line->qty, 'MT')).' | ';
$total_cost.= $sub_bom_product->pmp * $sub_bom_line->qty * $line->qty;
} else { // Minimum purchase price if cost price and PMP aren't defined
$sql_supplier_price = 'SELECT MIN(price) AS min_price, quantity AS qty FROM '.MAIN_DB_PREFIX.'product_fournisseur_price';
@@ -298,7 +306,7 @@ if ($resql) {
$obj = $object->db->fetch_object($resql_supplier_price);
$line_cost = $obj->min_price/$obj->qty * $sub_bom_line->qty * $line->qty;
- print ''.price($line_cost).' | ';
+ print ''.price2num($line_cost, 'MT').' | ';
$total_cost+= $line_cost;
}
}
diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
index ecfb9caad8e..ce410496a81 100644
--- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
@@ -846,12 +846,13 @@ class pdf_espadon extends ModelePdfExpedition
$totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);
}
if ($object->trueVolume) {
- $totalVolumetoshow = showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs);
+ if ($object->volume_units < 50) {
+ $totalVolumetoshow = showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs);
+ } else {
+ $totalVolumetoshow = price($object->trueVolume, 0, $outputlangs, 0, 0).' '.measuringUnitString(0, "volume", $object->volume_units);
+ }
}
-
-
-
if ($this->getColumnStatus('desc')) {
$this->printStdColumnContent($pdf, $tab2_top, 'desc', $outputlangs->transnoentities("Total"));
}
diff --git a/htdocs/core/modules/modBom.class.php b/htdocs/core/modules/modBom.class.php
index 6f2cc7ac4b2..12fc50b5ff3 100644
--- a/htdocs/core/modules/modBom.class.php
+++ b/htdocs/core/modules/modBom.class.php
@@ -422,7 +422,7 @@ class modBom extends DolibarrModules
$this->import_fieldshidden_array[$r] = array('extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'bom_bomline');
$this->import_regex_array[$r] = array();
- $this->import_updatekeys_array[$r] = array('bd.fk_bom' => 'BOM Id');
+ $this->import_updatekeys_array[$r] = array('bd.fk_bom' => 'BOM Id', 'bd.fk_product' => 'ProductRef');
$this->import_convertvalue_array[$r] = array(
'bd.fk_bom' => array(
'rule' => 'fetchidfromref',
diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php
index f0ac5395d9f..db0b90286b7 100644
--- a/htdocs/product/inventory/inventory.php
+++ b/htdocs/product/inventory/inventory.php
@@ -139,7 +139,7 @@ if (empty($reshook)) {
}
// Close inventory by recording the stock movements
- if ($action == 'update' && !empty($user->rights->stock->mouvement->creer)) {
+ if ($action == 'update' && !empty($user->rights->stock->mouvement->creer) && $object->status == $object::STATUS_VALIDATED) {
$stockmovment = new MouvementStock($db);
$stockmovment->setOrigin($object->element, $object->id);
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index dd5ccd7ef0b..12a82c44180 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -790,7 +790,6 @@ class Societe extends CommonObject
public $partnerships = array();
-
/**
* @var Account|string Default BAN account
*/
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 7fc0912a815..4405f379888 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -1995,29 +1995,29 @@ if ($action == 'create') {
// Create an order
if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) && $object->statut == SupplierProposal::STATUS_SIGNED) {
if ($usercancreateorder) {
- print '';
+ print '';
}
}
// Set accepted/refused
if ($object->statut == SupplierProposal::STATUS_VALIDATED && $usercanclose) {
- print 'id.'&action=statut'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#acceptedrefused').'"';
+ print '';
}
// Close
if ($object->statut == SupplierProposal::STATUS_SIGNED && $usercanclose) {
- print 'id.'&action=close'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"';
+ print '';
}
// Clone
if ($usercancreate) {
- print '';
+ print '';
}
// Delete
- print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', ($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) || $usercandelete);
+ print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', (($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) || $usercandelete));
}
}