helpmeplease Posted December 1, 2010 Share Posted December 1, 2010 Hi,Hope someone can help....I've been trying to sort this without successI'm trying to change the order items are displayed on the PDF invoiceFor example at present the invoice displaysDescription, Reference, U.Price, Qty and TotalIf possible I'd like to move Qty to the first positionSo it readsQty, Description, Reference, U.Price and TotalI've tried switching various bits of code around in the classes/PDF.phpbut I don't really know what I'm doing!Am I updating the correct file?Also is it possible to change the styling of any of elements on the PDF invoice - eg. make Qty bold?Thanks in advanceBrian Link to comment Share on other sites More sharing options...
rocky Posted December 2, 2010 Share Posted December 2, 2010 Change lines 568-572 of classes/PDF.php from: array(self::l('Description'), 'L'), array(self::l('Reference'), 'L'), array(self::l('U. price'), 'R'), array(self::l('Qty'), 'C'), array(self::l('Total'), 'R') to: $this->SetFont(self::fontname(), 'B', 8); array(self::l('Qty'), 'C'), $this->SetFont(self::fontname(), '', 8); array(self::l('Description'), 'L'), array(self::l('Reference'), 'L'), array(self::l('U. price'), 'R'), array(self::l('Total'), 'R') This will move the Qty and make it bold.Also change lines 686-696 from: $before = $this->GetY(); $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']), 'B'); $lineSize = $this->GetY() - $before; $this->SetXY($this->GetX() + $w[0] + ($delivery ? 15 : 0), $this->GetY() - $lineSize); $this->Cell($w[++$i], $lineSize, ($product['product_reference'] ? $product['product_reference'] : '--'), 'B'); if (!$delivery) $this->Cell($w[++$i], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($unit_price, self::$currency, true, false)), 'B', 0, 'R'); $this->Cell($w[++$i], $lineSize, $productQuantity, 'B', 0, 'C'); if (!$delivery) $this->Cell($w[++$i], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($final_price, self::$currency, true, false)), 'B', 0, 'R'); $this->Ln(); to: $before = $this->GetY(); $this->Cell($w[++$i], $lineSize, $productQuantity, 'B', 0, 'C'); $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']), 'B'); $lineSize = $this->GetY() - $before; $this->SetXY($this->GetX() + $w[0] + ($delivery ? 15 : 0), $this->GetY() - $lineSize); $this->Cell($w[++$i], $lineSize, ($product['product_reference'] ? $product['product_reference'] : '--'), 'B'); if (!$delivery) $this->Cell($w[++$i], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($unit_price, self::$currency, true, false)), 'B', 0, 'R'); if (!$delivery) $this->Cell($w[++$i], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($final_price, self::$currency, true, false)), 'B', 0, 'R'); $this->Ln(); This will move the product quantities too. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now