Sign in with Microsoft
New to Microsoft? Create an account.

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

Symptoms

Assume that you post a sales invoice in a foreign currency for a customer in Microsoft Dynamics NAV 2009 R2 and in Microsoft Dynamics NAV 2009 service Pack 1 (SP1). When you run the "Customer - Summary Aging" report (105) or the "Vendor - Summary Aging" report (305), the Totals value is incorrect if the amounts are not in local currency (LCY).

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. However, 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 of Data Item Number 1 in the Customer - Summary Aging report (105) as follows:
    Existing code

    ...
    DtldCustLedgEntry.SETRANGE("Customer No.","No.");
    DtldCustLedgEntry.SETRANGE("Initial Entry Due Date",PeriodStartDate[i],PeriodStartDate[i + 1] - 1);
    DtldCustLedgEntry.CALCSUMS("Amount (LCY)");
    CustBalanceDue[i] := DtldCustLedgEntry."Amount (LCY)";
    CustBalanceDueLCY[i] := DtldCustLedgEntry."Amount (LCY)";
    IF CustBalanceDue[i] <> 0 THEN
    PrintLine := TRUE;
    LineTotalCustBalance := LineTotalCustBalance + CustBalanceDueLCY[i];
    TotalCustBalanceLCY := TotalCustBalanceLCY + CustBalanceDueLCY[i];
    END;
    ...

    Replacement code

    ...
    DtldCustLedgEntry.SETRANGE("Customer No.","No.");
    DtldCustLedgEntry.SETRANGE("Initial Entry Due Date",PeriodStartDate[i],PeriodStartDate[i + 1] - 1);
    DtldCustLedgEntry.CALCSUMS("Amount (LCY)");
    CustBalanceDue[i] := DtldCustLedgEntry."Amount (LCY)";
    CustBalanceDueLCY[i] := DtldCustLedgEntry."Amount (LCY)";

    // Add the following lines.
    IF PrintAmountsInLCY THEN
    InCustBalanceDueLCY[i] += DtldCustLedgEntry."Amount (LCY)"
    ELSE
    InCustBalanceDueLCY2[i] += DtldCustLedgEntry."Amount (LCY)";
    // End of the lines.

    IF CustBalanceDue[i] <> 0 THEN
    PrintLine := TRUE;
    LineTotalCustBalance := LineTotalCustBalance + CustBalanceDueLCY[i];
    TotalCustBalanceLCY := TotalCustBalanceLCY + CustBalanceDueLCY[i];
    END;
    ...
  2. Change the code of Data Item Number 1 Sections in the Customer - Summary Aging report (105) as follows:
    Existing code

    ...
    DataSetFieldName=CustBalanceDueLCY_5__Control50 }
    { 51 ;TextBox ;16200;423 ;1800 ;423 ;FontBold=Yes;
    SourceExpr=TotalCustBalanceLCY;
    AutoFormatType=1;
    DataSetFieldName=TotalCustBalanceLCY_Control51 }
    }
    }
    }
    }
    { PROPERTIES
    ...

    Replacement code

    ...
    DataSetFieldName=CustBalanceDueLCY_5__Control50 }
    { 51 ;TextBox ;16200;423 ;1800 ;423 ;FontBold=Yes;
    SourceExpr=TotalCustBalanceLCY;
    AutoFormatType=1;
    DataSetFieldName=TotalCustBalanceLCY_Control51 }

    // Add the following lines.
    { 55 ;TextBox ;6450 ;0 ;1800 ;423 ;Visible=No;
    FontBold=Yes;
    SourceExpr=InCustBalanceDueLCY[1];
    AutoFormatType=1;
    DataSetFieldName=InCustBalanceDueLCY_1 }
    { 56 ;TextBox ;8400 ;0 ;1800 ;423 ;Visible=No;
    FontBold=Yes;
    SourceExpr=InCustBalanceDueLCY[2];
    AutoFormatType=1;
    DataSetFieldName=InCustBalanceDueLCY_2 }
    { 57 ;TextBox ;10350;0 ;1800 ;423 ;Visible=No;
    FontBold=Yes;
    SourceExpr=InCustBalanceDueLCY[3];
    AutoFormatType=1;
    DataSetFieldName=InCustBalanceDueLCY_3 }
    { 58 ;TextBox ;12300;0 ;1800 ;423 ;Visible=No;
    FontBold=Yes;
    SourceExpr=InCustBalanceDueLCY[4];
    AutoFormatType=1;
    DataSetFieldName=InCustBalanceDueLCY_4 }
    { 59 ;TextBox ;14250;0 ;1800 ;423 ;Visible=No;
    FontBold=Yes;
    SourceExpr=InCustBalanceDueLCY[5];
    AutoFormatType=1;
    DataSetFieldName=InCustBalanceDueLCY_5 }
    // End of the lines.

    }
    }
    }
    }
    { PROPERTIES
    ...
  3. Change the code of Data Item Number 2 in the Customer - Summary Aging report (105) as follows:
    Existing code

    ...
    DtldCustLedgEntry.SETRANGE("Customer No.",Customer."No.");
    DtldCustLedgEntry.SETRANGE("Initial Entry Due Date",PeriodStartDate[i],PeriodStartDate[i + 1] - 1);
    DtldCustLedgEntry.SETRANGE("Currency Code",Currency2.Code);
    DtldCustLedgEntry.CALCSUMS(Amount);
    CustBalanceDue[i] := DtldCustLedgEntry.Amount;
    IF CustBalanceDue[i] <> 0 THEN
    PrintLine := TRUE;
    LineTotalCustBalance := LineTotalCustBalance + CustBalanceDue[i];
    END;
    END;
    ...

    Replacement code

    ...
    DtldCustLedgEntry.SETRANGE("Customer No.",Customer."No.");
    DtldCustLedgEntry.SETRANGE("Initial Entry Due Date",PeriodStartDate[i],PeriodStartDate[i + 1] - 1);
    DtldCustLedgEntry.SETRANGE("Currency Code",Currency2.Code);
    DtldCustLedgEntry.CALCSUMS(Amount);
    CustBalanceDue[i] := DtldCustLedgEntry.Amount;

    // Add the following line.
    InCustBalanceDueLCY[i] := InCustBalanceDueLCY2[i];

    IF CustBalanceDue[i] <> 0 THEN
    PrintLine := TRUE;
    LineTotalCustBalance := LineTotalCustBalance + CustBalanceDue[i];
    END;
    END;
    ...
  4. Change the code of Global Variables in the Customer - Summary Aging report (105) as follows:
    Existing code 1

    ...
    CustBalanceDueLCY@1007 : ARRAY [5] OF Decimal;
    LineTotalCustBalance@1008 : Decimal;
    TotalCustBalanceLCY@1009 : Decimal;
    PrintLine@1010 : Boolean;
    i@1011 : Integer;

    BEGIN
    END.
    }
    RDLDATA
    ...

    Replacement code 1

    ...
    CustBalanceDueLCY@1007 : ARRAY [5] OF Decimal;
    LineTotalCustBalance@1008 : Decimal;
    TotalCustBalanceLCY@1009 : Decimal;
    PrintLine@1010 : Boolean;
    i@1011 : Integer;

    // Add the following lines.
    InCustBalanceDueLCY@1012 : ARRAY [5] OF Decimal;
    InCustBalanceDueLCY2@1013 : ARRAY [5] OF Decimal;
    // End of the lines.

    BEGIN
    END.
    }
    RDLDATA
    ...

    Existing code 2

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Delete the following line.
    <Textbox Name="CustBalanceDueLCY_1__Control46">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=Fields!CustBalanceDueLCY_1_Format.Value</Format>
    ...

    Replacement code 2

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Add the following line.
    <Textbox Name="InCustBalanceDueLCY_1">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=Fields!CustBalanceDueLCY_1_Format.Value</Format>
    ...

    Existing code 3

    ...
    <PaddingLeft>0.525cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Delete the following line.
    <Value>=Sum(Fields!CustBalanceDueLCY_1_.Value)</Value>

    <ZIndex>23</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Replacement code 3

    ...
    <PaddingLeft>0.525cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Add the following line.
    <Value>=Last(Fields!InCustBalanceDueLCY_1.Value)</Value>

    <ZIndex>23</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Existing code 4

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Delete the following line.
    <Textbox Name="CustBalanceDueLCY_2__Control47">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=Fields!CustBalanceDueLCY_2_Format.Value</Format>
    ...

    Replacement code 4

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Add the following line.
    <Textbox Name="InCustBalanceDueLCY_2">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=Fields!CustBalanceDueLCY_2_Format.Value</Format>
    ...

    Existing code 5

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Delete the following line.
    <Value>=Sum(Fields!CustBalanceDueLCY_2_.Value)</Value>

    <ZIndex>22</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Replacement code 5

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Add the following line.
    <Value>=Last(Fields!InCustBalanceDueLCY_2.Value)</Value>

    <ZIndex>22</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Existing code 6

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Delete the following line.
    <Textbox Name="CustBalanceDueLCY_3__Control48">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=Fields!CustBalanceDueLCY_3_Format.Value</Format>
    ...

    Replacement code 6

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Add the following line.
    <Textbox Name="InCustBalanceDueLCY_3">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=Fields!CustBalanceDueLCY_3_Format.Value</Format>
    ...

    Existing code 7

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Delete the following line.
    <Value>=Sum(Fields!CustBalanceDueLCY_3_.Value)</Value>

    <ZIndex>21</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Replacement code 7

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Add the following line.
    <Value>=Last(Fields!InCustBalanceDueLCY_3.Value)</Value>

    <ZIndex>21</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Existing code 8

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Delete the following line.
    <Textbox Name="CustBalanceDueLCY_4__Control49">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=Fields!CustBalanceDueLCY_4_Format.Value</Format>
    ...

    Replacement code 8

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Add the following line.
    <Textbox Name="InCustBalanceDueLCY_4">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=Fields!CustBalanceDueLCY_4_Format.Value</Format>
    ...

    Existing code 9

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Delete the following line.
    <Value>=Sum(Fields!CustBalanceDueLCY_4_.Value)</Value>

    <ZIndex>20</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Replacement code 9

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Add the following line.
    <Value>=Last(Fields!InCustBalanceDueLCY_4.Value)</Value>

    <ZIndex>20</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Existing code 10

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Delete the following line.
    <Textbox Name="CustBalanceDueLCY_5__Control50">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=Fields!CustBalanceDueLCY_5_Format.Value</Format>
    ...

    Replacement code 10

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Add the following line.
    <Textbox Name="InCustBalanceDueLCY_5">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=Fields!CustBalanceDueLCY_5_Format.Value</Format>
    ...

    Existing code 11

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Delete the following line.
    <Value>=Sum(Fields!CustBalanceDueLCY_5_.Value)</Value>

    <ZIndex>19</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Replacement code 11

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Add the following line.
    <Value>=Last(Fields!InCustBalanceDueLCY_5.Value)</Value>

    <ZIndex>19</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Existing code 12

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Delete the following line.
    <Value>=Sum(Fields!CustBalanceDueLCY_1_.Value)+ Sum(Fields!CustBalanceDueLCY_2_.Value) + Sum(Fields!CustBalanceDueLCY_3_.Value)+ Sum(Fields!CustBalanceDueLCY_4_.Value)+ Sum(Fields!CustBalanceDueLCY_5_.Value)</Value>

    <ZIndex>18</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    </TableCells>
    ...

    Replacement code 12

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Add the following line.
    <Value>=Last(Fields!InCustBalanceDueLCY_1.Value) + Last(Fields!InCustBalanceDueLCY_2.Value) + Last(Fields!InCustBalanceDueLCY_3.Value)+ Last(Fields!InCustBalanceDueLCY_4.Value) + Last(Fields!InCustBalanceDueLCY_5.Value)</Value>

    <ZIndex>18</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    </TableCells>
    ...

    Existing code 13

    ...
    Return Value
    End Function
    </Code>
    <DataSets>
    <DataSet Name="DataSet_Result">

    // Delete the following lines.
    <Query>
    <CommandText />
    <DataSourceName>DummyDataSource</DataSourceName>
    </Query>
    // End of the lines.

    <Fields>
    <Field Name="Customer___Summary_AgingCaption">
    <DataField>Customer___Summary_AgingCaption</DataField>
    </Field>
    <Field Name="FORMAT_TODAY_0_4_">
    ...

    Replacement code 13

    ...
    Return Value
    End Function
    </Code>
    <DataSets>
    <DataSet Name="DataSet_Result">
    <Fields>
    <Field Name="Customer___Summary_AgingCaption">
    <DataField>Customer___Summary_AgingCaption</DataField>
    </Field>
    <Field Name="FORMAT_TODAY_0_4_">
    ...

    Existing code 14

    ...
    <DataField>CustBalanceDueLCY_5__Control50Format</DataField>
    </Field>
    <Field Name="TotalCustBalanceLCY_Control51Format">
    <DataField>TotalCustBalanceLCY_Control51Format</DataField>
    </Field>
    <Field Name="LineTotalCustBalance_Control67">
    <DataField>LineTotalCustBalance_Control67</DataField>
    </Field>
    <Field Name="LineTotalCustBalance_Control67Format">
    <DataField>LineTotalCustBalance_Control67Format</DataField>
    ...

    Replacement code 14

    ...
    <DataField>CustBalanceDueLCY_5__Control50Format</DataField>
    </Field>
    <Field Name="TotalCustBalanceLCY_Control51Format">
    <DataField>TotalCustBalanceLCY_Control51Format</DataField>
    </Field>

    // Add the following lines.
    <Field Name="InCustBalanceDueLCY_1">
    <DataField>InCustBalanceDueLCY_1</DataField>
    </Field>
    <Field Name="InCustBalanceDueLCY_1Format">
    <DataField>InCustBalanceDueLCY_1Format</DataField>
    </Field>
    <Field Name="InCustBalanceDueLCY_2">
    <DataField>InCustBalanceDueLCY_2</DataField>
    </Field>
    <Field Name="InCustBalanceDueLCY_2Format">
    <DataField>InCustBalanceDueLCY_2Format</DataField>
    </Field>
    <Field Name="InCustBalanceDueLCY_3">
    <DataField>InCustBalanceDueLCY_3</DataField>
    </Field>
    <Field Name="InCustBalanceDueLCY_3Format">
    <DataField>InCustBalanceDueLCY_3Format</DataField>
    </Field>
    <Field Name="InCustBalanceDueLCY_4">
    <DataField>InCustBalanceDueLCY_4</DataField>
    </Field>
    <Field Name="InCustBalanceDueLCY_4Format">
    <DataField>InCustBalanceDueLCY_4Format</DataField>
    </Field>
    <Field Name="InCustBalanceDueLCY_5">
    <DataField>InCustBalanceDueLCY_5</DataField>
    </Field>
    <Field Name="InCustBalanceDueLCY_5Format">
    <DataField>InCustBalanceDueLCY_5Format</DataField>
    </Field>
    // End of the lines.

    <Field Name="LineTotalCustBalance_Control67">
    <DataField>LineTotalCustBalance_Control67</DataField>
    </Field>
    <Field Name="LineTotalCustBalance_Control67Format">
    <DataField>LineTotalCustBalance_Control67Format</DataField>
    ...

    Existing code 15

    ...
    </Field>
    <Field Name="Customer__No___Control75">
    <DataField>Customer__No___Control75</DataField>
    </Field>
    </Fields>
    <rd:DataSetInfo>
    <rd:DataSetName>DataSet</rd:DataSetName>
    <rd:TableName>Result</rd:TableName>
    </rd:DataSetInfo>
    </DataSet>
    ...

    Replacement code 15

    ...
    </Field>
    <Field Name="Customer__No___Control75">
    <DataField>Customer__No___Control75</DataField>
    </Field>
    </Fields>

    // Add the following lines.
    <Query>
    <CommandText />
    <DataSourceName>DummyDataSource</DataSourceName>
    </Query>
    // End of the lines.

    <rd:DataSetInfo>
    <rd:DataSetName>DataSet</rd:DataSetName>
    <rd:TableName>Result</rd:TableName>
    </rd:DataSetInfo>
    </DataSet>
    ...
  5. Change the code of Data Item Number 1 in the Vendor - Summary Aging report (305) as follows:
    Existing code

    ...
    DtldVendLedgEntry.SETRANGE("Vendor No.","No.");
    DtldVendLedgEntry.SETRANGE("Initial Entry Due Date",PeriodStartDate[i],PeriodStartDate[i + 1] - 1);
    DtldVendLedgEntry.CALCSUMS("Amount (LCY)");
    VendBalanceDue[i] := DtldVendLedgEntry."Amount (LCY)";
    VendBalanceDueLCY[i] := DtldVendLedgEntry."Amount (LCY)";
    IF VendBalanceDue[i] <> 0 THEN
    PrintLine := TRUE;
    LineTotalVendAmountDue := LineTotalVendAmountDue + VendBalanceDueLCY[i];
    TotalVendAmtDueLCY := TotalVendAmtDueLCY + VendBalanceDueLCY[i];
    END;
    ...

    Replacement code

    ...
    DtldVendLedgEntry.SETRANGE("Vendor No.","No.");
    DtldVendLedgEntry.SETRANGE("Initial Entry Due Date",PeriodStartDate[i],PeriodStartDate[i + 1] - 1);
    DtldVendLedgEntry.CALCSUMS("Amount (LCY)");
    VendBalanceDue[i] := DtldVendLedgEntry."Amount (LCY)";
    VendBalanceDueLCY[i] := DtldVendLedgEntry."Amount (LCY)";

    // Add the following lines.
    IF PrintAmountsInLCY THEN
    InVendBalanceDueLCY[i] += DtldVendLedgEntry."Amount (LCY)"
    ELSE
    InVendBalanceDueLCY2[i] += DtldVendLedgEntry."Amount (LCY)";
    // End of the lines.

    IF VendBalanceDue[i] <> 0 THEN
    PrintLine := TRUE;
    LineTotalVendAmountDue := LineTotalVendAmountDue + VendBalanceDueLCY[i];
    TotalVendAmtDueLCY := TotalVendAmtDueLCY + VendBalanceDueLCY[i];
    END;
    ...
  6. Change the code of Data Item Number 1 Sections in the Vendor - Summary Aging report (305) as follows:
    Existing code 1

    ...
    }
    { PROPERTIES
    {
    SectionType=Footer;
    SectionWidth=18150;

    // Delete the following line.
    SectionHeight=846;

    }
    CONTROLS
    {
    { 45 ;Label ;0 ;423 ;2250 ;423 ;FontBold=Yes;
    CaptionML=ENU=Total (LCY);
    ...

    Replacement code 1

    ...
    }
    { PROPERTIES
    {
    SectionType=Footer;
    SectionWidth=18150;

    // Add the following line.
    SectionHeight=1269;

    }
    CONTROLS
    {
    { 45 ;Label ;0 ;423 ;2250 ;423 ;FontBold=Yes;
    CaptionML=ENU=Total (LCY);
    ...

    Existing code 2

    ...
    DataSetFieldName=VendBalanceDueLCY_5__Control50 }
    { 51 ;TextBox ;16200;423 ;1800 ;423 ;FontBold=Yes;
    SourceExpr=TotalVendAmtDueLCY;
    AutoFormatType=1;
    DataSetFieldName=TotalVendAmtDueLCY_Control51 }
    }
    }
    }
    }
    { PROPERTIES
    ...

    Replacement code 2

    ...
    DataSetFieldName=VendBalanceDueLCY_5__Control50 }
    { 51 ;TextBox ;16200;423 ;1800 ;423 ;FontBold=Yes;
    SourceExpr=TotalVendAmtDueLCY;
    AutoFormatType=1;
    DataSetFieldName=TotalVendAmtDueLCY_Control51 }

    // Add the following lines.
    { 70 ;TextBox ;6450 ;0 ;1800 ;423 ;Visible=No;
    FontBold=Yes;
    SourceExpr=InVendBalanceDueLCY[1];
    AutoFormatType=1;
    DataSetFieldName=InVendBalanceDueLCY_1 }
    { 71 ;TextBox ;8400 ;0 ;1800 ;423 ;Visible=No;
    FontBold=Yes;
    SourceExpr=InVendBalanceDueLCY[2];
    AutoFormatType=1;
    DataSetFieldName=InVendBalanceDueLCY_2 }
    { 72 ;TextBox ;10350;0 ;1800 ;423 ;Visible=No;
    FontBold=Yes;
    SourceExpr=InVendBalanceDueLCY[3];
    AutoFormatType=1;
    DataSetFieldName=InVendBalanceDueLCY_3 }
    { 73 ;TextBox ;12300;0 ;1800 ;423 ;Visible=No;
    FontBold=Yes;
    SourceExpr=InVendBalanceDueLCY[4];
    AutoFormatType=1;
    DataSetFieldName=InVendBalanceDueLCY_4 }
    { 74 ;TextBox ;14250;0 ;1800 ;423 ;Visible=No;
    FontBold=Yes;
    SourceExpr=InVendBalanceDueLCY[5];
    AutoFormatType=1;
    DataSetFieldName=InVendBalanceDueLCY_5 }
    // End of the lines.

    }
    }
    }
    }
    { PROPERTIES
    ...
  7. Change the code of Data Item Number 2 in the Vendor - Summary Aging report (305) as follows:
    Existing code

    ...
    DtldVendLedgEntry.SETRANGE("Vendor No.",Vendor."No.");
    DtldVendLedgEntry.SETRANGE("Initial Entry Due Date",PeriodStartDate[i],PeriodStartDate[i + 1] - 1);
    DtldVendLedgEntry.SETRANGE("Currency Code",Currency2.Code);
    DtldVendLedgEntry.CALCSUMS(Amount);
    VendBalanceDue[i] := DtldVendLedgEntry.Amount;
    IF VendBalanceDue[i] <> 0 THEN
    PrintLine := TRUE;
    LineTotalVendAmountDue := LineTotalVendAmountDue + VendBalanceDue[i];
    END;
    END;
    ...

    Replacement code

    ...
    DtldVendLedgEntry.SETRANGE("Vendor No.",Vendor."No.");
    DtldVendLedgEntry.SETRANGE("Initial Entry Due Date",PeriodStartDate[i],PeriodStartDate[i + 1] - 1);
    DtldVendLedgEntry.SETRANGE("Currency Code",Currency2.Code);
    DtldVendLedgEntry.CALCSUMS(Amount);
    VendBalanceDue[i] := DtldVendLedgEntry.Amount;

    // Add the following line.
    InVendBalanceDueLCY[i] := InVendBalanceDueLCY2[i];

    IF VendBalanceDue[i] <> 0 THEN
    PrintLine := TRUE;
    LineTotalVendAmountDue := LineTotalVendAmountDue + VendBalanceDue[i];
    END;
    END;
    ...
  8. Change the code of Global Variables in the Vendor - Summary Aging report (305) as follows:
    Existing code 1

    ...
    VendBalanceDue@1007 : ARRAY [5] OF Decimal;
    VendBalanceDueLCY@1008 : ARRAY [5] OF Decimal;
    PeriodLength@1009 : DateFormula;
    PrintLine@1010 : Boolean;
    i@1011 : Integer;

    BEGIN
    END.
    }
    RDLDATA
    ...

    Replacement code 1

    ...
    VendBalanceDue@1007 : ARRAY [5] OF Decimal;
    VendBalanceDueLCY@1008 : ARRAY [5] OF Decimal;
    PeriodLength@1009 : DateFormula;
    PrintLine@1010 : Boolean;
    i@1011 : Integer;

    // Add the following lines.
    InVendBalanceDueLCY@1012 : ARRAY [5] OF Decimal;
    InVendBalanceDueLCY2@1013 : ARRAY [5] OF Decimal;
    // End of the lines.


    BEGIN
    END.
    }
    RDLDATA
    ...

    Existing code 2

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    </TableCells>
    <Visibility>

    // Delete the following line.
    <Hidden>=IIF(Fields!PrintAmountsInLCY.Value = "True" AND
    Fields!LineTotalVendAmountDue.Value <> "0",False,True)</Hidden>

    </Visibility>
    </TableRow>
    </TableRows>
    </Details>
    <Footer>
    ...

    Replacement code 2

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    </TableCells>
    <Visibility>

    // Add the following line.
    <Hidden>=IIF(Fields!LineTotalVendAmountDue.Value = "0",True,False)</Hidden>

    </Visibility>
    </TableRow>
    </TableRows>
    </Details>
    <Footer>
    ...

    Existing code 3

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Delete the following line.
    <Textbox Name="VendBalanceDueLCY_1__Control46">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=First(Fields!VendBalanceDueLCY_1_Format.Value)</Format>
    ...

    Replacement code 3

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Add the following line.
    <Textbox Name="InVendBalanceDueLCY_1">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=First(Fields!VendBalanceDueLCY_1_Format.Value)</Format>
    ...

    Existing code 4

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Delete the following line.
    <Value>=Sum(Fields!VendBalanceDueLCY_1_.Value)</Value>

    <ZIndex>23</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Replacement code 4

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Add the following line.
    <Value>=Last(Fields!InVendBalanceDueLCY_1.Value)</Value>

    <ZIndex>23</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Existing code 5

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Delete the following line.
    <Textbox Name="VendBalanceDueLCY_2__Control47">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=First(Fields!VendBalanceDueLCY_2_Format.Value)</Format>
    ...

    Replacement code 5

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Add the following line.
    <Textbox Name="InVendBalanceDueLCY_2">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=First(Fields!VendBalanceDueLCY_2_Format.Value)</Format>
    ...

    Existing code 6

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Delete the following line.
    <Value>=Sum(Fields!VendBalanceDueLCY_2_.Value)</Value>

    <ZIndex>22</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Replacement code 6

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Add the following line.
    <Value>=Last(Fields!InVendBalanceDueLCY_2.Value)</Value>

    <ZIndex>22</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Existing code 7

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Delete the following line.
    <Textbox Name="VendBalanceDueLCY_3__Control48">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=First(Fields!VendBalanceDueLCY_3_Format.Value)</Format>
    ...

    Replacement code 7

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Add the following line.
    <Textbox Name="InVendBalanceDueLCY_3">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=First(Fields!VendBalanceDueLCY_3_Format.Value)</Format>
    ...

    Existing code 8

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Delete the following line.
    <Value>=Sum(Fields!VendBalanceDueLCY_3_.Value)</Value>

    <ZIndex>21</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Replacement code 8

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Add the following line.
    <Value>=Last(Fields!InVendBalanceDueLCY_3.Value)</Value>

    <ZIndex>21</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Existing code 9

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Delete the following line.
    <Textbox Name="VendBalanceDueLCY_4__Control49">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=First(Fields!VendBalanceDueLCY_4_Format.Value)</Format>
    ...

    Replacement code 9

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Add the following line.
    <Textbox Name="InVendBalanceDueLCY_4">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=First(Fields!VendBalanceDueLCY_4_Format.Value)</Format>
    ...

    Existing code 10

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Delete the following line.
    <Value>=Sum(Fields!VendBalanceDueLCY_4_.Value)</Value>

    <ZIndex>20</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Replacement code 10

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Add the following line.
    <Value>=Last(Fields!InVendBalanceDueLCY_4.Value)</Value>

    <ZIndex>20</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Existing code 11

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Delete the following line.
    <Textbox Name="VendBalanceDueLCY_5__Control50">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=First(Fields!VendBalanceDueLCY_5_Format.Value)</Format>
    ...

    Replacement code 11

    ...
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    <ReportItems>

    // Add the following line.
    <Textbox Name="InVendBalanceDueLCY_5">

    <CanGrow>true</CanGrow>
    <Style>
    <FontSize>7pt</FontSize>
    <FontWeight>700</FontWeight>
    <Format>=First(Fields!VendBalanceDueLCY_5_Format.Value)</Format>
    ...

    Existing code 12

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Delete the following line.
    <Value>=Sum(Fields!VendBalanceDueLCY_5_.Value)</Value>

    <ZIndex>19</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Replacement code 12

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>0.075cm</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Add the following line.
    <Value>=Last(Fields!InVendBalanceDueLCY_5.Value)</Value>

    <ZIndex>19</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    <TableCell>
    ...

    Existing code 13

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Delete the following line.
    <Value>=Sum(Fields!TotalVendAmtDueLCY.Value)</Value>

    <ZIndex>18</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    </TableCells>
    ...

    Replacement code 13

    ...
    <PaddingLeft>0.075cm</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <VerticalAlign>Middle</VerticalAlign>
    </Style>

    // Add the following line.
    <Value>=Last(Fields!InVendBalanceDueLCY_1.Value) + Last(Fields!InVendBalanceDueLCY_2.Value) + Last(Fields!InVendBalanceDueLCY_3.Value) + Last(Fields!InVendBalanceDueLCY_4.Value) + Last(Fields!InVendBalanceDueLCY_5.Value)</Value>

    <ZIndex>18</ZIndex>
    </Textbox>
    </ReportItems>
    </TableCell>
    </TableCells>
    ...

    Existing code 14

    ...
    <GroupExpression>=Fields!Vendor__No__.Value</GroupExpression>
    </GroupExpressions>
    </Grouping>
    </TableGroup>
    </TableGroups>

    // Delete the following line.
    <Width>18.09524cm</Width>

    </Table>
    </ReportItems>
    </Body>
    <BottomMargin>2cm</BottomMargin>
    <Code>Public Function BlankZero(ByVal Value As Decimal)
    ...

    Replacement code 14

    ...
    <GroupExpression>=Fields!Vendor__No__.Value</GroupExpression>
    </GroupExpressions>
    </Grouping>
    </TableGroup>
    </TableGroups>

    // Add the following line.
    <Width>18.09522cm</Width>

    </Table>
    </ReportItems>
    </Body>
    <BottomMargin>2cm</BottomMargin>
    <Code>Public Function BlankZero(ByVal Value As Decimal)
    ...

    Existing code 15

    ...
    <DataField>VendBalanceDueLCY_5__Control50Format</DataField>
    </Field>
    <Field Name="TotalVendAmtDueLCY_Control51Format">
    <DataField>TotalVendAmtDueLCY_Control51Format</DataField>
    </Field>
    <Field Name="Currency2_Code">
    <DataField>Currency2_Code</DataField>
    </Field>
    <Field Name="LineTotalVendAmountDue_Control36">
    <DataField>LineTotalVendAmountDue_Control36</DataField>
    ...

    Replacement code 15

    ...
    <DataField>VendBalanceDueLCY_5__Control50Format</DataField>
    </Field>
    <Field Name="TotalVendAmtDueLCY_Control51Format">
    <DataField>TotalVendAmtDueLCY_Control51Format</DataField>
    </Field>

    // Add the following lines.
    <Field Name="InVendBalanceDueLCY_1">
    <DataField>InVendBalanceDueLCY_1</DataField>
    </Field>
    <Field Name="InVendBalanceDueLCY_1Format">
    <DataField>InVendBalanceDueLCY_1Format</DataField>
    </Field>
    <Field Name="InVendBalanceDueLCY_2">
    <DataField>InVendBalanceDueLCY_2</DataField>
    </Field>
    <Field Name="InVendBalanceDueLCY_2Format">
    <DataField>InVendBalanceDueLCY_2Format</DataField>
    </Field>
    <Field Name="InVendBalanceDueLCY_3">
    <DataField>InVendBalanceDueLCY_3</DataField>
    </Field>
    <Field Name="InVendBalanceDueLCY_3Format">
    <DataField>InVendBalanceDueLCY_3Format</DataField>
    </Field>
    <Field Name="InVendBalanceDueLCY_4">
    <DataField>InVendBalanceDueLCY_4</DataField>
    </Field>
    <Field Name="InVendBalanceDueLCY_4Format">
    <DataField>InVendBalanceDueLCY_4Format</DataField>
    </Field>
    <Field Name="InVendBalanceDueLCY_5">
    <DataField>InVendBalanceDueLCY_5</DataField>
    </Field>
    <Field Name="InVendBalanceDueLCY_5Format">
    <DataField>InVendBalanceDueLCY_5Format</DataField>
    </Field>
    // End of the lines.

    <Field Name="Currency2_Code">
    <DataField>Currency2_Code</DataField>
    </Field>
    <Field Name="LineTotalVendAmountDue_Control36">
    <DataField>LineTotalVendAmountDue_Control36</DataField>
    ...

Prerequisites

You must have one of the following products installed to apply this hotfix:

  • Microsoft Dynamics NAV 2009 R2

  • Microsoft Dynamics NAV 2009 Service Pack 1

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.

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?

What affected your experience?

Thank you for your feedback!

×