FIX Better compatible fix for the trouble of weight / size units

This commit is contained in:
Laurent Destailleur
2019-10-22 18:36:36 +02:00
parent b88968520b
commit e7e9898e0d
17 changed files with 82 additions and 74 deletions

View File

@@ -450,12 +450,12 @@ class pdf_squille extends ModelePdfReception
$weighttxt='';
if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->product->weight)
{
$weighttxt=round($object->lines[$i]->product->weight * $object->lines[$i]->qty, 5).' '.measuring_units_string($object->lines[$i]->product->weight_units, "weight");
$weighttxt=round($object->lines[$i]->product->weight * $object->lines[$i]->qty, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->product->weight_units);
}
$voltxt='';
if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->product->volume)
{
$voltxt=round($object->lines[$i]->product->volume * $object->lines[$i]->qty, 5).' '.measuring_units_string($object->lines[$i]->product->volume_units?$object->lines[$i]->product->volume_units:0, "volume");
$voltxt=round($object->lines[$i]->product->volume * $object->lines[$i]->qty, 5).' '.measuringUnitString(0, "volume", $object->lines[$i]->product->volume_units?$object->lines[$i]->product->volume_units:0);
}
$pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt, 0, 0, false, true, 'C');