purchase line discount % bug

ReinhardReinhard Member Posts: 249
edited 2011-11-22 in NAV Three Tier
Hello,

See if you can reproduce this error....

1. Create a Purchase Order.
2. Add an item and a unit cost. (for example 100 pieces for $10 each = $1,000 total amount, not tax liable)
3. Add a line discount % (say 10%)
4. Post receipt for all 100 pieces.
5. Post invoice for 50 pieces.
6. Post invoice for the remaining 50 pieces which should close out the order.

You should have two posted purchase invoices.
Each one should have $50 discounted.

Instead the first invoice posted $100 discount, and the second one $50 discount, for a total of $150.
150/1000 NOT EQUAL 10%!

Is there something I'm doing wrong or is the posting routine incorrect?

As always your feedback is greatly appreciated.
- Reinhard

Nav6.2
P&P Setup: Discount Posting = All Discounts
There are no other vendor, payment, etc. discounts.

Answers

  • ReinhardReinhard Member Posts: 249
    Was anyone else able to reproduce the error?
    Basically, the first time posting a partial invoice in a purch. line with a discount %, the entire discount was taken for the whole quantity.

    The reason appears to be, in codeunit 90, Purch.-Post, function:
    AddSalesTaxLineToSalesTaxCalc(PurchLine : Record "Purchase Line";FirstLine : Boolean)
    ...
      IF MaxInvQty <> Quantity THEN
        "Line Discount Amount" :=
          ROUND("Line Amount" * "Line Discount %" / 100,Currency."Amount Rounding Precision");
    ...
    

    MaxInvQty is the total quantity remaining to be invoiced. The first time you invoice an order, MaxInvQty will ALWAYS equal Quantity:
    MaxInvQty := (Quantity - "Quantity Invoiced");
    


    Proposed Solution
    I commented out the condition and always reset the line discount amount. Appears to post correctly for partial and full invoices.
    ...
      //IF MaxInvQty <> Quantity THEN
        "Line Discount Amount" :=
          ROUND("Line Amount" * "Line Discount %" / 100,Currency."Amount Rounding Precision");
    ...
    


    Feedback is appreciated. Is it a real bug? If so, how to report?
  • AndwianAndwian Member Posts: 627
    Reinhard wrote:
    If so, how to report?
    using support ticket :mrgreen:
    Maybe someone else could help with this.
    Really sorry, since I'm not in NSC anymore.
    Regards,
    Andwian
Sign In or Register to comment.