mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
NEW Add option to round weight and volumen on shipment pdf
This commit is contained in:
parent
c8167567ca
commit
37f15cfb42
|
|
@ -686,14 +686,14 @@ class pdf_espadon extends ModelePdfExpedition
|
|||
// weight
|
||||
$weighttxt = '';
|
||||
if (empty($object->lines[$i]->fk_product_type) && $object->lines[$i]->weight) {
|
||||
$weighttxt = round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units, 1);
|
||||
$weighttxt = round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, getDolGlobalInt('SHIPMENT_ROUND_WEIGHT_ON_PDF', 5)).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units, 1);
|
||||
}
|
||||
$voltxt = '';
|
||||
if (empty($object->lines[$i]->fk_product_type) && $object->lines[$i]->volume) {
|
||||
$voltxt = round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "volume", $object->lines[$i]->volume_units ? $object->lines[$i]->volume_units : 0, 1);
|
||||
$voltxt = round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, getDolGlobalInt('SHIPMENT_ROUND_VOLUME_ON_PDF', 5)).' '.measuringUnitString(0, "volume", $object->lines[$i]->volume_units ? $object->lines[$i]->volume_units : 0, 1);
|
||||
}
|
||||
|
||||
|
||||
// weight and volume
|
||||
if ($this->getColumnStatus('weight')) {
|
||||
$this->printStdColumnContent($pdf, $curY, 'weight', $weighttxt.(($weighttxt && $voltxt) ? '<br>' : '').$voltxt);
|
||||
$nexY = max($pdf->GetY(), $nexY);
|
||||
|
|
|
|||
|
|
@ -580,11 +580,11 @@ class pdf_rouget extends ModelePdfExpedition
|
|||
$pdf->SetXY($this->posxweightvol, $curY);
|
||||
$weighttxt = '';
|
||||
if (empty($object->lines[$i]->fk_product_type) && $object->lines[$i]->weight) {
|
||||
$weighttxt = round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units, 1);
|
||||
$weighttxt = round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, getDolGlobalInt('SHIPMENT_ROUND_WEIGHT_ON_PDF', 5)).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units, 1);
|
||||
}
|
||||
$voltxt = '';
|
||||
if (empty($object->lines[$i]->fk_product_type) && $object->lines[$i]->volume) {
|
||||
$voltxt = round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "volume", $object->lines[$i]->volume_units ? $object->lines[$i]->volume_units : 0, 1);
|
||||
$voltxt = round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, getDolGlobalInt('SHIPMENT_ROUND_VOLUME_ON_PDF', 5)).' '.measuringUnitString(0, "volume", $object->lines[$i]->volume_units ? $object->lines[$i]->volume_units : 0, 1);
|
||||
}
|
||||
|
||||
if (!getDolGlobalString('SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME')) {
|
||||
|
|
|
|||
|
|
@ -2164,6 +2164,12 @@ class Expedition extends CommonObject
|
|||
$line->qty_shipped = 4;
|
||||
$line->fk_product = $this->commande->lines[$xnbp]->fk_product;
|
||||
|
||||
$line->weight = 1.123456;
|
||||
$line->weight_units = 0; // kg
|
||||
|
||||
$line->volume = 2.34567;
|
||||
$line->volume_unit = 0;
|
||||
|
||||
$this->lines[] = $line;
|
||||
$xnbp++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user