Jump to content

Invoice number based on payment method


gizzza

Recommended Posts

Hi,

Looking for a solution where the invoice ID is based on payment method. Now i have seen this thread, but i would like to structure the invoice number so it follows the sequence based on method used.

Example paymentmethod. 
creditcard: 11000, 11001, 11002, 11003 etc...
Banktransfer: 33500, 33501, 33502 etc.
Paypal: 66290, 66291, 66292 etc....

The custom invoice # is just for reference for client - internally in DB is not necessary to re-organize. 

 

Link to comment
Share on other sites

15 hours ago, gizzza said:

Looking for a solution where the invoice ID is based on payment method. Now i have seen this thread, but i would like to structure the invoice number so it follows the sequence based on method used.

I think you would just need to tweak the hook to get the last custom invoice number for the current payment method - if it exists, add 1 to the value and use that as the new custom invoice number; if it doesn't exist, then create a new custom number combining your gateway assigned number(e.g 11 for cc) and 000.

15 hours ago, gizzza said:

The custom invoice # is just for reference for client - internally in DB is not necessary to re-organize. 

no need to reorganise, but you would find it easier to update the custom invoice number value (which would be blank otherwise and the invoice would just use the ID value) in the database - otherwise, multiple other tweaks would be required to modify the three other templates (html, pdf and email).

you'd also have to work out what happens to the next invoice after 11999 - i'm assuming that it either goes to 111000 or 12000 ?

Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated