Closed Transfer Orders

TimSmithTimSmith Member Posts: 36
i have the need to have multiple warehouses under multiple departments. How i am trying to handle this is by Using responsibility centres, with Dimension Codes defining the department, and locations.

Within my Nominal I have a couple of stock accounts and I can analyse these by department based upon the dimension values

This works fine for shipping and receiving in the warehouses, but when I use transfer orders to move stock around, then I get an issue. If i leave the Global Dimension field for the department blank, the posting of the ship and receipt (ship and receive are required) does not add a value to the dimension table for the from and too postings. If i fill a value in, then that value is used for the dimension values within the nominal ](*,)

Ideally what I want is to have the dimension of the responsibility centre, to which the location is attached to be used. Therefore the dimension will be different for the ship and receive process. Has anyone come across this before? If so how did you resolve it?

I am now going away to test selling to a customer attached to responsibility centre A, with the goods being shipped from responsibility centre B. Lets see what dimensions we get there!

Thanks
Tim 8-[

Comments

  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    It's gonna be hard, Navision is clearly not designed to support Dimension by Locations completely. What I can suggest is to set up different stock G/L Accounts for each Location instead of using Dimensions.
  • TimSmithTimSmith Member Posts: 36
    Thanks Miklos,

    Yes I thought of that one, but it defeats my desire to use the analysis by dimension views within the nominal. It would mean that I can see all financial information by dimensions, except the stock. Not really desireable.

    Tim
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    OK, then another workaround is to assign G/L Accounts to Locations and post the total net change of the account to the same account but all of the amount to the correct Dimension. You could even automate it - by writing a processing-only report, with some flowfilters and calcfields and creating the journal lines and running the form for the user to post. It would be a lot easier than hacking into the TO posting logic.
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    ...or a better idea could be to change TransRcptLine.INSERT to INSERT(TRUE) in CU5705 and write code in Transfer Receipt Line - OnInsert to generate and post a Reclassification-style Item Journal Line to change the dimension. Create such a journal line by hand, look at every field in Item Journal Line and Journal Line Dimension, duplicate it by code - it might be easier to fill all fields without validation, or you can fill just some fields by validation and let OnValidate-s do the job, your choice - and just call CU22 to that journal line record variable.
  • ara3nara3n Member Posts: 9,257
    Mike one problem with your suggestion is that if you haven't posted the received goods, the dimension will be still wrong.

    I've done a modification for client that wanted the same thing. Dimension comming from Location, and it works with transfer orders, and intransit location.
    The modification isn't that hard, but it does take some time to make it work. Let me know if you want to see the code.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • ara3nara3n Member Posts: 9,257
    Ok here is the code. //S001 is my modification

    CU 21. I've setup Default dimension for location.

    Function
    InsertItemLedgEntry(VAR ItemLedgEntry : Record "Item Ledger Entry";TransferItem : Boolean)
      IF TransferItem THEN BEGIN
        ItemLedgEntry."Global Dimension 1 Code" := "New Shortcut Dimension 1 Code";
        ItemLedgEntry."Global Dimension 2 Code" := "New Shortcut Dimension 2 Code";
        //S001 Start
        TempTransJnlDim.RESET;
        TempTransJnlDim.DELETEALL;
        //S001 End
        IF TempJnlLineDim.FIND('-') THEN BEGIN
          REPEAT
            IF TempJnlLineDim."New Dimension Value Code" <> '' THEN BEGIN
              LedgEntryDim.INIT;
              LedgEntryDim."Table ID" := DATABASE::"Item Ledger Entry";
              LedgEntryDim."Entry No." := ItemLedgEntry."Entry No.";
              LedgEntryDim."Dimension Code" := TempJnlLineDim."Dimension Code";
              LedgEntryDim."Dimension Value Code" := TempJnlLineDim."New Dimension Value Code";
    
              //S001 Start
              T_DefaultDim.SETRANGE("Table ID",DATABASE::Location);
              T_DefaultDim.SETRANGE("No.",ItemLedgEntry."Location Code");
              T_DefaultDim.SETRANGE("Dimension Code",TempJnlLineDim."Dimension Code");
              IF T_DefaultDim.FIND('-') THEN BEGIN
                LedgEntryDim."Dimension Value Code" := T_DefaultDim."Dimension Value Code";
                IF GLSetup."Global Dimension 1 Code" = T_DefaultDim."Dimension Code" THEN
                  ItemLedgEntry."Global Dimension 1 Code" := T_DefaultDim."Dimension Value Code";
                IF GLSetup."Global Dimension 2 Code" = T_DefaultDim."Dimension Code" THEN
                 ItemLedgEntry."Global Dimension 2 Code" := T_DefaultDim."Dimension Value Code";
              END;
              
              TempTransJnlDim := TempJnlLineDim;
              TempTransJnlDim."Dimension Value Code" := LedgEntryDim."Dimension Value Code";
              IF NOT TempTransJnlDim.INSERT THEN
                TempTransJnlDim.MODIFY;;
              //S001 End
              LedgEntryDim.INSERT;
            END;
          UNTIL TempJnlLineDim.NEXT = 0;
        END;
      END ELSE BEGIN
        ItemLedgEntry."Global Dimension 1 Code" := "Shortcut Dimension 1 Code";
        ItemLedgEntry."Global Dimension 2 Code" := "Shortcut Dimension 2 Code";
        //S001 Start
        T_DefaultDim.SETRANGE("Table ID",DATABASE::Location);
        T_DefaultDim.SETRANGE("No.",ItemLedgEntry."Location Code");
        IF T_DefaultDim.FIND('-') THEN REPEAT
          TempJnlLineDim.SETRANGE("Dimension Code",T_DefaultDim."Dimension Code");
          IF TempJnlLineDim.FIND('-') THEN BEGIN
            TempJnlLineDim."Dimension Value Code" := T_DefaultDim."Dimension Value Code";
            TempJnlLineDim.MODIFY;
          END;
        UNTIL TempJnlLineDim.NEXT = 0;
        TempJnlLineDim.RESET;
        TempJnlLineDim.SETRANGE("Dimension Code",GLSetup."Global Dimension 1 Code");
        IF TempJnlLineDim.FIND('-') THEN
           ItemLedgEntry."Global Dimension 1 Code" := TempJnlLineDim."Dimension Value Code";
        
        TempJnlLineDim.SETRANGE("Dimension Code",GLSetup."Global Dimension 2 Code");
        IF TempJnlLineDim.FIND('-') THEN
          ItemLedgEntry."Global Dimension 2 Code" := TempJnlLineDim."Dimension Value Code";
        TempJnlLineDim.RESET;
        //S001 end
    


    Function InsertValueEntry
       //S001 Start
        TempTransJnlDim.RESET;
        IF TempTransJnlDim.FIND('-') THEN BEGIN
          REPEAT
            LedgEntryDim.INIT;
            LedgEntryDim."Table ID" := DATABASE::"Value Entry";
            LedgEntryDim."Entry No." := ValueEntry."Entry No.";
            LedgEntryDim."Dimension Code" := TempTransJnlDim."Dimension Code";
            LedgEntryDim."Dimension Value Code" := TempTransJnlDim."Dimension Value Code";
            LedgEntryDim.INSERT;
            IF GLSetup."Global Dimension 1 Code" = TempTransJnlDim."Dimension Code" THEN
              ValueEntry."Global Dimension 1 Code" := TempTransJnlDim."Dimension Value Code";
            IF GLSetup."Global Dimension 2 Code" = TempTransJnlDim."Dimension Code" THEN
              ValueEntry."Global Dimension 2 Code" := TempTransJnlDim."Dimension Value Code";
          UNTIL TempTransJnlDim.NEXT = 0;
        END ELSE BEGIN
        //S001 End
        ValueEntry."Global Dimension 1 Code" := "New Shortcut Dimension 1 Code";
        ValueEntry."Global Dimension 2 Code" := "New Shortcut Dimension 2 Code";
        IF TempJnlLineDim.FIND('-') THEN BEGIN
          REPEAT
            IF TempJnlLineDim."New Dimension Value Code" <> '' THEN BEGIN
              LedgEntryDim.INIT;
              LedgEntryDim."Table ID" := DATABASE::"Value Entry";
              LedgEntryDim."Entry No." := ValueEntry."Entry No.";
              LedgEntryDim."Dimension Code" := TempJnlLineDim."Dimension Code";
              LedgEntryDim."Dimension Value Code" := TempJnlLineDim."New Dimension Value Code";
              LedgEntryDim.INSERT;
            END;
          UNTIL TempJnlLineDim.NEXT = 0;
        END;
        //S001 Start
        END;
        //S001 End
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • TimSmithTimSmith Member Posts: 36
    Thanks for the code. I will be incorporating it into my solution. Very much appreciated. Hope that I can repay the favour some time.
    Tim
  • ara3nara3n Member Posts: 9,257
    No problem. something about the code.
    END ELSE BEGIN
        ItemLedgEntry."Global Dimension 1 Code" := "Shortcut Dimension 1 Code";
        ItemLedgEntry."Global Dimension 2 Code" := "Shortcut Dimension 2 Code";
        //S001 Start
        T_DefaultDim.SETRANGE("Table ID",DATABASE::Location);
        T_DefaultDim.SETRANGE("No.",ItemLedgEntry."Location Code");
        IF T_DefaultDim.FIND('-') THEN REPEAT
          TempJnlLineDim.SETRANGE("Dimension Code",T_DefaultDim."Dimension Code");
          IF TempJnlLineDim.FIND('-') THEN BEGIN
            TempJnlLineDim."Dimension Value Code" := T_DefaultDim."Dimension Value Code";
            TempJnlLineDim.MODIFY;
          END;
        UNTIL TempJnlLineDim.NEXT = 0;
        TempJnlLineDim.RESET;
        TempJnlLineDim.SETRANGE("Dimension Code",GLSetup."Global Dimension 1 Code");
        IF TempJnlLineDim.FIND('-') THEN
           ItemLedgEntry."Global Dimension 1 Code" := TempJnlLineDim."Dimension Value Code";
       
        TempJnlLineDim.SETRANGE("Dimension Code",GLSetup."Global Dimension 2 Code");
        IF TempJnlLineDim.FIND('-') THEN
          ItemLedgEntry."Global Dimension 2 Code" := TempJnlLineDim."Dimension Value Code";
        TempJnlLineDim.RESET;
        //S001 end 
    


    you don't need this if you are not using default dim on origin location.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.