Skip to main content
edited body
Source Link
VijayS91
  • 1.8k
  • 1
  • 20
  • 41

I need to increment each new invoice id by 5, i have tried below code.

But changed all invoices, shipments, orders and credit memos.

I need each new invoice id increment by 5, shipments increment by 5 and credit memos increment by 3.

Also sales order increment by 1(normal).

How can i do this ?.?

Any one help me.

class Mage_Eav_Model_Entity_Increment_Numeric extends Mage_Eav_Model_Entity_Increment_Abstract    
{
   public function getNextId()
    {
        $last = $this->getLastId();

        if (strpos($last, $this->getPrefix()) === 0) {
            $last = (int)substr($last, strlen($this->getPrefix()));
        } else {
            $last = (int)$last;
        }

        $next = $last + 5;

        return $this->format($next);
    }
}

I need to increment each new invoice id by 5, i have tried below code.

But changed all invoices, shipments, orders and credit memos.

I need each new invoice id increment by 5, shipments increment by 5 and credit memos increment by 3.

Also sales order increment by 1(normal).

How can i do this ?.

Any one help me.

class Mage_Eav_Model_Entity_Increment_Numeric extends Mage_Eav_Model_Entity_Increment_Abstract    
{
   public function getNextId()
    {
        $last = $this->getLastId();

        if (strpos($last, $this->getPrefix()) === 0) {
            $last = (int)substr($last, strlen($this->getPrefix()));
        } else {
            $last = (int)$last;
        }

        $next = $last + 5;

        return $this->format($next);
    }
}

I need to increment each new invoice id by 5, i have tried below code.

But changed all invoices, shipments, orders and credit memos.

I need each new invoice id increment by 5, shipments increment by 5 and credit memos increment by 3.

Also sales order increment by 1(normal).

How can i do this .?

Any one help me.

class Mage_Eav_Model_Entity_Increment_Numeric extends Mage_Eav_Model_Entity_Increment_Abstract    
{
   public function getNextId()
    {
        $last = $this->getLastId();

        if (strpos($last, $this->getPrefix()) === 0) {
            $last = (int)substr($last, strlen($this->getPrefix()));
        } else {
            $last = (int)$last;
        }

        $next = $last + 5;

        return $this->format($next);
    }
}
edited tags
Link
VijayS91
  • 1.8k
  • 1
  • 20
  • 41
Tweeted twitter.com/#!/StackMagento/status/495101145770369024
Source Link
VijayS91
  • 1.8k
  • 1
  • 20
  • 41

Magento Each New Invoice Increment Id Increment By 5?

I need to increment each new invoice id by 5, i have tried below code.

But changed all invoices, shipments, orders and credit memos.

I need each new invoice id increment by 5, shipments increment by 5 and credit memos increment by 3.

Also sales order increment by 1(normal).

How can i do this ?.

Any one help me.

class Mage_Eav_Model_Entity_Increment_Numeric extends Mage_Eav_Model_Entity_Increment_Abstract    
{
   public function getNextId()
    {
        $last = $this->getLastId();

        if (strpos($last, $this->getPrefix()) === 0) {
            $last = (int)substr($last, strlen($this->getPrefix()));
        } else {
            $last = (int)$last;
        }

        $next = $last + 5;

        return $this->format($next);
    }
}