Page 1 of 1

Order tax details in invoice - New Version

Posted: 05 Oct 2011, 20:33
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?

Re: Order tax details in invoice - New Version

Posted: 05 Oct 2011, 21:21
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?

Re: Order tax details in invoice - New Version

Posted: 07 Oct 2011, 19:17
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