sql [magento]为订单,报价单,发票,货件或贷项通知单设置下一个increment_id

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql [magento]为订单,报价单,发票,货件或贷项通知单设置下一个increment_id相关的知识,希望对你有一定的参考价值。

### Orders
```
UPDATE eav_entity_store
  INNER JOIN eav_entity_type
  ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_last_id = '100000020'
WHERE eav_entity_type.entity_type_code = 'order'
  AND eav_entity_store.store_id = 1;
```

### Quotes
```
UPDATE eav_entity_store
  INNER JOIN eav_entity_type
  ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_last_id = '100064999'
WHERE eav_entity_type.entity_type_code = 'quote'
  AND eav_entity_store.store_id = 1;
```

### Invoices
```
UPDATE eav_entity_store
  INNER JOIN eav_entity_type
  ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_last_id = '100064999'
WHERE eav_entity_type.entity_type_code = 'invoice'
  AND eav_entity_store.store_id = 1;
```

### Shipments
```
UPDATE eav_entity_store
  INNER JOIN eav_entity_type
  ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_last_id = '100064999'
WHERE eav_entity_type.entity_type_code = 'shipment'
  AND eav_entity_store.store_id = 1;
```

### Credit Memos
```
UPDATE eav_entity_store
  INNER JOIN eav_entity_type
  ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_last_id = '100064999'
WHERE eav_entity_type.entity_type_code = 'creditmemo'
  AND eav_entity_store.store_id = 1;
```

Font:
https://makandracards.com/magento/8245-set-next-increment-id-for-orders-quotes-invoices-shipments-or-credit-memos
UPDATE eav_entity_store
  INNER JOIN eav_entity_type
  ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_last_id = '100064999'
WHERE eav_entity_type.entity_type_code = 'creditmemo'
  AND eav_entity_store.store_id = 1;

以上是关于sql [magento]为订单,报价单,发票,货件或贷项通知单设置下一个increment_id的主要内容,如果未能解决你的问题,请参考以下文章

数据仓库-订单管理应该注意那些事项?

数据建模草稿/报价/订单/发票

Magento:创建发票编号=订单号的发票?

以编程方式将 Magento 订单标记为完整

Magento 1.9.1.0 订单确认未发送

Magento 中的 Paypal 错误 #10602