Post by beerlim » Tue Oct 24, 2017 12:17 pm

System - Settings - Stores - Option Tab
Invoice Prefix is set to : 'INV-2017-00'
I place a test order and this order is given an Order-ID (for example #36).
The order status is pending and in the admin section - Sales - Orders, I edit the order and generate the Invoice: INV-0021
Not what I am expecting, am I missing something here?

/Marcel


New member

Posts

Joined
Tue May 23, 2017 5:39 pm

Post by straightlight » Wed Oct 25, 2017 6:57 am

v3.0.2.0 release does store the invoice prefix from the settings into the order from the checkout confirmation page and from the APi. Unless using an extension, the results you are reporting should not happen by default.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by beerlim » Wed Oct 25, 2017 12:24 pm

I don't have any extensions installed. Do you need any kind of screenshot on this?

/Marcel


New member

Posts

Joined
Tue May 23, 2017 5:39 pm

Post by straightlight » Wed Oct 25, 2017 9:03 pm

Let's try a comparison between checkout and the admin order sales.

In catalog/model/checkout/order.php file,

find:

Code: Select all

$order_id = $this->db->getLastId();
add below:

Code: Select all

$log = new Log('error.log');
		
$log->write('Checkout Order Invoice Prefix: ' . $data['invoice_prefix'] . ' (invoice number not generated yet at this point)');
In admin/model/sale/order.php file,

find:

Code: Select all

return $order_info['invoice_prefix'] . $invoice_no;
add above:

Code: Select all

$log = new Log('error.log');
			
$log->write('Admin Order Invoice Prefix: ' . $order_info['invoice_prefix'] . $invoice_no . ' (invoice number generated)');
In catalog/controller/api/order.php file,

find each instances of:

Code: Select all

// Store Details
add on the first:

Code: Select all

$log = new Log('error.log');
			
$log->write('Admin Add Order Invoice Prefix - API: ' . $order_data['invoice_prefix'] . ' (invoice number not generated yet at this point)');
add on the second:

Code: Select all

$log = new Log('error.log');
			
$log->write('Admin Edit Order Invoice Prefix - API: ' . $order_data['invoice_prefix'] . ' (invoice number not generated yet at this point)');
Then, create a new checkout order. Lastly, go to the admin and redo the activity you first mentioned on your first post. After completing these steps, go to your admin - > system - > maintenance - > error log and see if you notice the new messages of these tests appearing in the logs. If so, this is intended. Once posted the results on the forum, you can remove the steps above.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by beerlim » Thu Oct 26, 2017 12:03 am

Well, wouldn't you know it.
Now it generated: INV-2017-0001
I don't even know how to explain this. Cache ?

/Marcel


New member

Posts

Joined
Tue May 23, 2017 5:39 pm

Post by straightlight » Thu Oct 26, 2017 12:04 am

Possibly. ;)

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by beerlim » Fri Oct 27, 2017 7:13 pm

resolved

/Marcel


New member

Posts

Joined
Tue May 23, 2017 5:39 pm
Who is online

Users browsing this forum: No registered users and 2 guests