Page 2 of 2

Re: Order tax details in invoice

Posted: 01 Nov 2009, 15:11
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 ?

Re: Order tax details in invoice

Posted: 03 Nov 2009, 11:43
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

Re: Order tax details in invoice

Posted: 03 Mar 2010, 16:10
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.

Re: Order tax details in invoice

Posted: 07 Mar 2010, 12:34
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

Re: Order tax details in invoice

Posted: 07 Mar 2010, 18:16
by alex.strachwitz
Ça y est! Je vous prie de bien vouloir recevoir mes salutations distinguées.

SOLVED!

Re: Order tax details in invoice

Posted: 09 Dec 2010, 10:35
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

Re: Order tax details in invoice

Posted: 14 Dec 2010, 14:56
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)

Re: Order tax details in invoice

Posted: 05 Oct 2011, 21:31
by bcoelho
I have started a thread about applying this method to the new version of IDnR here: viewtopic.php?f=27&t=16019

Re: Order tax details in invoice

Posted: 07 Oct 2011, 19:14
by Jan
Ok