Bug in Delete Invoiced Sales Orders (SP3) ?

Miklos_HollenderMiklos_Hollender Member Posts: 1,598
(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

  • MarcoVMarcoV Member Posts: 15
    We've ran into the same problem here. Is there allready an official fix? :-k
    With kind regards,

    Marco de Vries
  • KeesMeuzelaarKeesMeuzelaar Member Posts: 26
    I have seen the same problem, before i read this forum i also corrected the <> to =.

    I tested it and it seems to work, if you do not change this it will never delete an order.
  • TomasTomas Member Posts: 420
    basically fix is instead of AND use OR.
                IF ((SalesOrderLine."Qty. Assigned" = SalesOrderLine."Quantity Invoiced") OR
                   (SalesOrderLine.Type <> SalesOrderLine.Type::"Charge (Item)")) OR
                   (SalesOrderLine."Qty. Assigned" <> 0)
    

    As I remember, there is an article in Knowledge Base regarding this issue.
Sign In or Register to comment.