Can't create Credit Memo from Customer RMA when original invoice is multishipment

Description

Scenario:
iDempiere client processes and ships multiple orders and shipments before creating invoices.
A common scenario is when using an invoice schedule. Shipments daily but weekly invoices.

With this scenario it's not possible to create credit memos from customer RMA because the InvoiceGenerateRMA process draws the conclusion that the shipments have never been invoiced.

Code fix will be attached. It fixed my scenario but it needs some eyeballing.

Environment

None

Activity

Show:

Martin Schönbeck February 3, 2021 at 9:10 AM

Having triaged it myself I now ran into the problem with a customer of mine.

Problem appears as follows:

MRMA.getOriginalInvoice fails.
first it tries to get the invoice from m_inout which is connected to rma m_inout. But no m_inout has a c_invoice_id other than null.
second it tries to get the invoice from c_order, but the invoice, where this order was invoiced was an invoice for two orders and is connected to another order. So this fails, too.

Because we allow to invoice more than one order with one invoice, connection can be done only on line level and of course it must be a line specific to this rma/shipment.

Martin Schönbeck May 9, 2020 at 4:13 PM

triaged by as not reproducible in 7.1z

with two orders, two shipments and one invoice rma could be generated on items of the first or second shipment, as well as for the full position as for a partial position.

Daniel Tamm July 2, 2015 at 7:10 AM
Edited

Clearification:
Multiple orders, multiple shipments goes into one single invoice.
The problem description probably should have been
".... when original invoice is multiorder", since I think it was the multiple order that was the problem, not the multiple shipment which is a side effect of multiple orders.

All invoices are generated from orders. No customization on this part.

Carlos Ruiz July 1, 2015 at 10:54 PM

, I was not able to reproduce the issue - seems like you're generating invoices not associated to an order? Is that a customization?

Daniel Tamm December 18, 2013 at 8:42 PM

Cannot Reproduce

Details

Assignee

Reporter

Tested By

Martin Schönbeck

Original estimate

Time tracking

No time logged1h remaining

Components

Affects versions

Priority

Created December 18, 2013 at 8:20 PM
Updated June 1, 2021 at 6:06 PM
Resolved April 21, 2021 at 1:55 PM