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
Please take a look at the axample
By the way, what a nice addon!!
Placing invoice details correct in PDF
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Placing invoice details correct in PDF
Hi, maybe you should try to reinstall it (copy the files again)
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 2
- Joined: 15 Sep 2009, 21:14
Re: Placing invoice details correct in PDF
I have the exact same problem. Have tried reinstalling about 7 times now. No go!
-
- Phoca Newbie
- Posts: 4
- Joined: 14 Sep 2009, 22:42
Re: Placing invoice details correct in PDF
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
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
-
- Phoca Newbie
- Posts: 2
- Joined: 15 Sep 2009, 21:14
Re: Placing invoice details correct in PDF
Any answers out there? Stuck in a rut right now. Any other ideas would be great!
-
- Phoca Newbie
- Posts: 4
- Joined: 14 Sep 2009, 22:42
Re: Placing invoice details correct in PDF
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.
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Placing invoice details correct in PDF
the files you can see here:
administrator\components\com_virtuemart\pdf\ (folder)
Jan
administrator\components\com_virtuemart\pdf\ (folder)
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 4
- Joined: 14 Sep 2009, 22:42
Re: Placing invoice details correct in PDF
I found the solution
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
In the file: administrator/component/com_virtuemart/pdf/delivery.pdf.php
You need to change the following lines:
// 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:
// 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
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Placing invoice details correct in PDF
Great, thank you for this guide.
Jan
Jan
If you find Phoca extensions useful, please support the project