Symptômes
Les bases et les montants sont incorrectement regroupés pour le même pourcentage de TVA et la période de la déclaration 340 avec espèces de TVA impliqués dans la version espagnole de Microsoft Dynamics NAV 2009.
Le même scénario avec TVA normale fonctionne comme prévu, en séparant chaque facture qu’ils aient le même pourcentage de TVA. Suivez les étapes décrites dans la section modifications du code pour résoudre ce problème. Ce problème se produit dans les produits suivants :
-
La version espagnole de Microsoft Dynamics NAV 2009 R2
-
La version espagnole de Microsoft Dynamics NAV 2009 SP1
Résolution
Informations sur le correctif
Un correctif pris en charge est désormais disponible auprès de Microsoft. Toutefois, il est conçu uniquement pour corriger le problème décrit dans cet article. Il s’applique uniquement aux systèmes rencontrant ce problème spécifique. Ce correctif peut subir des tests supplémentaires. Par conséquent, si vous n’êtes pas sérieusement concerné par ce problème, nous vous recommandons d’attendre le prochain service pack Microsoft Dynamics NAV 2009 ou la prochaine version de Microsoft Dynamics NAV qui comprendra ce correctif.
Remarque Dans certains cas, les frais généralement encourus pour la prise en charge des appels peuvent être annulés si un technicien du Support technique pour Microsoft Dynamics et les produits associés détermine qu’une mise à jour spécifique peut résoudre votre problème. Les coûts habituels du support technique s’appliqueront aux autres questions et problèmes qui ne relèvent pas de la mise à jour spécifique en question.
Informations sur l’installation
Microsoft fournit des exemples de programmation à titre d'illustration uniquement, sans garantie expresse ou implicite. Ceci inclut, mais n'est pas limité à, les garanties implicites de qualité marchande ou d'adéquation à un usage particulier. Cet article suppose que vous êtes familiarisé avec le langage de programmation présenté et les outils utilisés pour créer et déboguer des procédures. Les ingénieurs du support technique Microsoft peuvent aider à expliquer la fonctionnalité d'une procédure particulière. Toutefois, ils ne modifieront pas ces exemples pour fournir des fonctionnalités supplémentaires ou créer des procédures répondant à vos besoins spécifiques.
Remarque Avant d’installer ce correctif, vérifiez que tous les utilisateurs du client Microsoft Dynamics NAV sont déconnectés sur le système. Ceci comprend les services de Microsoft Dynamics NAV Application Server (NAS). Vous devez être le seul utilisateur client connecté lors de l’implémentation de ce correctif.
Pour appliquer ce correctif, vous devez posséder une licence développeur.
Il est recommandé que le compte d’utilisateur dans la fenêtre Logins Windows ou dans la fenêtre Logins base de données est affecté à l’ID de rôle « SUPER ». Si le compte d’utilisateur ne peut pas être affecté à l’ID de rôle « SUPER », vous devez vérifier que le compte d’utilisateur dispose des autorisations suivantes :
-
L’autorisation de modification pour l’objet que vous allez modifier.
-
L’autorisation d’exécution pour l’objet ID objet système 5210 et pour l' ID objet système 9015
objet.
Remarque Vous n’êtes pas obligé de disposer des droits pour les banques de données excepté si vous devez réparer des données.
Modifications du code
Remarque Toujours tester le code des correctifs dans un environnement contrôlé, avant d'appliquer les correctifs à vos ordinateurs de production.
Pour résoudre ce problème, procédez comme suit :
-
Modifiez le code dans le rapport de faire une déclaration de 340 (10743) comme suit :
Code existant 1... END;
END;
// Delete the following line.
OnAfterGetRecord=BEGIN
// End of the deleted line.
OperationCode := GetOperationCode(VATEntry2);
VATBuffer."VAT %" := "VAT %";
...Code de substitution 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 %";
...Code existant 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;
...Code de substitution 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;
...Code existant 3
... DataItemVarName=<Integer2>;
OnPreDataItem=BEGIN
VATBuffer.FIND('-');
VATEntryTemporary.SETCURRENTKEY("VAT %","EC %");
IF VATEntryTemporary.FINDFIRST THEN;
CurrReport.CREATETOTALS(VATBuffer2.Base,VATBuffer2.Amount);
Fin := FALSE;
...Code de substitution 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 le code existant
...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;
...Code de remplacement 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;
... -
Modifiez le code dans les Variables globales dans le rapport de faire une déclaration de 340 (10743) comme suit :
Code existant...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];
...Code de remplacement
... 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];
... -
Modifiez le code dans la fonction RecordTypePurchase dans le rapport de faire une déclaration de 340 (10743) comme suit :
Code existant... 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;
...Code de remplacement
... 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;
... -
Modifiez le code dans la fonction CheckVLEApplication dans le rapport de faire une déclaration de 340 (10743) comme suit :
Code existant... PrevDeclarationNumEnable := ReplaceDeclaration;
END;
BEGIN
END.
}
...Code de remplacement
...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.
}
...
Conditions préalables
Vous devez disposer d’un des produits suivants est installé pour appliquer ce correctif :
-
La version espagnole de Microsoft Dynamics NAV 2009 R2
-
La version espagnole de Microsoft Dynamics NAV 2009 SP1
Informations sur la suppression
Vous ne pouvez pas supprimer ce correctif.
État
Microsoft a confirmé l'existence de ce problème dans les produits Microsoft répertoriés dans la section « S'applique à ».
Remarque Il s’agit d’un article de « Dernière minute » créé directement à partir de l’organisation de support technique de Microsoft. Les informations contenues dans ce document sont fournies en l'état, en réponse à des problèmes nouveaux. En raison de la rapidité de leur mise à disposition, les documents peuvent contenir des erreurs typographiques et peuvent être révisés à tout moment sans préavis. Consultez les Conditions d’utilisationpour d’autres considérations.