De waarden in de velden Kostenbedrag (Verwacht) (ACY) en Kostenbedrag (Werkelijk) (ACY) zijn onjuist nadat een ongedaan maken verzending is geboekt in Microsoft Dynamics NAV

Van toepassing op
Dynamics NAV 2009 Microsoft Dynamics NAV 5.0

Dit artikel is van toepassing op Microsoft Dynamics NAV voor alle taalinstellingen.

Symptomen

Stel dat u een extra rapportagevaluta instelt in Grootboek instellen in Financieel beheer in Microsoft Dynamics NAV. Nadat u een zending ongedaan hebt gemaakt, ziet u dat de waarden in de velden Kostenbedrag (Verwacht) (ACY) en Kostenbedrag (Werkelijk) (ACY) onjuist zijn in de items in voorraadwaarde/grootboekposten.
Dit probleem treedt op in de volgende producten:

  • Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)
  • Microsoft Dynamics NAV 2009 R2
  • Microsoft Dynamics NAV 2009
  • Microsoft Dynamics NAV 5.0 Service Pack 1 (SP1)

Oplossing

Hotfix-informatie

Er is nu een ondersteunde hotfix beschikbaar bij Microsoft. Het is echter alleen bedoeld om het probleem op te lossen dat in dit artikel wordt beschreven. Pas deze alleen toe op systemen die dit specifieke probleem ondervinden. Deze hotfix kan aanvullende tests ontvangen. Als u niet ernstig last hebt van dit probleem, raden we u aan te wachten op het volgende Microsoft Dynamics NAV 2009-servicepack of de volgende Microsoft Dynamics NAV-versie die deze hotfix bevat.

Opmerking In speciale gevallen kunnen kosten die gewoonlijk worden gemaakt voor ondersteuningsoproepen worden geannuleerd als een technische ondersteuningsmedewerker voor Microsoft Dynamics en gerelateerde producten vaststelt dat een specifieke update uw probleem oplost. De gebruikelijke ondersteuningskosten zijn van toepassing op aanvullende ondersteuningsvragen en problemen die niet in aanmerking komen voor de specifieke update in kwestie.

            
          

Installatie-informatie

Microsoft biedt programmeervoorbeelden uitsluitend ter illustratie, zonder uitdrukkelijke of impliciete garantie. Dit omvat, maar is niet beperkt tot, de impliciete garanties van verkoopbaarheid of geschiktheid voor een bepaald doel. In dit artikel wordt ervan uitgegaan dat u bekend bent met de programmeertaal die wordt gedemonstreerd en met de hulpprogramma's die worden gebruikt om procedures te maken en fouten op te sporen. Microsoft-ondersteuningstechnici kunnen helpen bij het uitleggen van de functionaliteit van een bepaalde procedure, maar ze zullen deze voorbeelden niet wijzigen om extra functionaliteit te bieden of procedures te maken die voldoen aan uw specifieke vereisten.

Opmerking Voordat u deze hotfix installeert, controleert u of alle Microsoft Navision-clientgebruikers zijn afgemeld bij het systeem. Dit geldt ook voor gebruikers van Microsoft Navision Application Services (NAS). U moet de enige clientgebruiker zijn die is aangemeld wanneer u deze hotfix implementeert.

Als u deze hotfix wilt implementeren, moet u een ontwikkelaarslicentie hebben.

We raden u aan om aan het gebruikersaccount in het venster Windows-aanmeldingen of in het venster Databaseaanmeldingen de rol-id 'SUPER' toe te wijzen. Als de rol-id 'SUPER' niet kan worden toegewezen aan het gebruikersaccount, moet u controleren of het gebruikersaccount de volgende machtigingen heeft:

  • De machtiging Wijzigen voor het object dat u gaat wijzigen.
  • De machtiging Uitvoeren voor het object Systeemobject-id 5210 en voor het object Systeemobject-id 9015.

                
Opmerking U hoeft geen rechten te hebben voor de gegevensarchieven, tenzij u gegevensherstel moet uitvoeren.

Codewijzigingen

Opmerking Test altijd codecorrecties in een beheerde omgeving voordat u de correcties toepast op uw productiecomputers.
Voer de volgende stappen uit om dit probleem op te lossen:
Opmerking Omdat de code verschilt voor de Wereldwijde versie en de Noord-Amerikaanse versie, worden beide wijzigingenlogboeken vermeld onder de specifieke kop van de Wereldwijde versie of de Noord-Amerikaanse versie.

  1. Wijzig de code in de functie InsertValueEntry in de codeeenheid Item Jnl.-Post Line (22) als volgt:
    Voor de wereldwijde versie voor Microsoft Dynamics NAV 5.0 SP1, Microsoft Dynamics NAV 2009, Microsoft Dynamics NAV 2009 SP1 en Microsoft Dynamics NAV 2009 R2
    Bestaande code

    ...
             ELSE
            InvoicedQty := ValueEntry."Valued Quantity";
        END ELSE
          InvoicedQty := ValueEntry."Invoiced Quantity";
        CalcExpectedCost(
          ItemLedgEntry."Entry No.",
          InvoicedQty,
          ItemLedgEntry.Quantity,
          ValueEntry."Cost Amount (Expected)",
          ValueEntry."Cost Amount (Expected) (ACY)",
          ValueEntry."Sales Amount (Expected)",
          ValueEntry."Purchase Amount (Expected)",
          ItemLedgEntry.Quantity = ItemLedgEntry."Invoiced Quantity");
    // Delete the following lines.
        IF (InvdValueEntry."Cost Amount (Expected)" <>0) AND (ValueEntry."Cost Amount (Expected)" <> 0) THEN
          ValueEntry."Cost Amount (Expected)" :=
           ValueEntry."Cost Amount (Expected)" - InvdValueEntry."Cost Amount (Expected)";
        IF (InvdValueEntry."Cost Amount (Expected) (ACY)" <> 0) AND (ValueEntry."Cost Amount (Expected) (ACY)"<>0) THEN
          ValueEntry."Cost Amount (Expected) (ACY)" :=
            ValueEntry."Cost Amount (Expected) (ACY)" - InvdValueEntry."Cost Amount (Expected) (ACY)";
    // End of the deleted lines.
      END;
    
      IF ValueEntry.Inventoriable THEN
        PostInventoryToGL(ValueEntry);
      IF  ItemLedgEntry."Job No." <> '' THEN BEGIN
    ...
    

    Vervangende code

    ...
           ELSE
            InvoicedQty := ValueEntry."Valued Quantity";
        END ELSE
          InvoicedQty := ValueEntry."Invoiced Quantity";
        CalcExpectedCost(
    
    // Add the following line.
          ValueEntry,
    // End of the added line.
    
          ItemLedgEntry."Entry No.",
          InvoicedQty,
          ItemLedgEntry.Quantity,
          ValueEntry."Cost Amount (Expected)",
          ValueEntry."Cost Amount (Expected) (ACY)",
          ValueEntry."Sales Amount (Expected)",
          ValueEntry."Purchase Amount (Expected)",
          ItemLedgEntry.Quantity = ItemLedgEntry."Invoiced Quantity");
      END;
    
      IF ValueEntry.Inventoriable THEN
        PostInventoryToGL(ValueEntry);
      IF  ItemLedgEntry."Job No." <> '' THEN BEGIN
    ...
    

    Voor de Noord-Amerikaanse versie voor Microsoft Dynamics NAV 5.0 SP1, Microsoft Dynamics NAV 2009, Microsoft Dynamics NAV 2009 SP1 en Microsoft Dynamics NAV 2009 R2
    Bestaande code

    ...
          ELSE
            InvoicedQty := ValueEntry."Valued Quantity";
        END ELSE
          InvoicedQty := ValueEntry."Invoiced Quantity";
        IF NOT Kitting THEN BEGIN
          CalcExpectedCost(
            ItemLedgEntry."Entry No.",
            InvoicedQty,
            ItemLedgEntry.Quantity,
            ValueEntry."Cost Amount (Expected)",
            ValueEntry."Cost Amount (Expected) (ACY)",
            ValueEntry."Sales Amount (Expected)",
            ValueEntry."Purchase Amount (Expected)",
            ItemLedgEntry.Quantity = ItemLedgEntry."Invoiced Quantity");
    
    // Delete the following lines.
          IF (InvdValueEntry."Cost Amount (Expected)" <>0) AND (ValueEntry."Cost Amount (Expected)" <>0) THEN
            ValueEntry."Cost Amount (Expected)" :=
             ValueEntry."Cost Amount (Expected)" - InvdValueEntry."Cost Amount (Expected)";
          IF (InvdValueEntry."Cost Amount (Expected) (ACY)" <> 0) AND (ValueEntry."Cost Amount (Expected) (ACY)" <> 0) THEN
            ValueEntry."Cost Amount (Expected) (ACY)" :=
              ValueEntry."Cost Amount (Expected) (ACY)" - InvdValueEntry."Cost Amount (Expected) (ACY)";
    // End of the deleted lines.
    
        END;
      END;
    
      IF ValueEntry.Inventoriable THEN
        PostInventoryToGL(ValueEntry);
      IF  ItemLedgEntry."Job No." <>'' THEN BEGIN  
    ...
    

    Vervangende code

    ...
          ELSE
            InvoicedQty := ValueEntry."Valued Quantity";
        END ELSE
          InvoicedQty := ValueEntry."Invoiced Quantity";
        IF NOT Kitting THEN BEGIN
          CalcExpectedCost(
    // Add the following line.
            ValueEntry,
    // End of the added line.
    
            ItemLedgEntry."Entry No.",
            InvoicedQty,
            ItemLedgEntry.Quantity,
            ValueEntry."Cost Amount (Expected)",
            ValueEntry."Cost Amount (Expected) (ACY)",
            ValueEntry."Sales Amount (Expected)",
            ValueEntry."Purchase Amount (Expected)",
            ItemLedgEntry.Quantity = ItemLedgEntry."Invoiced Quantity");
        END;
      END;
    
      IF ValueEntry.Inventoriable THEN
        PostInventoryToGL(ValueEntry);
      IF  ItemLedgEntry."Job No."<>'' THEN BEGIN
    ...
    
  2. Wijzig de code in de functie CalcExpectedCost in de codeeenheid Item Jnl.-Post Line (22) als volgt:
    Voor de wereldwijde versie en de Noord-Amerikaanse versie voor Microsoft Dynamics NAV 5.0 SP1, Microsoft Dynamics NAV 2009, Microsoft Dynamics NAV 2009 SP1 en Microsoft Dynamics NAV 2009 R2
    Bestaande code 1

    ...
           LOCAL PROCEDURE CalcExpectedCost@60(ItemLedgEntryNo@1003 : Integer;InvoicedQty@1006 : Decimal;Quantity@1005 : Decimal;VAR ExpectedCost@1001 : Decimal;VAR ExpectedCostACY@1002 : Decimal;VAR ExpectedSalesAmt@1007 : Decimal;VAR ExpectedPurchAmt@1008 : Decimal;CalcReminder@1004 : Boolean);  
    ...
    

    Vervangende code 1

    ...
          LOCAL PROCEDURE CalcExpectedCost@60(VAR InvdValueEntry@1009 : Record 5802;ItemLedgEntryNo@1003 : Integer;InvoicedQty@1006 : Decimal;Quantity@1005 : Decimal;VAR ExpectedCost@1001 : Decimal;VAR ExpectedCostACY@1002 : Decimal;VAR ExpectedSalesAmt@1007 : Decimal;VAR ExpectedPurchAmt@1008 : Decimal;CalcReminder@1004 : Boolean);
    ...
    

    Bestaande code 2 voor Microsoft Dynamics NAV 5.0 SP1 en Microsoft Dynamics NAV 2009

    ...
              "Sales Amount (Expected)","Purchase Amount (Expected)");
          ExpectedCost :=  -"Cost Amount (Expected)";
          ExpectedCostACY := -"Cost Amount (Expected) (ACY)";
          ExpectedSalesAmt := -"Sales Amount (Expected)";
          ExpectedPurchAmt := -"Purchase Amount (Expected)";
        END ELSE BEGIN
          REPEAT
            IF "Expected Cost" THEN BEGIN
              ExpectedCost := ExpectedCost + "Cost Amount (Expected)";
              ExpectedCostACY := ExpectedCostACY + "Cost Amount (Expected) (ACY)"         
    ...
    

    Vervangende code 2 voor Microsoft Dynamics NAV 5.0 SP1 en Microsoft Dynamics NAV 2009

    ...
                "Sales Amount (Expected)","Purchase Amount (Expected)");
          ExpectedCost :=  -"Cost Amount (Expected)";
          ExpectedCostACY := -"Cost Amount (Expected) (ACY)";
          ExpectedSalesAmt := -"Sales Amount (Expected)";
          ExpectedPurchAmt := -"Purchase Amount (Expected)";
    
    // Add the following lines.
        END ELSE
          IF InvdValueEntry.Adjustment AND
             (InvdValueEntry."Entry Type" = InvdValueEntry."Entry Type"::"Direct Cost")
          THEN BEGIN
            ExpectedCost := -InvdValueEntry."Cost Amount (Actual)";
            ExpectedCostACY := -InvdValueEntry."Cost Amount (Actual) (ACY)";
            IF NOT CalledFromAdjustment THEN BEGIN
              ExpectedSalesAmt := -InvdValueEntry."Sales Amount (Actual)";
              ExpectedPurchAmt := -InvdValueEntry."Purchase Amount (Actual)";
            END
    // End of the added lines.
    
        END ELSE BEGIN
          REPEAT
            IF "Expected Cost" THEN BEGIN
              ExpectedCost := ExpectedCost + "Cost Amount (Expected)";
              ExpectedCostACY := ExpectedCostACY + "Cost Amount (Expected) (ACY)";
    ...
    

    Bestaande code 3 voor Microsoft Dynamics NAV 2009 SP1 en Microsoft Dynamics NAV 2009 R2

    …
    IF FINDSET AND "Expected Cost" THEN
      IF CalcReminder THEN BEGIN
        CALCSUMS(
             "Cost Amount (Expected)","Cost Amount (Expected) (ACY)",
             "Sales Amount (Expected)","Purchase Amount (Expected)");
        ExpectedCost :=  -"Cost Amount (Expected)";
        ExpectedCostACY := -"Cost Amount (Expected) (ACY)";
        IF NOT CalledFromAdjustment THEN BEGIN
           ExpectedSalesAmt := -"Sales Amount (Expected)";
           ExpectedPurchAmt := -"Purchase Amount (Expected)";
        END
      END ELSE BEGIN
            REPEAT
               IF "Expected Cost" THEN BEGIN
                 ExpectedCost := ExpectedCost + "Cost Amount (Expected)";
                 ExpectedCostACY := ExpectedCostACY + "Cost Amount (Expected) (ACY)";
    …
    

    Vervangende code 3 voor Microsoft Dynamics NAV 2009 SP1 en Microsoft Dynamics NAV 2009 R2

    …
    IF FINDSET AND "Expected Cost" THEN
      IF CalcReminder THEN BEGIN
        CALCSUMS(
             "Cost Amount (Expected)","Cost Amount (Expected) (ACY)",
             "Sales Amount (Expected)","Purchase Amount (Expected)");
        ExpectedCost :=  -"Cost Amount (Expected)";
        ExpectedCostACY := -"Cost Amount (Expected) (ACY)";
        IF NOT CalledFromAdjustment THEN BEGIN
           ExpectedSalesAmt := -"Sales Amount (Expected)";
           ExpectedPurchAmt := -"Purchase Amount (Expected)";
        END
    
    // Add the following lines.   
         END ELSE
           IF InvdValueEntry.Adjustment AND
              (InvdValueEntry."Entry Type" = InvdValueEntry."Entry Type"::"Direct Cost")
           THEN BEGIN
             ExpectedCost := -InvdValueEntry."Cost Amount (Actual)";
             ExpectedCostACY := -InvdValueEntry."Cost Amount (Actual) (ACY)";
             IF NOT CalledFromAdjustment THEN BEGIN
               ExpectedSalesAmt := -InvdValueEntry."Sales Amount (Actual)";
               ExpectedPurchAmt := -InvdValueEntry."Purchase Amount (Actual)";
             END
    // End of the added lines.
    
      END ELSE BEGIN
           REPEAT
                IF "Expected Cost" THEN BEGIN
                  ExpectedCost := ExpectedCost + "Cost Amount (Expected)";
                  ExpectedCostACY := ExpectedCostACY + "Cost Amount (Expected) (ACY)";
    …
    
    

Vereisten

U moet een van de volgende producten hebben geïnstalleerd om deze hotfix toe te passen:

  • Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)
  • Microsoft Dynamics NAV 2009 R2
  • Microsoft Dynamics NAV 2009
  • Microsoft Dynamics NAV 5.0 Service Pack 1 (SP1)

                
              

Verwijderingsgegevens

U kunt deze hotfix niet verwijderen.

Status

Microsoft heeft bevestigd dat dit een probleem is bij de Microsoft-producten die worden vermeld in de sectie Van toepassing op.

Meer informatie

VSTF DynamicsNAV SE: 266892

Opmerking Dit is een artikel 'FAST PUBLISH' dat rechtstreeks vanuit de microsoft-ondersteuningsorganisatie is gemaakt. De hierin opgenomen informatie wordt als zodanig verstrekt als reactie op nieuwe problemen. Als gevolg van de snelheid waarmee het beschikbaar wordt gesteld, kunnen de materialen typografische fouten bevatten en te allen tijde zonder voorafgaande kennisgeving worden herzien. Zie Gebruiksvoorwaarden voor andere overwegingen.