0

I have a order with canceled order items in it. As an example:
Item 1 = 10 euro
Item 2 = 20 euro
Item 3 = 30 euro

Now the items 2 and 3 are canceled.
The grand_total should now be 10 Euro.

But when I create an invoice programmatically the invoice is always 60 euro.

To create my invoice I create a new Mage_Sales_Model_Order $order and use this for my invoice. But inside that model there are also the canceled items and so my invoice is always wrong.

3
  • What's the code you programmatically create your invoice with? The prepareInvoice method in the Order model knows which items are canceled, see Mage_Sales_Model_Order_Item::getQtyToInvoice Commented Mar 30, 2015 at 15:25
  • Sorry my fault. The quantity is correct. The problem is the total. In my invoice I only see the confirmed item but the total is from all items. Commented Mar 31, 2015 at 7:29
  • I think this is why Magento will cancel the whole order and create a new order with just the products needed, then you will be fine
    – Jeroen
    Commented Apr 8, 2015 at 19:14

1 Answer 1

1

Magento creates always an invoice with all items and creditmemos with the canceled ones, together you get the sums you expect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.