"Beløp (NOK) må ha samme fortegn som Beløpet i gen. Feilmeldingen Logglinje når du legger inn en faktura for en delvis levert salgsordre eller innkjøpsordre der feltet Forskuddsbetaling%er satt til 100 i Microsoft Dynamics NAV...

Gjelder for
Dynamics NAV 2009

Denne artikkelen gjelder for Microsoft Dynamics NAV for alle land og alle språkinnstillinger.

Symptomer

Anta at du oppretter en salgsordre som har feltet Forskuddsbetaling% satt til 100 i Microsoft Dynamics NAV 2009. Deretter legger du inn forskuddsbetalingsfakturaen for salgsordren. Deretter legger du inn forsendelsen delvis for salgsordren. Når du i denne situasjonen publiserer fakturaen for salgsordren, får du følgende feilmelding:

Obs!

Beløp (NOK) må ha samme fortegn som Beløpet i Gen. Journallinje.

Dette problemet oppstår også når du legger inn en faktura for en delvis levert innkjøpsordre der feltet Forskuddsbetaling% er satt til 100.
Dette problemet oppstår i følgende produkter:

  • Microsoft Dynamics NAV 2009 R2
  • Microsoft Dynamics NAV 2009 Service Pack 1

      

Oppløsning

Hurtigreparasjonsinformasjon

En støttet hurtigreparasjon er nå tilgjengelig fra Microsoft. Det er imidlertid bare ment å rette opp problemet som er beskrevet i denne artikkelen. Bruk den bare på systemer som opplever dette spesifikke problemet. Denne hurtigreparasjonen kan få ytterligere testing. Hvis du ikke er alvorlig påvirket av dette problemet, anbefaler vi derfor at du venter på den neste Microsoft Dynamics NAV 2009-oppdateringspakken eller den neste Microsoft Dynamics NAV-versjonen som inneholder denne hurtigreparasjonen.

Obs! I spesielle tilfeller kan kostnader som vanligvis påløper for støtteanrop, bli avbrutt hvis en technical support professional for Microsoft Dynamics og relaterte produkter bestemmer at en bestemt oppdatering vil løse problemet. De vanlige støttekostnadene gjelder for ytterligere støttespørsmål og problemer som ikke kvalifiserer for den aktuelle oppdateringen.

            
          

Installasjonsinformasjon

Microsoft tilbyr programmeringseksempler bare for illustrasjon, uten garanti enten uttrykt eller underforstått. Dette omfatter, men er ikke begrenset til, de underforståtte garantiene om salgbarhet eller egnethet for et bestemt formål. Denne artikkelen antar at du er kjent med programmeringsspråket som demonstreres, og med verktøyene som brukes til å opprette og feilsøke prosedyrer. Microsoft kundestøtteteknikere kan bidra til å forklare funksjonaliteten til en bestemt prosedyre, men de vil ikke endre disse eksemplene for å gi ekstra funksjonalitet eller konstruere prosedyrer for å oppfylle dine spesifikke krav.

Obs! Før du installerer denne hurtigreparasjonen, må du kontrollere at alle Microsoft Navision-klientbrukere er logget av systemet. Dette inkluderer microsoft Navision Application Services (NAS)-klientbrukere. Du bør være den eneste klientbrukeren som er logget på når du implementerer denne hurtigreparasjonen.

Hvis du vil implementere denne hurtigreparasjonen, må du ha en utviklerlisens.

Vi anbefaler at brukerkontoen i Windows-påloggingsvinduet eller i vinduet Pålogginger for database tilordnes rolle-ID-en SUPER. Hvis brukerkontoen ikke kan tilordnes rolle-IDen SUPER, må du kontrollere at brukerkontoen har følgende tillatelser:

  • Endre-tillatelsen for objektet du skal endre.
  • Execute-tillatelsen for Objektet System Object ID 5210 og systemobjekt-ID 9015-objektet.

                
Vær oppmerksom på at du ikke trenger å ha rettigheter til datalagrene med mindre du må utføre datareparasjon.

Kodeendringer

Obs! Test alltid kodeløsninger i et kontrollert miljø før du bruker løsningene på produksjonsdatamaskinene.
Følg disse trinnene for å løse dette problemet:

  1. Endre koden i CalcVATAmountLines@35-prosedyren i tabellen Salgslinje (37) på følgende måte:
    Eksisterende kode

    ...
    END ELSE BEGIN
    CASE "VAT Calculation Type" OF
    "VAT Calculation Type"::"Normal VAT",
    "VAT Calculation Type"::"Reverse Charge VAT":
    BEGIN
    "VAT Base" := "Line Amount" - "Invoice Discount Amount";
    "VAT Amount" :=
    "VAT Difference" +
    ROUND(
    PrevVatAmountLine."VAT Amount" +
    "VAT Base" * "VAT %" / 100 * (1 - SalesHeader."VAT Base Discount %" / 100),
    Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
    "Amount Including VAT" := "Line Amount" - "Invoice Discount Amount" + "VAT Amount";
    IF Positive THEN
    PrevVatAmountLine.INIT
    
    // Delete the following lines.
    ELSE BEGIN
    PrevVatAmountLine := VATAmountLine;
    PrevVatAmountLine."VAT Amount" :=
    ROUND(PrevVatAmountLine."VAT Amount" -
    "VAT Base" * "VAT %" / 100 * (1 - SalesHeader."VAT Base Discount %" / 100),
    Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
    END;
    // End of the lines.
    ...
    

    Erstatningskode

    ...
    END ELSE BEGIN
    CASE "VAT Calculation Type" OF
    "VAT Calculation Type"::"Normal VAT",
    "VAT Calculation Type"::"Reverse Charge VAT":
    BEGIN
    "VAT Base" := "Line Amount" - "Invoice Discount Amount";
    "VAT Amount" :=
    "VAT Difference" +
    ROUND(
    PrevVatAmountLine."VAT Amount" +
    "VAT Base" * "VAT %" / 100 * (1 - SalesHeader."VAT Base Discount %" / 100),
    Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
    "Amount Including VAT" := "Line Amount" - "Invoice Discount Amount" + "VAT Amount";
    IF Positive THEN
    PrevVatAmountLine.INIT
    
    // Add the following lines.
    ELSE
    IF NOT "Includes Prepayment" THEN BEGIN
    PrevVatAmountLine := VATAmountLine;
    PrevVatAmountLine."VAT Amount" :=
    "VAT Base" * "VAT %" / 100 * (1 - SalesHeader."VAT Base Discount %" / 100);
    PrevVatAmountLine."VAT Amount" :=
    PrevVatAmountLine."VAT Amount" -
    ROUND(PrevVatAmountLine."VAT Amount",Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
    END;
    // End of the lines.
    ... 
    
  2. Endre koden i CalcVATAmountLines@24 prosedyren i «Kjøpslinje»-tabellen (39) på følgende måte:
    Eksisterende kode

    ...
    CASE "VAT Calculation Type" OF
    "VAT Calculation Type"::"Normal VAT",
    "VAT Calculation Type"::"Reverse Charge VAT":
    BEGIN
    "VAT Base" := "Line Amount" - "Invoice Discount Amount";
    "VAT Amount" :=
    "VAT Difference" +
    ROUND(
    PrevVatAmountLine."VAT Amount" +
    "VAT Base" * "VAT %" / 100 * (1 - PurchHeader."VAT Base Discount %" / 100),
    Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
    "Amount Including VAT" := "Line Amount" - "Invoice Discount Amount" + "VAT Amount";
    IF Positive THEN
    PrevVatAmountLine.INIT
    
    // Delete the following lines.
    ELSE BEGIN
    PrevVatAmountLine := VATAmountLine;
    PrevVatAmountLine."VAT Amount" :=
    "VAT Base" * "VAT %" / 100 * (1 - PurchHeader."VAT Base Discount %" / 100);
    PrevVatAmountLine."VAT Amount" :=
    PrevVatAmountLine."VAT Amount" -
    ROUND(PrevVatAmountLine."VAT Amount",Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
    END;
    // End of the lines.
    ...
    

    Erstatningskode

    ...
    CASE "VAT Calculation Type" OF
    "VAT Calculation Type"::"Normal VAT",
    "VAT Calculation Type"::"Reverse Charge VAT":
    BEGIN
    "VAT Base" := "Line Amount" - "Invoice Discount Amount";
    "VAT Amount" :=
    "VAT Difference" +
    ROUND(
    PrevVatAmountLine."VAT Amount" +
    "VAT Base" * "VAT %" / 100 * (1 - PurchHeader."VAT Base Discount %" / 100),
    Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
    "Amount Including VAT" := "Line Amount" - "Invoice Discount Amount" + "VAT Amount";
    IF Positive THEN
    PrevVatAmountLine.INIT
    
    // Add the following lines.
    ELSE
    IF NOT "Includes Prepayment" THEN BEGIN
    PrevVatAmountLine := VATAmountLine;
    PrevVatAmountLine."VAT Amount" :=
    "VAT Base" * "VAT %" / 100 * (1 - PurchHeader."VAT Base Discount %" / 100);
    PrevVatAmountLine."VAT Amount" :=
    PrevVatAmountLine."VAT Amount" -
    ROUND(PrevVatAmountLine."VAT Amount",Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
    END;
    // End of the lines.
    ...
    
  3. Endre koden i OnRun-utløseren i kodeenheten Salgspost (80) på følgende måte:
    Eksisterende kode 1

    ...
    RemQtyToBeInvoiced := RemQtyToBeInvoiced - QtyToBeInvoiced;
    RemQtyToBeInvoicedBase := RemQtyToBeInvoicedBase - QtyToBeInvoicedBase;
    ReturnRcptLine."Quantity Invoiced" :=
    ReturnRcptLine."Quantity Invoiced" + QtyToBeInvoiced;
    ReturnRcptLine."Qty. Invoiced (Base)" :=
    ReturnRcptLine."Qty. Invoiced (Base)" + QtyToBeInvoicedBase;
    ReturnRcptLine."Return Qty. Rcd. Not Invd." :=
    ReturnRcptLine.Quantity - ReturnRcptLine."Quantity Invoiced";
    ReturnRcptLine.MODIFY;
    IF SalesLine.Type = SalesLine.Type::Item THEN
    PostItemJnlLine(
    SalesLine,
    0,0,
    QtyToBeInvoiced,
    QtyToBeInvoicedBase,
    
    // Delete the following line.
    {ReturnRcptLine."Item Rcpt. Entry No."}
    
    ItemEntryRelation."Item Entry No.",'',TempInvoicingSpecification);
    IF TrackingSpecificationExists THEN
    EndLoop := (TempInvoicingSpecification.NEXT = 0)
    ELSE
    EndLoop :=
    (ReturnRcptLine.NEXT = 0) OR (ABS(RemQtyToBeInvoiced) <= ABS(SalesLine."Return Qty. to Receive"));
    UNTIL EndLoop;
    END ELSE
    ERROR(
    Text025,
    SalesLine."Return Receipt Line No.",SalesLine."Return Receipt No.");
    END;
    ...
    

    Erstatningskode 1

    ...
    RemQtyToBeInvoiced := RemQtyToBeInvoiced - QtyToBeInvoiced;
    RemQtyToBeInvoicedBase := RemQtyToBeInvoicedBase - QtyToBeInvoicedBase;
    ReturnRcptLine."Quantity Invoiced" :=
    ReturnRcptLine."Quantity Invoiced" + QtyToBeInvoiced;
    ReturnRcptLine."Qty. Invoiced (Base)" :=
    ReturnRcptLine."Qty. Invoiced (Base)" + QtyToBeInvoicedBase;
    ReturnRcptLine."Return Qty. Rcd. Not Invd." :=
    ReturnRcptLine.Quantity - ReturnRcptLine."Quantity Invoiced";
    ReturnRcptLine.MODIFY;
    IF SalesLine.Type = SalesLine.Type::Item THEN
    PostItemJnlLine(
    SalesLine,
    0,0,
    QtyToBeInvoiced,
    QtyToBeInvoicedBase,
    ItemEntryRelation."Item Entry No.",'',TempInvoicingSpecification);
    IF TrackingSpecificationExists THEN
    EndLoop := (TempInvoicingSpecification.NEXT = 0)
    ELSE
    EndLoop :=
    (ReturnRcptLine.NEXT = 0) OR (ABS(RemQtyToBeInvoiced) <= ABS(SalesLine."Return Qty. to Receive"));
    UNTIL EndLoop;
    END ELSE
    ERROR(
    Text025,
    SalesLine."Return Receipt Line No.",SalesLine."Return Receipt No.");
    END;
    ...
    

    Eksisterende kode 2

    ...
    RemQtyToBeInvoiced := RemQtyToBeInvoiced - QtyToBeInvoiced;
    RemQtyToBeInvoicedBase := RemQtyToBeInvoicedBase - QtyToBeInvoicedBase;
    SalesShptLine."Quantity Invoiced" :=
    SalesShptLine."Quantity Invoiced" - QtyToBeInvoiced;
    SalesShptLine."Qty. Invoiced (Base)" :=
    SalesShptLine."Qty. Invoiced (Base)" - QtyToBeInvoicedBase;
    SalesShptLine."Qty. Shipped Not Invoiced" :=
    SalesShptLine.Quantity - SalesShptLine."Quantity Invoiced";
    SalesShptLine.MODIFY;
    IF SalesLine.Type = SalesLine.Type::Item THEN
    PostItemJnlLine(
    SalesLine,
    0,0,
    QtyToBeInvoiced,
    QtyToBeInvoicedBase,
    
    // Delete the following line.
    {SalesShptLine."Item Shpt. Entry No."}
    
    ItemEntryRelation."Item Entry No.",'',TempInvoicingSpecification);
    IF TrackingSpecificationExists THEN
    EndLoop := (TempInvoicingSpecification.NEXT = 0)
    ELSE
    EndLoop :=
    (SalesShptLine.NEXT = 0) OR (ABS(RemQtyToBeInvoiced) <= ABS(SalesLine."Qty. to Ship"))
    UNTIL EndLoop;
    END ELSE
    ERROR(
    Text026,
    SalesLine."Shipment Line No.",SalesLine."Shipment No.");
    END;
    

    Erstatningskode 2

    ...
    RemQtyToBeInvoiced := RemQtyToBeInvoiced - QtyToBeInvoiced;
    RemQtyToBeInvoicedBase := RemQtyToBeInvoicedBase - QtyToBeInvoicedBase;
    SalesShptLine."Quantity Invoiced" :=
    SalesShptLine."Quantity Invoiced" - QtyToBeInvoiced;
    SalesShptLine."Qty. Invoiced (Base)" :=
    SalesShptLine."Qty. Invoiced (Base)" - QtyToBeInvoicedBase;
    SalesShptLine."Qty. Shipped Not Invoiced" :=
    SalesShptLine.Quantity - SalesShptLine."Quantity Invoiced";
    SalesShptLine.MODIFY;
    IF SalesLine.Type = SalesLine.Type::Item THEN
    PostItemJnlLine(
    SalesLine,
    0,0,
    QtyToBeInvoiced,
    QtyToBeInvoicedBase,
    ItemEntryRelation."Item Entry No.",'',TempInvoicingSpecification);
    IF TrackingSpecificationExists THEN
    EndLoop := (TempInvoicingSpecification.NEXT = 0)
    ELSE
    EndLoop :=
    (SalesShptLine.NEXT = 0) OR (ABS(RemQtyToBeInvoiced) <= ABS(SalesLine."Qty. to Ship"))
    UNTIL EndLoop;
    END ELSE
    ERROR(
    Text026,
    SalesLine."Shipment Line No.",SalesLine."Shipment No.");
    END;
    ...
    
  4. Endre koden i den lokale AdjustPrepmtAmountLCY@84 prosedyren i kodeenheten Salgspost (80) på følgende måte:
    Eksisterende kode 1

    ...
    TempPrepmtDeductLCYSalesLine.SETRANGE("Attached to Line No.",PrepmtSalesLine."Line No.");
    IF TempPrepmtDeductLCYSalesLine.FINDSET(TRUE) THEN
    REPEAT
    SalesLine := TempPrepmtDeductLCYSalesLine;
    SalesLine.FIND;
    IF SalesLine."Document Type" = SalesLine."Document Type"::Invoice THEN
    GetSalesOrderLine(SalesLine,SalesLine);
    DeductionFactor :=
    SalesLine."Prepmt Amt to Deduct" /
    (SalesLine."Prepmt. Amt. Inv." - SalesLine."Prepmt Amt Deducted");
    ...
    

    Erstatningskode 1

    ...
    TempPrepmtDeductLCYSalesLine.SETRANGE("Attached to Line No.",PrepmtSalesLine."Line No.");
    IF TempPrepmtDeductLCYSalesLine.FINDSET(TRUE) THEN
    REPEAT
    SalesLine := TempPrepmtDeductLCYSalesLine;
    SalesLine.FIND;
    IF SalesLine."Document Type" = SalesLine."Document Type"::Invoice THEN
    GetSalesOrderLine(SalesLine,SalesLine);
    
    // Add the following line.
    SalesLine."Prepmt Amt to Deduct" := CalcPrepmtAmtToDeduct(SalesLine);
    
    DeductionFactor :=
    SalesLine."Prepmt Amt to Deduct" /
    (SalesLine."Prepmt. Amt. Inv." - SalesLine."Prepmt Amt Deducted");
    ...
    

    Eksisterende kode 2

    ...
    IF ABS(TotalPrepmtVATAmtLCYDifference) <= GLSetup."Amount Rounding Precision" THEN
    TotalPrepmtVATAmtLCYDifference := 0;
    PrepmtSalesLine."Prepmt. VAT Amount Inv. (LCY)" := TotalPrepmtVATAmtLCYDifference;
    NewAmountIncludingVAT := PrepmtSalesLine.Amount + TotalPrepmtVATAmtLCY + TotalPrepmtVATAmtLCYDifference;
    Increment(TotalSalesLineLCY."Amount Including VAT",PrepmtSalesLine."Amount Including VAT" - NewAmountIncludingVAT);
    PrepmtSalesLine."Amount Including VAT" := NewAmountIncludingVAT;
    END;
    END;
    LOCAL PROCEDURE GetSalesOrderLine@85(VAR SalesOrderLine@1000 : Record 37;SalesLine@1001 : Record 37);
    ...
    

    Erstatningskode 2

    ...
    IF ABS(TotalPrepmtVATAmtLCYDifference) <= GLSetup."Amount Rounding Precision" THEN
    TotalPrepmtVATAmtLCYDifference := 0;
    PrepmtSalesLine."Prepmt. VAT Amount Inv. (LCY)" := TotalPrepmtVATAmtLCYDifference;
    NewAmountIncludingVAT := PrepmtSalesLine.Amount + TotalPrepmtVATAmtLCY + TotalPrepmtVATAmtLCYDifference;
    Increment(TotalSalesLineLCY."Amount Including VAT",PrepmtSalesLine."Amount Including VAT" - NewAmountIncludingVAT);
    
    // Add the following lines.
    IF SalesLine."Currency Code" = '' THEN
    TotalSalesLine."Amount Including VAT" := TotalSalesLineLCY."Amount Including VAT";
    // End of the lines.
    
    PrepmtSalesLine."Amount Including VAT" := NewAmountIncludingVAT;
    END;
    END;
    
    // Add the following lines.
    PROCEDURE CalcPrepmtAmtToDeduct@71(SalesLine@1000 : Record 37) : Decimal;
    VAR
    AllowedQtyToInvoice@1001 : Decimal;
    BEGIN
    WITH SalesLine DO BEGIN
    AllowedQtyToInvoice := "Qty. Shipped Not Invoiced";
    IF SalesHeader.Ship THEN
    AllowedQtyToInvoice := AllowedQtyToInvoice + "Qty. to Ship";
    IF "Qty. to Invoice" > AllowedQtyToInvoice THEN BEGIN
    "Qty. to Invoice" := AllowedQtyToInvoice;
    CalcPrepaymentToDeduct;
    END;
    EXIT("Prepmt Amt to Deduct");
    END;
    END;
    // End of the lines.
    
    LOCAL PROCEDURE GetSalesOrderLine@85(VAR SalesOrderLine@1000 : Record 37;SalesLine@1001 : Record 37);
    ...
    
  5. Endre koden i OnRun-utløseren i kodeenheten «Purch.-Post» (90) på følgende måte:
    Eksisterende kode 1

    ...
    RemQtyToBeInvoiced := RemQtyToBeInvoiced - QtyToBeInvoiced;
    RemQtyToBeInvoicedBase := RemQtyToBeInvoicedBase - QtyToBeInvoicedBase;
    ReturnShptLine."Quantity Invoiced" :=
    ReturnShptLine."Quantity Invoiced" - QtyToBeInvoiced;
    ReturnShptLine."Qty. Invoiced (Base)" :=
    ReturnShptLine."Qty. Invoiced (Base)" - QtyToBeInvoicedBase;
    ReturnShptLine."Return Qty. Shipped Not Invd." :=
    ReturnShptLine.Quantity - ReturnShptLine."Quantity Invoiced";
    ReturnShptLine.MODIFY;
    IF PurchLine.Type = PurchLine.Type::Item THEN
    PostItemJnlLine(
    PurchLine,
    0,0,
    QtyToBeInvoiced,QtyToBeInvoicedBase,
    
    // Delete the following line.
    {ReturnShptLine."Item Shpt. Entry No."}
    
    ItemEntryRelation."Item Entry No.",'',TempInvoicingSpecification);
    IF TrackingSpecificationExists THEN
    ...
    

    Erstatningskode 1

    ...
    RemQtyToBeInvoiced := RemQtyToBeInvoiced - QtyToBeInvoiced;
    RemQtyToBeInvoicedBase := RemQtyToBeInvoicedBase - QtyToBeInvoicedBase;
    ReturnShptLine."Quantity Invoiced" :=
    ReturnShptLine."Quantity Invoiced" - QtyToBeInvoiced;
    ReturnShptLine."Qty. Invoiced (Base)" :=
    ReturnShptLine."Qty. Invoiced (Base)" - QtyToBeInvoicedBase;
    ReturnShptLine."Return Qty. Shipped Not Invd." :=
    ReturnShptLine.Quantity - ReturnShptLine."Quantity Invoiced";
    ReturnShptLine.MODIFY;
    IF PurchLine.Type = PurchLine.Type::Item THEN
    PostItemJnlLine(
    PurchLine,
    0,0,
    QtyToBeInvoiced,QtyToBeInvoicedBase,
    ItemEntryRelation."Item Entry No.",'',TempInvoicingSpecification);
    IF TrackingSpecificationExists THEN
    ...
    

    Eksisterende kode 2

    ...
    RemQtyToBeInvoiced := RemQtyToBeInvoiced - QtyToBeInvoiced;
    RemQtyToBeInvoicedBase := RemQtyToBeInvoicedBase - QtyToBeInvoicedBase;
    PurchRcptLine."Quantity Invoiced" := PurchRcptLine."Quantity Invoiced" + QtyToBeInvoiced;
    PurchRcptLine."Qty. Invoiced (Base)" := PurchRcptLine."Qty. Invoiced (Base)" + QtyToBeInvoicedBase;
    PurchRcptLine."Qty. Rcd. Not Invoiced" :=
    PurchRcptLine.Quantity - PurchRcptLine."Quantity Invoiced";
    PurchRcptLine.MODIFY;
    IF PurchLine.Type = PurchLine.Type::Item THEN
    PostItemJnlLine(
    PurchLine,
    0,0,
    QtyToBeInvoiced,QtyToBeInvoicedBase,
    
    // Delete the following line.
    {PurchRcptLine."Item Rcpt. Entry No."}
    
    ItemEntryRelation."Item Entry No.",'',TempInvoicingSpecification);
    IF TrackingSpecificationExists THEN
    ...
    

    Erstatningskode 2

    ...
    RemQtyToBeInvoiced := RemQtyToBeInvoiced - QtyToBeInvoiced;
    RemQtyToBeInvoicedBase := RemQtyToBeInvoicedBase - QtyToBeInvoicedBase;
    PurchRcptLine."Quantity Invoiced" := PurchRcptLine."Quantity Invoiced" + QtyToBeInvoiced;
    PurchRcptLine."Qty. Invoiced (Base)" := PurchRcptLine."Qty. Invoiced (Base)" + QtyToBeInvoicedBase;
    PurchRcptLine."Qty. Rcd. Not Invoiced" :=
    PurchRcptLine.Quantity - PurchRcptLine."Quantity Invoiced";
    PurchRcptLine.MODIFY;
    IF PurchLine.Type = PurchLine.Type::Item THEN
    PostItemJnlLine(
    PurchLine,
    0,0,
    QtyToBeInvoiced,QtyToBeInvoicedBase,
    ItemEntryRelation."Item Entry No.",'',TempInvoicingSpecification);
    IF TrackingSpecificationExists THEN
    ...
    
  6. Endre koden i AdjustPrepmtAmountLCY@84 lokal prosedyre i kodeenheten «Purch.-Post» (90) på følgende måte:
    Eksisterende kode 1

    ...
    TempPrepmtDeductLCYPurchLine.SETRANGE("Attached to Line No.",PrepmtPurchLine."Line No.");
    IF TempPrepmtDeductLCYPurchLine.FINDSET(TRUE) THEN
    REPEAT
    PurchLine := TempPrepmtDeductLCYPurchLine;
    PurchLine.FIND;
    IF PurchLine."Document Type" = PurchLine."Document Type"::Invoice THEN
    GetPurchOrderLine(PurchLine,PurchLine);
    DeductionFactor :=
    PurchLine."Prepmt Amt to Deduct" /
    (PurchLine."Prepmt. Amt. Inv." - PurchLine."Prepmt Amt Deducted");
    PrepmtAmtLCYDifference :=
    ...
    

    Erstatningskode 1

    ...
    TempPrepmtDeductLCYPurchLine.SETRANGE("Attached to Line No.",PrepmtPurchLine."Line No.");
    IF TempPrepmtDeductLCYPurchLine.FINDSET(TRUE) THEN
    REPEAT
    PurchLine := TempPrepmtDeductLCYPurchLine;
    PurchLine.FIND;
    IF PurchLine."Document Type" = PurchLine."Document Type"::Invoice THEN
    GetPurchOrderLine(PurchLine,PurchLine);
    
    // Add the following line.
    PurchLine."Prepmt Amt to Deduct" := CalcPrepmtAmtToDeduct(PurchLine);
    
    DeductionFactor :=
    PurchLine."Prepmt Amt to Deduct" /
    (PurchLine."Prepmt. Amt. Inv." - PurchLine."Prepmt Amt Deducted");
    PrepmtAmtLCYDifference :=
    ...
    

    Eksisterende kode 2

    ...
    IF ABS(TotalPrepmtVATAmtLCYDifference) <= GLSetup."Amount Rounding Precision" THEN
    TotalPrepmtVATAmtLCYDifference := 0;
    PrepmtPurchLine."Prepmt. VAT Amount Inv. (LCY)" := -TotalPrepmtVATAmtLCYDifference;
    NewAmountIncludingVAT := PrepmtPurchLine.Amount - (TotalPrepmtVATAmtLCY + TotalPrepmtVATAmtLCYDifference);
    Increment(TotalPurchLineLCY."Amount Including VAT",-(PrepmtPurchLine."Amount Including VAT" - NewAmountIncludingVAT));
    PrepmtPurchLine."Amount Including VAT" := NewAmountIncludingVAT;
    END;
    END;
    LOCAL PROCEDURE GetPurchOrderLine@85(VAR PurchOrderLine@1000 : Record 39;PurchLine@1001 : Record 39);
    ...
    

    Erstatningskode 2

    ...
    IF ABS(TotalPrepmtVATAmtLCYDifference) <= GLSetup."Amount Rounding Precision" THEN
    TotalPrepmtVATAmtLCYDifference := 0;
    PrepmtPurchLine."Prepmt. VAT Amount Inv. (LCY)" := -TotalPrepmtVATAmtLCYDifference;
    NewAmountIncludingVAT := PrepmtPurchLine.Amount - (TotalPrepmtVATAmtLCY + TotalPrepmtVATAmtLCYDifference);
    Increment(TotalPurchLineLCY."Amount Including VAT",-(PrepmtPurchLine."Amount Including VAT" - NewAmountIncludingVAT));
    
    // Add the following lines.
    IF PurchLine."Currency Code" = '' THEN
    TotalPurchLine."Amount Including VAT" := TotalPurchLineLCY."Amount Including VAT";
    // End of the lines.
    
    PrepmtPurchLine."Amount Including VAT" := NewAmountIncludingVAT;
    END;
    END;
    
    // Add the following lines.
    LOCAL PROCEDURE CalcPrepmtAmtToDeduct@71(PurchLine@1000 : Record 39) : Decimal;
    VAR
    AllowedQtyToInvoice@1001 : Decimal;
    BEGIN
    WITH PurchLine DO BEGIN
    AllowedQtyToInvoice := "Qty. Rcd. Not Invoiced";
    IF PurchHeader.Receive THEN
    AllowedQtyToInvoice := AllowedQtyToInvoice + "Qty. to Receive";
    IF "Qty. to Invoice" > AllowedQtyToInvoice THEN BEGIN
    "Qty. to Invoice" := AllowedQtyToInvoice;
    CalcPrepaymentToDeduct;
    END;
    EXIT("Prepmt Amt to Deduct");
    END;
    END;
    // End of the lines.
    
    LOCAL PROCEDURE GetPurchOrderLine@85(VAR PurchOrderLine@1000 : Record 39;PurchLine@1001 : Record 39);
    ...
    

Forutsetninger

Du må ha ett av følgende produkter installert for å bruke denne hurtigreparasjonen:

  • Microsoft Dynamics NAV 2009 R2
  • Microsoft Dynamics NAV 2009 Service Pack 1

Informasjon om fjerning

Du kan ikke fjerne denne hurtigreparasjonen.

Status

Microsoft har bekreftet at dette er et problem i Microsoft-produktene som er oppført i delen «Gjelder for».

Obs! Dette er en «FAST PUBLISH»-artikkel som er opprettet direkte fra Microsofts støtteorganisasjon. Informasjonen i dette er angitt som svar på nye problemer. Som et resultat av hastigheten på å gjøre det tilgjengelig, kan materialene inkludere typografiske feil og kan bli revidert når som helst uten varsel. Se vilkår for bruk for andre hensyn.