1

How can I have the same number count for invoice and credit memo in Magento? magento use two different counters, I need an univocal count number for invoices and credit memos.

thanks

edit: fixed text

Infrid
  • 723
  • 5
  • 12
  • 28

3 Answers3

0

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.

Max
  • 8,671
  • 4
  • 33
  • 46
0

I think the extension Fooman_SameOrderInvoiceNumber should help you.

Simon
  • 4,103
  • 7
  • 28
  • 53
  • I've explained badly sorry. In a default magento installation you can have invoice orders and credit memos with the same number id. Magento pick up an id from a counter, there are two counters for invoice and credit memo numbers. This leads to have memos and invoice with the same number. Conceptually speaking there's nothing wrong with that because there are two different things, but for my needs I must have an unique number for both entities. – Infrid Sep 05 '11 at 14:26
0

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);

  } 
Infrid
  • 723
  • 5
  • 12
  • 28