Your account is limited to posting only in the Pre-Sales Questions forum.
Support forum access is limited to members with a purchase history.

If you are working on behalf of another member, please contact us with the name of the license holder and we will upgrade your account.
   
 
Invoice creation
Posted: 15 June 2010 01:15 PM   [ Ignore ]
Wallflower
Rank
Total Posts:  18
Joined  2010-04-14

Hi,

Got a question. We want to allow for the creation of invoices by the system. I started by using the order weblog and have an invoice template.

I only show the ‘print invoice’ button when a order has a certain status. When a customer succesfully returned from PayPal the order is automatically changed to the complete status. So far so good, but this creates a problem in my case:

In the netherlands and other parts of the EU, we are required to use a sequential invoicenumbering, thus we can not use the ordernumber as an invoicenumber.

To solve this problem we would need to create a function to by using a frontend template that creates a invoice entry on the order succes page (when an order is set to complete).

But this leads to another problem. I have certain products that do not need to be invoiced. If i have only such products in my cart i do not need to show the payment gateways (since, no payment needs to be made) or use a hidden one. You could suggest that i use the Offline Payments gateway, but i already use this gateway for ‘Invoice per regular mail’ and also this gateway sets the order to complete that should trigger the creation of an invoice.

To allow for this i had the following ideas:
- check on the checkout page if a product that has a custom_field set to a certain value (in my case we have private and public products), we show different/hidden payment gateways.

{exp:weblog:entries entry_id="{exp:cartthrob:cart_entry_ids}" search:producttype="noinvoice" limit="1"}
{if 
"{absolute_count}" == "{exp:cartthrob:unique_items_count}"}
SHOW HIDDEN PAYMENT GATEWAY
{if
:elseif no_results || "{absolute_count}" != "{exp:cartthrob:unique_items_count}"}
SHOW REGULAR PAYMENT GATEWAYS
{
/if}
{
/exp:weblog:entries} 

I don’t know if the above works, but i think you’ll get the idea.

- create a new payment gateway, inspired on the Offline Payments module that sets a custom order status, something like Complete-no-invoice.
Any idea how to set a custom status?

- On the order complete page, we check if the status is set to complete (not complete-no-invoice) and launch the createInvoice method. This method creates a new entry in the invoices weblog and preferably relates this entry in the order entry.
Any idea to do this an easy way?

-Later in the my account section, retrieving the invoice shouldn’t be a too big of a problem.

Profile
 
 
Posted: 15 June 2010 01:51 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8342
Joined  2008-09-29

One note, you can set the order number to be sequential in the order options settings. Do you need the invoice numbers to be separately numbered than the standard completed orders?

 Signature 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile
 
 
Posted: 16 June 2010 05:00 AM   [ Ignore ]   [ # 2 ]
Wallflower
Rank
Total Posts:  18
Joined  2010-04-14

Yes, invoicenumbers need to be seperatly numbered from the ordernumbers.

Profile
 
 
Posted: 03 March 2011 03:22 PM   [ Ignore ]   [ # 3 ]
Wallflower
Rank
Total Posts:  3
Joined  2010-06-11

We are currently waiting for Cartthrob EE 2 and I was making sure that it had all the needed features, however as our company is a european company, we will also need to have separate invoice numbers.

In Europe an invoice is different to an order. And European laws state that invoice numbers must follow and must be reset to zero either once a year or once a month.

I use INV110200055 for my numbers

11 : year
03 : month
00055 : number of invoices so far in march 2011

Others will use :

INV1100055
11 : year
00055 : number of invoices so far in 2011

If I receive 20 orders but I don’t receive payment for these orders I cancel the orders, don’t send the product and don’t create an invoice.

This means that the order numbers will be completely different. I can miss a single number and if I refund a customer I keep his invoice and generate a credit statement to cancel the invoice.

Cartthrob can’t work for EU companies if we can’t manage invoice numbers !

Thank you.

Profile
 
 
Posted: 04 March 2011 12:35 PM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8342
Joined  2008-09-29

We’ve added this feature to our “to do” list.

 Signature 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile
 
 
Posted: 04 March 2011 01:29 PM   [ Ignore ]   [ # 5 ]
Wallflower
Rank
Total Posts:  3
Joined  2010-06-11

Thank you !

The way some other e-commerce tools do this is to allow users to change prefix and next invoice number.

[ Edited: 04 March 2011 01:31 PM by Monarobase ]
Profile
 
 
Posted: 05 March 2011 01:01 PM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8342
Joined  2008-09-29

You know, I’d forgotten. Each entry has an entry id that’s always going to be sequential. BUT, the title field also displays the order number. You can set the title’s number to be a sequential invoice id unrelated to the entry id, and you can set the next invoice number either by using a prefix, or by changing the invoice number in the most recent order’s title. 

Here’s the setting:

CartThrob settings > Order Settings > Orders Section > Order Save Options

Set “Order Numbers” to create sequential order numbers

The system will then generate sequential order numbers in the title. Currently the system will look at the last order’s title (order number) and use that as the starting point for the next order number. I admit, that it’d be more straightforward to have a box that says “next invoice number =  10 ” but at the current time we don’t have a setting like that. But you can at least set it.

 Signature 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile