Jump to content

Generate 2 different PDF invoices


LinnB

Recommended Posts

Hi,

 

Until I sell for a certain amount, I can't make the customers pay taxes, so i temporarily commented all the "tax incl." of the code that I could find.

I intend to put them back when I reach the amount, but I have a problem with the invoice and the fact that it is generated when the customer clicks on the pdf icon.

I changed the pdf so my first customers won't see the (tax incl.), but after the "switch", if they want to see an old invoice, it will be re-generated with the new template thus with the (tax incl.).

 

I think the solution resides in the pdf-invoice.php file, I would like to put a condition checking the order number and, depending on the result, it will either call the classes/PDF.php file or a copy of it with the tax incl. commented.

 

but how? my php sucks

Link to comment
Share on other sites

ok, I managed to put the condition in and it seems to work:

 

last lines of pdf-invoice.php

else
if (((int)($_GET['id_order'])) > 50)PDF::invoice($order); elseif(((int)($_GET['id_order'])) <= 50)PDF::invoice($order)

 

Here both the orders <=50 and >50 call the same function(or file??) so it's not finished yet.

 

I don't understand the PDF::invoice

 

what file/function does it call?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...