';
-
// Shipping Method
if (!empty($conf->expedition->enabled)) {
print '
'.$langs->trans('SendingMethod').'
';
@@ -2148,7 +2148,7 @@ if ($action == 'create' && $usercancreate) {
print '';
} else {
print $object->date ? dol_print_date($object->date, 'day') : ' ';
- if ($object->hasDelay()) {
+ if ($object->hasDelay() && empty($object->delivery_date)) { // If there is a delivery date planned, warning should be on this date
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
}
}
@@ -2176,6 +2176,18 @@ if ($action == 'create' && $usercancreate) {
print '
';
-
// TODO Order mode (how we receive order). Not yet implemented
/*
print '
';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index c479b59cbde..aa940e1f03a 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -5159,7 +5159,8 @@ class Form
print '';
print '';
$this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty);
- print '';
+ print '';
+ print '';
print '';
} else {
if ($selected) {
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 14021292428..235b76aa885 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -5418,15 +5418,16 @@ function price2num($amount, $rounding = '', $option = 0)
/**
* Output a dimension with best unit
*
- * @param float $dimension Dimension
- * @param int $unit Unit scale of dimension (Example: 0=kg, -3=g, -6=mg, 98=ounce, 99=pound, ...)
- * @param string $type 'weight', 'volume', ...
- * @param Translate $outputlangs Translate language object
- * @param int $round -1 = non rounding, x = number of decimal
+ * @param float $dimension Dimension
+ * @param int $unit Unit scale of dimension (Example: 0=kg, -3=g, -6=mg, 98=ounce, 99=pound, ...)
+ * @param string $type 'weight', 'volume', ...
+ * @param Translate $outputlangs Translate language object
+ * @param int $round -1 = non rounding, x = number of decimal
* @param string $forceunitoutput 'no' or numeric (-3, -6, ...) compared to $unit (In most case, this value is value defined into $conf->global->MAIN_WEIGHT_DEFAULT_UNIT)
- * @return string String to show dimensions
+ * @param int $use_short_label 1=Use short label ('g' instead of 'gram'). Short labels are not translated.
+ * @return string String to show dimensions
*/
-function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round = -1, $forceunitoutput = 'no')
+function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round = -1, $forceunitoutput = 'no', $use_short_label = 0)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
@@ -5456,7 +5457,8 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round
$unit = $forceunitoutput;
}*/
- $ret = price($dimension, 0, $outputlangs, 0, 0, $round).' '.measuringUnitString(0, $type, $unit);
+ $ret = price($dimension, 0, $outputlangs, 0, 0, $round);
+ $ret .= ' '.measuringUnitString(0, $type, $unit, $use_short_label, $outputlangs);
return $ret;
}
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index 64cc72a8879..10c838b4c43 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -589,12 +589,12 @@ function measuring_units_string($scale = '', $measuring_style = '', $unit = 0, $
/**
* Return translation label of a unit key
*
- * @param int $unit ID of unit (rowid in llx_c_units table)
- * @param string $measuring_style Style of unit: 'weight', 'volume', ..., '' = 'net_measure' for option PRODUCT_ADD_NET_MEASURE
- * @param string $scale Scale of unit: '0', '-3', '6', ...
- * @param int $use_short_label 1=Use short label ('g' instead of 'gram'). Short labels are not translated.
+ * @param int $unit ID of unit (rowid in llx_c_units table)
+ * @param string $measuring_style Style of unit: 'weight', 'volume', ..., '' = 'net_measure' for option PRODUCT_ADD_NET_MEASURE
+ * @param string $scale Scale of unit: '0', '-3', '6', ...
+ * @param int $use_short_label 1=Use short label ('g' instead of 'gram'). Short labels are not translated.
* @param Translate $outputlangs Language object
- * @return string Unit string
+ * @return string Unit string
* @see formproduct->selectMeasuringUnits()
*/
function measuringUnitString($unit, $measuring_style = '', $scale = '', $use_short_label = 0, $outputlangs = null)
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index b8814450030..66546523f11 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -357,7 +357,7 @@ if ($id > 0 || !empty($ref)) {
print '
'.$langs->trans('Date').'
';
print '
';
print dol_print_date($object->date, 'day');
- if ($object->hasDelay() && empty($object->delivery_date)) {
+ if ($object->hasDelay() && empty($object->delivery_date)) { // If there is a delivery date planned, warning should be on this date
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
}
print '