Placing invoice details correct in PDF

Before you ask about IDnR Addon see the VirtueMart - Invoice, Delivery Note and Receipt Addon
mivm
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 14 Sep 2009, 22:42

Placing invoice details correct in PDF

Post by mivm »

Hi all

I have a problem placing the invoice details correctly in the pdf document, it seems like there is no offset from the top, all the order lines including totalt are placed in top of the shipping adress and the invoice adress, and I can't figure out where to change this, I have looked in the delivery.pdf.php and in the phoca.tcpdf.php files with no luck so far, could anyone please help my to at lest search in the correct direction :roll:

Please take a look at the axample

Image

By the way, what a nice addon!!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Placing invoice details correct in PDF

Post by Jan »

Hi, maybe you should try to reinstall it (copy the files again) :idea:
If you find Phoca extensions useful, please support the project
drunkmaster
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 15 Sep 2009, 21:14

Re: Placing invoice details correct in PDF

Post by drunkmaster »

I have the exact same problem. Have tried reinstalling about 7 times now. No go!
mivm
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 14 Sep 2009, 22:42

Re: Placing invoice details correct in PDF

Post by mivm »

I think it must be something with an offset for the orderdetails to be set somewhere, but I can't figure out where. I hope someone who really knows how the pdf generation works can answer this.

Someone must have made changes to the default template, or does every body use the default template?

I tryed to reinstall but with no luck :cry:
drunkmaster
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 15 Sep 2009, 21:14

Re: Placing invoice details correct in PDF

Post by drunkmaster »

Any answers out there? Stuck in a rut right now. Any other ideas would be great!
mivm
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 14 Sep 2009, 22:42

Re: Placing invoice details correct in PDF

Post by mivm »

If just anyone could say what file to look in, it would be a great help. I have made small changes to the logo and other small adjustments to the shipping details, but I can't find the values for placing the invoice details. :!:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Placing invoice details correct in PDF

Post by Jan »

the files you can see here:
administrator\components\com_virtuemart\pdf\ (folder)

Jan
If you find Phoca extensions useful, please support the project
mivm
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 14 Sep 2009, 22:42

Re: Placing invoice details correct in PDF

Post by mivm »

I found the solution :twisted: :lol: :P

In the file: administrator/component/com_virtuemart/pdf/delivery.pdf.php

You need to change the following lines:

// PDF
// SKU
$pdf->SetFont($pdfFont,'',7);
$pdf->Cell(15,5,$db->f('order_item_sku'),0,0,'L');

if($d['gen'] == 'bill') {

$pdf->Cell(70,5,$db->f('order_item_name'),0,0,'L');
$pdf->Cell(7,5,$db->f('product_quantity'),0,0,'C');
// $pdf->Cell(8,5,$db->f('product_quantity_delivered'),0,0,'C');
// $pdf->Cell(10,5,$remaining,0,0,'C');
$pdf->Cell(18,5,$pdf->unhtmlentities($CURRENCY_DISPLAY->getFullValue($price_without_tax['item'])),0,0,'R');

$pdf->Cell(19,5,$pdf->unhtmlentities($CURRENCY_DISPLAY->getFullValue($price_without_tax['sum'])),0,0,'R');

$pdf->Cell(12,5,$pdf->unhtmlentities($CURRENCY_DISPLAY->getFullValue($price_tax['sum'])),0,0,'R');

$pdf->Cell(19,5,$pdf->unhtmlentities($CURRENCY_DISPLAY->getFullValue($price_with_tax['sum'])),0,0,'R');
} else {
$pdf->Cell(70,5,$db->f('order_item_name'),0,0,'L');
$pdf->Cell(10,5,$db->f('product_quantity'),0,0,'C');
$pdf->Cell(10,5,$db->f('product_quantity_delivered'),0,0,'C');
$pdf->Cell(20,5,$remaining,0,0,'C');
}

With This:

// PDF
// This is where the order details are placed in the PDF the second number Y in rows: Cell(X,Y,$............. is the
// position of the order details.
// SKU
$pdf->SetFont($pdfFont,'',7);
$pdf->Cell(15,200,$db->f('order_item_sku'),0,0,'L');

if($d['gen'] == 'bill') {

$pdf->Cell(70,200,$db->f('order_item_name'),0,0,'L');
$pdf->Cell(7,200,$db->f('product_quantity'),0,0,'C');
// $pdf->Cell(8,200,$db->f('product_quantity_delivered'),0,0,'C');
// $pdf->Cell(10,200,$remaining,0,0,'C');
$pdf->Cell(18,200,$pdf->unhtmlentities($CURRENCY_DISPLAY->getFullValue($price_without_tax['item'])),0,0,'R');

$pdf->Cell(19,200,$pdf->unhtmlentities($CURRENCY_DISPLAY->getFullValue($price_without_tax['sum'])),0,0,'R');

$pdf->Cell(12,200,$pdf->unhtmlentities($CURRENCY_DISPLAY->getFullValue($price_tax['sum'])),0,0,'R');

$pdf->Cell(19,200,$pdf->unhtmlentities($CURRENCY_DISPLAY->getFullValue($price_with_tax['sum'])),0,0,'R');
} else {
$pdf->Cell(70,200,$db->f('order_item_name'),0,0,'L');
$pdf->Cell(10,200,$db->f('product_quantity'),0,0,'C');
$pdf->Cell(10,200,$db->f('product_quantity_delivered'),0,0,'C');
$pdf->Cell(20,200,$remaining,0,0,'C');
}



And this:

$pdf->Ln(5);
$pdf->SetX(110);
$pdf->SetFont($pdfFont,'B',9);
$pdf->Cell(40,5,$VM_LANG->_('VM_DELIVERY_PRINT_SUBTOTAL_LBL').' :',0,0,'R');
$pdf->SetFont($pdfFont,'',9);
$pdf->Cell(30,5,$pdf->unhtmlentities($CURRENCY_DISPLAY->getFullValue($without_tax['item_total'])),0,0,'R');


with this:

// This is the posistion of the Total values $pdf->Ln(190)
$pdf->Ln(110);
$pdf->SetX(110);
$pdf->SetFont($pdfFont,'B',9);
$pdf->Cell(40,5,$VM_LANG->_('VM_DELIVERY_PRINT_SUBTOTAL_LBL').' :',0,0,'R');
$pdf->SetFont($pdfFont,'',9);
$pdf->Cell(30,5,$pdf->unhtmlentities($CURRENCY_DISPLAY->getFullValue($without_tax['item_total'])),0,0,'R');


Please pay attention to the comments I have made, maybe you will need to adjust these settings a little to fit your report correctly
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Placing invoice details correct in PDF

Post by Jan »

Great, thank you for this guide.

Jan
If you find Phoca extensions useful, please support the project
Post Reply