Page 1 of 2

[v.1.5.1.3] automatically generate invoice number

Posted: Mon Dec 26, 2011 10:25 am
by Melanie
Hi there,

So when an order is placed the invoice number isn't generated automatically unil you press the following tab: [ Create Invoice No. ]

Is there any way to automate this so that it is automatically created when the order is placed?

Is there any reason why it isn't automatically created?

Thanks.

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Tue Dec 27, 2011 1:52 am
by Maansy
Would you like it to generate invoice even if order still pending?
I would like it to auto generate on a completion status.

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Tue Dec 27, 2011 12:40 pm
by Melanie
Yes, as soon as the order is made, as payment is taken right away.

Is there a way of doing this?

Thanks.

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Tue Dec 27, 2011 3:06 pm
by i2Paq
I believe that in 1.5.1.1 or so there was an auto-generate Invoice-number.

It was removed because this is not the way the Invoice-number system should work.

You could download that 1.5.1.1 and adopt the code in your 1.5.1.3

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Tue Jan 24, 2012 2:38 pm
by tooheys
There was a comment in this thread which indicated that the auto generation of invoice numbers would be included in release 1.5.1.2.
http://forum.opencart.com/viewtopic.php ... 4&start=20

Now its 1.5.1.3, is there a reason its not included??

Thanks.

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Tue Jan 24, 2012 7:38 pm
by i2Paq
tooheys wrote: Now its 1.5.1.3, is there a reason its not included??
yes, the reason is the many different laws in country's across the world.

A manual Generate Invoice button is the only way.

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Tue Jan 24, 2012 10:36 pm
by Qphoria
I suppose a simple setting in the setting area could be added:

AutoGenerate Invoice YES/NO

AutoGenerate When Status is: Complete/Processing (multiselect)

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Wed Jan 25, 2012 1:43 am
by straightlight
Qphoria wrote:I suppose a simple setting in the setting area could be added:

AutoGenerate Invoice YES/NO

AutoGenerate When Status is: Complete/Processing (multiselect)
Done. Under Settings - > Option tab at the bottom.

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Wed Jan 25, 2012 8:23 am
by Melanie
Hey straightlight!!!

I tried this modification.

HOWEVER, when I try access SALES ---> ORDERS i get an error:

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfil the request.

Also when I try and access an order from the main page of the dashboard I also get an error.

Please advise.

Thanks, Mel

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Wed Jan 25, 2012 10:12 am
by straightlight
In the admin - > systems - > error logs, what does it report regarding this event ?

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Wed Jan 25, 2012 10:44 am
by jty
Running it on xammp, my error when trying to access sals > orders or view the order from dashboard is:

Code: Select all

Fatal error: Can't use method return value in write context in C:\test\vqmod\vqcache\vq2-admin_controller_sale_order.php on line 93
I've tracked the offending line to be line 116 in the xml. This line:

Code: Select all

if (isset($this->request->get['order_id']) && !empty($this->request->get['order_id']) && isset($this->config->get('config_generate_invoice') && (int)$this->config->get('config_generate_invoice') == 1 && isset($this->config->get('config_invoice_order_statuses')) && is_array($this->config->get('config_invoice_order_statuses')) && !empty($order_status_ids)) {
If I remove all the coditions except for the first if (isset($this->request->get['order_id']), the error goes away. But then of course, the results aren't right. But at least it shows us where to look.

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Wed Jan 25, 2012 10:47 am
by jty
PS: there's nothing in the admin error log and no vqmod error log

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Wed Jan 25, 2012 10:50 am
by straightlight
But then of course, the results aren't right.
Could you be more specific regarding the aren't right ? What is the result that is producing on your end ?

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Wed Jan 25, 2012 11:08 am
by straightlight
I updated the XML file to get rid of the above error.

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Wed Jan 25, 2012 11:45 am
by Melanie
straightlight wrote:I updated the XML file to get rid of the above error.
Thank you, error has gone now.

Waiting for the next order to see it in action :)

Thanks.

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Wed Feb 01, 2012 6:01 am
by tooheys
great. how do you implement the xml file?

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Wed Feb 01, 2012 6:25 am
by straightlight
XML file updated. Thanks to clapiana for reporting a very slight issue in the configuration key. Further evaluation was done regarding the paste over the XML file within the wrong method name from the admin order's controller file. All is working as it should now.

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Wed Feb 01, 2012 6:27 am
by straightlight
tooheys wrote:great. how do you implement the xml file?
You must install VQMod and upload the XML file into your vqmod/xml folder. Then, go to your admin - > system - > Settings - > Option and go to the Option tab. Then, at the bottom, you will see the auto-generate invoice options (2 of them). Then, go to the Sales - > Orders - > Order History after selecting a specific order from the order list. Upon the ones you selected from the settings previously, those settings should match accordingly from your order status history and your invoice number should be generated automatically as such and as soon you click on the Add History button.

Then, see your invoice number on the second tab on the left and you should see the generated invoice number.

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Mon Feb 06, 2012 5:46 pm
by gpcsnet
It's ok, it's working.
But how do I change the number of invoice?
When I use manual where is thi tab [ Create Invoice No. ] ??


Thank you!

Re: [v.1.5.1.3] automatically generate invoice number

Posted: Mon Feb 06, 2012 10:15 pm
by straightlight
The subject title does say automatic does it ? ;)
The Automatic term represents process you don't need to do manually ?