Adjusting costs for BOM

AdunAdun Member Posts: 19
Hello everyone!

I faced the issue that adjusting cost for BOM components give no impact on the output entry. Searching the forum I have found the following topics related to the problem, stating "that's the way the system works", but of the year 2005:
viewtopic.php?f=14&t=4665&hilit=BOM+unit+cost+adjust
viewtopic.php?f=5&t=6432&hilit=BOM+unit+cost+adjust

Just want to make sure that the things have not been changed since Navision Attain.

Thanks.

Answers

  • vaprogvaprog Member Posts: 1,141
    With NAV 2013 Assembly and Production, cost of output does get adjusted. I don't know about previous versions.
    We faced some problems that we had to reset some flags to re-adjust inventory to fully adjust from purchase of components to sales of assembly item, but then we had not deployed application updates and there are corrections in this area.
  • AdunAdun Member Posts: 19
    We are actually using NAV 2009 R2 at the moment, but I'm glad to know that it works fine for 2013.
  • AdunAdun Member Posts: 19
    edited 2013-11-20
    Ok, dug into the code. Eventually NAV2009 has the same mistake with BOM. Looking through NAV2013 solution in happens to be that there is still a minor mistake in 7th version as well. Positive output entries are indeed being adjusted according to BOM components, however the cost is not adjusted for the output item in general. Meaning if you have already sold/written off this item, negative entry cost will remain old. Until you make another receipt of this output item.

    The solution we've made is the following:
    - in CU5895 (Inventory Adjustment) calling of MakeSingleLevelAdjmt(TempItem) within MakeMultiLevelAdjmt() function was transfered after MakeAssemblyAdjmt()
    - during cost adjustment of BOM components a check mark for output item in table 5804 (Avg. Cost Adjmt. Entry Point) is being removed, as well as "Cost is Adjusted" check mark on an Item card.

    Hope this will help someone else as well.
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    My solution was to make a tool for this in a Revaluation Journal and run it monthly. I will give you the code but please do not just copy-paste but rather use it is as an example, and develop one according to your own specific situation:

    Button / Menu Item / in RTC Action on Reval. Journal form:
    <Control1048202> - OnPush()
    Rep.SetTemplateAndBatch("Journal Template Name","Journal Batch Name");
    ReportCorrBOM.RUNMODAL;
    CurrForm.UPDATE(TRUE);
    
    

    Report:
    BOM Ledger Entry - OnAfterGetRecord()
    
    CALCFIELDS("Document No. Lookup");
    ILE.GET("Reference Entry No.");
    ILE.CALCFIELDS("Cost Amount (Actual)");
    
    CLEAR(Total);
    CLEAR(Amend);
    CLEAR(BOLE2);
    
    BOLE2.CALCFIELDS("Document No. Lookup");
    BOLE2.SETRANGE("Document No. Lookup","Document No. Lookup");
    BOLE2.SETFILTER("Entry No.", '>%1', "Entry No.");
    IF BOLE2.FINDSET THEN REPEAT
       BOLE2.TESTFIELD("Reference Type",BOLE2."Reference Type"::Item);
       IF BOLE2."Entry Type"= BOLE2."Entry Type"::Component THEN BEGIN
          ILE2.GET(BOLE2."Reference Entry No.");
          ILE2.CALCFIELDS("Cost Amount (Actual)");
          Total :=  Total + ILE2."Cost Amount (Actual)";
       END;
    
    
    //we have no resources or else I would add that too
    UNTIL (BOLE2.NEXT = 0) OR (BOLE2."Entry Type" = BOLE2."Entry Type"::BOM);
    
    Total := - 1 * Total;
    
    
    
    Amend :=  -1 * (ILE."Cost Amount (Actual)"-Total)/ILE.Quantity;
    
    
    
    IF ABS(Amend) >= 0.001 THEN BEGIN
    
      CLEAR(ReValJnlLine1);
      ReValJnlLine1."Journal Template Name" := Template;
      ReValJnlLine1."Journal Batch Name" := Batch;
    
      CLEAR(ReValJnlLine2);
      ReValJnlLine2.SETRANGE("Journal Template Name",Template);
      ReValJnlLine2.SETRANGE("Journal Batch Name",Batch);
      IF ReValJnlLine2.FINDLAST THEN;
    
      ReValJnlLine1."Line No." := ReValJnlLine2."Line No."+10000;
      ReValJnlLine1.SetUpNewLine(ReValJnlLine2);
      ReValJnlLine1.VALIDATE("Item No.", ILE."Item No.");
      ReValJnlLine1.INSERT(TRUE);
      ReValJnlLine1.VALIDATE("Applies-to Entry" ,ILE."Entry No.");
      ReValJnlLine1.VALIDATE("Document No.","Document No. Lookup");
    
      ReValJnlLine1.VALIDATE("Inventory Value (Revalued)", Total);
      ReValJnlLine1.MODIFY(TRUE);
    END;
    
    
Sign In or Register to comment.