Sintomi
Le basi e gli importi vengono raggruppati in modo non corretto per la stessa percentuale di IVA e il periodo della dichiarazione 340 con cassa IVA coinvolti nella versione spagnola di Microsoft Dynamics NAV 2009.
Lo stesso scenario con IVA normale funziona come previsto, separando ogni fattura indipendentemente dal fatto che abbiano la stessa percentuale di IVA. Seguire i passaggi nella sezione modifiche al codice per risolvere questo problema. Questo problema si verifica nei seguenti prodotti:
-
La versione spagnola di Microsoft Dynamics NAV 2009 R2
-
La versione spagnola di Microsoft Dynamics NAV 2009 SP1
Risoluzione
Informazioni sull'hotfix
Un hotfix supportato è ora disponibile da Microsoft. Tuttavia, è destinato esclusivamente alla risoluzione del problema descritto in questo articolo. Applicarlo solo ai sistemi in cui si verificano questo problema specifico. Questo hotfix potrebbe essere sottoposto ad ulteriori test. Pertanto, se il problema non causa gravi difficoltà, consiglia di attendere il prossimo service pack di Microsoft Dynamics NAV 2009 o versione successiva di Microsoft Dynamics NAV contenente tale hotfix.
Nota: In casi particolari, le spese normalmente addebitate per le chiamate potrebbero essere annullate qualora un aggiornamento del supporto tecnico di Microsoft Dynamics e prodotti correlati di supporto determina che uno specifico aggiornamento risolverà il problema. I costi di supporto normale verranno applicati per eventuali ulteriori domande e problemi che non dovessero rientrare nello specifico aggiornamento in questione.
Informazioni sull'installazione
Microsoft fornisce esempi di programmazione a scopo puramente illustrativo, senza alcuna garanzia espressa o implicita. Ciò include, ma non limitato a, le garanzie implicite di commerciabilità o idoneità per uno scopo particolare. In questo articolo si presuppone che si abbia familiarità con il linguaggio di programmazione in questione e gli strumenti utilizzati per creare ed eseguire la procedura di debug. Tecnici del supporto Microsoft consentono di spiegare la funzionalità di una particolare procedura. Tuttavia, essi non modificherà questi esempi per fornire funzionalità aggiuntive o creare procedure atte a soddisfare specifiche esigenze.
Nota: Prima di installare questo hotfix, verificare che tutti gli utenti di client di Microsoft Dynamics NAV sono disconnessi dal sistema. Sono inclusi i servizi di Microsoft Dynamics NAV Application Server (NAS). Dovrebbe essere il solo l'utente client connesso quando si implementa questo hotfix.
Per implementare questo hotfix, è necessario disporre di una licenza di sviluppatore.
È consigliabile che l'account utente nella finestra Login Windows o Login Database assegnare l'ID di ruolo "SUPER". Se l'account utente non può essere assegnato l'ID ruolo "SUPER", è necessario verificare che l'account utente disponga delle autorizzazioni seguenti:
-
Autorizzazione alla modifica dell'oggetto che si desidera modificare.
-
L'autorizzazione di esecuzione per l'oggetto System Object ID 5210 e per il sistema oggetto ID 9015
oggetto.
Nota: Non è necessario disporre dei diritti per gli archivi dati a meno che non è necessario eseguire il ripristino di dati.
Modifiche al codice
Nota: Sempre il codice di test consente di correggere in un ambiente controllato prima di applicare le correzioni per i computer di produzione.
Per risolvere questo problema, attenersi alla seguente procedura:
-
Modificare il codice del report di rendere dichiarazione 340 (10743) come segue:
Codice esistente 1... END;
END;
// Delete the following line.
OnAfterGetRecord=BEGIN
// End of the deleted line.
OperationCode := GetOperationCode(VATEntry2);
VATBuffer."VAT %" := "VAT %";
...Codice sostitutivo 1
... END;
END;
// Add the following lines.
OnAfterGetRecord=VAR
VendLedgEntryAppl@1100000 : Record 25;
NewEntry@1100001 : Boolean;
BEGIN
// End of the added lines.
OperationCode := GetOperationCode(VATEntry2);
VATBuffer."VAT %" := "VAT %";
...Codice esistente 2
... VATBuffer.Amount := Amount;
END;
VATBuffer.INSERT;
// Delete the following lines.
IF Type = VATEntry.Type::Purchase THEN BEGIN
VATEntryTemporary := VATEntry2;
VATEntryTemporary.INSERT;
END;
END;
// End of the deleted lines.
END;
TotalFields=Base,Amount;
...Codice di sostituzione 2
...VATBuffer.Amount := Amount;
END;
VATBuffer.INSERT;
// Add the following lines.
END;
IF Type = VATEntry.Type::Purchase THEN
IF HasBeenRealized("Entry No.") OR ("Unrealized VAT Entry No." <> 0) THEN BEGIN
NewEntry := CheckVLEApplication(VATEntry2);
VATEntryTemporary.SETRANGE("Posting Date","Posting Date");
VATEntryTemporary.SETRANGE("Document No.","Document No.");
VATEntryTemporary.SETRANGE("Document Type","Document Type");
VATEntryTemporary.SETRANGE(Type,Type);
VATEntryTemporary.SETRANGE("VAT %","VAT %");
VATEntryTemporary.SETRANGE("Transaction No.","Transaction No.");
IF VATEntryTemporary.FINDFIRST AND NOT NewEntry THEN BEGIN
VATEntryTemporary.Base += Base;
VATEntryTemporary.Amount += Amount;
VATEntryTemporary.MODIFY;
END ELSE BEGIN
VATEntryTemporary := VATEntry2;
VATEntryTemporary.INSERT;
END;
END ELSE BEGIN
VATEntryTemporary := VATEntry2;
VATEntryTemporary.INSERT;
END;
// End of the added lines.
END;
TotalFields=Base,Amount;
...3 il codice esistente
... DataItemVarName=<Integer2>;
OnPreDataItem=BEGIN
VATBuffer.FIND('-');
VATEntryTemporary.SETCURRENTKEY("VAT %","EC %");
IF VATEntryTemporary.FINDFIRST THEN;
CurrReport.CREATETOTALS(VATBuffer2.Base,VATBuffer2.Amount);
Fin := FALSE;
...Codice di sostituzione 3
... DataItemVarName=<Integer2>;
OnPreDataItem=BEGIN
VATBuffer.FIND('-');
// Delete the following line.
VATEntryTemporary.SETCURRENTKEY("VAT %","EC %");
// End of the deleted line.
IF VATEntryTemporary.FINDFIRST THEN;
CurrReport.CREATETOTALS(VATBuffer2.Base,VATBuffer2.Amount);
Fin := FALSE;
...4 il codice esistente
...IF VATEntry.Type = VATEntry.Type::Purchase THEN BEGIN
VATEntryTemporary.Amount := VATBuffer.Amount;
VATDeductAmt := CheckDeductibleVAT(VATEntryTemporary);
// Delete the following lines.
VATEntryTemporary.NEXT;
RecordTypePurchase(VATEntry2);
// End of the deleted lines.
END;
Fin := VATBuffer.NEXT = 0;
END;
...Codice di sostituzione 4
... IF VATEntry.Type = VATEntry.Type::Purchase THEN BEGIN
VATEntryTemporary.Amount := VATBuffer.Amount;
VATDeductAmt := CheckDeductibleVAT(VATEntryTemporary);
// Add the following lines.
VATEntryTemporary.SETCURRENTKEY("VAT %","EC %");
VATEntryTemporary.SETRANGE("VAT %",VATBuffer."VAT %");
VATEntryTemporary.SETRANGE("EC %",VATBuffer."EC %");
VATEntryTemporary.FINDSET;
REPEAT
RecordTypePurchase(VATEntryTemporary);
UNTIL VATEntryTemporary.NEXT = 0;
// End of the added lines.
END;
Fin := VATBuffer.NEXT = 0;
END;
... -
Modificare il codice nelle variabili globali del report di rendere dichiarazione 340 (10743) come segue:
Codice esistente...VATEntryTemporary@1100078 : TEMPORARY Record 254;
TempDeclarationLines@1100149 : TEMPORARY Record 10744;
TempVATEntry@1100007 : TEMPORARY Record 254;
CommonDialogMgt@1100015 : Codeunit 412;
OutFile@1100016 : File;
DeclarationNum@1100017 : Text[4];
...Codice di sostituzione
... VATEntryTemporary@1100078 : TEMPORARY Record 254;
TempDeclarationLines@1100149 : TEMPORARY Record 10744;
TempVATEntry@1100007 : TEMPORARY Record 254;
// Add the following line.
TempDtldVendLedgerEntry@1100115 : TEMPORARY Record 380;
// End of the added line.
CommonDialogMgt@1100015 : Codeunit 412;
OutFile@1100016 : File;
DeclarationNum@1100017 : Text[4];
... -
Modificare il codice nella funzione RecordTypePurchase nel rapporto di rendere dichiarazione 340 (10743) come segue:
Codice esistente... END ELSE
OperationDateText := FormatDate(VATEntryRec."Posting Date");
// Delete the following lines.
IF VATEntryRec."Document Type" IN [VATEntryRec."Document Type"::Payment,VATEntryRec."Document Type"::Refund] THEN BEGIN
UnrealizedVATEntryNo := VATEntryRec."Unrealized VAT Entry No.";
DocumentDate := VATEntryRec."Posting Date";
IF UnrealizedVATEntryNo <> 0 THEN BEGIN
UnrealizedVATEntry.GET(UnrealizedVATEntryNo);
OperationDateText := FormatDate(UnrealizedVATEntry."Posting Date");
DocumentDate := UnrealizedVATEntry."Document Date";
// End of the deleted lines.
END;
END ELSE
UnrealizedVATEntryNo := 0;
...Codice di sostituzione
... END ELSE
OperationDateText := FormatDate(VATEntryRec."Posting Date");
// Add the following lines.
VATBuffer2.Base := VATBuffer.Base;
VATBuffer2.Amount := VATBuffer.Amount;
IF VATEntryRec."Document Type" IN [VATEntryRec."Document Type"::Payment,VATEntryRec."Document Type"::Refund] THEN BEGIN
UnrealizedVATEntryNo := VATEntryTemporary."Unrealized VAT Entry No.";
DocumentDate := VATEntryTemporary."Posting Date";
IF UnrealizedVATEntryNo <> 0 THEN BEGIN
UnrealizedVATEntry.GET(UnrealizedVATEntryNo);
OperationDateText := FormatDate(UnrealizedVATEntry."Posting Date");
DocumentDate := UnrealizedVATEntry."Document Date";
IF FindPmtOrderBillGrBankAcc(VATEntry.Type,VATEntry."Document No.") = '' THEN BEGIN
VendorDocumentNo := UnrealizedVATEntry."External Document No.";
VATBuffer2.Base := VATEntryTemporary.Base;
VATBuffer2.Amount := VATEntryTemporary.Amount;
END;
// End of the added lines.
END;
END ELSE
UnrealizedVATEntryNo := 0;
... -
Modificare il codice nella funzione CheckVLEApplication nel rapporto di rendere dichiarazione 340 (10743) come segue:
Codice esistente... PrevDeclarationNumEnable := ReplaceDeclaration;
END;
BEGIN
END.
}
...Codice di sostituzione
...PrevDeclarationNumEnable := ReplaceDeclaration;
END;
// Add the following lines.
LOCAL PROCEDURE CheckVLEApplication@1100074(VATEntry@1100000 : Record 254) : Boolean;
VAR
VendorLedgerEntry@1100001 : Record 25;
DtldVendLedgEntry@1100002 : Record 380;
CheckVendLedgEntry@1100003 : Record 25;
UnrealizedVendLedgEntry@1100004 : Integer;
BEGIN
FilterVendLedgerEntryByVATEntry(VendorLedgerEntry,VATEntry);
UnrealizedVendLedgEntry := GetUnrealizedInvoiceVLENo(VATEntry."Unrealized VAT Entry No.");
IF VendorLedgerEntry.FINDSET THEN
REPEAT
DtldVendLedgEntry.RESET;
DtldVendLedgEntry.SETRANGE(Unapplied,FALSE);
DtldVendLedgEntry.SETRANGE("Entry Type",DtldVendLedgEntry."Entry Type"::Application);
DtldVendLedgEntry.SETRANGE("Applied Vend. Ledger Entry No.",VendorLedgerEntry."Entry No.");
IF UnrealizedVendLedgEntry <> 0 THEN
DtldVendLedgEntry.SETRANGE("Vendor Ledger Entry No.",UnrealizedVendLedgEntry);
IF DtldVendLedgEntry.FINDSET THEN
REPEAT
IF (DtldVendLedgEntry."Vendor Ledger Entry No." <> DtldVendLedgEntry."Applied Vend. Ledger Entry No.") AND
CheckVendLedgEntry.GET(DtldVendLedgEntry."Vendor Ledger Entry No.")
THEN BEGIN
IF ExistDtldVLE(DtldVendLedgEntry."Vendor Ledger Entry No.",DtldVendLedgEntry."Applied Vend. Ledger Entry No.") THEN
EXIT(FALSE);
InsertTempDtldVLE(DtldVendLedgEntry."Vendor Ledger Entry No.",DtldVendLedgEntry."Applied Vend. Ledger Entry No.");
EXIT(TRUE);
END;
UNTIL DtldVendLedgEntry.NEXT = 0
ELSE BEGIN
DtldVendLedgEntry.SETRANGE("Applied Vend. Ledger Entry No.");
DtldVendLedgEntry.SETRANGE("Vendor Ledger Entry No.",VendorLedgerEntry."Entry No.");
IF UnrealizedVendLedgEntry <> 0 THEN
DtldVendLedgEntry.SETRANGE("Applied Vend. Ledger Entry No.",UnrealizedVendLedgEntry);
IF DtldVendLedgEntry.FINDSET THEN
REPEAT
IF CheckVendLedgEntry.GET(DtldVendLedgEntry."Applied Vend. Ledger Entry No.") THEN BEGIN
IF ExistDtldVLE(DtldVendLedgEntry."Applied Vend. Ledger Entry No.",DtldVendLedgEntry."Vendor Ledger Entry No.") THEN
EXIT(FALSE);
InsertTempDtldVLE(DtldVendLedgEntry."Applied Vend. Ledger Entry No.",DtldVendLedgEntry."Vendor Ledger Entry No.");
EXIT(TRUE);
END;
UNTIL DtldVendLedgEntry.NEXT = 0;
END;
UNTIL VendorLedgerEntry.NEXT = 0;
EXIT(TRUE);
END;
LOCAL PROCEDURE GetUnrealizedInvoiceVLENo@1100075(VATEntryNo@1100000 : Integer) : Integer;
VAR
VATEntry@1100002 : Record 254;
VendLedgEntry@1100001 : Record 25;
BEGIN
IF NOT VATEntry.GET(VATEntryNo) THEN
EXIT(0);
FilterVendLedgerEntryByVATEntry(VendLedgEntry,VATEntry);
IF VendLedgEntry.FINDFIRST THEN
EXIT(VendLedgEntry."Entry No.");
EXIT(0);
END;
LOCAL PROCEDURE FilterVendLedgerEntryByVATEntry@1100087(VAR VendLedgEntry@1100001 : Record 25;VATEntry@1100000 : Record 254);
BEGIN
VendLedgEntry.SETRANGE("Vendor No.",VATEntry."Bill-to/Pay-to No.");
VendLedgEntry.SETRANGE("Posting Date",VATEntry."Posting Date");
VendLedgEntry.SETRANGE("Document Type",VATEntry."Document Type");
VendLedgEntry.SETRANGE("Document No.",VATEntry."Document No.");
VendLedgEntry.SETRANGE("Transaction No.",VATEntry."Transaction No.");
END;
LOCAL PROCEDURE HasBeenRealized@1100064(VATEntryNo@1100000 : Integer) : Boolean;
VAR
UnrealizedVATEntry@1100001 : Record 254;
BEGIN
UnrealizedVATEntry.SETRANGE("Unrealized VAT Entry No.",VATEntryNo);
EXIT(NOT UnrealizedVATEntry.ISEMPTY);
END;
LOCAL PROCEDURE ExistDtldVLE@1100195(VLENo@1100001 : Integer;AppliedVLENo@1100000 : Integer) : Boolean;
BEGIN
TempDtldVendLedgerEntry.SETRANGE("Vendor Ledger Entry No.",VLENo);
TempDtldVendLedgerEntry.SETRANGE("Applied Vend. Ledger Entry No.",AppliedVLENo);
EXIT(NOT TempDtldVendLedgerEntry.ISEMPTY);
END;
LOCAL PROCEDURE InsertTempDtldVLE@1100191(VLENo@1100000 : Integer;AppliedVLENo@1100001 : Integer);
BEGIN
TempDtldVendLedgerEntry.INIT;
IF TempDtldVendLedgerEntry.FINDLAST THEN;
TempDtldVendLedgerEntry."Entry No." += 1;
TempDtldVendLedgerEntry."Vendor Ledger Entry No." := VLENo;
TempDtldVendLedgerEntry."Applied Vend. Ledger Entry No." := AppliedVLENo;
TempDtldVendLedgerEntry.INSERT;
END;
// End of the added lines.
BEGIN
END.
}
...
Prerequisiti
Deve avere uno dei seguenti prodotti per applicare questo hotfix:
-
La versione spagnola di Microsoft Dynamics NAV 2009 R2
-
La versione spagnola di Microsoft Dynamics NAV 2009 SP1
Informazioni sulla rimozione
Non è possibile rimuovere questo hotfix.
Stato
Microsoft ha confermato che questo è un problema dei prodotti Microsoft elencati nella sezione "Si applica a".
Nota: Si tratta di un articolo a "Pubblicazione Veloce" creato direttamente all'interno dell'organizzazione di supporto Microsoft. Le informazioni contenute nel presente documento sono fornite così come sono in risposta a problemi urgenti. Per la velocità in rendendo disponibili, i materiali possono includere errori tipografici e possono essere modificati in qualsiasi momento senza preavviso. Per altre considerazioni, vedere Condizioni di utilizzo.