1

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?

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.