Kļūdas ziņojums "Pasūtījumam [numurs] ir negrāmatotas priekšapmaksas summas", grāmatojot pārdošanas pasūtījuma daļēju sūtījumu Microsoft Dynamics NAV 2009 R2 Austrumeiropas versijā

Attiecas uz
Dynamics NAV 2009

Šis raksts attiecas uz Microsoft Dynamics NAV Austrumeiropas (EE) reģionam.

Pazīmes

Grāmatojot pārdošanas pasūtījuma daļēju sūtījumu Microsoft Dynamics NAV 2009 R2 Austrumeiropas versijā, tiek parādīts šāds kļūdas ziņojums:

Piezīme

Pasūtījuma numurā ir negrāmatotas priekšapmaksas summas.

Šī problēma rodas, ja pārdošanas pasūtījumam tiek norādīta un apstrādāta priekšapmaksa.

Risinājums

Informācija par labojumfailu

Atbalstīts labojumfails tagad ir pieejams no Microsoft. Tomēr tas ir paredzēts tikai šajā rakstā aprakstītās problēmas novēršanai. Lietojiet to tikai sistēmām, kurās rodas šī konkrētā problēma. Šim labojumfailam var tikt veiktas papildu pārbaudes. Tāpēc, ja šī problēma jūs nopietni neietekmē, ieteicams gaidīt nākamo Microsoft Dynamics NAV servisa pakotni vai nākamo Microsoft Dynamics NAV versiju, kurā ir šis labojumfails.

Piezīme Īpašos gadījumos maksa, kas parasti tiek piemērota par atbalsta zvaniem, var tikt atcelta, ja Microsoft Dynamics un saistīto produktu tehniskā atbalsta speciālists nosaka, ka problēma tiks novērsta, instalējot noteiktu atjauninājumu. Parasti atbalsta izmaksas attiecas uz jautājumiem par papildu atbalstu un problēmām, kas neskar specifisko atjauninājumu apspriešanu.

            
          

Informācija par instalāciju

Microsoft sniedz programmēšanas piemērus tikai ilustrācijai, bez tiešas vai netiešas garantijas. Tas ietver, bet neaprobežojas ar netiešām garantijām par piemērotību pārdošanai vai piemērotībai noteiktam mērķim. Šajā rakstā tiek pieņemts, ka pārzināt demonstrējamo programmēšanas valodu un rīkus, kas tiek izmantoti procedūru izveidei un atkļūdošanai. Microsoft atbalsta inženieri var palīdzēt izskaidrot konkrētās procedūras funkcionalitāti, bet viņi šos piemērus nemodificēs, lai nodrošinātu papildu funkcionalitāti vai veidotu procedūras, kas atbilst jūsu specifiskajām prasībām.

Piezīme Pirms šī labojumfaila instalēšanas pārliecinieties, vai visi Microsoft Navision klienta lietotāji ir atteikušies no sistēmas. Tas ietver Microsoft Navision lietojumprogrammu pakalpojumu (NAS) klienta lietotājus. Jūs esat vienīgais klienta lietotājs, kurš ir pieteicies, ieviešot šo labojumfailu.

Lai ieviestu šo labojumfailu, ir nepieciešama izstrādātāja licence.

Iesakām lietotāja kontam logā Windows pieteikšanās vai datu bāzes pieteikšanās logā piešķirt lomas ID "SUPER". Ja lietotāja kontam nevar piešķirt "SUPER" lomas ID, jums ir jāpārbauda, vai lietotāja kontam ir šādas atļaujas:

  • Modificēt objektu, kuru mainīsit.
  • Izpildes atļauja sistēmas objekta ID 5210 un sistēmas objekta ID 9015.

                
Piezīme. Jums nav tiesību uz datu krātuvēm, ja vien jums nav jāveic datu labošana.

Koda izmaiņas

Piezīme Pirms labojumu lietošanas ražošanas datoros vienmēr pārbaudiet koda labojumus kontrolētā vidē.
Lai atrisinātu šo problēmu, veiciet tālāk norādītās darbības.

  1. Mainiet kodu funkcijā TestSalesPrepayment apstiprinājumu pārvaldības koda vienībā (439) šādi:
    Esošais kods

    ...
    SalesLines.SETRANGE("Document Type",SalesHeader."Document Type");
    SalesLines.SETRANGE("Document No.",SalesHeader."No.");
    SalesLines.SETFILTER("Prepmt. Line Amount",'<>%1',0);
    ...
    

    Aizstāšanas kods

    ...
    // 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);
    ...
    
  2. Mainiet kodu funkciju TestPurchasePrepayment apstiprinājumu pārvaldības koda vienībā (439) šādi:
    Esošais kods

    ...
    PurchaseLines.SETRANGE("Document Type",PurchaseHeader."Document Type");
    PurchaseLines.SETRANGE("Document No.",PurchaseHeader."No.");
    PurchaseLines.SETFILTER("Prepmt. Line Amount",'<>%1',0);
    ...
    

    Aizstāšanas kods

    ...
    // 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);
    ...
    
  3. Mainiet kodu OnRun trigerī "Sales-Post" codeunit (80) šādi:
    Esošais kods

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

    Aizstāšanas kods

    ...
    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;
    ...
    
  4. Izveidojiet jaunu funkciju TestPrepmtAmount koda vienībā "Pārdošanas pasts" (80) šādi:

    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;
    
  5. Koda vienībā "Purch.-Post" (90) funkcijā TestPrepmtAmount izdzēsiet šādus lokālos mainīgos:

    • Atlikusī summa
    • Atlikušais daudzums.
  6. Pievienojiet jaunu lokālo mainīgo funkcijas TestPrepmtAmount koda vienībā "Purch.-Post" (90) un pēc tam norādiet mainīgo šādi:

    • Nosaukums: AllowedQtyToReceive
    • DataType: Decimal
  7. Mainiet funkcijas TestPrepmtAmount kodu koda vienībā "Purch.-Post" (90) šādi:
    Esošais kods

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

    Aizstāšanas kods

    ...
    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;
    ...
    
  8. Mainiet kodu Prepmt Amt uz Deduct-OnValidate trigeri tabulā Pārdošanas rinda (37), kā norādīts tālāk.
    Esošais kods

    ...
    IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN
    TESTFIELD("Prepmt Amt to Deduct","Prepmt. Amt. Inv." - "Prepmt Amt Deducted");
    ...
    

    Aizstāšanas kods

    ...
    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. 
    ...
    
  9. Izdzēsiet šādus lokālos mainīgos funkcijā CalcPrepaymentToDeduct tabulā Pārdošanas rinda (37):

    • PrepmtPct
    • AbsoluteAdvCorrection
  10. Mainiet tabulas Pārdošanas rinda (37) funkcijas CalcPrepaymentToDeduct kodu šādi:
    Esošais kods

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

    Aizstāšanas kods

    ... 
    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
    ...
    
  11. Izveidojiet jaunu funkciju PrepmtAmtToDeduct tabulā Pārdošanas rinda (37), kā norādīts tālāk.

    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;
    
  12. Mainiet kodu laukā Prepmt Amt, lai atskaitītu - OnValidate tabulā Pirkšanas rinda (39), kā norādīts tālāk.
    Esošais kods

    ...
    IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN
    TESTFIELD("Prepmt Amt to Deduct","Prepmt. Amt. Inv." - "Prepmt Amt Deducted");
    ...
    

    Aizstāšanas kods

    ...
    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. 
    ...
    
  13. Izdzēsiet šādus lokālos mainīgos no funkcijas CalcPrepaymentToDeduct tabulā Pirkšanas rinda (39):

    • PrepmtPct
    • AbsoluteAdvCorrection
  14. Mainiet kodu funkcijā CalcPrepaymentToDeduct tabulā Pirkšanas rinda (39), rīkojoties šādi:
    Esošais kods

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

    Aizstāšanas kods

    ...
    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
    ...
    
  15. Izveidojiet jaunu funkciju PrepmtAmtToDeduct tabulā Pirkšanas rinda (39), kā norādīts tālāk.

    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;
    

Priekšnosacījumi

Lai lietotu šo labojumfailu, jābūt instalētai Microsoft Dynamics NAV 2009 R2 Austrumeiropas versijai.

Noņemšanas informācija

Šo labojumfailu nevar noņemt.

Statuss

Microsoft apstiprināja, ka šī ir problēma Microsoft produktos, kas norādīti sadaļā "attiecas uz".

Piezīme Šis ir "ĀTRĀS PUBLICĒŠANAS" raksts, kas izveidots tieši Microsoft atbalsta organizācijā. Šeit ietvertā informācija tiek sniegta tāda, kāda tā ir, reaģējot uz jauniem jautājumiem. Ātrās pieejamības rezultātā materiālos var būt drukas kļūdas, un tos var pārskatīt jebkurā laikā bez iepriekšēja brīdinājuma. Citus apsvērumus skatiet lietošanas nosacījumos .