Order/invoice custom numbering
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Order/invoice custom numbering
OS: Linux
Aimeos ver: 2021.10.4
Database :MariaDB
How can we change the Order numbering/naming to add 2 or 3 letter prefix to the number generated? thanks.
Aimeos ver: 2021.10.4
Database :MariaDB
How can we change the Order numbering/naming to add 2 or 3 letter prefix to the number generated? thanks.
Re: Order/invoice custom numbering
You can register your own method for formatting the order numbers like described here:
https://aimeos.org/tips/aimeos-2021-10-lts-release/
https://aimeos.org/tips/aimeos-2021-10-lts-release/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Order/invoice custom numbering
I've seen that before, but I would like to know where would one put that code, which files and how would you use it.aimeos wrote: ↑15 Dec 2021, 09:50 You can register your own method for formatting the order numbers like described here:
https://aimeos.org/tips/aimeos-2021-10-lts-release/
What is the syntax of the parameters it accepts and are there any restrictions.
Re: Order/invoice custom numbering
Add them to the AppServiceProvider::boot() method of your Laravel application like you would do for Laravel macros.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Order/invoice custom numbering
Hi,
The sample code in above link works for me when changing syntax 'method' for 'macro'.
Although this changes the ordernumber, it does not change the invoicenumber. I wanted to also format the invoicenumber. At least I was able to change the startnumber in table mshop_local_site, but I am still interested to know if it is also possible to format it like the ordernumber.
thanks in advance
The sample code in above link works for me when changing syntax 'method' for 'macro'.
Code: Select all
use \Aimeos\MShop\Order\Item\Standard as Order;
//below method results in error (method not defined):
Order::method( 'ordernumber', function( \Aimeos\MShop\Order\Item\Iface $order ) {
return 'RE-' . date( 'Y' ) . '-' . $order->getId();
} );
//however when changing as macro it works fine:
Order::macro( 'ordernumber', function( \Aimeos\MShop\Order\Item\Iface $order ) {
return 'RE-' . date( 'Y' ) . '-' . $order->getId();
} );
thanks in advance
System info:
Running Aimeos Laravel: 2022.10
Laravel Framework 9.52
Almalinux
PHP 8.1
Re: Order/invoice custom numbering
"method()" changed to "macro()" in 2022.x+
There's no method for customizing the invoice number in the same way yet but we will add it for the next release. Currently, the only way is to add the code to format the number in all templates where the invoice number is used.
There's no method for customizing the invoice number in the same way yet but we will add it for the next release. Currently, the only way is to add the code to format the number in all templates where the invoice number is used.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Order/invoice custom numbering
Thanks, it all makes sense now
Appreciate the speedy responses, very helpful!
Appreciate the speedy responses, very helpful!
System info:
Running Aimeos Laravel: 2022.10
Laravel Framework 9.52
Almalinux
PHP 8.1