Helytelenek a főkönyvi bejegyzések, miután olyan számlát vagy rendelést adott fel, amelyhez 100 százalékos sorkedvezmény tartozik a Microsoft Dynamics NAV belga verziójában

Hatókör
Dynamics NAV 2009

Ez a cikk a Microsoft Dynamics NAV belga (be) területi beállítására vonatkozik.

Tünetek

Ha a Microsoft Dynamics NAV belgiumi verziójában felad egy értékesítési számlát, egy megrendelést, egy beszerzési számlát, egy beszerzési megrendelést vagy egy olyan szolgáltatási rendelést, amely 100 százalékos sorkedvezményt tartalmaz, a főkönyvi bejegyzések helytelenek.
Ez a probléma akkor fordul elő, ha a sor összege, a sor leszámítolási összege, az általános forgalmi adó (áfa) alapösszege és az "Összeg áfával" érték nulla.

Ez a probléma a következő termékekben fordul elő:

  • A Microsoft Dynamics NAV 2009 Service Pack 1 (SP1) belgiumi verziója
  • A Microsoft Dynamics NAV 2009 R2 belga verziója

Megoldás

Gyorsjavítással kapcsolatos információk

A Microsoft már elérhető egy támogatott gyorsjavítást kínál. Ez azonban csak a cikkben ismertetett probléma megoldására szolgál. Csak olyan rendszerekre alkalmazza, amelyek tapasztalják ezt a problémát. Előfordulhat, hogy a gyorsjavítás további tesztelésen eshet át. Ezért ha nem érinti súlyosan ez a probléma, azt javasoljuk, hogy várja meg a Microsoft Dynamics NAV 2009 következő szervizcsomagját, illetve a Microsoft Dynamics NAV következő olyan verzióját, amely tartalmazza ezt a gyorsjavítást.

Megjegyzés: Különleges esetekben a támogatási hívások szokásos díjai törölhetők, ha a Microsoft Dynamics és a kapcsolódó termékek terméktámogatási szakértője úgy ítéli meg, hogy egy adott frissítés megoldja a problémát. A szokásos támogatási költségek olyan további támogatási kérdések és problémák esetén merülnek fel, amelyek nem felelnek meg a kérdéses frissítés feltételeinek.

            
          

Telepítési információk

A Microsoft csak illusztrációs céllal kínál programozási példákat, kifejezett vagy vélelmezett garancia nélkül. Ez magában foglalja, de nem kizárólagosan a forgalmazhatóságra vagy az adott célra való alkalmasságra vonatkozó vélelmezett garanciát. Ez a cikk feltételezi, hogy ismeri a bemutatott programozási nyelvet, valamint az eljárások létrehozásához és hibakereséséhez használt eszközöket. A Microsoft támogatási szakemberei segíthetnek elmagyarázni egy adott eljárás funkcionalitását, de nem módosítják a példákat, hogy további funkciókat biztosítsanak, és nem építenek ki eljárásokat az egyéni igényekre.

Megjegyzés: A gyorsjavítás telepítése előtt győződjön meg arról, hogy a Microsoft Navision-ügyfél összes felhasználója kijelentkezett a rendszerről. Ide tartoznak a Microsoft Navision Application Services (NAS) kliens felhasználói is. A gyorsjavítás telepítésekor csak Ön lehet az, aki be van jelentkezve.

A gyorsjavítás implementálásához fejlesztői licenccel kell rendelkeznie.

Javasoljuk, hogy a Windows Bejelentkezések ablakában vagy az Adatbázis-bejelentkezések ablakban látható felhasználói fiókhoz rendelje a "SUPER" szerepkörazonosítót. Ha a felhasználói fiókhoz nem rendelhető a "SUPER" szerepkörazonosító, ellenőriznie kell, hogy a felhasználói fiók rendelkezik-e az alábbi engedélyekkel:

  • A módosítani kívánt objektum Módosítás engedélye.
  • Végrehajtási engedély az 5210-es rendszerazonosítójú objektumhoz és a 9015-ös rendszerobjektum-azonosítójú objektumhoz.

                
Megjegyzés: Az adattárakhoz csak akkor kell jogokkal rendelkeznie, ha adatokat kell javítást végeznie.

Kódváltozások

Megjegyzés: Mindig ellenőrzött környezetben tesztelje a kódjavításokat, mielőtt telepítené őket az üzemi számítógépekre.
A probléma megoldásához hajtsa végre az alábbi lépéseket:

  1. Módosítsa az Értékesítési sor táblázat ZeroAmountLine függvényében szereplő kódot (37) a következők szerint:

    Meglévő kód

    ...
       IF Type = Type::" " THEN
        EXIT(TRUE);
      IF Quantity = 0 THEN
        EXIT(TRUE);
    
    // Delete the following line.         
      IF ("Unit Price" = 0) OR ("Line Discount %" = 100) THEN
    
        EXIT(TRUE);
      IF QtyType = QtyType::Invoicing THEN
        IF "Qty. to Invoice" = 0 THEN
          EXIT(TRUE);
      EXIT(FALSE);  
    ...
    

    Helyettesítő kód

    ...
        IF Type = Type::" " THEN
        EXIT(TRUE);
      IF Quantity = 0 THEN
        EXIT(TRUE);
    // Add the following line.          
      IF ("Unit Price" = 0) THEN
    
        EXIT(TRUE);
      IF QtyType = QtyType::Invoicing THEN
        IF "Qty. to Invoice" = 0 THEN
          EXIT(TRUE);
      EXIT(FALSE);
    ...
    
  2. Módosítsa a kódot a Beszerzési sor tábla UpdateVATOnLines függvényében (39) a következők szerint:

    Meglévő kód: 1

    ...
         IF FINDSET THEN
        REPEAT
    // Delete the following lines.            
          VATAmountLine.GET("VAT Identifier","VAT Calculation Type","Tax Group Code","Use Tax","Line Amount" >= 0);
          IF VATAmountLine.Modified THEN BEGIN
            xRecRef.GETTABLE(PurchLine);
            IF NOT TempVATAmountLineRemainder.GET(
                 "VAT Identifier","VAT Calculation Type","Tax Group Code","Use Tax","Line Amount" >= 0)
            THEN BEGIN
              TempVATAmountLineRemainder := VATAmountLine;
              TempVATAmountLineRemainder.INIT;
              TempVATAmountLineRemainder.INSERT;
            END;
    
            IF QtyType = QtyType::General THEN
              LineAmountToInvoice := "Line Amount"
            ELSE
              LineAmountToInvoice :=
                ROUND("Line Amount" * "Qty. to Invoice" / Quantity,Currency."Amount Rounding Precision");
    
            IF "Allow Invoice Disc." THEN BEGIN
              IF VATAmountLine."Inv. Disc. Base Amount" = 0 THEN
                InvDiscAmount := 0
              ELSE BEGIN
                IF QtyType = QtyType::General THEN
                  LineAmountToInvoice := "Line Amount"
                ELSE
                  LineAmountToInvoice :=
                    ROUND("Line Amount" * "Qty. to Invoice" / Quantity,Currency."Amount Rounding Precision");
                TempVATAmountLineRemainder."Invoice Discount Amount" :=
                  TempVATAmountLineRemainder."Invoice Discount Amount" +
                  VATAmountLine."Invoice Discount Amount" * LineAmountToInvoice /
                  VATAmountLine."Inv. Disc. Base Amount";
                InvDiscAmount :=
                  ROUND(
                    TempVATAmountLineRemainder."Invoice Discount Amount",Currency."Amount Rounding Precision");
                TempVATAmountLineRemainder."Invoice Discount Amount" :=
                  TempVATAmountLineRemainder."Invoice Discount Amount" - InvDiscAmount;
              END;
              IF QtyType = QtyType::General THEN BEGIN
                "Inv. Discount Amount" := InvDiscAmount;
                CalcInvDiscToInvoice;
              END ELSE
                "Inv. Disc. Amount to Invoice" := InvDiscAmount;
            END ELSE
              InvDiscAmount := 0;
            IF QtyType = QtyType::General THEN
              IF PurchHeader."Prices Including VAT" THEN BEGIN
                IF (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount" = 0) OR
                   ("Line Amount" = 0)
                THEN BEGIN
                  VATAmount := 0;
                  NewAmountIncludingVAT := 0;
                END ELSE BEGIN
                  VATAmount :=
                    TempVATAmountLineRemainder."VAT Amount" +
                    VATAmountLine."VAT Amount" *
                    ("Line Amount" - "Inv. Discount Amount") /
                    (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount");
                  NewAmountIncludingVAT :=
                    TempVATAmountLineRemainder."Amount Including VAT" +
                    VATAmountLine."Amount Including VAT" *
                    ("Line Amount" - "Inv. Discount Amount") /
                    (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount");
                END;
                NewAmount :=
                  ROUND(NewAmountIncludingVAT,Currency."Amount Rounding Precision") -
                  ROUND(VATAmount,Currency."Amount Rounding Precision");
                IF ("VAT %" <> 0) AND
                   (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount"<> 0)
                THEN
                  NewVATBaseAmount :=
                    TempVATAmountLineRemainder."VAT Base (Lowered)" +
                    VATAmountLine."Line Amount" * (1 - PurchHeader."VAT Base Discount %" / 100) *
                    ("Line Amount" - "Inv. Discount Amount") /
                    (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount")
                ELSE NewVATBaseAmount := NewAmount;
              END ELSE BEGIN
                IF "VAT Calculation Type" = "VAT Calculation Type"::"Full VAT" THEN BEGIN
                  VATAmount := "Line Amount" - "Inv. Discount Amount";
                  NewAmount := 0;
                  NewVATBaseAmount := 0;
                END ELSE BEGIN
                  NewAmount := "Line Amount" - "Inv. Discount Amount";
    // End of the deleted lines.
                  IF ("VAT %" <> 0) AND
                     (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount" <> 0)
                  THEN
                    NewVATBaseAmount :=
                      TempVATAmountLineRemainder."VAT Base (Lowered)" +
    ...
    

    Helyettesítő kód 1

    ...
        IF FINDSET THEN
        REPEAT
    // Add the following lines.
          IF NOT ZeroAmountLine(QtyType) THEN BEGIN
            VATAmountLine.GET("VAT Identifier","VAT Calculation Type","Tax Group Code","Use Tax","Line Amount" >= 0);
            IF VATAmountLine.Modified THEN BEGIN
              xRecRef.GETTABLE(PurchLine);
              IF NOT TempVATAmountLineRemainder.GET(
                   "VAT Identifier","VAT Calculation Type","Tax Group Code","Use Tax","Line Amount" >= 0)
              THEN BEGIN
                TempVATAmountLineRemainder := VATAmountLine;
                TempVATAmountLineRemainder.INIT;
                TempVATAmountLineRemainder.INSERT;
              END;
    
              IF QtyType = QtyType::General THEN
                LineAmountToInvoice := "Line Amount"
              ELSE
                LineAmountToInvoice :=
                  ROUND("Line Amount" * "Qty. to Invoice" / Quantity,Currency."Amount Rounding Precision");
    
              IF "Allow Invoice Disc." THEN BEGIN
                IF VATAmountLine."Inv. Disc. Base Amount" = 0 THEN
                  InvDiscAmount := 0
                ELSE BEGIN
                  IF QtyType = QtyType::General THEN
                    LineAmountToInvoice := "Line Amount"
                  ELSE
                    LineAmountToInvoice :=
                      ROUND("Line Amount" * "Qty. to Invoice" / Quantity,Currency."Amount Rounding Precision");
                  TempVATAmountLineRemainder."Invoice Discount Amount" :=
                    TempVATAmountLineRemainder."Invoice Discount Amount" +
                    VATAmountLine."Invoice Discount Amount" * LineAmountToInvoice /
                    VATAmountLine."Inv. Disc. Base Amount";
                  InvDiscAmount :=
                    ROUND(
                      TempVATAmountLineRemainder."Invoice Discount Amount",Currency."Amount Rounding Precision");
                  TempVATAmountLineRemainder."Invoice Discount Amount" :=
                    TempVATAmountLineRemainder."Invoice Discount Amount" - InvDiscAmount;
                END;
                IF QtyType = QtyType::General THEN BEGIN
                  "Inv. Discount Amount" := InvDiscAmount;
                  CalcInvDiscToInvoice;
                END ELSE
                  "Inv. Disc. Amount to Invoice" := InvDiscAmount;
              END ELSE
                InvDiscAmount := 0;
              IF QtyType = QtyType::General THEN
                IF PurchHeader."Prices Including VAT" THEN BEGIN
                  IF (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount" = 0) OR
                     ("Line Amount" = 0)
                  THEN BEGIN
                    VATAmount := 0;
                    NewAmountIncludingVAT := 0;
                  END ELSE BEGIN
                    VATAmount :=
                      TempVATAmountLineRemainder."VAT Amount" +
                      VATAmountLine."VAT Amount" *
                      ("Line Amount" - "Inv. Discount Amount") /
                      (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount");
                    NewAmountIncludingVAT :=
                      TempVATAmountLineRemainder."Amount Including VAT" +
                      VATAmountLine."Amount Including VAT" *
                      ("Line Amount" - "Inv. Discount Amount") /
                      (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount");
                  END;
                  NewAmount :=
                    ROUND(NewAmountIncludingVAT,Currency."Amount Rounding Precision") -
                    ROUND(VATAmount,Currency."Amount Rounding Precision");
    // End of the added lines. 
                  IF ("VAT %"<> 0) AND
                     (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount" <> 0)
                  THEN
                    NewVATBaseAmount :=
                      TempVATAmountLineRemainder."VAT Base (Lowered)" +
    ...
    

    Meglévő 2. kód

    ...
                        TempVATAmountLineRemainder."VAT Base (Lowered)" +
                      VATAmountLine."Line Amount" * (1 - PurchHeader."VAT Base Discount %" / 100) *
                      ("Line Amount" - "Inv. Discount Amount") /
                      (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount")
                  ELSE NewVATBaseAmount := NewAmount;
    // Delete the following lines.                      
                  IF VATAmountLine."VAT Base" = 0 THEN
                    VATAmount := 0
                  ELSE
                    VATAmount :=
                      TempVATAmountLineRemainder."VAT Amount" +
                      VATAmountLine."VAT Amount" * NewAmount / VATAmountLine."VAT Base";
                END;
                NewAmountIncludingVAT := NewAmount + ROUND(VATAmount,Currency."Amount Rounding Precision");
              END
            ELSE BEGIN
              IF (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount") = 0 THEN
                VATDifference := 0
              ELSE
                VATDifference :=
                  TempVATAmountLineRemainder."VAT Difference" +
                  VATAmountLine."VAT Difference" * (LineAmountToInvoice - InvDiscAmount) /
                  (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount");
              IF LineAmountToInvoice = 0 THEN
                "VAT Difference" := 0
              ELSE
                "VAT Difference" := ROUND(VATDifference,Currency."Amount Rounding Precision");
            END;
    
            IF (QtyType = QtyType::General) AND (PurchHeader.Status = PurchHeader.Status::Released) THEN BEGIN
              Amount := NewAmount;
              "Amount Including VAT" := ROUND(NewAmountIncludingVAT,Currency."Amount Rounding Precision");
              IF "VAT %" <> 0 THEN
                "VAT Base Amount" := ROUND(NewVATBaseAmount,Currency."Amount Rounding Precision")
              ELSE "VAT Base Amount" := Amount;
            END;
            InitOutstanding;
            IF NOT ((Type = Type::"Charge (Item)") AND ("Quantity Invoiced" <> "Qty. Assigned")) THEN BEGIN
              SetUpdateFromVAT(TRUE);
              UpdateUnitCost;
            END;
            IF Type = Type::"Charge (Item)" THEN
              UpdateItemChargeAssgnt;
            MODIFY;
            RecRef.GETTABLE(PurchLine);
            ChangeLogMgt.LogModification(RecRef,xRecRef);
    
            TempVATAmountLineRemainder."Amount Including VAT" :=
              NewAmountIncludingVAT - ROUND(NewAmountIncludingVAT,Currency."Amount Rounding Precision");
            TempVATAmountLineRemainder."VAT Amount" := VATAmount - NewAmountIncludingVAT + NewAmount;
            TempVATAmountLineRemainder."VAT Difference" := VATDifference - "VAT Difference";
            TempVATAmountLineRemainder."VAT Base (Lowered)" := NewVATBaseAmount - "VAT Base Amount";
            TempVATAmountLineRemainder.MODIFY;
    // End of the deleted lines.
          END;
        UNTIL NEXT = 0;
      SETRANGE(Type);
      SETRANGE(Quantity);
      SETRANGE("Qty. to Invoice"); 
    ...
    

    2-es helyettesítő kód

    ...
                       TempVATAmountLineRemainder."VAT Base (Lowered)" +
                      VATAmountLine."Line Amount" * (1 - PurchHeader."VAT Base Discount %" / 100) *
                      ("Line Amount" - "Inv. Discount Amount") /
                      (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount")
                  ELSE NewVATBaseAmount := NewAmount;
    // Add the following lines.                      
                END ELSE BEGIN
                  IF "VAT Calculation Type" = "VAT Calculation Type"::"Full VAT" THEN BEGIN
                    VATAmount := "Line Amount" - "Inv. Discount Amount";
                    NewAmount := 0;
                    NewVATBaseAmount := 0;
                  END ELSE BEGIN
                    NewAmount := "Line Amount" - "Inv. Discount Amount";
                    IF ("VAT %" <>0) AND
                       (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount"<>0)
                    THEN
                      NewVATBaseAmount :=
                        TempVATAmountLineRemainder."VAT Base (Lowered)" +
                        VATAmountLine."Line Amount" * (1 - PurchHeader."VAT Base Discount %" / 100) *
                        ("Line Amount" - "Inv. Discount Amount") /
                        (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount")
                    ELSE NewVATBaseAmount := NewAmount;
                    IF VATAmountLine."VAT Base" = 0 THEN
                      VATAmount := 0
                    ELSE
                      VATAmount :=
                        TempVATAmountLineRemainder."VAT Amount" +
                        VATAmountLine."VAT Amount" * NewAmount / VATAmountLine."VAT Base";
                  END;
                  NewAmountIncludingVAT := NewAmount + ROUND(VATAmount,Currency."Amount Rounding Precision");
                END
              ELSE BEGIN
                IF (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount") = 0 THEN
                  VATDifference := 0
                ELSE
                  VATDifference :=
                    TempVATAmountLineRemainder."VAT Difference" +
                    VATAmountLine."VAT Difference" * (LineAmountToInvoice - InvDiscAmount) /
                    (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount");
                IF LineAmountToInvoice = 0 THEN
                  "VAT Difference" := 0
                ELSE
                  "VAT Difference" := ROUND(VATDifference,Currency."Amount Rounding Precision");
              END;
    
              IF (QtyType = QtyType::General) AND (PurchHeader.Status = PurchHeader.Status::Released) THEN BEGIN
                Amount := NewAmount;
                "Amount Including VAT" := ROUND(NewAmountIncludingVAT,Currency."Amount Rounding Precision");
                IF "VAT %" <> 0 THEN
                  "VAT Base Amount" := ROUND(NewVATBaseAmount,Currency."Amount Rounding Precision")
                ELSE "VAT Base Amount" := Amount;
              END;
              InitOutstanding;
              IF NOT ((Type = Type::"Charge (Item)") AND ("Quantity Invoiced" <>"Qty. Assigned")) THEN BEGIN
                SetUpdateFromVAT(TRUE);
                UpdateUnitCost;
              END;
              IF Type = Type::"Charge (Item)" THEN
                UpdateItemChargeAssgnt;
              MODIFY;
              RecRef.GETTABLE(PurchLine);
              ChangeLogMgt.LogModification(RecRef,xRecRef);
    
              TempVATAmountLineRemainder."Amount Including VAT" :=
                NewAmountIncludingVAT - ROUND(NewAmountIncludingVAT,Currency."Amount Rounding Precision");
              TempVATAmountLineRemainder."VAT Amount" := VATAmount - NewAmountIncludingVAT + NewAmount;
              TempVATAmountLineRemainder."VAT Difference" := VATDifference - "VAT Difference";
              TempVATAmountLineRemainder."VAT Base (Lowered)" := NewVATBaseAmount - "VAT Base Amount";
              TempVATAmountLineRemainder.MODIFY;
            END;
    // End of the added lines. 
          END;
        UNTIL NEXT = 0;
      SETRANGE(Type);
      SETRANGE(Quantity);
      SETRANGE("Qty. to Invoice");
    ...
    
  3. Módosítsa a kódot a CalcVATAmountLines függvényben a Beszerzési sor táblában (39) a következők szerint:

    Meglévő kód

    ...
          Vendor.GET(PurchHeader."Pay-to Vendor No.");
        VendorPostingGroup.GET(Vendor."Vendor Posting Group");
      END;
      IF FINDSET THEN
        REPEAT
    // Delete the following lines.            
          IF (Type = Type::"G/L Account") AND NOT "Prepayment Line" THEN
            RoundingLineInserted := ("No." = VendorPostingGroup."Invoice Rounding Account") OR RoundingLineInserted;
          IF "VAT Calculation Type" IN
             ["VAT Calculation Type"::"Reverse Charge VAT","VAT Calculation Type"::"Sales Tax"]
          THEN
            "VAT %" := 0;
          IF NOT VATAmountLine.GET(
               "VAT Identifier","VAT Calculation Type","Tax Group Code","Use Tax","Line Amount" >= 0)
          THEN BEGIN
            VATAmountLine.INIT;
            VATAmountLine."VAT Identifier" := "VAT Identifier";
            VATAmountLine."VAT Calculation Type" := "VAT Calculation Type";
            VATAmountLine."Tax Group Code" := "Tax Group Code";
            VATAmountLine."Use Tax" := "Use Tax";
            VATAmountLine."VAT %" := "VAT %";
            VATAmountLine.Modified := TRUE;
            VATAmountLine.Positive := "Line Amount" >= 0;
            VATAmountLine.INSERT;
          END;
          CASE QtyType OF
            QtyType::General:
              BEGIN
                VATAmountLine.Quantity := VATAmountLine.Quantity + "Quantity (Base)";
                VATAmountLine."Line Amount" := VATAmountLine."Line Amount" + "Line Amount";
                IF "Allow Invoice Disc." THEN
                  VATAmountLine."Inv. Disc. Base Amount" :=
                    VATAmountLine."Inv. Disc. Base Amount" + "Line Amount";
                VATAmountLine."Invoice Discount Amount" :=
                  VATAmountLine."Invoice Discount Amount" + "Inv. Discount Amount";
                VATAmountLine."VAT Difference" := VATAmountLine."VAT Difference" + "VAT Difference";
                IF "Prepayment Line" THEN
                  VATAmountLine."Includes Prepayment" := TRUE;
                VATAmountLine."VAT Base (Lowered)" := VATAmountLine."VAT Base (Lowered)" + "VAT Base Amount";
                VATAmountLine.MODIFY;
              END;
            QtyType::Invoicing:
              BEGIN
                CASE TRUE OF
                  ("Document Type" IN ["Document Type"::Order,"Document Type"::Invoice]) AND
                  (NOT PurchHeader.Receive) AND PurchHeader.Invoice AND (NOT "Prepayment Line"):
                    BEGIN
                      IF "Receipt No." = '' THEN BEGIN
                        QtyToHandle := GetAbsMin("Qty. to Invoice","Qty. Rcd. Not Invoiced");
                        VATAmountLine.Quantity :=
                          VATAmountLine.Quantity + GetAbsMin("Qty. to Invoice (Base)","Qty. Rcd. Not Invoiced (Base)");
                      END ELSE BEGIN
                        QtyToHandle := "Qty. to Invoice";
                        VATAmountLine.Quantity := VATAmountLine.Quantity + "Qty. to Invoice (Base)";
                      END;
                    END;
                  ("Document Type" IN ["Document Type"::"Return Order","Document Type"::"Credit Memo"]) AND
                  (NOT PurchHeader.Ship) AND PurchHeader.Invoice:
                    BEGIN
                      QtyToHandle := GetAbsMin("Qty. to Invoice","Return Qty. Shipped Not Invd.");
                      VATAmountLine.Quantity :=
                        VATAmountLine.Quantity + GetAbsMin("Qty. to Invoice (Base)","Ret. Qty. Shpd Not Invd.(Base)");
                    END;
                  ELSE
                    BEGIN
                    QtyToHandle := "Qty. to Invoice";
                    VATAmountLine.Quantity := VATAmountLine.Quantity + "Qty. to Invoice (Base)";
                  END;
                END;
                VATAmountLine."Line Amount" :=
                  VATAmountLine."Line Amount" +
                  (ROUND(QtyToHandle * "Direct Unit Cost" - ("Line Discount Amount" * QtyToHandle / Quantity),
                  Currency."Amount Rounding Precision"));
                IF "Allow Invoice Disc." THEN
                  VATAmountLine."Inv. Disc. Base Amount" :=
                    VATAmountLine."Inv. Disc. Base Amount" +
                    (ROUND(QtyToHandle * "Direct Unit Cost" - ("Line Discount Amount" * QtyToHandle / Quantity),
                    Currency."Amount Rounding Precision"));
                IF (PurchHeader."Invoice Discount Calculation" <> PurchHeader."Invoice Discount Calculation"::Amount) THEN
                  VATAmountLine."Invoice Discount Amount" :=
                    VATAmountLine."Invoice Discount Amount" +
                    ROUND("Inv. Discount Amount" * QtyToHandle / Quantity,Currency."Amount Rounding Precision")
                ELSE
                  VATAmountLine."Invoice Discount Amount" :=
                    VATAmountLine."Invoice Discount Amount" + "Inv. Disc. Amount to Invoice";
                VATAmountLine."VAT Difference" := VATAmountLine."VAT Difference" + "VAT Difference";
                IF "Prepayment Line" THEN
                  VATAmountLine."Includes Prepayment" := TRUE;
                VATAmountLine."VAT Base (Lowered)" := VATAmountLine."VAT Base (Lowered)" + "VAT Base Amount";
                VATAmountLine.MODIFY;
              END;
            QtyType::Shipping:
              BEGIN
                IF "Document Type" IN
                   ["Document Type"::"Return Order","Document Type"::"Credit Memo"]
                THEN BEGIN
                  QtyToHandle := "Return Qty. to Ship";
                  VATAmountLine.Quantity := VATAmountLine.Quantity + "Return Qty. to Ship (Base)";
                END ELSE BEGIN
                  QtyToHandle := "Qty. to Receive";
                  VATAmountLine.Quantity := VATAmountLine.Quantity + "Qty. to Receive (Base)";
                END;
                VATAmountLine."Line Amount" :=
                  VATAmountLine."Line Amount" +
                  (ROUND(QtyToHandle * "Direct Unit Cost" - ("Line Discount Amount" * QtyToHandle / Quantity),
                  Currency."Amount Rounding Precision"));
                IF "Allow Invoice Disc." THEN
                  VATAmountLine."Inv. Disc. Base Amount" :=
                    VATAmountLine."Inv. Disc. Base Amount" +
                    (ROUND(QtyToHandle * "Direct Unit Cost" - ("Line Discount Amount" * QtyToHandle / Quantity),
                    Currency."Amount Rounding Precision"));
                VATAmountLine."Invoice Discount Amount" :=
                  VATAmountLine."Invoice Discount Amount" +
                  ROUND("Inv. Discount Amount" * QtyToHandle / Quantity,Currency."Amount Rounding Precision");
                VATAmountLine."VAT Difference" := VATAmountLine."VAT Difference" + "VAT Difference";
                IF "Prepayment Line" THEN
                  VATAmountLine."Includes Prepayment" := TRUE;
                VATAmountLine.MODIFY;
              END;
          END;
          TotalVATAmount := TotalVATAmount + "Amount Including VAT" - Amount;
    // End of the deleted lines.
        UNTIL NEXT = 0;
      SETRANGE(Type);
      SETRANGE(Quantity); 
    ...
    

    Helyettesítő kód

    ...
          Vendor.GET(PurchHeader."Pay-to Vendor No.");
        VendorPostingGroup.GET(Vendor."Vendor Posting Group");
      END;
      IF FINDSET THEN
        REPEAT
    // Add the following lines.            
          IF NOT ZeroAmountLine(QtyType) THEN BEGIN
            IF (Type = Type::"G/L Account") AND NOT "Prepayment Line" THEN
              RoundingLineInserted := ("No." = VendorPostingGroup."Invoice Rounding Account") OR RoundingLineInserted;
            IF "VAT Calculation Type" IN
               ["VAT Calculation Type"::"Reverse Charge VAT","VAT Calculation Type"::"Sales Tax"]
            THEN
              "VAT %" := 0;
            IF NOT VATAmountLine.GET(
                 "VAT Identifier","VAT Calculation Type","Tax Group Code","Use Tax","Line Amount" >= 0)
            THEN BEGIN
              VATAmountLine.INIT;
              VATAmountLine."VAT Identifier" := "VAT Identifier";
              VATAmountLine."VAT Calculation Type" := "VAT Calculation Type";
              VATAmountLine."Tax Group Code" := "Tax Group Code";
              VATAmountLine."Use Tax" := "Use Tax";
              VATAmountLine."VAT %" := "VAT %";
              VATAmountLine.Modified := TRUE;
              VATAmountLine.Positive := "Line Amount" >= 0;
              VATAmountLine.INSERT;
            END;
            CASE QtyType OF
              QtyType::General:
                BEGIN
                  VATAmountLine.Quantity := VATAmountLine.Quantity + "Quantity (Base)";
                  VATAmountLine."Line Amount" := VATAmountLine."Line Amount" + "Line Amount";
                  IF "Allow Invoice Disc." THEN
                    VATAmountLine."Inv. Disc. Base Amount" :=
                      VATAmountLine."Inv. Disc. Base Amount" + "Line Amount";
                  VATAmountLine."Invoice Discount Amount" :=
                    VATAmountLine."Invoice Discount Amount" + "Inv. Discount Amount";
                  VATAmountLine."VAT Difference" := VATAmountLine."VAT Difference" + "VAT Difference";
                  IF "Prepayment Line" THEN
                    VATAmountLine."Includes Prepayment" := TRUE;
                  VATAmountLine."VAT Base (Lowered)" := VATAmountLine."VAT Base (Lowered)" + "VAT Base Amount";
                  VATAmountLine.MODIFY;
                END;
              QtyType::Invoicing:
                BEGIN
                  CASE TRUE OF
                    ("Document Type" IN ["Document Type"::Order,"Document Type"::Invoice]) AND
                    (NOT PurchHeader.Receive) AND PurchHeader.Invoice AND (NOT "Prepayment Line"):
                      BEGIN
                        IF "Receipt No." = '' THEN BEGIN
                          QtyToHandle := GetAbsMin("Qty. to Invoice","Qty. Rcd. Not Invoiced");
                          VATAmountLine.Quantity :=
                            VATAmountLine.Quantity + GetAbsMin("Qty. to Invoice (Base)","Qty. Rcd. Not Invoiced (Base)");
                        END ELSE BEGIN
                          QtyToHandle := "Qty. to Invoice";
                          VATAmountLine.Quantity := VATAmountLine.Quantity + "Qty. to Invoice (Base)";
                        END;
                      END;
                    ("Document Type" IN ["Document Type"::"Return Order","Document Type"::"Credit Memo"]) AND
                    (NOT PurchHeader.Ship) AND PurchHeader.Invoice:
                      BEGIN
                        QtyToHandle := GetAbsMin("Qty. to Invoice","Return Qty. Shipped Not Invd.");
                        VATAmountLine.Quantity :=
                          VATAmountLine.Quantity + GetAbsMin("Qty. to Invoice (Base)","Ret. Qty. Shpd Not Invd.(Base)");
                      END;
                    ELSE
                      BEGIN
                      QtyToHandle := "Qty. to Invoice";
                      VATAmountLine.Quantity := VATAmountLine.Quantity + "Qty. to Invoice (Base)";
                    END;
                  END;
                  VATAmountLine."Line Amount" :=
                    VATAmountLine."Line Amount" +
                    (ROUND(QtyToHandle * "Direct Unit Cost" - ("Line Discount Amount" * QtyToHandle / Quantity),
                    Currency."Amount Rounding Precision"));
                  IF "Allow Invoice Disc." THEN
                    VATAmountLine."Inv. Disc. Base Amount" :=
                      VATAmountLine."Inv. Disc. Base Amount" +
                      (ROUND(QtyToHandle * "Direct Unit Cost" - ("Line Discount Amount" * QtyToHandle / Quantity),
                      Currency."Amount Rounding Precision"));
                  IF (PurchHeader."Invoice Discount Calculation" <> PurchHeader."Invoice Discount Calculation"::Amount) THEN
                    VATAmountLine."Invoice Discount Amount" :=
                      VATAmountLine."Invoice Discount Amount" +
                      ROUND("Inv. Discount Amount" * QtyToHandle / Quantity,Currency."Amount Rounding Precision")
                  ELSE
                    VATAmountLine."Invoice Discount Amount" :=
                      VATAmountLine."Invoice Discount Amount" + "Inv. Disc. Amount to Invoice";
                  VATAmountLine."VAT Difference" := VATAmountLine."VAT Difference" + "VAT Difference";
                  IF "Prepayment Line" THEN
                    VATAmountLine."Includes Prepayment" := TRUE;
                  VATAmountLine."VAT Base (Lowered)" := VATAmountLine."VAT Base (Lowered)" + "VAT Base Amount";
                  VATAmountLine.MODIFY;
                END;
              QtyType::Shipping:
                BEGIN
                  IF "Document Type" IN
                     ["Document Type"::"Return Order","Document Type"::"Credit Memo"]
                  THEN BEGIN
                    QtyToHandle := "Return Qty. to Ship";
                    VATAmountLine.Quantity := VATAmountLine.Quantity + "Return Qty. to Ship (Base)";
                  END ELSE BEGIN
                    QtyToHandle := "Qty. to Receive";
                    VATAmountLine.Quantity := VATAmountLine.Quantity + "Qty. to Receive (Base)";
                  END;
                  VATAmountLine."Line Amount" :=
                    VATAmountLine."Line Amount" +
                    (ROUND(QtyToHandle * "Direct Unit Cost" - ("Line Discount Amount" * QtyToHandle / Quantity),
                    Currency."Amount Rounding Precision"));
                  IF "Allow Invoice Disc." THEN
                    VATAmountLine."Inv. Disc. Base Amount" :=
                      VATAmountLine."Inv. Disc. Base Amount" +
                      (ROUND(QtyToHandle * "Direct Unit Cost" - ("Line Discount Amount" * QtyToHandle / Quantity),
                      Currency."Amount Rounding Precision"));
                  VATAmountLine."Invoice Discount Amount" :=
                    VATAmountLine."Invoice Discount Amount" +
                    ROUND("Inv. Discount Amount" * QtyToHandle / Quantity,Currency."Amount Rounding Precision");
                  VATAmountLine."VAT Difference" := VATAmountLine."VAT Difference" + "VAT Difference";
                  IF "Prepayment Line" THEN
                    VATAmountLine."Includes Prepayment" := TRUE;
                  VATAmountLine.MODIFY;
                END;
            END;
            TotalVATAmount := TotalVATAmount + "Amount Including VAT" - Amount;
          END;
    // End of the added lines. 
        UNTIL NEXT = 0;
      SETRANGE(Type);
      SETRANGE(Quantity);
    ...
    
  4. Hozza létre a ZeroAmountLine függvényt a Beszerzési sor táblában (39) az alábbiak szerint:

    ...
      PROCEDURE ZeroAmountLine@66(QtyType@1000 : 'General,Invoicing,Shipping') : Boolean;
      BEGIN
        IF Type = Type::" " THEN
          EXIT(TRUE);
        IF Quantity = 0 THEN
          EXIT(TRUE);
        IF ("Direct Unit Cost" = 0) THEN // W10001
          EXIT(TRUE);
        IF QtyType = QtyType::Invoicing THEN
          IF "Qty. to Invoice" = 0 THEN
            EXIT(TRUE);
        EXIT(FALSE);
      END; 
    ...
    
  5. Módosítsa az UpdInvPostingBuffer függvény kódját a Sales-Post codeunit (80) értékeként a következők szerint:

    Meglévő kód

    ...
         InvPostingBuffer[1]."Dimension Entry No." := EntryNo;
      IF InvPostingBuffer[1].Type = InvPostingBuffer[1].Type::"Fixed Asset" THEN BEGIN
        FALineNo := FALineNo + 1;
        InvPostingBuffer[1]."Fixed Asset Line No." := FALineNo;
      END;
    
      InvPostingBuffer[2] := InvPostingBuffer[1];
      IF InvPostingBuffer[2].FIND THEN BEGIN
        InvPostingBuffer[2].Amount := InvPostingBuffer[2].Amount + InvPostingBuffer[1].Amount;
        InvPostingBuffer[2]."VAT Amount"  :=
          InvPostingBuffer[2]."VAT Amount" + InvPostingBuffer[1]."VAT Amount";
    ...
    

    Helyettesítő kód

    ...
        InvPostingBuffer[1]."Dimension Entry No." := EntryNo;
      IF InvPostingBuffer[1].Type = InvPostingBuffer[1].Type::"Fixed Asset" THEN BEGIN
        FALineNo := FALineNo + 1;
        InvPostingBuffer[1]."Fixed Asset Line No." := FALineNo;
      END;
    // Add the following lines.
      IF (SalesLine."Line Discount %" = 100) THEN BEGIN
        InvPostingBuffer[1]."VAT Base Amount" := 0;
        InvPostingBuffer[1]."VAT Base Amount (ACY)" := 0;
        InvPostingBuffer[1]."VAT Amount" := 0;
        InvPostingBuffer[1]."VAT Amount (ACY)" := 0;
      END;
    // End of the added lines. 
      InvPostingBuffer[2] := InvPostingBuffer[1];
      IF InvPostingBuffer[2].FIND THEN BEGIN
        InvPostingBuffer[2].Amount := InvPostingBuffer[2].Amount + InvPostingBuffer[1].Amount;
        InvPostingBuffer[2]."VAT Amount"  :=
          InvPostingBuffer[2]."VAT Amount" + InvPostingBuffer[1]."VAT Amount";
    ...
    
  6. Módosítsa a kódot a Sales-Post kódegységben (80) a következőképpen:

    Meglévő kód

    ...
         IF RoundingLineInserted AND (RoundingLineNo = SalesLine."Line No.") THEN
        EXIT;
      WITH SalesLine DO
    // Delete the following line        
        IF (SalesLineQty = 0) OR ("Unit Price" = 0) OR ("Line Discount %" = 100) THEN BEGIN
          "Line Amount" := 0;
          "Line Discount Amount" := 0;
          "Inv. Discount Amount" := 0;
          "VAT Base Amount" := 0;
          Amount := 0;
    ...
    

    Helyettesítő kód

    ...
        IF RoundingLineInserted AND (RoundingLineNo = SalesLine."Line No.") THEN
        EXIT;
      WITH SalesLine DO
    // Add the following line
        IF (SalesLineQty = 0) OR ("Unit Price" = 0) THEN BEGIN // W10001
          "Line Amount" := 0;
          "Line Discount Amount" := 0;
          "Inv. Discount Amount" := 0;
          "VAT Base Amount" := 0;
          Amount := 0;
    ...
    
  7. Módosítsa az UpdInvPostingBuffer függvény kódját a Purch.-Post codeunit (90) értékben a következőképpen:

    Meglévő kód

    ...
        IF InvPostingBuffer[1].Type = InvPostingBuffer[1].Type::"Fixed Asset" THEN BEGIN
        FALineNo := FALineNo + 1;
        InvPostingBuffer[1]."Fixed Asset Line No." := FALineNo;
      END;
      InvPostingBuffer[2] := InvPostingBuffer[1];
      IF InvPostingBuffer[2].FIND THEN BEGIN
        InvPostingBuffer[2].Amount :=
          InvPostingBuffer[2].Amount + InvPostingBuffer[1].Amount;
        InvPostingBuffer[2]."VAT Amount" := 
    ...
    

    Helyettesítő kód

    ...
       IF InvPostingBuffer[1].Type = InvPostingBuffer[1].Type::"Fixed Asset" THEN BEGIN
        FALineNo := FALineNo + 1;
        InvPostingBuffer[1]."Fixed Asset Line No." := FALineNo;
      END;
    // Add the following lines.
      IF (PurchLine."Line Discount %" = 100) THEN BEGIN
        InvPostingBuffer[1]."VAT Base Amount" := 0;
        InvPostingBuffer[1]."VAT Base Amount (ACY)" := 0;
        InvPostingBuffer[1]."VAT Amount" := 0;
        InvPostingBuffer[1]."VAT Amount (ACY)" := 0;
      END;
    // End of the added lines. 
      InvPostingBuffer[2] := InvPostingBuffer[1];
      IF InvPostingBuffer[2].FIND THEN BEGIN
        InvPostingBuffer[2].Amount :=
          InvPostingBuffer[2].Amount + InvPostingBuffer[1].Amount;
        InvPostingBuffer[2]."VAT Amount" :=
    ...
    
  8. Módosítsa a kódot a DivideAmount függvényben a Purch.-Postal Codeunit (90) értékben a következőképpen:

    Meglévő kód

    ...
         IF RoundingLineInserted AND (RoundingLineNo = PurchLine."Line No.") THEN
        EXIT;
      WITH PurchLine DO
    // Delete the following line        
        IF (PurchLineQty = 0) OR ("Direct Unit Cost" = 0) OR ("Line Discount %" = 100) THEN BEGIN
          "Line Amount" := 0;
          "Line Discount Amount" := 0;
          "Inv. Discount Amount" := 0;
          "VAT Base Amount" := 0;
          Amount := 0;
    ...
    

    Helyettesítő kód

    ...
       IF RoundingLineInserted AND (RoundingLineNo = PurchLine."Line No.") THEN
        EXIT;
      WITH PurchLine DO
    // Add the following line        
        IF (PurchLineQty = 0) OR ("Direct Unit Cost" = 0) THEN BEGIN // W10001
          "Line Amount" := 0;
          "Line Discount Amount" := 0;
          "Inv. Discount Amount" := 0;
          "VAT Base Amount" := 0;
          Amount := 0; 
    ...
    
  9. Módosítsa a FillInvPostingBuffer függvény kódját a Serv-Amounts Mgt. codeunit (5986) értékben a következők szerint:

    Meglévő kód: 1

    ...
             TotalVATACY,
          TotalAmount,
          TotalAmountACY,
          TotalVATBase,
          TotalVATBaseACY);
        UpdInvPostingBuffer(InvPostingBuffer,TempDocDim);
      END;
    
      IF SalesSetup."Discount Posting" IN
        [SalesSetup."Discount Posting"::"Line Discounts",SalesSetup."Discount Posting"::"All Discounts"] THEN
    ...
    

    Helyettesítő kód 1

    ...
            TotalVATACY,
          TotalAmount,
          TotalAmountACY,
          TotalVATBase,
          TotalVATBaseACY);
    // Add the following lines.
        IF ServiceLine."Line Discount %" = 100 THEN
          ClearSerLineDiscBuffer(InvPostingBuffer[1]);
    // End of the added lines. 
        UpdInvPostingBuffer(InvPostingBuffer,TempDocDim);
      END;
    
      IF SalesSetup."Discount Posting" IN
        [SalesSetup."Discount Posting"::"Line Discounts",SalesSetup."Discount Posting"::"All Discounts"] THEN
    ...
    

    Meglévő 2. kód

    ...
             TotalVATACY,
          TotalAmount,
          TotalAmountACY,
          TotalVATBase,
          TotalVATBaseACY);
        UpdInvPostingBuffer(InvPostingBuffer,TempDocDim);
      END;
    
      InvPostingBuffer[1].SetAmounts(
        TotalVAT,
    ...
    

    2-es helyettesítő kód

    ...
            TotalVATACY,
          TotalAmount,
          TotalAmountACY,
          TotalVATBase,
          TotalVATBaseACY);
    // Add the following lines.
        IF ServiceLine."Line Discount %" = 100 THEN
          ClearSerLineDiscBuffer(InvPostingBuffer[1]);
    // End of the added lines. 
        UpdInvPostingBuffer(InvPostingBuffer,TempDocDim);
      END;
    
      InvPostingBuffer[1].SetAmounts(
        TotalVAT,
    ...
    

    Meglévő 3-as kód

    ...
                TotalVATBase,
              TotalVATBaseACY);
          END;
        END;
      END;
    
      UpdInvPostingBuffer(InvPostingBuffer,TempDocDim); 
    ...
    

    3-as helyettesítő kód

    ...
                TotalVATBase,
              TotalVATBaseACY);
          END;
        END;
      END;
    // Add the following lines.
      IF ServiceLine."Line Discount %" = 100 THEN
        ClearSerLineDiscBuffer(InvPostingBuffer[1]);
    // End of the added lines. 
    
      UpdInvPostingBuffer(InvPostingBuffer,TempDocDim);
    ...
    
  10. Módosítsa a kódot a ClearSerLineDiscBuffer függvényben a Serv-Amounts Mgt. codeunit (5986) a következők szerint:

    ...
      LOCAL PROCEDURE ClearSerLineDiscBuffer@50(VAR InvPostingBuffer@1050 : Record 49);
      BEGIN
        InvPostingBuffer."VAT Base Amount" := 0;
        InvPostingBuffer."VAT Base Amount (ACY)" := 0;
        InvPostingBuffer."VAT Amount" := 0;
        InvPostingBuffer."VAT Amount (ACY)" := 0;
      END; 
    ...
    

Előfeltételek

A gyorsjavítás alkalmazásához az alábbi termékek egyikének telepítve kell lennie:

  • A Microsoft Dynamics NAV 2009 Service Pack 1 (SP1) belgiumi verziója
  • A Microsoft Dynamics NAV 2009 R2 belga verziója

                
              

Eltávolítással kapcsolatos információk

Ez a gyorsjavítás nem távolítható el.

Állapot

A Microsoft megerősítette, hogy ez egy olyan probléma a Microsoft-termékekben, amely az „Érintett szolgáltatás“ című szakaszban van felsorolva.

Hivatkozások

VSTF DynamicsNAV SE: 284212

Megjegyzés: Ez egy "GYORS KÖZZÉTÉTELŰ" cikk, amelyet közvetlenül a Microsoft támogatási szervezete készített. A dokumentumban szereplő információkat adott formában bocsátjuk rendelkezésre, a felmerülő problémákra adott válaszként. A rendelkezésre bocsátás gyorsasága következtében az anyagok sajtóhibákat tartalmazhatnak, és bármikor, előzetes értesítés nélkül felülvizsgálhatók. További szempontokat a használati feltételekben talál.