Item Charge Assignment to Dimensions

n_c_balajin_c_balaji Member Posts: 34
Hi All,

I am unable to post a Purchase Order with Item Charge lines and the Items have a Dimension Validation set up as "Same Code".

Basically Navision expects me to populate dimensions for the Item Charge Lines because I have set up a Same code validation at the Item Master.

Now the Dimension validation at Item Master cannot be removed as Item Charges are applicable only for Imported Items rest of the PO's need the Item Dimensions.

I can foresee an option to solve this issue:

Manually key in the Item charge Lines Dimension wise (ie) per item charge line per item. ( which means 100 lines of Item + 500 lines of item charges in place of 100 item lines and 5 Item charge Lines). Which will be tedious task for the customer to make data entry.

Has anyone come across this issue. If u can help me out with the FOB's it would be of great.......

With Regards,

Balaji



Has anyone come across this kind of an issue.

Comments

  • kinekine Member Posts: 12,562
    I know that we solved for one customer this in a way, that when applying the charge to some line, the target line dimension are taken and not the charge line dim.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • n_c_balajin_c_balaji Member Posts: 34
    Hi Kine,


    Thanks for ur reply....did u do any customisation to solve this issue...can u help me with the steps u followed for the solution.....

    Thanks in advance,

    Balaji
  • kinekine Member Posts: 12,562
    I found out where is the point where charge is posted for the assigned line (where the Journal line for that is filled in) and changed the rutine getting dimensions to get them from line of the target and not of the charge. Sorry, I cannot say you more...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • n_c_balajin_c_balaji Member Posts: 34
    Thanks Kine....would follow the same.....
  • ayhan06ayhan06 Member Posts: 210
    PROCEDURE CombineJnlLineDim@50002000(VAR TempJnlLineDim@1000000002 : Record 356;ItemLedgEntryNo@1000000003 : Integer);
        VAR
          TempJnlLineDim2@1000000001 : TEMPORARY Record 356;
          LedgEntryDim@1000000000 : Record 355;
        BEGIN
          // 6GEN Ayhan ™zbay 20.07.2007
          TempJnlLineDim2.RESET;
          TempJnlLineDim2.DELETEALL;
          LedgEntryDim.SETRANGE("Table ID",DATABASE::"Item Ledger Entry");
          LedgEntryDim.SETRANGE("Entry No.",ItemLedgEntryNo);
          DimMgt.CopyLedgEntryDimToJnlLineDim(LedgEntryDim,TempJnlLineDim2);
          IF TempJnlLineDim2.FIND('-') THEN
            REPEAT
              IF TempJnlLineDim.GET(DATABASE::"Purchase Line",'','',0,0,TempJnlLineDim2."Dimension Code") THEN BEGIN
                TempJnlLineDim."Dimension Value Code" := TempJnlLineDim2."Dimension Value Code";
                TempJnlLineDim.MODIFY;
              END
              ELSE BEGIN
                TempJnlLineDim."Table ID" := DATABASE::"Purchase Line";
                TempJnlLineDim."Journal Template Name" := '';
                TempJnlLineDim."Journal Batch Name" := '';
                TempJnlLineDim."Journal Line No." := 0;
                TempJnlLineDim."Allocation Line No." := 0;
                TempJnlLineDim."Dimension Code" := TempJnlLineDim2."Dimension Code";
                TempJnlLineDim."Dimension Value Code" :=  TempJnlLineDim2."Dimension Value Code";
                TempJnlLineDim.INSERT;
              END;
            UNTIL TempJnlLineDim2.NEXT = 0;
        END;
    


    this function must be added to codeunit 90(also codeunit 80)..


    change 1 in codeunit 90
              IF (QtyToBeReceivedBase <> 0) THEN
                IF "Document Type" IN ["Document Type"::"Return Order","Document Type"::"Credit Memo"] THEN
                  ReservePurchLine.TransferPurchLineToItemJnlLine(PurchLine,ItemJnlLine,-QtyToBeReceivedBase)
                ELSE
                  ReservePurchLine.TransferPurchLineToItemJnlLine(PurchLine,ItemJnlLine,QtyToBeReceivedBase);
              TempJnlLineDim.DELETEALL;
              TempDocDim.RESET;
              TempDocDim.SETRANGE("Table ID",DATABASE::"Purchase Line");
              TempDocDim.SETRANGE("Line No.","Line No.");
              DimMgt.CopyDocDimToJnlLineDim(TempDocDim,TempJnlLineDim);
    
              // 6GEN Ayhan ™zbay 20.07.2007
              IF ItemChargeNo <> '' THEN
                CombineJnlLineDim(TempJnlLineDim,ItemLedgShptEntryNo);
              // 6GEN Ayhan ™zbay 20.07.2007
    
    
              OriginalItemJnlLine := ItemJnlLine;
              ItemJnlPostLine.RunWithCheck(ItemJnlLine,TempJnlLineDim);
    



    change 2 in codeunit 90
          WITH TempTrackingSpecificationInv DO BEGIN
            RESET;
            SETRANGE("Source Type",DATABASE::"Purchase Line");
            SETRANGE("Source ID",TempItemChargeAssgntPurch."Applies-to Doc. No.");
            SETRANGE("Source Ref. No.",TempItemChargeAssgntPurch ."Applies-to Doc. Line No.");
    
            { 6GEN Ayhan ™zbay 20.07.2007
            IF NOT FIND('-') THEN
              ItemJnlPostLine.RunWithCheck(ItemJnlLine2,TempJnlLineDim)
            }
    
            //6GEN Ayhan ™zbay 20.07.2007 BEGIN
            IF NOT FIND('-') THEN BEGIN
              CombineJnlLineDim(TempJnlLineDim,ItemJnlLine2."Item Shpt. Entry No.");
              ItemJnlPostLine.RunWithCheck(ItemJnlLine2,TempJnlLineDim)
            END
            //6GEN Ayhan ™zbay 20.07.2007 END
    
            ELSE BEGIN
              NonDistrItemJnlLine := ItemJnlLine2;
              OriginalAmt := NonDistrItemJnlLine.Amount;
              OriginalAmtACY := NonDistrItemJnlLine."Amount (ACY)";
              OriginalDiscountAmt := NonDistrItemJnlLine."Discount Amount";
              OriginalQty := NonDistrItemJnlLine."Quantity (Base)";
              IF ("Quantity (Base)" / OriginalQty) > 0 THEN
                SignFactor := 1
              ELSE
                SignFactor := -1;
              REPEAT
    
                //6GEN Ayhan ™zbay 20.07.2007 BEGIN
                TempJnlLineDim.RESET;
                TempJnlLineDim.DELETEALL;
                DimMgt.CopyDocDimToJnlLineDim(TempDocDim,TempJnlLineDim);
                CombineJnlLineDim(TempJnlLineDim,"Appl.-to Item Entry");
                //6GEN Ayhan ™zbay 20.07.2007 END
    
    
                Factor := "Quantity (Base)" / OriginalQty * SignFactor;
                IF ABS("Quantity (Base)") < ABS(NonDistrItemJnlLine."Quantity (Base)") THEN BEGIN
                  ItemJnlLine2."Quantity (Base)" := "Quantity (Base)";
                  ItemJnlLine2."Invoiced Qty. (Base)" := ItemJnlLine2."Quantity (Base)";
                  ItemJnlLine2."Amount (ACY)" :=
                    ROUND(OriginalAmtACY * Factor,GLSetup."Amount Rounding Precision");
                  ItemJnlLine2.Amount :=
                    ROUND(OriginalAmt * Factor,GLSetup."Amount Rounding Precision");
                  ItemJnlLine2."Unit Cost (ACY)" :=
                    ROUND(ItemJnlLine2.Amount / ItemJnlLine2."Invoiced Qty. (Base)",
                     Currency."Unit-Amount Rounding Precision") * SignFactor;
    
    
    
    

    the code modification above can be applied to codeunit 80 sales-post in the similar way.
  • n_c_balajin_c_balaji Member Posts: 34
    Hi Ayhan,

    Thanks a lot for sharing your experience..... :D

    thanks,

    N C Balaji
Sign In or Register to comment.