The value of the Direct Unit incl VAT in a created purchase credit memo is incorrect in Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)

This article applies to Microsoft Dynamics NAV for all language locales.

Symptoms

When you use the Get Return Shipment Lines function to create a purchase credit memo in Microsoft Dynamics NAV 2009 Service Pack 1 (SP1), the value of the Direct Unit incl VAT in the created purchase credit memo is incorrect.

Resolution

Hotfix information

A supported hotfix is now available from Microsoft. However, it is only intended to correct the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Dynamics NAV 2009 service pack or the next Microsoft Dynamics NAV version that contains this hotfix.

Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Technical Support Professional for Microsoft Dynamics and related products determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.



Installation information

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

Note Before you install this hotfix, verify that all Microsoft Navision client users are logged off the system. This includes Microsoft Navision Application Services (NAS) client users. You should be the only client user who is logged on when you implement this hotfix.

To implement this hotfix, you must have a developer license.

We recommend that the user account in the Windows Logins window or in the Database Logins window be assigned the "SUPER" role ID. If the user account cannot be assigned the "SUPER" role ID, you must verify that the user account has the following permissions:

  • The Modify permission for the object that you will be changing.

  • The Execute permission for the System Object ID 5210 object and for the System Object ID 9015 object.



Note You do not have to have rights to the data stores unless you have to perform data repair.

Code changes

Note Always test code fixes in a controlled environment before you apply the fixes to your production computers.
To resolve this problem, follow these steps:

  1. Change the code in the Fields in the table (36) as follows:
    Existing code

    ...
    OnValidate=BEGIN
    MessageIfSalesLinesExist(FIELDCAPTION("Customer Price Group"));
    END;

    CaptionML=ENU=Customer Price Group }
    // Delete the following lines.
    { 35 ; ;Prices Including VAT;Boolean ;OnValidate=VAR
    SalesLine@1000 : Record 37;
    Currency@1001 : Record 4;
    JobPostLine@1003 : Codeunit 1001;
    RecalculatePrice@1002 : Boolean;
    BEGIN
    TESTFIELD(Status,Status::Open);

    IF "Prices Including VAT" <> xRec."Prices Including VAT" THEN BEGIN
    SalesLine.SETRANGE("Document Type","Document Type");
    SalesLine.SETRANGE("Document No.","No.");
    SalesLine.SETFILTER("Job Contract Entry No.",' <>%1',0);
    IF SalesLine.FIND('-') THEN BEGIN
    SalesLine.TESTFIELD("Job No.",'');
    SalesLine.TESTFIELD("Job Contract Entry No.",0);
    END;

    SalesLine.RESET;
    SalesLine.SETRANGE("Document Type","Document Type");
    SalesLine.SETRANGE("Document No.","No.");
    SalesLine.SETFILTER("Unit Price",' <>%1',0);
    SalesLine.SETFILTER("VAT %",' <>%1',0);
    IF SalesLine.FINDFIRST THEN BEGIN
    RecalculatePrice :=
    CONFIRM(
    STRSUBSTNO(
    Text024 +
    Text026,
    FIELDCAPTION("Prices Including VAT"),SalesLine.FIELDCAPTION("Unit Price")),
    TRUE);
    SalesLine.SetSalesHeader(Rec);

    IF "Currency Code" = '' THEN
    Currency.InitRoundingPrecision
    ELSE
    Currency.GET("Currency Code");
    SalesLine.LOCKTABLE;
    LOCKTABLE;
    SalesLine.FINDSET;
    REPEAT
    SalesLine.TESTFIELD("Quantity Invoiced",0);
    SalesLine.TESTFIELD("Prepmt. Amt. Inv.",0);
    IF NOT RecalculatePrice THEN BEGIN
    SalesLine."VAT Difference" := 0;
    SalesLine.InitOutstandingAmount;
    END ELSE
    IF "Prices Including VAT" THEN BEGIN
    SalesLine."Unit Price" :=
    ROUND(
    SalesLine."Unit Price" * (1 + (SalesLine."VAT %" / 100)),
    Currency."Unit-Amount Rounding Precision");
    IF SalesLine.Quantity <> 0 THEN BEGIN
    SalesLine."Line Discount Amount" :=
    ROUND(
    SalesLine.Quantity * SalesLine."Unit Price" * SalesLine."Line Discount %" / 100,
    Currency."Amount Rounding Precision");
    SalesLine.VALIDATE("Inv. Discount Amount",
    ROUND(
    SalesLine."Inv. Discount Amount" * (1 + (SalesLine."VAT %" / 100)),
    Currency."Amount Rounding Precision"));
    END;
    END ELSE BEGIN
    SalesLine."Unit Price" :=
    ROUND(
    SalesLine."Unit Price" / (1 + (SalesLine."VAT %" / 100)),
    Currency."Unit-Amount Rounding Precision");
    IF SalesLine.Quantity <> 0 THEN BEGIN
    SalesLine."Line Discount Amount" :=
    ROUND(
    SalesLine.Quantity * SalesLine."Unit Price" * SalesLine."Line Discount %" / 100,
    Currency."Amount Rounding Precision");
    SalesLine.VALIDATE("Inv. Discount Amount",
    ROUND(
    SalesLine."Inv. Discount Amount" / (1 + (SalesLine."VAT %" / 100)),
    Currency."Amount Rounding Precision"));
    END;
    END;
    SalesLine.MODIFY;
    UNTIL SalesLine.NEXT = 0;
    END;
    END;
    // End of the deleted lines.

    END;

    CaptionML=ENU=Prices Including VAT }
    { 37 ; ;Invoice Disc. Code ;Code20 ;OnValidate=BEGIN
    TESTFIELD(Status,Status::Open);
    ...

    Replacement code

    ...
    OnValidate=BEGIN
    MessageIfSalesLinesExist(FIELDCAPTION("Customer Price Group"));
    END;

    CaptionML=ENU=Customer Price Group }

    // Add the following lines.
    { 35 ; ;Prices Including VAT;Boolean ;OnValidate=BEGIN
    TESTFIELD(Status,Status::Open);

    IF "Prices Including VAT" <> xRec."Prices Including VAT" THEN
    UpdtPriceInclVAT;
    // End of the added lines.

    END;

    CaptionML=ENU=Prices Including VAT }
    { 37 ; ;Invoice Disc. Code ;Code20 ;OnValidate=BEGIN
    TESTFIELD(Status,Status::Open);
    ...
  2. Change the code in the UpdtPriceInclVAT function in the table (36) as follows:
    Existing code

    ...
    IF NewSalesLine."Bin Code" <> OldSalesLine."Bin Code" THEN
    NewSalesLine.VALIDATE("Bin Code",OldSalesLine."Bin Code");
    IF NewSalesLine.MODIFY THEN;
    END;

    BEGIN
    END.
    }
    }
    ...

    Replacement code

    ...
    IF NewSalesLine."Bin Code"<> OldSalesLine."Bin Code" THEN
    NewSalesLine.VALIDATE("Bin Code",OldSalesLine."Bin Code");
    IF NewSalesLine.MODIFY THEN;
    END;

    // Add the following lines.
    PROCEDURE UpdtPriceInclVAT@73();
    VAR
    SalesLine@1000 : Record 37;
    Currency@1001 : Record 4;
    JobPostLine@1002 : Codeunit 1001;
    RecalculatePrice@1003 : Boolean;
    BEGIN
    SalesLine.SETRANGE("Document Type","Document Type");
    SalesLine.SETRANGE("Document No.","No.");
    SalesLine.SETFILTER("Job Contract Entry No.",' <>%1',0);
    IF SalesLine.FINDFIRST THEN BEGIN
    SalesLine.TESTFIELD("Job No.",'');
    SalesLine.TESTFIELD("Job Contract Entry No.",0);
    END;

    SalesLine.RESET;
    SalesLine.SETRANGE("Document Type","Document Type");
    SalesLine.SETRANGE("Document No.","No.");
    SalesLine.SETFILTER("Unit Price",' <> %1',0);
    SalesLine.SETFILTER("VAT %",' <> %1',0);
    IF SalesLine.FINDFIRST THEN BEGIN
    IF CurrFieldNo = FIELDNO("Prices Including VAT") THEN
    RecalculatePrice :=
    CONFIRM(
    STRSUBSTNO(
    Text024 +
    Text026,
    FIELDCAPTION("Prices Including VAT"),SalesLine.FIELDCAPTION("Unit Price")),
    TRUE)
    ELSE
    RecalculatePrice := TRUE;

    SalesLine.SetSalesHeader(Rec);

    IF "Currency Code" = '' THEN
    Currency.InitRoundingPrecision
    ELSE
    Currency.GET("Currency Code");
    SalesLine.LOCKTABLE;
    LOCKTABLE;
    SalesLine.FINDSET;
    REPEAT
    SalesLine.TESTFIELD("Quantity Invoiced",0);
    SalesLine.TESTFIELD("Prepmt. Amt. Inv.",0);
    IF NOT RecalculatePrice THEN BEGIN
    SalesLine."VAT Difference" := 0;
    SalesLine.InitOutstandingAmount;
    END ELSE
    IF "Prices Including VAT" THEN BEGIN
    SalesLine."Unit Price" :=
    ROUND(
    SalesLine."Unit Price" * (1 + (SalesLine."VAT %" / 100)),
    Currency."Unit-Amount Rounding Precision");
    IF SalesLine.Quantity <> 0 THEN BEGIN
    SalesLine."Line Discount Amount" :=
    ROUND(
    SalesLine.Quantity * SalesLine."Unit Price" * SalesLine."Line Discount %" / 100,
    Currency."Amount Rounding Precision");
    SalesLine.VALIDATE("Inv. Discount Amount",
    ROUND(
    SalesLine."Inv. Discount Amount" * (1 + (SalesLine."VAT %" / 100)),
    Currency."Amount Rounding Precision"));
    END;
    END ELSE BEGIN
    SalesLine."Unit Price" :=
    ROUND(
    SalesLine."Unit Price" / (1 + (SalesLine."VAT %" / 100)),
    Currency."Unit-Amount Rounding Precision");
    IF SalesLine.Quantity <>0 THEN BEGIN
    SalesLine."Line Discount Amount" :=
    ROUND(
    SalesLine.Quantity * SalesLine."Unit Price" * SalesLine."Line Discount %" / 100,
    Currency."Amount Rounding Precision");
    SalesLine.VALIDATE("Inv. Discount Amount",
    ROUND(
    SalesLine."Inv. Discount Amount" / (1 + (SalesLine."VAT %" / 100)),
    Currency."Amount Rounding Precision"));
    END;
    END;
    SalesLine.MODIFY;
    UNTIL SalesLine.NEXT = 0;
    END;
    END;
    // End of the added lines.

    BEGIN
    END.
    }
    }
    ...
  3. Change the code in the Heading in the Purchase Header table (38) as follows:
    Existing code

    ...
    OBJECT Table 38 Purchase Header
    {
    OBJECT-PROPERTIES
    {

    // Delete the following lines.
    Date=14/08/09;
    Time=12:00:00;
    Version List=NAVW16.00.01;
    }
    PROPERTIES
    {
    DataCaptionFields=No.,Buy-from Vendor Name;
    // End of the deleted lines.

    OnInsert=BEGIN
    PurchSetup.GET;

    IF "No." = '' THEN BEGIN
    TestNoSeries;
    ...

    Replacement code

    ...
    OBJECT Table 38 Purchase Header
    {
    OBJECT-PROPERTIES
    {

    // Add the following lines.
    Date=09-02-11;
    Time=10:37:51 PM;
    Modified=Yes;
    Version List=NAVW16.00.01;
    }
    PROPERTIES
    {
    // End of the added lines.

    OnInsert=BEGIN
    PurchSetup.GET;

    IF "No." = '' THEN BEGIN
    TestNoSeries;
    ...
  4. Change the code in the Properties in the Purchase Header table (38) as follows:
    Existing code

    ...
    OnRename=BEGIN
    ERROR(Text003,TABLECAPTION);
    END;

    CaptionML=ENU=Purchase Header;
    LookupFormID=Form53;
    }
    FIELDS
    {
    ...

    Replacement code

    ...
    OnRename=BEGIN
    ERROR(Text003,TABLECAPTION);
    END;

    // Add the following line.
    DataCaptionFields=No.,Buy-from Vendor Name;
    // End of the added line.

    CaptionML=ENU=Purchase Header;
    LookupFormID=Form53;
    }
    FIELDS
    {
    ...
  5. Change the code in the Properties in the Purchase Header table (38) as follows:
    Existing code

    ...
    UpdatePurchLines(FIELDCAPTION("Currency Factor"));
    END;

    CaptionML=ENU=Currency Factor;
    DecimalPlaces=0:15;

    // Delete the following lines.
    MinValue=0;
    Editable=No }
    { 35 ; ;Prices Including VAT;Boolean ;OnValidate=VAR
    PurchLine@1000 : Record 39;
    Currency@1001 : Record 4;
    RecalculatePrice@1002 : Boolean;
    BEGIN
    TESTFIELD(Status,Status::Open);

    IF "Prices Including VAT" <> xRec."Prices Including VAT" THEN BEGIN
    PurchLine.SETRANGE("Document Type","Document Type");
    PurchLine.SETRANGE("Document No.","No.");
    PurchLine.SETFILTER("Direct Unit Cost",' <>%1',0);
    PurchLine.SETFILTER("VAT %",' <>%1',0);
    IF PurchLine.FINDFIRST THEN BEGIN
    RecalculatePrice :=
    CONFIRM(
    STRSUBSTNO(
    Text025 +
    Text027,
    FIELDCAPTION("Prices Including VAT"),PurchLine.FIELDCAPTION("Direct Unit Cost")),
    TRUE);
    PurchLine.SetPurchHeader(Rec);

    IF "Currency Code" = '' THEN
    Currency.InitRoundingPrecision
    ELSE
    Currency.GET("Currency Code");

    REPEAT
    PurchLine.TESTFIELD("Quantity Invoiced",0);
    PurchLine.TESTFIELD("Prepmt. Amt. Inv.",0);
    IF NOT RecalculatePrice THEN BEGIN
    PurchLine."VAT Difference" := 0;
    PurchLine.InitOutstandingAmount;
    END ELSE
    IF "Prices Including VAT" THEN BEGIN
    PurchLine."Direct Unit Cost" :=
    ROUND(
    PurchLine."Direct Unit Cost" * (1 + PurchLine."VAT %" / 100),
    Currency."Unit-Amount Rounding Precision");
    IF PurchLine.Quantity <> 0 THEN BEGIN
    PurchLine."Line Discount Amount" :=
    ROUND(
    PurchLine.Quantity * PurchLine."Direct Unit Cost" * PurchLine."Line Discount %" / 100,
    Currency."Amount Rounding Precision");
    PurchLine.VALIDATE("Inv. Discount Amount",
    ROUND(
    PurchLine."Inv. Discount Amount" * (1 + PurchLine."VAT %" / 100),
    Currency."Amount Rounding Precision"));
    END;
    END ELSE BEGIN
    PurchLine."Direct Unit Cost" :=
    ROUND(
    PurchLine."Direct Unit Cost" / (1 + PurchLine."VAT %" / 100),
    Currency."Unit-Amount Rounding Precision");
    IF PurchLine.Quantity <> 0 THEN BEGIN
    PurchLine."Line Discount Amount" :=
    ROUND(
    PurchLine.Quantity * PurchLine."Direct Unit Cost" * PurchLine."Line Discount %" / 100,
    Currency."Amount Rounding Precision");
    PurchLine.VALIDATE("Inv. Discount Amount",
    ROUND(
    PurchLine."Inv. Discount Amount" / (1 + PurchLine."VAT %" / 100),
    Currency."Amount Rounding Precision"));
    END;
    END;
    PurchLine.MODIFY;
    UNTIL PurchLine.NEXT = 0;
    END;
    END;
    // End of the deleted lines.

    END;

    CaptionML=ENU=Prices Including VAT }
    { 37 ; ;Invoice Disc. Code ;Code20 ;OnValidate=BEGIN
    TESTFIELD(Status,Status::Open);
    ...

    Replacement code

    ...
    UpdatePurchLines(FIELDCAPTION("Currency Factor"));
    END;

    CaptionML=ENU=Currency Factor;
    DecimalPlaces=0:15;

    // Add the following lines.
    Editable=No;
    MinValue=0 }
    { 35 ; ;Prices Including VAT;Boolean ;OnValidate=BEGIN
    TESTFIELD(Status,Status::Open);

    IF "Prices Including VAT" <> xRec."Prices Including VAT" THEN
    UpdtPriceInclVAT;
    // End of the added lines.

    END;

    CaptionML=ENU=Prices Including VAT }
    { 37 ; ;Invoice Disc. Code ;Code20 ;OnValidate=BEGIN
    TESTFIELD(Status,Status::Open);
    ...
  6. Change the code in the Fields in the Purchase Header table (38) as follows:
    Existing code 1

    ...
    END;

    CaptionML=ENU=Purchaser Code }
    { 45 ; ;Order Class ;Code10 ;CaptionML=ENU=Order Class }
    { 46 ; ;Comment ;Boolean ;FieldClass=FlowField;

    // Delete the following lines.
    CalcFormula=Exist("Purch. Comment Line" WHERE (Document Type=FIELD(Document Type),
    No.=FIELD(No.),
    Document Line No.=CONST(0)));
    // End of the deleted lines.

    CaptionML=ENU=Comment;
    Editable=No }
    { 47 ; ;No. Printed ;Integer ;CaptionML=ENU=No. Printed;
    Editable=No }
    { 51 ; ;On Hold ;Code3 ;CaptionML=ENU=On Hold }
    ...

    Replacement code 1

    ...
    END;

    CaptionML=ENU=Purchaser Code }
    { 45 ; ;Order Class ;Code10 ;CaptionML=ENU=Order Class }
    { 46 ; ;Comment ;Boolean ;FieldClass=FlowField;

    // Add the following line.
    CalcFormula=Exist("Purch. Comment Line" WHERE (Document Type=FIELD(Document Type), No.=FIELD(No.), Document Line No.=CONST(0)));
    // End of the added line.

    CaptionML=ENU=Comment;
    Editable=No }
    { 47 ; ;No. Printed ;Integer ;CaptionML=ENU=No. Printed;
    Editable=No }
    { 51 ; ;On Hold ;Code3 ;CaptionML=ENU=On Hold }

    ...

    Existing code 2

    ...
    END;
    CLEAR(ApplyVendEntries);
    END;

    CaptionML=ENU=Applies-to Doc. No. }

    // Delete the following lines.
    { 55 ; ;Bal. Account No. ;Code20 ;TableRelation=IF (Bal. Account Type=CONST(G/L Account)) "G/L Account"
    ELSE IF (Bal. Account Type=CONST(Bank Account)) "Bank Account";
    // End of the deleted lines.

    OnValidate=BEGIN
    IF "Bal. Account No." <>'' THEN
    CASE "Bal. Account Type" OF
    "Bal. Account Type"::"G/L Account":
    BEGIN
    ...

    Replacement code 2

    ...
    END;
    CLEAR(ApplyVendEntries);
    END;

    CaptionML=ENU=Applies-to Doc. No. }

    // Add the following line.
    { 55 ; ;Bal. Account No. ;Code20 ;TableRelation=IF (Bal. Account Type=CONST(G/L Account)) "G/L Account" ELSE IF (Bal. Account Type=CONST(Bank Account)) "Bank Account";
    // End of the added line.

    OnValidate=BEGIN
    IF "Bal. Account No." <> '' THEN
    CASE "Bal. Account Type" OF
    "Bal. Account Type"::"G/L Account":
    BEGIN
    ...

    Existing code 3

    ...
    CaptionML=ENU=Bal. Account No. }
    { 57 ; ;Receive ;Boolean ;CaptionML=ENU=Receive }
    { 58 ; ;Invoice ;Boolean ;CaptionML=ENU=Invoice }
    { 60 ; ;Amount ;Decimal ;FieldClass=FlowField;

    // Delete the following lines.
    CalcFormula=Sum("Purchase Line".Amount WHERE (Document Type=FIELD(Document Type),
    Document No.=FIELD(No.)));
    // End of the deleted lines.

    CaptionML=ENU=Amount;
    Editable=No;
    AutoFormatType=1;
    AutoFormatExpr="Currency Code" }
    { 61 ; ;Amount Including VAT;Decimal ;FieldClass=FlowField;
    ...

    Replacement code 3

    ...
    CaptionML=ENU=Bal. Account No. }
    { 57 ; ;Receive ;Boolean ;CaptionML=ENU=Receive }
    { 58 ; ;Invoice ;Boolean ;CaptionML=ENU=Invoice }
    { 60 ; ;Amount ;Decimal ;FieldClass=FlowField;

    // Add the following line.
    CalcFormula=Sum("Purchase Line".Amount WHERE (Document Type=FIELD(Document Type), Document No.=FIELD(No.)));
    // End of the added line.

    CaptionML=ENU=Amount;
    Editable=No;
    AutoFormatType=1;
    AutoFormatExpr="Currency Code" }
    { 61 ; ;Amount Including VAT;Decimal ;FieldClass=FlowField;
    ...

    Existing code 4

    ...
    CaptionML=ENU=Amount;
    Editable=No;
    AutoFormatType=1;
    AutoFormatExpr="Currency Code" }
    { 61 ; ;Amount Including VAT;Decimal ;FieldClass=FlowField;

    // Delete the following lines.
    CalcFormula=Sum("Purchase Line"."Amount Including VAT" WHERE (Document Type=FIELD(Document Type),
    Document No.=FIELD(No.)));
    // End of the deleted lines.

    CaptionML=ENU=Amount Including VAT;
    Editable=No;
    AutoFormatType=1;
    AutoFormatExpr="Currency Code" }
    { 62 ; ;Receiving No. ;Code20 ;CaptionML=ENU=Receiving No. }
    ...

    Replacement code 4

    ...
    CaptionML=ENU=Amount;
    Editable=No;
    AutoFormatType=1;
    AutoFormatExpr="Currency Code" }
    { 61 ; ;Amount Including VAT;Decimal ;FieldClass=FlowField;

    // Add the following line.
    CalcFormula=Sum("Purchase Line"."Amount Including VAT" WHERE (Document Type=FIELD(Document Type), Document No.=FIELD(No.)));
    // End of the added line.

    CaptionML=ENU=Amount Including VAT;
    Editable=No;
    AutoFormatType=1;
    AutoFormatExpr="Currency Code" }
    { 62 ; ;Receiving No. ;Code20 ;CaptionML=ENU=Receiving No. }
    ...

    Existing code 5

    ...
    CaptionML=ENU=Prepmt. Payment Discount %;
    DecimalPlaces=0:5 }
    { 151 ; ;Quote No. ;Code20 ;CaptionML=ENU=Quote No.;
    Editable=No }
    { 5043; ;No. of Archived Versions;Integer ;FieldClass=FlowField;

    // Delete the following lines.
    CalcFormula=Max("Purchase Header Archive"."Version No." WHERE (Document Type=FIELD(Document Type),
    No.=FIELD(No.),
    Doc. No. Occurrence=FIELD(Doc. No. Occurrence)));
    // End of the deleted lines.

    CaptionML=ENU=No. of Archived Versions;
    Editable=No }
    { 5048; ;Doc. No. Occurrence ;Integer ;CaptionML=ENU=Doc. No. Occurrence }
    { 5050; ;Campaign No. ;Code20 ;TableRelation=Campaign;
    OnValidate=VAR
    ...

    Replacement code 5

    ...
    CaptionML=ENU=Prepmt. Payment Discount %;
    DecimalPlaces=0:5 }
    { 151 ; ;Quote No. ;Code20 ;CaptionML=ENU=Quote No.;
    Editable=No }
    { 5043; ;No. of Archived Versions;Integer ;FieldClass=FlowField;
    // Add the following line.
    CalcFormula=Max("Purchase Header Archive"."Version No." WHERE (Document Type=FIELD(Document Type), No.=FIELD(No.), Doc. No. Occurrence=FIELD(Doc. No. Occurrence)));
    // End of the added line.
    CaptionML=ENU=No. of Archived Versions;
    Editable=No }
    { 5048; ;Doc. No. Occurrence ;Integer ;CaptionML=ENU=Doc. No. Occurrence }
    { 5050; ;Campaign No. ;Code20 ;TableRelation=Campaign;
    OnValidate=VAR
    ...

    Existing code 6

    ...
    END;
    END;

    CaptionML=ENU=Responsibility Center }
    { 5752; ;Completely Received ;Boolean ;FieldClass=FlowField;

    // Delete the following lines.
    CalcFormula=Min("Purchase Line"."Completely Received" WHERE (Document Type=FIELD(Document Type),
    Document No.=FIELD(No.),
    Type=FILTER( <>' '),
    Location Code=FIELD(Location Filter)));
    // End of the deleted lines.

    CaptionML=ENU=Completely Received;
    Editable=No }
    { 5753; ;Posting from Whse. Ref.;Integer ;CaptionML=ENU=Posting from Whse. Ref. }
    { 5754; ;Location Filter ;Code10 ;FieldClass=FlowFilter;
    TableRelation=Location;
    ...

    Replacement code 6

    ...
    END;
    END;

    CaptionML=ENU=Responsibility Center }
    { 5752; ;Completely Received ;Boolean ;FieldClass=FlowField;

    // Add the following line.
    CalcFormula=Min("Purchase Line"."Completely Received" WHERE (Document Type=FIELD(Document Type), Document No.=FIELD(No.), Type=FILTER(<>' '), Location Code=FIELD(Location Filter)));
    // End of the added line.

    CaptionML=ENU=Completely Received;
    Editable=No }
    { 5753; ;Posting from Whse. Ref.;Integer ;CaptionML=ENU=Posting from Whse. Ref. }
    { 5754; ;Location Filter ;Code10 ;FieldClass=FlowFilter;
    TableRelation=Location;
    ...
  7. Change the code in the UpdtPriceInclVAT function in the Purchase Header table (38) as follows:
    Existing code

    ...
    PurchSetup.GET;
    IF PurchSetup."Calc. Inv. Discount" THEN
    PurchaseInvDisc.CalculateIncDiscForHeader(Rec);
    END;

    BEGIN
    END.
    }
    }
    ...

    Replacement code

    ...
    PurchSetup.GET;
    IF PurchSetup."Calc. Inv. Discount" THEN
    PurchaseInvDisc.CalculateIncDiscForHeader(Rec);
    END;

    // Add the following lines.
    PROCEDURE UpdtPriceInclVAT@76();
    VAR
    PurchLine@1001 : Record 39;
    Currency@1002 : Record 4;
    RecalculatePrice@1003 : Boolean;
    BEGIN
    PurchLine.SETRANGE("Document Type","Document Type");
    PurchLine.SETRANGE("Document No.","No.");
    PurchLine.SETFILTER("Direct Unit Cost",'<> %1',0);
    PurchLine.SETFILTER("VAT %",'<>%1',0);
    IF PurchLine.FINDFIRST THEN BEGIN
    IF CurrFieldNo = FIELDNO("Prices Including VAT") THEN
    RecalculatePrice :=
    CONFIRM(
    STRSUBSTNO(
    Text025 +
    Text027,
    FIELDCAPTION("Prices Including VAT"),PurchLine.FIELDCAPTION("Direct Unit Cost")),
    TRUE)
    ELSE
    RecalculatePrice := TRUE;

    PurchLine.SetPurchHeader(Rec);

    IF "Currency Code" = '' THEN
    Currency.InitRoundingPrecision
    ELSE
    Currency.GET("Currency Code");

    REPEAT
    PurchLine.TESTFIELD("Quantity Invoiced",0);
    PurchLine.TESTFIELD("Prepmt. Amt. Inv.",0);
    IF NOT RecalculatePrice THEN BEGIN
    PurchLine."VAT Difference" := 0;
    PurchLine.InitOutstandingAmount;
    END ELSE
    IF "Prices Including VAT" THEN BEGIN
    PurchLine."Direct Unit Cost" :=
    ROUND(
    PurchLine."Direct Unit Cost" * (1 + PurchLine."VAT %" / 100),
    Currency."Unit-Amount Rounding Precision");
    IF PurchLine.Quantity <> 0 THEN BEGIN
    PurchLine."Line Discount Amount" :=
    ROUND(
    PurchLine.Quantity * PurchLine."Direct Unit Cost" * PurchLine."Line Discount %" / 100,
    Currency."Amount Rounding Precision");
    PurchLine.VALIDATE("Inv. Discount Amount",
    ROUND(
    PurchLine."Inv. Discount Amount" * (1 + PurchLine."VAT %" / 100),
    Currency."Amount Rounding Precision"));
    END;
    END ELSE BEGIN
    PurchLine."Direct Unit Cost" :=
    ROUND(
    PurchLine."Direct Unit Cost" / (1 + PurchLine."VAT %" / 100),
    Currency."Unit-Amount Rounding Precision");
    IF PurchLine.Quantity <> 0 THEN BEGIN
    PurchLine."Line Discount Amount" :=
    ROUND(
    PurchLine.Quantity * PurchLine."Direct Unit Cost" * PurchLine."Line Discount %" / 100,
    Currency."Amount Rounding Precision");
    PurchLine.VALIDATE("Inv. Discount Amount",
    ROUND(
    PurchLine."Inv. Discount Amount" / (1 + PurchLine."VAT %" / 100),
    Currency."Amount Rounding Precision"));
    END;
    END;
    PurchLine.MODIFY;
    UNTIL PurchLine.NEXT = 0;
    END;
    END;
    // End of the added lines.

    BEGIN
    END.
    }
    }
    ...
  8. Change the code in the Heading in the Return Shipment Line table (6651) as follows:
    Existing code

    ...
    OBJECT Table 6651 Return Shipment Line
    {
    OBJECT-PROPERTIES
    {

    // Delete the following lines.
    Date=14/08/09;
    Time=12:00:00;
    // End of the deleted lines.

    Version List=NAVW16.00.01;
    }
    PROPERTIES
    {
    Permissions=TableData 32=r,
    ...

    Replacement code

    ...
    OBJECT Table 6651 Return Shipment Line
    {
    OBJECT-PROPERTIES
    {

    // Add the following lines.
    Date=10-02-11;
    Time=[ 6:14:00 PM];
    Modified=Yes;
    // End of the added lines.

    Version List=NAVW16.00.01;
    }
    PROPERTIES
    {
    Permissions=TableData 32=r,
    ...
  9. Change the code in the Fields in the Return Shipment Line table (6651) as follows:
    Existing code 1

    ...
    CaptionML=ENU=Document No. }
    { 4 ; ;Line No. ;Integer ;CaptionML=ENU=Line No. }
    { 5 ; ;Type ;Option ;CaptionML=ENU=Type;
    OptionCaptionML=ENU=" ,G/L Account,Item,,Fixed Asset,Charge (Item)";
    OptionString=[ ,G/L Account,Item,,Fixed Asset,Charge (Item)] }

    // Delete the following lines.
    { 6 ; ;No. ;Code20 ;TableRelation=IF (Type=CONST(G/L Account)) "G/L Account"
    ELSE IF (Type=CONST(Item)) Item
    ELSE IF (Type=CONST(Fixed Asset)) "Fixed Asset"
    ELSE IF (Type=CONST("Charge (Item)")) "Item Charge";
    CaptionML=ENU=No. }
    { 7 ; ;Location Code ;Code10 ;TableRelation=Location WHERE (Use As In-Transit=CONST(No));
    CaptionML=ENU=Location Code }
    { 8 ; ;Posting Group ;Code10 ;TableRelation=IF (Type=CONST(Item)) "Inventory Posting Group"
    ELSE IF (Type=CONST(Fixed Asset)) "FA Posting Group";
    // End of the deleted lines.
    CaptionML=ENU=Posting Group;
    Editable=No }
    { 11 ; ;Description ;Text50 ;CaptionML=ENU=Description }
    { 12 ; ;Description 2 ;Text50 ;CaptionML=ENU=Description 2 }
    { 13 ; ;Unit of Measure ;Text10 ;CaptionML=ENU=Unit of Measure }
    ...

    Replacement code 1

    ...
    CaptionML=ENU=Document No. }
    { 4 ; ;Line No. ;Integer ;CaptionML=ENU=Line No. }
    { 5 ; ;Type ;Option ;CaptionML=ENU=Type;
    OptionCaptionML=ENU=" ,G/L Account,Item,,Fixed Asset,Charge (Item)";
    OptionString=[ ,G/L Account,Item,,Fixed Asset,Charge (Item)] }

    // Add the following lines.
    { 6 ; ;No. ;Code20 ;TableRelation=IF (Type=CONST(G/L Account)) "G/L Account" ELSE IF (Type=CONST(Item)) Item ELSE IF (Type=CONST(Fixed Asset)) "Fixed Asset" ELSE IF (Type=CONST("Charge (Item)")) "Item Charge";
    CaptionML=ENU=No. }
    { 7 ; ;Location Code ;Code10 ;TableRelation=Location WHERE (Use As In-Transit=CONST(No));
    CaptionML=ENU=Location Code }
    { 8 ; ;Posting Group ;Code10 ;TableRelation=IF (Type=CONST(Item)) "Inventory Posting Group" ELSE IF (Type=CONST(Fixed Asset)) "FA Posting Group";
    // End of the added lines.

    CaptionML=ENU=Posting Group;
    Editable=No }
    { 11 ; ;Description ;Text50 ;CaptionML=ENU=Description }
    { 12 ; ;Description 2 ;Text50 ;CaptionML=ENU=Description 2 }
    { 13 ; ;Unit of Measure ;Text10 ;CaptionML=ENU=Unit of Measure }

    ...

    Existing code 2

    ...
    CaptionML=ENU=Currency Code;
    Editable=No }
    { 97 ; ;Blanket Order No. ;Code20 ;TableRelation="Sales Header".No. WHERE (Document Type=CONST(Blanket Order));
    TestTableRelation=No;
    CaptionML=ENU=Blanket Order No. }

    // Delete the following lines.
    { 98 ; ;Blanket Order Line No.;Integer ;TableRelation="Sales Line"."Line No." WHERE (Document Type=CONST(Blanket Order),
    Document No.=FIELD(Blanket Order No.));
    // End of the deleted lines.
    TestTableRelation=No;
    CaptionML=ENU=Blanket Order Line No. }
    { 99 ; ;VAT Base Amount ;Decimal ;CaptionML=ENU=VAT Base Amount;
    Editable=No;
    AutoFormatType=1;
    ...

    Replacement code 2

    ...
    CaptionML=ENU=Currency Code;
    Editable=No }
    { 97 ; ;Blanket Order No. ;Code20 ;TableRelation="Sales Header".No. WHERE (Document Type=CONST(Blanket Order));
    TestTableRelation=No;
    CaptionML=ENU=Blanket Order No. }

    // Add the following line.
    { 98 ; ;Blanket Order Line No.;Integer ;TableRelation="Sales Line"."Line No." WHERE (Document Type=CONST(Blanket Order), Document No.=FIELD(Blanket Order No.));
    // End of the added line.
    TestTableRelation=No;
    CaptionML=ENU=Blanket Order Line No. }
    { 99 ; ;VAT Base Amount ;Decimal ;CaptionML=ENU=VAT Base Amount;
    Editable=No;
    AutoFormatType=1;

    ...

    Existing code 3

    ...
    AutoFormatExpr=GetCurrencyCode }
    { 131 ; ;Posting Date ;Date ;CaptionML=ENU=Posting Date }
    { 5401; ;Prod. Order No. ;Code20 ;CaptionML=ENU=Prod. Order No. }
    { 5402; ;Variant Code ;Code10 ;TableRelation=IF (Type=CONST(Item)) "Item Variant".Code WHERE (Item No.=FIELD(No.));
    CaptionML=ENU=Variant Code }

    // Delete the following lines.
    { 5403; ;Bin Code ;Code20 ;TableRelation=Bin.Code WHERE (Location Code=FIELD(Location Code),
    Item Filter=FIELD(No.),
    Variant Filter=FIELD(Variant Code));
    CaptionML=ENU=Bin Code }
    { 5404; ;Qty. per Unit of Measure;Decimal ;CaptionML=ENU=Qty. per Unit of Measure;
    DecimalPlaces=0:5;
    Editable=No }
    { 5407; ;Unit of Measure Code;Code10 ;TableRelation=IF (Type=CONST(Item)) "Item Unit of Measure".Code WHERE (Item No.=FIELD(No.))
    ELSE "Unit of Measure";
    // End of the deleted lines.

    CaptionML=ENU=Unit of Measure Code }
    { 5415; ;Quantity (Base) ;Decimal ;CaptionML=ENU=Quantity (Base);
    DecimalPlaces=0:5 }
    { 5461; ;Qty. Invoiced (Base);Decimal ;CaptionML=ENU=Qty. Invoiced (Base);
    DecimalPlaces=0:5;
    ...

    Replacement code 3

    ...
    AutoFormatExpr=GetCurrencyCode }
    { 131 ; ;Posting Date ;Date ;CaptionML=ENU=Posting Date }
    { 5401; ;Prod. Order No. ;Code20 ;CaptionML=ENU=Prod. Order No. }
    { 5402; ;Variant Code ;Code10 ;TableRelation=IF (Type=CONST(Item)) "Item Variant".Code WHERE (Item No.=FIELD(No.));
    CaptionML=ENU=Variant Code }

    // Add the following lines.
    { 5403; ;Bin Code ;Code20 ;TableRelation=Bin.Code WHERE (Location Code=FIELD(Location Code), Item Filter=FIELD(No.), Variant Filter=FIELD(Variant Code));
    CaptionML=ENU=Bin Code }
    { 5404; ;Qty. per Unit of Measure;Decimal ;CaptionML=ENU=Qty. per Unit of Measure;
    DecimalPlaces=0:5;
    Editable=No }
    { 5407; ;Unit of Measure Code;Code10 ;TableRelation=IF (Type=CONST(Item)) "Item Unit of Measure".Code WHERE (Item No.=FIELD(No.)) ELSE "Unit of Measure";
    // End of the added lines.

    CaptionML=ENU=Unit of Measure Code }
    { 5415; ;Quantity (Base) ;Decimal ;CaptionML=ENU=Quantity (Base);
    DecimalPlaces=0:5 }
    { 5461; ;Qty. Invoiced (Base);Decimal ;CaptionML=ENU=Qty. Invoiced (Base);
    DecimalPlaces=0:5;

    ...
  10. Change the code in the InsertInvLineFromRetShptLine function in the Return Shipment Line table (6651) as follows:
    Add the following variables:

    • Name: PurchCrMemoHeader; DataType: Record; 38

    • Name: PurchRetOrderHeader; DataType: Record; 38

    Existing code

    ...
    NextLineNo := NextLineNo + 10000;
    IF "Attached to Line No." = 0 THEN
    SETRANGE("Attached to Line No.","Line No.");
    UNTIL (NEXT = 0) OR ("Attached to Line No." = 0);
    END;

    PROCEDURE GetPurchCrMemoLines@4(VAR TempPurchCrMemoLine@1000 : TEMPORARY Record 125);
    VAR
    PurchCrMemoLine@1003 : Record 125;
    ...

    Replacement code

    ...
    NextLineNo := NextLineNo + 10000;
    IF "Attached to Line No." = 0 THEN
    SETRANGE("Attached to Line No.","Line No.");
    UNTIL (NEXT = 0) OR ("Attached to Line No." = 0);

    // Add the following lines.
    PurchCrMemoHeader.GET(PurchCrMemoHeader."Document Type"::"Credit Memo",PurchLine."Document No.");
    PurchRetOrderHeader.GET(PurchRetOrderHeader."Document Type"::"Return Order","Return Order No.");
    IF PurchCrMemoHeader."Prices Including VAT" <> PurchRetOrderHeader."Prices Including VAT" THEN
    PurchCrMemoHeader.UpdtPriceInclVAT;
    // End of the added lines.

    END;

    PROCEDURE GetPurchCrMemoLines@4(VAR TempPurchCrMemoLine@1000 : TEMPORARY Record 125);
    VAR
    PurchCrMemoLine@1003 : Record 125;

    ...
  11. Change the code in the Heading in the Return Receipt Line table (6661) as follows:
    Existing code

    ...
    OBJECT Table 6661 Return Receipt Line
    {
    OBJECT-PROPERTIES
    {

    // Delete the following lines.
    Date=14/08/09;
    Time=12:00:00;
    // End of the deleted lines.

    Version List=NAVW16.00.01;
    }
    PROPERTIES
    {
    Permissions=TableData 32=r,
    ...

    Replacement code

    ...
    OBJECT Table 6661 Return Receipt Line
    {
    OBJECT-PROPERTIES
    {

    // Add the following lines.
    Date=10-02-11;
    Time=[ 6:15:56 PM];
    Modified=Yes;
    // End of the added lines.

    Version List=NAVW16.00.01;
    }
    PROPERTIES
    {
    Permissions=TableData 32=r,

    ...
  12. Change the code in the Fields in the Return Receipt Line table (6661) as follows:
    Existing code 1

    ...
    CaptionML=ENU=Document No. }
    { 4 ; ;Line No. ;Integer ;CaptionML=ENU=Line No. }
    { 5 ; ;Type ;Option ;CaptionML=ENU=Type;
    OptionCaptionML=ENU=" ,G/L Account,Item,Resource,Fixed Asset,Charge (Item)";
    OptionString=[ ,G/L Account,Item,Resource,Fixed Asset,Charge (Item)] }

    // Delete the following lines.
    { 6 ; ;No. ;Code20 ;TableRelation=IF (Type=CONST(G/L Account)) "G/L Account"
    ELSE IF (Type=CONST(Item)) Item
    ELSE IF (Type=CONST(Resource)) Resource
    ELSE IF (Type=CONST(Fixed Asset)) "Fixed Asset"
    ELSE IF (Type=CONST("Charge (Item)")) "Item Charge";
    CaptionML=ENU=No. }
    { 7 ; ;Location Code ;Code10 ;TableRelation=Location WHERE (Use As In-Transit=CONST(No));
    CaptionML=ENU=Location Code }
    { 8 ; ;Posting Group ;Code10 ;TableRelation=IF (Type=CONST(Item)) "Inventory Posting Group"
    ELSE IF (Type=CONST(Fixed Asset)) "FA Posting Group";
    // End of the deleted lines.

    CaptionML=ENU=Posting Group;
    Editable=No }
    { 10 ; ;Shipment Date ;Date ;CaptionML=ENU=Shipment Date }
    { 11 ; ;Description ;Text50 ;CaptionML=ENU=Description }
    { 12 ; ;Description 2 ;Text50 ;CaptionML=ENU=Description 2 }
    ...

    Replacement code 1

    ...
    CaptionML=ENU=Document No. }
    { 4 ; ;Line No. ;Integer ;CaptionML=ENU=Line No. }
    { 5 ; ;Type ;Option ;CaptionML=ENU=Type;
    OptionCaptionML=ENU=" ,G/L Account,Item,Resource,Fixed Asset,Charge (Item)";
    OptionString=[ ,G/L Account,Item,Resource,Fixed Asset,Charge (Item)] }

    // Add the following lines.
    { 6 ; ;No. ;Code20 ;TableRelation=IF (Type=CONST(G/L Account)) "G/L Account" ELSE IF (Type=CONST(Item)) Item ELSE IF (Type=CONST(Resource)) Resource ELSE IF (Type=CONST(Fixed Asset)) "Fixed Asset" ELSE IF (Type=CONST("Charge (Item)")) "Item Charge";
    CaptionML=ENU=No. }
    { 7 ; ;Location Code ;Code10 ;TableRelation=Location WHERE (Use As In-Transit=CONST(No));
    CaptionML=ENU=Location Code }
    { 8 ; ;Posting Group ;Code10 ;TableRelation=IF (Type=CONST(Item)) "Inventory Posting Group" ELSE IF (Type=CONST(Fixed Asset)) "FA Posting Group";
    // End of the added lines.

    CaptionML=ENU=Posting Group;
    Editable=No }
    { 10 ; ;Shipment Date ;Date ;CaptionML=ENU=Shipment Date }
    { 11 ; ;Description ;Text50 ;CaptionML=ENU=Description }
    { 12 ; ;Description 2 ;Text50 ;CaptionML=ENU=Description 2 }

    ...

    Existing code 2

    ...
    CaptionML=ENU=Currency Code;
    Editable=No }
    { 97 ; ;Blanket Order No. ;Code20 ;TableRelation="Sales Header".No. WHERE (Document Type=CONST(Blanket Order));
    TestTableRelation=No;
    CaptionML=ENU=Blanket Order No. }

    // Delete the following lines.
    { 98 ; ;Blanket Order Line No.;Integer ;TableRelation="Sales Line"."Line No." WHERE (Document Type=CONST(Blanket Order),
    Document No.=FIELD(Blanket Order No.));
    // End of the deleted lines.

    TestTableRelation=No;
    CaptionML=ENU=Blanket Order Line No. }
    { 99 ; ;VAT Base Amount ;Decimal ;CaptionML=ENU=VAT Base Amount;
    Editable=No;
    AutoFormatType=1;
    ...

    Replacement code 2

    ...
    CaptionML=ENU=Currency Code;
    Editable=No }
    { 97 ; ;Blanket Order No. ;Code20 ;TableRelation="Sales Header".No. WHERE (Document Type=CONST(Blanket Order));
    TestTableRelation=No;
    CaptionML=ENU=Blanket Order No. }
    // Add the following line.
    { 98 ; ;Blanket Order Line No.;Integer ;TableRelation="Sales Line"."Line No." WHERE (Document Type=CONST(Blanket Order), Document No.=FIELD(Blanket Order No.));
    // End of the added line.

    TestTableRelation=No;
    CaptionML=ENU=Blanket Order Line No. }
    { 99 ; ;VAT Base Amount ;Decimal ;CaptionML=ENU=VAT Base Amount;
    Editable=No;
    AutoFormatType=1;

    ...

    Existing code 3

    ...
    AutoFormatType=2;
    AutoFormatExpr=GetCurrencyCode }
    { 131 ; ;Posting Date ;Date ;CaptionML=ENU=Posting Date }
    { 5402; ;Variant Code ;Code10 ;TableRelation=IF (Type=CONST(Item)) "Item Variant".Code WHERE (Item No.=FIELD(No.));
    CaptionML=ENU=Variant Code }

    // Delete the following lines.
    { 5403; ;Bin Code ;Code20 ;TableRelation=Bin.Code WHERE (Location Code=FIELD(Location Code),
    Item Filter=FIELD(No.),
    Variant Filter=FIELD(Variant Code));
    CaptionML=ENU=Bin Code }
    { 5404; ;Qty. per Unit of Measure;Decimal ;CaptionML=ENU=Qty. per Unit of Measure;
    DecimalPlaces=0:5;
    Editable=No }
    { 5407; ;Unit of Measure Code;Code10 ;TableRelation=IF (Type=CONST(Item)) "Item Unit of Measure".Code WHERE (Item No.=FIELD(No.))
    ELSE "Unit of Measure";
    // End of the deleted lines.

    CaptionML=ENU=Unit of Measure Code }
    { 5415; ;Quantity (Base) ;Decimal ;CaptionML=ENU=Quantity (Base);
    DecimalPlaces=0:5 }
    { 5461; ;Qty. Invoiced (Base);Decimal ;CaptionML=ENU=Qty. Invoiced (Base);
    DecimalPlaces=0:5;
    ...

    Replacement code 3

    ...
    AutoFormatType=2;
    AutoFormatExpr=GetCurrencyCode }
    { 131 ; ;Posting Date ;Date ;CaptionML=ENU=Posting Date }
    { 5402; ;Variant Code ;Code10 ;TableRelation=IF (Type=CONST(Item)) "Item Variant".Code WHERE (Item No.=FIELD(No.));
    CaptionML=ENU=Variant Code }

    // Add the following lines.
    { 5403; ;Bin Code ;Code20 ;TableRelation=Bin.Code WHERE (Location Code=FIELD(Location Code), Item Filter=FIELD(No.), Variant Filter=FIELD(Variant Code));
    CaptionML=ENU=Bin Code }
    { 5404; ;Qty. per Unit of Measure;Decimal ;CaptionML=ENU=Qty. per Unit of Measure;
    DecimalPlaces=0:5;
    Editable=No }
    { 5407; ;Unit of Measure Code;Code10 ;TableRelation=IF (Type=CONST(Item)) "Item Unit of Measure".Code WHERE (Item No.=FIELD(No.)) ELSE "Unit of Measure";
    // End of the added lines.

    CaptionML=ENU=Unit of Measure Code }
    { 5415; ;Quantity (Base) ;Decimal ;CaptionML=ENU=Quantity (Base);
    DecimalPlaces=0:5 }
    { 5461; ;Qty. Invoiced (Base);Decimal ;CaptionML=ENU=Qty. Invoiced (Base);
    DecimalPlaces=0:5;

    ...
  13. Change the code in the InsertInvLineFromRetRcptLine function in the Return Receipt Line table (6661) as follows:
    Add the following variables:

    • Name: SalesCrMemoHeader; DataType: Record; 36

    • Name: SalesRetOrderHeader; DataType: Record; 36

    Existing code

    ...
    IF SalesOrderHeader.GET(SalesOrderHeader."Document Type"::Order,"Return Order No.") THEN BEGIN
    SalesOrderHeader."Get Shipment Used" := TRUE;
    SalesOrderHeader.MODIFY;
    END;
    END;

    PROCEDURE GetSalesCrMemoLines@4(VAR TempSalesCrMemoLine@1000 : TEMPORARY Record 115);
    VAR
    SalesCrMemoLine@1003 : Record 115;
    ...

    Replacement code

    ...
    IF SalesOrderHeader.GET(SalesOrderHeader."Document Type"::Order,"Return Order No.") THEN BEGIN
    SalesOrderHeader."Get Shipment Used" := TRUE;
    SalesOrderHeader.MODIFY;
    END;
    // Add the following lines.
    SalesCrMemoHeader.GET(SalesCrMemoHeader."Document Type"::"Credit Memo",SalesLine."Document No.");
    SalesRetOrderHeader.GET(SalesRetOrderHeader."Document Type"::"Return Order","Return Order No.");
    IF SalesCrMemoHeader."Prices Including VAT" <> SalesRetOrderHeader."Prices Including VAT" THEN
    SalesCrMemoHeader.UpdtPriceInclVAT;
    // End of the added lines.

    END;

    PROCEDURE GetSalesCrMemoLines@4(VAR TempSalesCrMemoLine@1000 : TEMPORARY Record 115);
    VAR
    SalesCrMemoLine@1003 : Record 115;

    ...


Prerequisites

You must have Microsoft Dynamics NAV 2009 Service Pack 1 (SP1) installed to apply this hotfix.

Removal information

You cannot remove this hotfix.

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

References

VSTF DynamicsNAV SE: 252355

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

Thank you for your feedback!

×