Question

On the invoice PDF I need to display a message when VAT is shifted.

In the file app/code/local/Mage/Sales/Model/Order/Pdf/Abstract.php I want to use a variable $vatShifted, that is true or false, and then display the message "VAT shifted" if true.

First thought might be to base this on customer group. That won't work however. I'm using the Pillwax EuVAT module, and based on a valid VAT number for foreign EU customers, it can set the VAT to 0% for customers that do not create or use an account. These customers are assigned to the customer group NOT LOGGED IN, and that group is used for customers that pay tax as well.

I guess the only option is to see if the VAT paid is zero or not. (Better solutions are welcome!) This can be per order item with the message displayed next to the item in the PDF. An easier solution will be to use the total VAT value. VAT will be shifted for all items or for none, and I don't foresee a situation where this will change.

How can I get the total vat value to define $vatShifted?

Was it helpful?

Solution

The solution I found was as follows. In Abstract.php I used var_dump($order) with a die(), and looking for the vat amount of that particular order I found that $order["base_tax_amount"] held the correct value. So based on that, whether it's 0 or not, I display a message in the PDF.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top