Adding line to AR Invoice from another invoice

I am trying to rewrite an assembly into a function where we basically take multiple Shipment Invoices from the same order and consolidate the lines into one AR Invoice. I have almost everything working except I am not able to add a new InvcDtl to the existing Invoice. I get this error “Cannot add line items to this type of invoice.”
To generate the new row, I just create a new InvcDtl row and buffer copy all except InvoiceNum, InvoiceLine, SysRowID and SysRevID. Then give it the existing InvoiceNum and next LineNum, row mod = A, add it to the tableset and call Update.

In the assembly code it inserts the row directly to the Db, which is not best practice and I’m not sure I could do that in a Function.

won’t help existing invoices but have you tried this.
Consolidate packing slips in customer entry


image

I have not seen that. We will take a look. Would this cover both Customer Shipments and Drop Shipments?

I would assume as long as they are on the same order and in the same Fiscal period it would

It looks like we have this setting already turned on. It does look like it consolidates them into a new invoice. Our customization will consolidate it into an existing open invoice for that Order.

What do they want to accomplish? Just one invoice per order?

If just one invoice per order I think you could use Order “Invoice when complete” in customer entry
image

1 Like

There are shipments they want to invoice before the Order is fully closed. This is a preexisting process that I’m just converting to a function. I’m attempting to keep it the same with no process changes, just different code to support it.