Find credit memo line(s) associated with an invoice line.

bhalpinbhalpin Member Posts: 309
This is NAV 2015.

My dev problem is this: From a given Posted Sales Invoice line, find any/all Posted Sales Credit Memo lines associated with that invoice line.

I've hunted through a whole jungle of tables/recs to find a foolproof path from one to the other and I just don't see one. I would have thought there would be "pointer" fields in the credit memo line to specify the original invoice line, or some "Applies To" field in customer or item ledger entry, but no joy. (Well - I think it was in ILE I saw an Applies to Entry" field, but it was always blank.)

Short of adding these pointer fields to the Cr Memo myself, does anyone have any guidance/experience, etc. ?

Thanks in advance!

Comments

  • bbrownbbrown Member Posts: 3,268
    There isn't one because they are not directly related to each other. The answer might also depend on if you are asking this question from an Accounts Receivable or Inventory Costing standpoint.

    For Accounts Receivable, the relation is to the Customer Ledger Entry (Posted Sales Invoice Header) to which the credit memo is applied.

    For inventory, this would be the Item Ledger Entry from which the posted credit memo line will get its cost. This can be set by the system based on the costing method or by the user by using the "Applies to" field on the credit memo line.

    There are no bugs - only undocumented features.
  • bhalpinbhalpin Member Posts: 309
    Hmmmm... Good stuff.

    I really don't know what the "point of view" is. It's just a requirement from a customer to export Posted Sales Invoice info NET OF credit memo returns. All to satisfy some legacy process. I don't know why - and it's not my business. (Above my pay-grade. :-))

    But I can't find any useful info in the cr memo line though. If there is an "Applies To" (can't remember - my head is spinning badly) it is empty - but I'll go back and check.

    But to boil it down to the user's perspective - "For this Posted Sales Invoice, what (Item/Qty/Lot) did the user reject/return/not receive and we issued a credit memo for?" Seems like a reasonable question, eh? And you would think (!) the "Navigate" action on the Posted Sales Invoice page might include an option like that. You would think ...
  • bbrownbbrown Member Posts: 3,268
    The information you are looking for can be found in Table 339 "Item Application Entry". This table relates the inbound and outbound "Item Ledger Entry" records. See the code behind the "Applied Entries" action of the "Item Ledger Entries" page for guidance on how this table is used.

    You will need to find the "Item Ledger Entry" records related to you posted document lines. Then find the related "Item Application Entry" records and link them together.

    There are no bugs - only undocumented features.
  • bbrownbbrown Member Posts: 3,268
    The solution above is only applicable if the customer is explicitly relating credit memos to the invoice lines (Item Ledger Entry) that they are reversing. If they are not, then there is no relationship and the credits simply start a new costing chain.

    There are no bugs - only undocumented features.
  • bhalpinbhalpin Member Posts: 309
    Hi - and thanks all!

    From my autopsying their data, they are not doing whatever is required to establish the link(s) needed. It's ok. My search is pretty-good now that I added a check to ensure the item-tracking in the credit memo lines up with that in the invoice. (It was fun!)

    If the customer can be shown the process where the links are there then I'll switch to that search method. I don't know that process, but others in our company probably do. (I'm the mechanic - not the driver.)

    Thanks again!
Sign In or Register to comment.