Order tax details in invoice - New Version

Before you ask about IDnR Addon see the VirtueMart - Invoice, Delivery Note and Receipt Addon
bcoelho
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 12 Jun 2011, 17:54

Order tax details in invoice - New Version

Post by bcoelho »

I followed the directions in this old thread ( viewtopic.php?f=27&t=5454 ) to insert sales tax details from the Purchase Order email into the PDF Invoice.

The problem is this old thread applies to the previous version of IDnR and the directions need to be modified for the new version.

Old IDnR = com_virtuemart_IDnR_addon.zip http://joomlacode.org/gf/download/frsre ... _addon.zip

New IDnr = plg_phocapdf_virtuemart_v1.0.1.zip http://joomlacode.org/gf/download/frsre ... v1.0.1.zip

"show_tax_details" function is in /administrator/components/com_virtuemart/classes/ps_checkout.php


The old method inserted the "show_tax_details" function into /administrator/components/com_virtuemart/phoca.tcpdf.php (Which = /plugins/phocapdf/virtuemart/virtuemarthelper.php in the new version.)

The output of the "show_tax_details" function was called in /administrator/components/com_virtuemart/delivery.pdf.php (Which = /plugins/phocapdf/virtuemart/virtuemartpdfoutput.php in the new version.)


Applying the old directions to the new version of IDnR creates this error: Call to a member function f() on a non-object

Does anyone see how to correct this?
bcoelho
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 12 Jun 2011, 17:54

Re: Order tax details in invoice - New Version

Post by bcoelho »

Here is some more info.

If the function is called like this:
PhocaPDFVirtueMartHelper::show_tax_details($db->f('order_tax_details'), $db->f('order_currency'));

The error is: "Fatal error: Call to a member function f() on a non-object"


If it is called like this:
PhocaPDFVirtueMartHelper::show_tax_details($dbb->f('order_tax_details'), $dbb->f('order_currency'));

The error is: "Fatal error: Call to undefined method stdClass::f()"


It looks like $db and $dbb are defined in: /administrator/components/com_virtuemart/classes/ps_delivery.php and /administrator/components/com_virtuemart/classes/ps_order_delivery.php


Now what?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Order tax details in invoice - New Version

Post by Jan »

Hi,
VirtueMart has a specific solution for calling functions, such functions must be defined in database (I don't know why) so maybe try to check if the database table of VM includes such function. :idea:

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