Order tax details in invoice

Before you ask about IDnR Addon see the VirtueMart - Invoice, Delivery Note and Receipt Addon
francois32310
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 31 May 2009, 14:25

Re: Order tax details in invoice

Post by francois32310 »

J'ai essayé ta solution et une fois que j'essaie d'insérer le code dans pdf/delivery.pdf.php j'ai une erreur du style :

Code: Select all

Parse error: syntax error, unexpected $end in /home/www/e2e65de5c07ba90ed6b7f523ac793d77/web/administrator/components/com_virtuemart/pdf/delivery.pdf.php on line 356
Peux tu me dire ou tu l'as mis ?

Merci d'avance


I tried your solution and when I try to insert code into html / delivery.pdf.php I get an error like:


Can you tell me where you have put it in this file ?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Order tax details in invoice

Post by Jan »

Hi, you have an error in your code, try to check it (check if () are ended, it there is not missed ; , etc.

Jan
If you find Phoca extensions useful, please support the project
alex.strachwitz
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 12 Sep 2008, 06:22

Re: Order tax details in invoice

Post by alex.strachwitz »

Thank you, @gmarin for this hack... works fine...

BUT

It only shows the tax rates if an order contains items with different tax rates (e.g. 10% tax products & 20% tax products). It does not give me the details if an order contains only 10% tax products.

What I need is to always show both of my tax rates in my shop, whether they are zero or not.
Where is the IF-CLAUSE I have to change? Why does it not always show both of my tax rate details...

I do call the function

Code: Select all

$pdf->Ln(-5);
	$pdf->Cell(40,5,($pdf->show_tax_details($dbo->f('order_tax_details'), $dbo->f('order_currency'))),0,0,'R');
	$pdf->Ln(5);
	$pdf->SetX(120);
in here

Code: Select all

// Sumarize
if($d['gen'] == 'bill') {
...and not within any other condition resp. if-clause... so no exception here (delivery.pdf.php)

Maybe it is related to the $details variable...?

Help would be much appreciated. Thank You.
gmarin
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 25 Sep 2009, 15:37

Re: Order tax details in invoice

Post by gmarin »

Hi, it's an old post for me.
I don't work more on this project but try this :
function show_tax_details( $details, $currency = '' ) {
global $discount_factor, $CURRENCY_DISPLAY, $VM_LANG;

if( !isset( $discount_factor) || !empty($_REQUEST['discount_factor'])) {
$discount_factor = 1;
}
$auth = $_SESSION['auth'];
if( !is_array( $details )) {
$details = @unserialize( $details );
if( !is_array($details)) {
return false;
}
}
//if( sizeof( $details) > 1 ) {
$this->Ln(5);
$this->SetX(110);
$this->SetFont($fD['font'],'B',9);
$this->Cell(40,5,$VM_LANG->_('VM_TAXDETAILS_LABEL'),0,0,'R');
foreach ($details as $rate => $value ) {
if( !$auth['show_price_including_tax']) {
$value /= $discount_factor;
}
$this->Ln(5);
$this->SetFont($pdfFont,'',9);
$this->SetX(130);
$rate = str_replace( '-', $CURRENCY_DISPLAY->decimal, $rate )*100;
$this->Cell(40,5,$CURRENCY_DISPLAY->getFullValue( $value, 5, $currency ).' ('.$rate.'% '.$VM_LANG->_('PHPSHOP_CART_TAX').')',0,0,'R');
}
//}
}

In the original code, I check if the tax is empty to print it
I hope I help you
Cordialement
Gilbert
alex.strachwitz
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 12 Sep 2008, 06:22

Re: Order tax details in invoice

Post by alex.strachwitz »

Ça y est! Je vous prie de bien vouloir recevoir mes salutations distinguées.

SOLVED!
numero7
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 04 Jun 2010, 10:41

Re: Order tax details in invoice

Post by numero7 »

Hello I bring this post back to life :-)

I've succeed with the gmarin code to print Vat rates details on the bill, thank you for your help :-) but I have a problem now.

The rate detail printed is not right but the calculation is right.
I have 7,6% Vat and it state 8% in my order... I think IDNR round the rate but I really need to print the correct rate...

The rate is correctly printed in my basket and all modules in virtuemart, I only have this problem on my pdf bill

Could you help me ?

many thanks
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Order tax details in invoice

Post by Jan »

Hi, then try to see:
plugins\phocapdf\virtuemart\virtuemartpdfoutput.php
plugins\phocapdf\virtuemart\virtuemarthelper.php

and try to modify it there (this is new version of the addon)
If you find Phoca extensions useful, please support the project
bcoelho
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 12 Jun 2011, 17:54

Re: Order tax details in invoice

Post by bcoelho »

I have started a thread about applying this method to the new version of IDnR here: viewtopic.php?f=27&t=16019
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Order tax details in invoice

Post by Jan »

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