(Seems my previous attempt at opening this topic got shredded into tiny electrons by MySQL and recycled...
)
If you ship 10 Bicycles in CRONUS from a Sales Order, then invoice it separately with Invoice / Get Shipment Lines and then run the Delete Invoiced Sales Orders batch job, it should delete this order, shouldn't it?
Apparently it does not in SP3 (and the version of the batch job is NAVW14.00.03) and by looking at the code, I found the following condition:
IF ((SalesOrderLine."Qty. Assigned" = SalesOrderLine."Quantity Invoiced") OR
(SalesOrderLine.Type <> SalesOrderLine.Type::"Charge (Item)")) AND
(SalesOrderLine."Qty. Assigned" <> 0)
So basically it says that if it's an Item Charge, the full Assigned quantity should be invoiced, which is correct. But if it's not an Item Charge, but f.e. an Item, it says the Assigned quantity should be different from zero - and I think it's simply wrong, because only Item Charges should be assigned, you cannot assign anything else.
I think the last <> should be replaced with a = or maybe removed altogether as it's unnecessary.
Question: does anybody happen to remember a bug in the earlier versions that this "solution" tried to repair? (I mean that if we simply repair it as stated above maybe we'll just find another, older trouble.)
Comments
Marco de Vries
I tested it and it seems to work, if you do not change this it will never delete an order.
As I remember, there is an article in Knowledge Base regarding this issue.
Dynamics NAV Enthusiast