Den här artikeln gäller Microsoft Dynamics NAV för regionen Östeuropa (EE).
Symptom
När du bokför en del av leveransen för en försäljningsorder i den östeuropeiska versionen av Microsoft Dynamics NAV 2009 R2 får du följande felmeddelande:
Obs
Det finns ej bokförda förskottsbetalningsbelopp på ordernumret.
Det här problemet uppstår när en förskottsbetalning anges och bearbetas för försäljningsordern.
Lösning
Snabbkorrigeringsinformation
En snabbkorrigering som stöds är nu tillgänglig från Microsoft. Det är dock bara avsett att åtgärda problemet som beskrivs i den här artikeln. Använd den bara på system som har det här specifika problemet. Den här snabbkorrigeringen kan få ytterligare tester. Om du inte drabbas hårt av det här problemet rekommenderar vi därför att du väntar på nästa Microsoft Dynamics NAV Service Pack eller nästa Microsoft Dynamics NAV-version som innehåller den här snabbkorrigeringen.
Obs! I särskilda fall kan avgifter som vanligtvis uppkommer för supportsamtal avbrytas om en teknisk supporttekniker för Microsoft Dynamics och relaterade produkter fastställer att en specifik uppdatering löser problemet. De vanliga supportkostnaderna gäller för ytterligare supportfrågor och problem som inte är berättigade till den aktuella uppdateringen.
Installationsinformation
Microsoft tillhandahåller endast programmeringsexempel i visningssyfte, utan att någon form av garanti uttrycks eller är underförstådd. Detta omfattar men är inte begränsat till underförstådda garantier för säljbarhet eller lämplighet för ett visst ändamål. Den här artikeln förutsätter att du är bekant med programmeringsspråket som demonstreras och med de verktyg som används för att skapa och felsöka procedurer. Microsofts supporttekniker kan hjälpa till att förklara funktionaliteten i en viss procedur, men de ändrar inte de här exemplen för att tillhandahålla ytterligare funktioner eller konstruera procedurer för att uppfylla dina specifika krav.
Obs! Innan du installerar den här snabbkorrigeringen kontrollerar du att alla Microsoft Navision-klientanvändare loggas ut från systemet. Detta omfattar användare av Microsoft Navision Application Services (NAS). Du bör vara den enda klientanvändare som är inloggad när du implementerar snabbkorrigeringen.
Om du vill implementera den här snabbkorrigeringen måste du ha en utvecklarlicens.
Vi rekommenderar att användarkontot i fönstret Windows-inloggningar eller i fönstret Databasinloggningar tilldelas roll-ID:t "SUPER". Om användarkontot inte kan tilldelas superroll-ID måste du kontrollera att användarkontot har följande behörigheter:
- Behörigheten Ändra för det objekt som du kommer att ändra.
- Körbehörigheten för systemobjekt-ID 5210-objektet och för 9015-objektet Systemobjekt-ID.
Obs! Du behöver inte ha rättigheter till datakällorna om du inte behöver utföra datareparation.
Kodändringar
Obs! Testa alltid korrigeringar av kod i en kontrollerad miljö innan du tillämpar korrigeringarna på produktionsdatorerna.
Lös problemet genom att följa de här stegen:
Ändra koden i funktionen TestSalesPrepayment i codeuniten Approvals Management (439) enligt följande:
Befintlig kod... SalesLines.SETRANGE("Document Type",SalesHeader."Document Type"); SalesLines.SETRANGE("Document No.",SalesHeader."No."); SalesLines.SETFILTER("Prepmt. Line Amount",'<>%1',0); ...Ersättningskod
... // Add the following lines. IF SalesHeader."Prepayment Type" = SalesHeader."Prepayment Type"::Advance THEN EXIT(FALSE); // End of the lines. SalesLines.SETRANGE("Document Type",SalesHeader."Document Type"); SalesLines.SETRANGE("Document No.",SalesHeader."No."); SalesLines.SETFILTER("Prepmt. Line Amount",'<>%1',0); ...Ändra koden i funktionen TestPurchasePrepayment i codeunit för godkännandehantering (439) enligt följande:
Befintlig kod... PurchaseLines.SETRANGE("Document Type",PurchaseHeader."Document Type"); PurchaseLines.SETRANGE("Document No.",PurchaseHeader."No."); PurchaseLines.SETFILTER("Prepmt. Line Amount",'<>%1',0); ...Ersättningskod
... // Add the following lines. IF PurchaseHeader."Prepayment Type" = PurchaseHeader."Prepayment Type"::Advance THEN EXIT(FALSE); // End of the lines. PurchaseLines.SETRANGE("Document Type",PurchaseHeader."Document Type"); PurchaseLines.SETRANGE("Document No.",PurchaseHeader."No."); PurchaseLines.SETFILTER("Prepmt. Line Amount",'<>%1',0); ...Ändra koden i OnRun-utlösaren i koduniten "Försäljning efter" (80) enligt följande:
Befintlig kod... Window.UPDATE(2,LineCount); IF Invoice AND (NOT GLSetup."Allow VAT Date Change in Lines") THEN SalesLine."VAT Date" := "VAT Date"; IF SalesLine.Type = SalesLine.Type::"Charge (Item)" THEN BEGIN SalesLine.TESTFIELD(Amount); SalesLine.TESTFIELD("Job No.",''); SalesLine.TESTFIELD("Job Contract Entry No.",0); END; ...Ersättningskod
... Window.UPDATE(2,LineCount); IF Invoice AND (NOT GLSetup."Allow VAT Date Change in Lines") THEN SalesLine."VAT Date" := "VAT Date"; // Add the following lines. IF Invoice THEN TestPrepmtAmount; // End of the lines. IF SalesLine.Type = SalesLine.Type::"Charge (Item)" THEN BEGIN SalesLine.TESTFIELD(Amount); SalesLine.TESTFIELD("Job No.",''); SalesLine.TESTFIELD("Job Contract Entry No.",0); END; ...Skapa en ny TestPrepmtAmount-funktion i koduniten "Sales-Post" (80) enligt följande:
PROCEDURE TestPrepmtAmount@1470003(); VAR AllowedQtyToShip@1470000 : Decimal; BEGIN WITH SalesLine DO BEGIN IF ("Prepmt. Line Amount" = 0) OR (Quantity = 0) THEN EXIT; AllowedQtyToShip := ROUND( ("Line Amount" - "Prepmt. Line Amount" + "Prepmt. Amt. Inv.") / "Line Amount" * Quantity - "Quantity Invoiced",0.00001); IF "Qty. to Ship" > AllowedQtyToShip THEN FIELDERROR("Qty. to Ship",STRSUBSTNO(Text047,AllowedQtyToShip)); END; END;Ta bort följande lokala variabler i funktionen TestPrepmtAmount i koduniten "Purch.-Post" (90):
- Återståendebelopp
- Återståendekvty
Lägg till en ny lokal variabel i funktionen TestPrepmtAmount i koduniten "Purch.-Post" (90) och ange sedan variabeln enligt följande:
- Namn: AllowedQtyToReceive
- DataType: Decimal
Ändra koden i funktionen TestPrepmtAmount i koduniten "Purch.-Post" (90) enligt följande:
Befintlig kod... WITH PurchLine DO BEGIN // Delete the following lines. IF "Prepmt. Line Amount" = 0 THEN EXIT; IF NOT PurchHeader.Receive AND ("Qty. to Invoice" = Quantity - "Quantity Invoiced") THEN BEGIN IF "Qty. Rcd. Not Invoiced" + "Quantity Received" = Quantity THEN RemainingAmount := 0 ELSE BEGIN RemainingQty := "Qty. to Receive"; RemainingAmount := ROUND(RemainingQty * "Direct Unit Cost" * (1 - "Line Discount %" / 100),Currency."Amount Rounding Precision"); END; END ELSE BEGIN IF "Qty. to Invoice" + "Quantity Invoiced" = Quantity THEN RemainingAmount := 0 ELSE BEGIN RemainingQty := Quantity - "Qty. to Invoice" - "Quantity Invoiced"; RemainingAmount := ROUND(RemainingQty * "Direct Unit Cost" * (1 - "Line Discount %" / 100),Currency."Amount Rounding Precision"); END; END; IF RemainingAmount < "Prepmt. Line Amount" - "Prepmt Amt to Deduct" - "Prepmt Amt Deducted" THEN FIELDERROR("Prepmt. Line Amount",STRSUBSTNO(Text049,"Qty. to Invoice")); // End of the lines. END; ...Ersättningskod
... WITH PurchLine DO BEGIN // Add the following lines. IF ("Prepmt. Line Amount" = 0) OR (Quantity = 0) THEN EXIT; AllowedQtyToReceive := ROUND( ("Line Amount" - "Prepmt. Line Amount" + "Prepmt. Amt. Inv.") / "Line Amount" * Quantity - "Quantity Invoiced",0.00001); IF "Qty. to Receive" > AllowedQtyToReceive THEN FIELDERROR("Qty. to Receive",STRSUBSTNO(Text047,AllowedQtyToReceive)); // End of the lines. END; ...Ändra koden i prepmt amt till Deduct-OnValidate utlösare i tabellen Försäljningsrad (37) enligt följande:
Befintlig kod... IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN TESTFIELD("Prepmt Amt to Deduct","Prepmt. Amt. Inv." - "Prepmt Amt Deducted"); ...Ersättningskod
... IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN TESTFIELD("Prepmt Amt to Deduct","Prepmt. Amt. Inv." - "Prepmt Amt Deducted"); // Add the following lines. GetSalesHeader; IF SalesHeader."Prepayment Type" = SalesHeader."Prepayment Type"::Advance THEN BEGIN VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group"); IF VATPostingSetup."Adv. Invoice Correction Type" <> 0 THEN VATPostingSetup.TESTFIELD("Adv. Invoice Correction Type",VATPostingSetup."Adv. Invoice Correction Type"::Percentage); END; // End of the lines. ...Ta bort följande lokala variabler i funktionen CalcPrepaymentToDeduct i tabellen Försäljningsrad (37):
- PrepmtPct
- AbsoluteAdvCorrection
Ändra koden i funktionen CalcPrepaymentToDeduct i tabellen Försäljningsrad (37) enligt följande:
Befintlig kod... IF SalesHeader."Prepayment Type" = SalesHeader."Prepayment Type"::Advance THEN BEGIN VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group"); // Delete the following lines. AbsoluteAdvCorrection := VATPostingSetup."Adv. Invoice Correction Type" = VATPostingSetup."Adv. Invoice Correction Type"::Absolute; IF AbsoluteAdvCorrection THEN BEGIN PrepmtPct := "Prepayment %"; "Prepayment %" := 100; END; END; IF SalesHeader."Prices Including VAT" THEN "Prepmt Amt to Deduct" := ROUND( ROUND( ROUND( ROUND("Unit Price" * "Qty. to Invoice",Currency."Amount Rounding Precision") * (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") * ("Prepayment %" / 100) / (1 + ("VAT %" / 100)),Currency."Amount Rounding Precision") * (1 + ("VAT %" / 100)),Currency."Amount Rounding Precision") ELSE "Prepmt Amt to Deduct" := ROUND( ROUND( ROUND("Unit Price" * "Qty. to Invoice",Currency."Amount Rounding Precision") * (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") * "Prepayment %" / 100 ,Currency."Amount Rounding Precision"); IF AbsoluteAdvCorrection THEN BEGIN "Prepayment %" := PrepmtPct; IF "Prepmt Amt to Deduct" > ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted") THEN "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted"; END; // End of the lines. END ELSE "Prepmt Amt to Deduct" := 0 ...Ersättningskod
... IF SalesHeader."Prepayment Type" = SalesHeader."Prepayment Type"::Advance THEN BEGIN VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group"); // Add the following lines. CASE VATPostingSetup."Adv. Invoice Correction Type" OF VATPostingSetup."Adv. Invoice Correction Type"::Percentage: "Prepmt Amt to Deduct" := ROUND("Qty. to Invoice" / (Quantity - "Quantity Invoiced") * ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted"),Currency."Amount Rounding Precision"); VATPostingSetup."Adv. Invoice Correction Type"::Absolute: BEGIN "Prepmt Amt to Deduct" := PrepmtAmtToDeduct(SalesHeader."Prices Including VAT",100); IF "Prepmt Amt to Deduct" > ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted") THEN "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted"; END; VATPostingSetup."Adv. Invoice Correction Type"::"Fully Invoiced": IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted" ELSE "Prepmt Amt to Deduct" := 0; END; END ELSE "Prepmt Amt to Deduct" := PrepmtAmtToDeduct(SalesHeader."Prices Including VAT","Prepayment %"); // End of the lines. END ELSE "Prepmt Amt to Deduct" := 0 ...Skapa en ny prepmtAmtToDeduct-funktion i tabellen Försäljningsrad (37) enligt följande:
PROCEDURE PrepmtAmtToDeduct@1470002(PricesIncludingVAT@1470000 : Boolean;PrepaymentPct@1470001 : Decimal) : Decimal; VAR VATPct@1470002 : Decimal; BEGIN IF PricesIncludingVAT THEN VATPct := "VAT %" ELSE VATPct := 0; EXIT( ROUND( ROUND( ROUND( ROUND("Unit Price" * "Qty. to Invoice",Currency."Amount Rounding Precision") * (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") * (PrepaymentPct / 100) / (1 + (VATPct / 100)),Currency."Amount Rounding Precision") * (1 + (VATPct / 100)),Currency."Amount Rounding Precision")); END;Ändra koden i utlösaren Prepmt Amt to Deduct - OnValidate i tabellen Inköpsrad (39) enligt följande:
Befintlig kod... IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN TESTFIELD("Prepmt Amt to Deduct","Prepmt. Amt. Inv." - "Prepmt Amt Deducted"); ...Ersättningskod
... IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN TESTFIELD("Prepmt Amt to Deduct","Prepmt. Amt. Inv." - "Prepmt Amt Deducted"); // Add the following lines. GetPurchHeader; IF PurchHeader."Prepayment Type" = PurchHeader."Prepayment Type"::Advance THEN BEGIN VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group"); IF VATPostingSetup."Adv. Invoice Correction Type" <> 0 THEN VATPostingSetup.TESTFIELD("Adv. Invoice Correction Type",VATPostingSetup."Adv. Invoice Correction Type"::Percentage); END; // End of the lines. ...Ta bort följande lokala variabler i funktionen CalcPrepaymentToDeduct i tabellen Inköpsrad (39):
- PrepmtPct
- AbsoluteAdvCorrection
Ändra koden i funktionen CalcPrepaymentToDeduct i tabellen Inköpsrad (39) enligt följande:
Befintlig kod... IF PurchHeader."Prepayment Type" = PurchHeader."Prepayment Type"::Advance THEN BEGIN VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group"); // Delete the following lines. AbsoluteAdvCorrection := VATPostingSetup."Adv. Invoice Correction Type" = VATPostingSetup."Adv. Invoice Correction Type"::Absolute; IF AbsoluteAdvCorrection THEN BEGIN PrepmtPct := "Prepayment %"; "Prepayment %" := 100; END; END; IF PurchHeader."Prices Including VAT" THEN "Prepmt Amt to Deduct" := ROUND( ROUND( ROUND( ROUND("Direct Unit Cost" * "Qty. to Invoice",Currency."Amount Rounding Precision") * (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") * ("Prepayment %" / 100) / (1 + ("VAT %" / 100)),Currency."Amount Rounding Precision") * (1 + ("VAT %" / 100)),Currency."Amount Rounding Precision") ELSE "Prepmt Amt to Deduct" := ROUND( ROUND( ROUND("Direct Unit Cost" * "Qty. to Invoice",Currency."Amount Rounding Precision") * (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") * "Prepayment %" / 100,Currency."Amount Rounding Precision"); IF AbsoluteAdvCorrection THEN BEGIN "Prepayment %" := PrepmtPct; IF "Prepmt Amt to Deduct" > ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted") THEN "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted"; END; // End of the lines. END ELSE "Prepmt Amt to Deduct" := 0 ...Ersättningskod
... IF PurchHeader."Prepayment Type" = PurchHeader."Prepayment Type"::Advance THEN BEGIN VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group"); // Add the following lines. CASE VATPostingSetup."Adv. Invoice Correction Type" OF VATPostingSetup."Adv. Invoice Correction Type"::Percentage: "Prepmt Amt to Deduct" := ROUND("Qty. to Invoice" / (Quantity - "Quantity Invoiced") * ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted"),Currency."Amount Rounding Precision"); VATPostingSetup."Adv. Invoice Correction Type"::Absolute: BEGIN "Prepmt Amt to Deduct" := PrepmtAmtToDeduct(PurchHeader."Prices Including VAT",100); IF "Prepmt Amt to Deduct" > ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted") THEN "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted"; END; VATPostingSetup."Adv. Invoice Correction Type"::"Fully Invoiced": IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted" ELSE "Prepmt Amt to Deduct" := 0; END; END ELSE "Prepmt Amt to Deduct" := PrepmtAmtToDeduct(PurchHeader."Prices Including VAT","Prepayment %"); // End of the lines. END ELSE "Prepmt Amt to Deduct" := 0 ...Skapa en ny prepmtAmtToDeduct-funktion i tabellen Inköpsrad (39) enligt följande:
PROCEDURE PrepmtAmtToDeduct@1470002(PricesIncludingVAT@1470000 : Boolean;PrepaymentPct@1470001 : Decimal) : Decimal; VAR VATPct@1470002 : Decimal; BEGIN IF PricesIncludingVAT THEN VATPct := "VAT %" ELSE VATPct := 0; EXIT( ROUND( ROUND( ROUND( ROUND("Direct Unit Cost" * "Qty. to Invoice",Currency."Amount Rounding Precision") * (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") * (PrepaymentPct / 100) / (1 + (VATPct / 100)),Currency."Amount Rounding Precision") * (1 + (VATPct / 100)),Currency."Amount Rounding Precision")); END;
Krav
Du måste ha den östeuropeiska versionen av Microsoft Dynamics NAV 2009 R2 installerad för att kunna använda den här snabbkorrigeringen.
Information om borttagning
Du kan inte ta bort den här snabbkorrigeringen.
Status
Microsoft har bekräftat att detta är ett problem i de Microsoft-produkter som anges i avsnittet "Gäller".
Obs! Det här är en "FAST PUBLISH"-artikel som skapats direkt från Microsofts supportorganisation. Den information som finns häri tillhandahålls i befintligt format som svar på framväxande problem. Till följd av hur snabbt materialet blir tillgängligt kan materialet innehålla typografiska fel och kan komma att revideras när som helst utan föregående meddelande. Se användningsvillkor för andra överväganden.