Questo articolo si applica a Microsoft Dynamics NAV per le impostazioni locali della lingua portoghese (pt).
Sintomi
Si supponga di aver applicato l'hotfix in KB 983245 nella versione portoghese di Microsoft Dynamics NAV. Quando si prova a registrare una transazione di fattura con uno sconto riga di 100 percentuali, viene visualizzato il messaggio di errore seguente:
Nota
La transazione non può essere completata perché causerà incoerenze nella tabella delle voci C/G. Verificare dove e come viene usata la funzione COERENTE nella transazione per trovare il motivo dell'errore. Rivolgiti all'amministratore del sistema. Le tabelle possono essere contrassegnate come non coerenti durante le attività complete, ad esempio la registrazione. In questo modo si evita che i dati vengano aggiornati in modo non corretto.
Per altre informazioni, fare clic sul numero dell'articolo seguente per visualizzare l'articolo della Microsoft Knowledge Base:
983245 movimenti di contabilità generale non sono corretti quando si registrano transazioni di fattura con uno sconto riga percentuale 100 in Microsoft Dynamics NAV 2009 SP1
Questo problema si verifica nei prodotti seguenti:
- Versione portoghese di Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)
- Versione portoghese di Microsoft Dynamics NAV 2009 R2
Risoluzione
Informazioni sull'aggiornamento rapido
È ora disponibile un hotfix supportato da Microsoft. Tuttavia, è destinato solo a correggere il problema descritto in questo articolo. Applicala solo ai sistemi che stanno riscontrando questo problema specifico. Questo hotfix potrebbe ricevere ulteriori test. Pertanto, se non sei gravemente interessato da questo problema, ti consigliamo di attendere il prossimo Service Pack di Microsoft Dynamics NAV 2009 o la prossima versione di Microsoft Dynamics NAV che contiene questo hotfix.
Nota In casi speciali, gli addebiti normalmente sostenuti per le chiamate al supporto tecnico possono essere annullati se un professionista del supporto tecnico per Microsoft Dynamics e i prodotti correlati determinano che un aggiornamento specifico risolverà il problema. I soliti costi del supporto verranno applicati a domande e problemi di supporto aggiuntivi che non sono idonei per l'aggiornamento specifico in questione.
Informazioni sull'installazione
Microsoft fornisce esempi di programmazione a titolo puramente illustrativo, senza alcuna garanzia espressa o implicita. Ciò include, a titolo esemplificativo e non esaustivo, le garanzie implicite di commerciabilità o idoneità a uno scopo particolare. Questo articolo presuppone che si abbia familiarità con il linguaggio di programmazione oggetto della dimostrazione e con gli strumenti utilizzati per la creazione e il debug delle procedure. I tecnici del supporto Tecnico Microsoft possono spiegare le funzionalità di una particolare procedura, ma non modificarli per fornire funzionalità aggiuntive o creare procedure in base a specifici requisiti.
Nota Prima di installare questo hotfix, verificare che tutti gli utenti client di Microsoft Navision siano disconnessi dal sistema. Sono inclusi gli utenti client di Microsoft Navision Application Services (NAS). Dovresti essere l'unico utente client connesso quando implementi questo hotfix.
Per implementare questo hotfix, è necessario disporre di una licenza per sviluppatori.
È consigliabile assegnare l'ID ruolo "SUPER" all'account utente nella finestra Accessi di Windows o nella finestra Accessi database. Se all'account utente non è possibile assegnare l'ID ruolo "SUPER", è necessario verificare che l'account utente disponga delle autorizzazioni seguenti:
- Autorizzazione modifica per l'oggetto che si desidera modificare.
- Autorizzazione Execute per l'oggetto System Object ID 5210 e per l'oggetto System Object ID 9015.
Nota: non è necessario disporre dei diritti per gli archivi dati a meno che non sia necessario eseguire il ripristino dei dati.
Modifiche al codice
Nota Verifica sempre le correzioni del codice in un ambiente controllato prima di applicare le correzioni ai computer di produzione.
Per risolvere il problema, attenersi alla procedura seguente:
Modificare il codice nella funzione UpdInvPostingBuffer nella codeunit di Sales-Post (80) come segue:
Codice esistente
... FALineNo := FALineNo + 1; InvPostingBuffer[1]."Fixed Asset Line No." := FALineNo; END; // Delete the following line. InvPostingBuffer[2] := InvPostingBuffer[1]; IF InvPostingBuffer[2].FIND THEN BEGIN InvPostingBuffer[2].Amount := InvPostingBuffer[2].Amount + InvPostingBuffer[1].Amount; ...Codice sostitutivo
... 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; ...Modificare il codice nella funzione DivideAmount nell'Sales-Post codeunit (80) come segue:
Codice esistente 1
... 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; ...Codice di sostituzione 1
... 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 "Line Amount" := 0; "Line Discount Amount" := 0; "Inv. Discount Amount" := 0; ...Codice esistente 2
... (TempVATAmountLine."Line Amount" - TempVATAmountLine."Invoice Discount Amount" - TempVATAmountLine."Pmt. Disc. Given Amount"); END; // Delete the following lines. "Amount Including VAT" := ROUND(TempVATAmountLineRemainder."Amount Including VAT",Currency."Amount Rounding Precision"); // End of the deleted lines. Amount := ROUND("Amount Including VAT",Currency."Amount Rounding Precision") - //--PT---- ...Codice di sostituzione 2
... (TempVATAmountLine."Line Amount" - TempVATAmountLine."Invoice Discount Amount" - TempVATAmountLine."Pmt. Disc. Given Amount"); END; // Add the following lines. IF "Line Discount %" <>100 THEN "Amount Including VAT" := ROUND(TempVATAmountLineRemainder."Amount Including VAT",Currency."Amount Rounding Precision") ELSE "Amount Including VAT" := 0; // End of the added lines. Amount := ROUND("Amount Including VAT",Currency."Amount Rounding Precision") - //--PT---- ...Codice esistente 3
... TempVATAmountLineRemainder."VAT Amount" - "Amount Including VAT" + Amount; END ELSE BEGIN IF "VAT Calculation Type" = "VAT Calculation Type"::"Full VAT" THEN BEGIN // Delete the following line. "Amount Including VAT" := "Line Amount" - "Inv. Discount Amount"; Amount := 0; "VAT Base Amount" := 0; END ELSE BEGIN ...Codice di sostituzione 3
... TempVATAmountLineRemainder."VAT Amount" - "Amount Including VAT" + Amount; END ELSE BEGIN IF "VAT Calculation Type" = "VAT Calculation Type"::"Full VAT" THEN BEGIN // Add the following lines. IF "Line Discount %" <>100 THEN "Amount Including VAT" := "Line Amount" - "Inv. Discount Amount" ELSE "Amount Including VAT" := 0; // End of the added lines. Amount := 0; "VAT Base Amount" := 0; END ELSE BEGIN ...Codice esistente 4
... TempVATAmountLine."VAT Amount" * ("Line Amount" - "Inv. Discount Amount") / (TempVATAmountLine."Line Amount" - TempVATAmountLine."Invoice Discount Amount"); // Delete the following lines. "Amount Including VAT" := //--PT---- // Amount + ROUND(TempVATAmountLineRemainder."VAT Amount",Currency."Amount Rounding Precision"); Amount + ROUND(TempVATAmountLineRemainder."VAT Amount" + TempVATAmountLine."ND Amount", Currency."Amount Rounding Precision",Currency.VATRoundingDirection); // End of the deleted lines. //-------- TempVATAmountLineRemainder."VAT Amount" := TempVATAmountLineRemainder."VAT Amount" - "Amount Including VAT" + Amount; ...Codice di sostituzione 4
... TempVATAmountLine."VAT Amount" * ("Line Amount" - "Inv. Discount Amount") / (TempVATAmountLine."Line Amount" - TempVATAmountLine."Invoice Discount Amount"); // Add the following lines. IF "Line Discount %" <> 100 THEN "Amount Including VAT" := //--PT---- // Amount + ROUND(TempVATAmountLineRemainder."VAT Amount",Currency."Amount Rounding Precision"); Amount + ROUND(TempVATAmountLineRemainder."VAT Amount" + TempVATAmountLine."ND Amount", Currency."Amount Rounding Precision",Currency.VATRoundingDirection) ELSE "Amount Including VAT" := 0; // End of the added lines. //-------- TempVATAmountLineRemainder."VAT Amount" := TempVATAmountLineRemainder."VAT Amount" - "Amount Including VAT" + Amount; ...Modificare il codice nella funzione UpdInvPostingBuffer nella codeunit Purch.-Post (90) come segue:
Codice esistente
... FALineNo := FALineNo + 1; InvPostingBuffer[1]."Fixed Asset Line No." := FALineNo; END; InvPostingBuffer[2] := InvPostingBuffer[1]; IF InvPostingBuffer[2].FIND THEN BEGIN InvPostingBuffer[2].Amount := ...Codice sostitutivo
... 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 := ...Modificare il codice nella funzione DivideAmount nella codeunit Purch.-Post (90) come segue:
Codice esistente 1
... 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; ...Codice di sostituzione 1
... 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 "Line Amount" := 0; "Line Discount Amount" := 0; "Inv. Discount Amount" := 0; ...Codice esistente 2
... TempVATAmountLine."Pmt. Disc. Given Amount"); END; // Delete the following lines. . "Amount Including VAT" := ROUND(TempVATAmountLineRemainder."Amount Including VAT",Currency."Amount Rounding Precision"); // End of the deleted lines. Amount := ROUND("Amount Including VAT",Currency."Amount Rounding Precision") - //--PT---- ...Codice di sostituzione 2
... TempVATAmountLine."Pmt. Disc. Given Amount"); END; // Add the following lines. IF "Line Discount %" <> 100 THEN "Amount Including VAT" := ROUND(TempVATAmountLineRemainder."Amount Including VAT",Currency."Amount Rounding Precision") ELSE "Amount Including VAT" := 0; // End of the added lines. Amount := ROUND("Amount Including VAT",Currency."Amount Rounding Precision") - //--PT---- ...Codice esistente 3
... TempVATAmountLineRemainder."VAT Amount" - "Amount Including VAT" + Amount; END ELSE BEGIN IF "VAT Calculation Type" = "VAT Calculation Type"::"Full VAT" THEN BEGIN // Delete the following line. "Amount Including VAT" := "Line Amount" - "Inv. Discount Amount"; Amount := 0; "VAT Base Amount" := 0; END ELSE BEGIN ...Codice di sostituzione 3
... TempVATAmountLineRemainder."VAT Amount" - "Amount Including VAT" + Amount; END ELSE BEGIN IF "VAT Calculation Type" = "VAT Calculation Type"::"Full VAT" THEN BEGIN // Add the following lines. IF "Line Discount %" <> 100 THEN "Amount Including VAT" := "Line Amount" - "Inv. Discount Amount" ELSE "Amount Including VAT" := 0; // End of the added lines. Amount := 0; "VAT Base Amount" := 0; END ELSE BEGIN ...Codice esistente 4
... (TempVATAmountLine."Line Amount" - TempVATAmountLine."Invoice Discount Amount"); END; //-------- // Delete the following lines. "Amount Including VAT" := Amount + ROUND(TempVATAmountLineRemainder."VAT Amount" + TempVATAmountLineRemainder."ND Amount", Currency."Amount Rounding Precision",Currency.VATRoundingDirection); // End of the deleted lines. TempVATAmountLineRemainder."VAT Amount" := TempVATAmountLineRemainder."VAT Amount" - "Amount Including VAT" + Amount; END; ...Codice di sostituzione 4
... (TempVATAmountLine."Line Amount" - TempVATAmountLine."Invoice Discount Amount"); END; //-------- // Add the following lines. IF "Line Discount %" <> 100 THEN "Amount Including VAT" := Amount + ROUND(TempVATAmountLineRemainder."VAT Amount" + TempVATAmountLineRemainder."ND Amount", Currency."Amount Rounding Precision",Currency.VATRoundingDirection) ELSE "Amount Including VAT" := 0; // End of the added lines. TempVATAmountLineRemainder."VAT Amount" := TempVATAmountLineRemainder."VAT Amount" - "Amount Including VAT" + Amount; END; ...Modificare il codice nella funzione FillInvPostingBuffer nel Serv-Amounts Mgt. codeunit (5986) come segue:
Codice esistente 1... TotalVATACY, TotalAmount, TotalAmountACY); UpdInvPostingBuffer(InvPostingBuffer,TempDocDim); END; END; ...Codice di sostituzione 1
... TotalVATACY, TotalAmount, TotalAmountACY); // Add the following lines. IF ServiceLine."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. UpdInvPostingBuffer(InvPostingBuffer,TempDocDim); END; END; ...Codice esistente 2
... TotalVATACY, TotalAmount, TotalAmountACY); UpdInvPostingBuffer(InvPostingBuffer,TempDocDim); END; END; ...Codice di sostituzione 2
... TotalVATACY, TotalAmount, TotalAmountACY); // Add the following lines. IF ServiceLine."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. UpdInvPostingBuffer(InvPostingBuffer,TempDocDim); END; END; ...Codice esistente 3
... TotalVATACY, TotalAmount, TotalAmountACY); UpdInvPostingBuffer(InvPostingBuffer,TempDocDim); END; END; ...Codice di sostituzione 3
... TotalVATACY, TotalAmount, TotalAmountACY); // Add the following lines. IF ServiceLine."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. UpdInvPostingBuffer(InvPostingBuffer,TempDocDim); END; END; ...Codice esistente 4
... END; END; END; UpdInvPostingBuffer(InvPostingBuffer,TempDocDim); END; ...Codice di sostituzione 4
... END; END; END; // Add the following lines. IF ServiceLine."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. UpdInvPostingBuffer(InvPostingBuffer,TempDocDim); END; ...Modificare il codice nella funzione DivideAmount nella Serv-Amounts Mgt. codeunit (5986) come segue:
Codice esistente 1... (TempVATAmountLine."Line Amount" - TempVATAmountLine."Invoice Discount Amount" - TempVATAmountLine."Pmt. Disc. Given Amount"); END; // Delete the following lines. "Amount Including VAT" := ROUND(TempVATAmountLineRemainder."Amount Including VAT",Currency."Amount Rounding Precision"); // End of the deleted lines. Amount := ROUND("Amount Including VAT",Currency."Amount Rounding Precision") - ROUND(TempVATAmountLineRemainder."VAT Amount",Currency."Amount Rounding Precision"); ...Codice di sostituzione 1
... (TempVATAmountLine."Line Amount" - TempVATAmountLine."Invoice Discount Amount" - TempVATAmountLine."Pmt. Disc. Given Amount"); END; // Add the following lines. IF "Line Discount %" <> 100 THEN "Amount Including VAT" := ROUND(TempVATAmountLineRemainder."Amount Including VAT",Currency."Amount Rounding Precision") ELSE "Amount Including VAT" := 0; // End of the added lines. Amount := ROUND("Amount Including VAT",Currency."Amount Rounding Precision") - ROUND(TempVATAmountLineRemainder."VAT Amount",Currency."Amount Rounding Precision"); ...Codice esistente 2
... TempVATAmountLineRemainder."VAT Amount" - "Amount Including VAT" + Amount; END ELSE BEGIN IF "VAT Calculation Type" = "VAT Calculation Type"::"Full VAT" THEN BEGIN // Delete the following line. "Amount Including VAT" := "Line Amount" - "Inv. Discount Amount"; Amount := 0; "VAT Base Amount" := 0; END ELSE BEGIN ...Codice di sostituzione 2
... TempVATAmountLineRemainder."VAT Amount" - "Amount Including VAT" + Amount; END ELSE BEGIN IF "VAT Calculation Type" = "VAT Calculation Type"::"Full VAT" THEN BEGIN // Add the following lines. IF "Line Discount %" <> 100 THEN "Amount Including VAT" := "Line Amount" - "Inv. Discount Amount" ELSE "Amount Including VAT" := 0; // End of the added lines. Amount := 0; "VAT Base Amount" := 0; END ELSE BEGIN ...Codice esistente 3
... ("Line Amount" - "Inv. Discount Amount" - "Pmt. Disc. Given Amount") / (TempVATAmountLine."Line Amount" - TempVATAmountLine."Invoice Discount Amount" - TempVATAmountLine."Pmt. Disc. Given Amount"); // Delete the following lines. "Amount Including VAT" := Amount + ROUND(TempVATAmountLineRemainder."VAT Amount",Currency."Amount Rounding Precision") + ROUND(TempVATAmountLineRemainder."ND Amount",Currency."Amount Rounding Precision"); // End of the deleted lines. TempVATAmountLineRemainder."VAT Amount" := TempVATAmountLineRemainder."VAT Amount" - "Amount Including VAT" + Amount; END; ...Codice di sostituzione 3
... ("Line Amount" - "Inv. Discount Amount" - "Pmt. Disc. Given Amount") / (TempVATAmountLine."Line Amount" - TempVATAmountLine."Invoice Discount Amount" - TempVATAmountLine."Pmt. Disc. Given Amount"); // Add the following lines. IF "Line Discount %" <> 100 THEN "Amount Including VAT" := Amount + ROUND(TempVATAmountLineRemainder."VAT Amount",Currency."Amount Rounding Precision") + ROUND(TempVATAmountLineRemainder."ND Amount",Currency."Amount Rounding Precision") ELSE "Amount Including VAT" := 0; // End of the added lines. TempVATAmountLineRemainder."VAT Amount" := TempVATAmountLineRemainder."VAT Amount" - "Amount Including VAT" + Amount; END; ...
Prerequisiti
Per applicare questo hotfix, è necessario che sia installato uno dei prodotti seguenti:
- Versione portoghese di Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)
- Versione portoghese di Microsoft Dynamics NAV 2009 R2
Informazioni sulla rimozione
Non è possibile rimuovere questo hotfix.
Stato
Microsoft ha confermato che si tratta di un problema relativo ai prodotti elencati nella sezione "Si applica a".
Riferimenti
VSTF DynamicsNAV SE: 255528
Nota Questo è un articolo "FAST PUBLISH" creato direttamente dall'organizzazione di supporto Microsoft. Le informazioni contenute nel presente documento vengono fornite così come sono in risposta ai problemi emergenti. A causa della velocità di reso disponibile, i materiali possono includere errori tipografici e possono essere modificati in qualsiasi momento senza preavviso. Per altre considerazioni, vedere Condizioni per l'utilizzo .