Microsoft Dynamics NAV'ın Belçika sürümünde yüzde 100 satır iskontosu olan bir fatura veya sipariş deftere nakledildikten sonra genel muhasebe girişleri hatalı oluyor

Uygulandığı Öğe
Dynamics NAV 2009

Bu makale, Belçika (be) dil yerel ayarı için Microsoft Dynamics NAV için geçerlidir.

Belirtiler

Microsoft Dynamics NAV'ın Belçika sürümünde yüzde 100 satır iskontosu olan bir satış faturası, satış siparişi, satınalma faturası, satınalma siparişi veya hizmet siparişi deftere naklettiğinizde, genel muhasebe (GL) girişleri yanlış oluyor.
Bu sorun, satır tutarı, satır iskonto tutarı, katma değer vergisi (KDV) matrahı ve "KDV Dahil Tutar" tutarı sıfır olarak ayarlandığında oluşur.

Bu sorun aşağıdaki ürünlerde oluşur:

  • Microsoft Dynamics NAV 2009 Service Pack 1'in (SP1) Belçika sürümü
  • Microsoft Dynamics NAV 2009 R2'nin Belçika sürümü

Çözüm

Düzeltme bilgileri

Artık Microsoft, desteklenen bir düzeltme sunmaktadır. Ancak, yalnızca bu makalede açıklanan sorunu düzeltmeye yöneliktir. Bunu yalnızca bu özel sorunun yaşandığı sistemlere uygulayın. Bu düzeltme için ek sınamalar gerekebilir. Bu nedenle, bu sorundan ciddi bir şekilde etkilenmiyorsanız, bir sonraki Microsoft Dynamics NAV 2009 hizmet paketini veya bu düzeltmeyi içeren bir sonraki Microsoft Dynamics NAV sürümünü beklemenizi öneririz.

Not Özel durumlarda, Microsoft Dynamics ve ilgili ürünler için bir Teknik Destek Uzmanı belirli bir güncelleştirmenin sorunu çözeceğini belirlerse, normalde destek aramaları için yapılan ücretler iptal edilebilir. Ek destek soruları ve söz konusu güncelleştirme için uygun olmayan sorunlara normal destek ücretleri uygulanır.

            
          

Yükleme bilgileri

Microsoft, programlama örneklerini yalnızca gösterim amacıyla sağlar; açık veya zımni hiçbir garanti vermez. Bu, satılabilirlik veya belirli bir amaca uygunluk ile ilgili zımni garantileri içerir, ancak bunlarla sınırlı değildir. Bu makale, gösterilen programlama diline ve prosedürler oluşturmak ve prosedürlerde hata ayıklamak için kullanılan araçlara aşina olduğunuzu varsaymaktadır. Microsoft destek mühendisleri, belirli bir yordamın işlevselliğinin açıklanmasına yardımcı olabilir, ancak gereksinimlerinizi karşılamaya yönelik ek işlevsellik sağlamak veya yordamlar geliştirmek amacıyla bu örnekleri değiştirmezler.

Not Bu düzeltmeyi yüklemeden önce, tüm Microsoft Navision istemcisi kullanıcılarının sistem oturumunu kapattığını doğrulayın. Bu, Microsoft Navision Application Services (NAS) istemci kullanıcılarını içerir. Bu düzeltmeyi uyguladığınızda oturum açan tek istemci kullanıcı siz olmalısınız.

Bu düzeltmeyi uygulamak için bir geliştirici lisansınız olmalıdır.

Windows Oturum Açma veya Veritabanı Oturum Açma penceresindeki kullanıcı hesabına "SUPER" rol kimliğinin atanmasını öneririz. Kullanıcı hesabına "SUPER" rol kimliği atanamıyorsa, kullanıcı hesabının aşağıdaki izinlere sahip olduğunu doğrulamanız gerekir:

  • Değiştireceğiniz nesnenin Değiştirme izni.
  • Sistem Nesne Kimliği 5210 nesnesi ve Sistem Nesne Kimliği 9015 nesnesi için Yürütme izni.

                
Not: Veri onarımı gerçekleştirmeniz gerekmediği sürece, veri depoları üzerinde haklarınız olması gerekmez.

Kod değişiklikleri

Not: Kod düzeltmelerini üretim bilgisayarlarınıza uygulamadan önce her zaman denetimli bir ortamda sınayın.
Bu sorunu gidermek için aşağıdaki adımları izleyin:

  1. Satış Satırı tablosunda (37) yer alan ZeroAmountLine işlevindeki kodu aşağıdaki gibi değiştirin:

    Mevcut kod

    ...
       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);  
    ...
    

    Değişim kodu

    ...
        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. Purchase Line tablosundaki (39) UpdateVATOnLines işlevindeki kodu aşağıdaki gibi değiştirin:

    Mevcut kod 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)" +
    ...
    

    Değiştirme kodu 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)" +
    ...
    

    Mevcut kod 2

    ...
                        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"); 
    ...
    

    Değiştirme kodu 2

    ...
                       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. Purchase Line tablosundaki (39) CalcVATAmountLines işlevindeki kodu aşağıdaki gibi değiştirin:

    Mevcut kod

    ...
          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); 
    ...
    

    Değişim kodu

    ...
          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. Satınalma Satırı tablosunda (39) ZeroAmountLine işlevini aşağıdaki gibi oluşturun:

    ...
      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. Sales-Post kod birimindeki (80) UpdInvPostingBuffer işlevindeki kodu aşağıdaki gibi değiştirin:

    Mevcut kod

    ...
         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";
    ...
    

    Değişim kodu

    ...
        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. Sales-Post kod birimindeki (80) BölTutar işlevindeki kodu aşağıdaki gibi değiştirin:

    Mevcut kod

    ...
         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;
    ...
    

    Değişim kodu

    ...
        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. Purch.-Post kod birimindeki (90) UpdInvPostingBuffer işlevindeki kodu aşağıdaki gibi değiştirin:

    Mevcut kod

    ...
        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" := 
    ...
    

    Değişim kodu

    ...
       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. Purch.-Post kod birimindeki (90) DivideAmount işlevindeki kodu aşağıdaki gibi değiştirin:

    Mevcut kod

    ...
         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;
    ...
    

    Değişim kodu

    ...
       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. Serv-Amounts Mgt. kod birimindeki (5986) FillInvPostingBuffer işlevindeki kodu aşağıdaki gibi değiştirin:

    Mevcut kod 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
    ...
    

    Değiştirme kodu 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
    ...
    

    Mevcut kod 2

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

    Değiştirme kodu 2

    ...
            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,
    ...
    

    Mevcut kod 3

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

    Değiştirme kodu 3

    ...
                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. Serv-Amounts Mgt. kod birimindeki (5986) ClearSerLineDiscBuffer işlevindeki kodu aşağıdaki gibi değiştirin:

    ...
      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; 
    ...
    

Önkoşullar

Bu düzeltmeyi uygulamak için aşağıdaki ürünlerden birini yüklemiş olmanız gerekir:

  • Microsoft Dynamics NAV 2009 Service Pack 1'in (SP1) Belçika sürümü
  • Microsoft Dynamics NAV 2009 R2'nin Belçika sürümü

                
              

Kaldırma bilgileri

Bu düzeltmeyi kaldıramazsınız.

Durum

Microsoft bunun, "Şunlar için geçerlidir" bölümünde listelenen Microsoft ürünlerinde sorun olduğunu doğrulamıştır.

Başvurular

VSTF DynamicsNAV SE: 284212

Not: Bu, doğrudan Microsoft destek kuruluşu tarafından hazırlanmış bir "HIZLI YAYIMLAMA" makalesidir. Burada yer alan bilgiler acil sorunlar karşısında bu şekliyle verilir. Kullanıma sunma hızının bir sonucu olarak, materyaller yazım hataları içerebilir ve herhangi bir zamanda önceden haber verilmeksizin revize edilebilir. Göz önünde bulundurulması gereken diğer hususlar için Kullanım Koşulları'na bakın.