How can I have the same number count for invoice and credit memo in Magento?
How can I have the same number count for invoice and credit memo in Magento? magento use two开发者_如何学Python different counters, I need an univocal count number for invoices and credit memos.
thanks
edit: fixed text
I wouldn't touch that, those numbers are mean to be different on purpose. My site has far more invoices than credit memos. They're just not the same thing.
I think the extension Fooman_SameOrderInvoiceNumber should help you.
I did it, I wrote an observer for change the increment_id
public function sales_order_creditmemo_save_before($observer)
{
$creditmemo = $observer->getCreditmemo();
$order = $creditmemo->getOrder();
$store_id = $order->getStore()->getStoreId();
$entity_type_model=Mage::getSingleton('eav/config')->getEntityType('invoice');
$new_incr_id = $entity_type_model->fetchNewIncrementId($store_id);
$creditmemo->setIncrementId($new_incr_id);
}
精彩评论