// Quantity from BOM (technical value) $qty = (float) $bom->lines[$i]->qty; $qtytot = (float) ($object->qty * $qty); // Domyślne wartości do wyświetlenia $disp_qty = $qty; $disp_qtytot = $qtytot; /* * KOSMETYKA: * - jeśli BOM ma qty = 0.5 (pół SF na 1 FG), * to na wydruku chcemy widzieć: * Qty = 1, Qty total = ilość FG (object->qty) * * - dla normalnej produkcji 1:1 (qty = 1) * warunek się nie wykona i wszystko zostaje jak było. */ if (abs($qty - 0.5) < 1e-6) { $disp_qty = 1; $disp_qtytot = (float) $object->qty; } // Quantity // Enough for 6 chars if ($this->getColumnStatus('qty')) { $this->printStdColumnContent($pdf, $curY, 'qty', (string) $disp_qty); $nexY = max($pdf->GetY(), $nexY); } // Quantity total // Enough for 6 chars if ($this->getColumnStatus('qtytot')) { $this->printStdColumnContent($pdf, $curY, 'qtytot', (string) $disp_qtytot); $nexY = max($pdf->GetY(), $nexY); }