Remove summing of Sales Lines when posting Invoices

iqbalmadiqbalmad Member Posts: 179
hi,

in Sales Invoices, if i input 2 sales lines with same G/L account number, navision automatically sums u these 2 lines.

I would like to change this, but could not find this code which is doing this in Codeunit 80.

can anybody give me a hint hw the above can be done

thanks

Comments

  • Alex_ChowAlex_Chow Member Posts: 5,063
    :?: :?: :?:

    This must be a localize thing. If you look at the world wide version, it will not summarize up the lines for you during posting.
  • ara3nara3n Member Posts: 9,257
    Well in US it summarize the lines, and I believe in world wide version it summarizes as well.

    You need to look at
    FillInvPostingBuffer(SalesLine : Record "Sales Line";SalesLineACY : Record "Sales Line")

    which then calls UpdInvPostingBuffer.

    The function UpdInvPostingBuffer combines the lines. Make the changes in that function and you should be set.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • krikikriki Member, Moderator Posts: 9,118
    ara3n wrote:
    Well in US it summarize the lines, and I believe in world wide version it summarizes as well.
    Correct: also W1 summarizes.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • iqbalmadiqbalmad Member Posts: 179
    am commenting these lines which apparently do this.. but when am posting, it says that InvPostingBuffer exists already..

    {InvPostingBuffer[2] := InvPostingBuffer[1];
    IF InvPostingBuffer[2].FIND THEN BEGIN
    InvPostingBuffer[2].Amount := InvPostingBuffer[2].Amount + InvPostingBuffer[1].Amount;
    .
    .
    .
    IF NOT InvPostingBuffer[1]."System-Created Entry" THEN
    InvPostingBuffer[2]."System-Created Entry" := FALSE;
    InvPostingBuffer[2].MODIFY;
    END ELSE}
  • 2tje2tje Member Posts: 80
    Take a look at the following.
    In Belgium they made changes to the posting routine, if the description on the PO line is different the lines will not be summarized. You could do something similar with the line no or some other field.

    see also: http://www.mibuso.com/forum/viewtopic.p ... highlight=
    (dutch speaking)

    W1 version:
    IF (Type = Type::"G/L Account") OR (Type = Type::"Fixed Asset") THEN
        InvPostingBuffer[1]."G/L Account" := "No."
      ELSE
        IF "Document Type" IN ["Document Type"::"Return Order","Document Type"::"Credit Memo"] THEN BEGIN
          GenPostingSetup.TESTFIELD("Purch. Credit Memo Account");
          InvPostingBuffer[1]."G/L Account" := GenPostingSetup."Purch. Credit Memo Account";
        END ELSE BEGIN
          GenPostingSetup.TESTFIELD("Purch. Account");
          InvPostingBuffer[1]."G/L Account" := GenPostingSetup."Purch. Account";
        END;
    

    Belgian version:
    IF (Type = Type::"G/L Account") OR (Type = Type::"Fixed Asset") THEN BEGIN
        InvPostingBuffer[1]."Line No." := "Line No.";
        InvPostingBuffer[1]."G/L Account" := "No.";
        InvPostingBuffer[1]."Posting Description" := Description;
      END ELSE BEGIN
        IF "Document Type" IN ["Document Type"::"Return Order","Document Type"::"Credit Memo"] THEN BEGIN
          GenPostingSetup.TESTFIELD("Purch. Credit Memo Account");
          InvPostingBuffer[1]."G/L Account" := GenPostingSetup."Purch. Credit Memo Account";
        END ELSE BEGIN
          GenPostingSetup.TESTFIELD("Purch. Account");
          InvPostingBuffer[1]."G/L Account" := GenPostingSetup."Purch. Account";
        END;
        InvPostingBuffer[1]."Posting Description" := PurchHeader."Posting Description";
      END;
    


    And don't forget to add the field Posting Description to Table 49 and add this field to the primary key of the table.
  • iqbalmadiqbalmad Member Posts: 179
    thankx 2tje.. the lines of codes were of enormous help..

    instead of Posting Description, i inserted Line No. in table 49 keys.

    so it will check line no. instead..

    also i uncommented the codes which i previously commented..

    i think i did everything right..

    thankx again 2tje..
  • Alex_ChowAlex_Chow Member Posts: 5,063
    ara3n wrote:
    Well in US it summarize the lines, and I believe in world wide version it summarizes as well.

    You need to look at
    FillInvPostingBuffer(SalesLine : Record "Sales Line";SalesLineACY : Record "Sales Line")

    which then calls UpdInvPostingBuffer.

    The function UpdInvPostingBuffer combines the lines. Make the changes in that function and you should be set.

    :oops:
Sign In or Register to comment.