Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: configure order/invoice start number, increment and prefix #1199

Open
f1-outsourcing opened this issue Aug 16, 2021 · 6 comments
Open

Comments

@f1-outsourcing
Copy link

f1-outsourcing commented Aug 16, 2021

Feature description

Maybe nice to set via the command line the

  • order/invoice/shipment start number
  • order/invoice/shipment padding / length
  • order prefix
  • increment on these (I think not possible like on m2, not a sequence, maybe requires module)
  • stores share same increment sequence
@ktomk ktomk changed the title maybe nice to configure order/invoice start number, increment and prefix feature: configure order/invoice start number, increment and prefix Aug 17, 2021
@f1-outsourcing
Copy link
Author

Just curious a bit if this is going to be on the roadmap, and if it is worth waiting for it?

@ktomk
Copy link
Collaborator

ktomk commented Sep 6, 2021

@f1-outsourcing: Would you consider filing a PR for this feature?

@cmuench
Copy link
Member

cmuench commented Sep 6, 2021

@f1-outsourcing There is not really a roadmap for n98-magerun. :-)

@f1-outsourcing
Copy link
Author

f1-outsourcing commented Jan 11, 2022

order padding

change order string lenght from 8 to 6 (is global setting?)


UPDATE eav_entity_type t 
INNER JOIN eav_entity_store s ON (t.entity_type_id=s.entity_type_id)
INNER JOIN core_store cs ON (s.store_id=cs.store_id)
SET t.increment_pad_length=6
WHERE t.entity_type_code='order' and cs.code='en_gb'

increment prefix

$productEntityType = Mage::getModel('eav/entity_type')
    ->loadByCode(Mage_Catalog_Model_Product::ENTITY);
$entityStoreConfig = Mage::getModel('eav/entity_store')
    ->loadByEntityStore($productEntityType->getId(), 0);
$entityStoreConfig->setEntityTypeId($productEntityType->getId())
    ->setStoreId(0)
    ->setIncrementPrefix($prefix)
    ->setIncrementLastId($lastId)
    ->save();

Just store view

UPDATE eav_entity_store s 
INNER JOIN core_store cs ON (s.store_id=cs.store_id)
INNER JOIN eav_entity_type t ON (t.entity_type_id=s.entity_type_id)
SET increment_last_id=concat('XXX',trim(leading increment_prefix from increment_last_id)), increment_prefix='XXX' 
WHERE t.entity_type_code='order' and  cs.code='en_gb'

global(?)

UPDATE eav_entity_store s 
INNER JOIN core_store cs ON (s.store_id=cs.store_id)
INNER JOIN eav_entity_type t ON (t.entity_type_id=s.entity_type_id)
SET increment_last_id=concat('XXX',trim(leading increment_prefix from increment_last_id)), increment_prefix='XXX' 
WHERE t.entity_type_code='order' and cs.code='admin'

https://magento.stackexchange.com/questions/71771/how-to-change-order-increment-prefix

stores share increment sequence

Mage::getModel('eav/entity_type')->loadByCode('invoice')->setIncrementPerStore(false)->save()

UPDATE eav_entity_type t 
INNER JOIN eav_entity_store s ON (t.entity_type_id=s.entity_type_id)
INNER JOIN core_store cs ON (s.store_id=cs.store_id)
SET t.increment_per_store=0
WHERE cs.code='en_gb' and t.entity_type_code='order'

https://magento.stackexchange.com/questions/344/having-multiple-store-views-share-the-same-order-increment-id-number-range

@cmuench
Copy link
Member

cmuench commented Jan 12, 2022

@f1-outsourcing Feel free to create a Pull Request.

@f1-outsourcing
Copy link
Author

Sorry but I am already wasting quite a lot of time getting to know things like magento eg. searching a lot for objects, classes, methods, examples. The only reason why I am doing this myself now, is that the magento development companies I asked to do this, are structurally overcharging me.
It is even so bad that I, without the experience, do some tasks in less hours then they are offering me.
It just does not make sense for me to do something, that someone else with experience does in 1/5th of the time. I am only posting some info here that could be relevant.
When there is some example code it is easier for me, because it is just copying and changing a bit. That is probably how I created the OrderDeleteCommand in the mangento 2 cli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants