Síntomas
Las bases y los importes se agrupan incorrectamente para el período de la declaración 340 con caja de IVA implicado en la versión en español de Microsoft Dynamics NAV 2009 y el mismo porcentaje de IVA.
El mismo escenario con IVA normal funciona como se esperaba, separando cada factura independientemente de si tienen el mismo porcentaje de IVA. Siga los pasos descritos en la sección de cambios de código para resolver este problema. Este problema se produce en los siguientes productos:
-
La versión en español de Microsoft Dynamics NAV 2009 R2
-
La versión en español de Microsoft Dynamics NAV 2009 SP1
Solución
Información de la revisión
Ahora hay una revisión compatible de Microsoft. Sin embargo, sólo se diseñó para corregir el problema que se describe en este artículo. Aplíquela sólo a sistemas que experimenten este problema específico. Esta revisión puede ser sometida a comprobaciones adicionales. Por lo tanto, si no se ve muy afectado por este problema, recomendamos que espere al próximo service pack de Microsoft Dynamics NAV 2009 o la próxima versión de Microsoft Dynamics NAV que contenga esta revisión.
Nota: En casos especiales, los costos derivados normalmente de las llamadas pueden cancelarse si un profesional de soporte técnico de Microsoft Dynamics y productos relacionados de soporte determina que una actualización específica resolverá el problema. Los costos habituales de soporte se aplicarán a las preguntas de soporte técnico adicionales y problemas que no guarden relación con la actualización en cuestión.
Información sobre la instalación
Microsoft proporciona ejemplos de programación únicamente con fines ilustrativos, sin ninguna garantía expresa o implícita. Esto incluye, pero no se limita, a las garantías implícitas de comerciabilidad o idoneidad para un propósito particular. Este artículo asume que está familiarizado con el lenguaje de programación que se muestra y con las herramientas que se utilizan para crear y depurar procedimientos. Los ingenieros de soporte técnico de Microsoft pueden explicarle la funcionalidad de un determinado procedimiento. Sin embargo, no modificarán estos ejemplos para ofrecer mayor funcionalidad ni crearán procedimientos que cumplan sus requisitos específicos.
Nota: Antes de instalar este hotfix, compruebe que todos los usuarios del cliente de Microsoft Dynamics NAV han salido del sistema. Esto incluye los servicios de Microsoft Dynamics NAV Application Server (NAS). Debe ser el único usuario del cliente conectado cuando implemente este hotfix.
Para implementar esta revisión, debe tener una licencia de desarrollador.
Recomendamos que la cuenta de usuario en la ventana Conexiones Windows o en la ventana Conexiones base de datos se asigne el identificador de rol "SUPER". Si la cuenta de usuario no se puede asignar el identificador de rol "SUPER", debe comprobar que la cuenta de usuario tiene los permisos siguientes:
-
El permiso de modificación para el objeto que se va a cambiar.
-
El permiso Execute para el objeto System Object ID 5210 y el System Object ID 9015 .
objeto.
Nota: No es necesario tener derechos para los almacenes de datos a menos que deba realizar reparaciones de datos.
Cambios de código
Nota: Siempre pruebe correcciones de código en un entorno controlado antes de aplicar las revisiones a los equipos de producción.
Para resolver este problema, siga estos pasos:
-
Cambie el código en el informe de hacer declaración de 340 (10743) como sigue:
Código existente 1... END;
END;
// Delete the following line.
OnAfterGetRecord=BEGIN
// End of the deleted line.
OperationCode := GetOperationCode(VATEntry2);
VATBuffer."VAT %" := "VAT %";
...Código nuevo 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 %";
...Código existente 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;
...Código nuevo 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;
...Código existente 3
... DataItemVarName=<Integer2>;
OnPreDataItem=BEGIN
VATBuffer.FIND('-');
VATEntryTemporary.SETCURRENTKEY("VAT %","EC %");
IF VATEntryTemporary.FINDFIRST THEN;
CurrReport.CREATETOTALS(VATBuffer2.Base,VATBuffer2.Amount);
Fin := FALSE;
...Código nuevo 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;
...Código existente 4
...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;
...Código nuevo 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;
... -
Cambie el código en las Variables globales en el informe de hacer declaración de 340 (10743) como sigue:
Código existente...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];
...Código de sustitución
... 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];
... -
Cambie el código en la función RecordTypePurchase en el informe de hacer declaración de 340 (10743) como sigue:
Código existente... 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;
...Código de sustitución
... 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;
... -
Cambie el código en la función CheckVLEApplication en el informe de hacer declaración de 340 (10743) como sigue:
Código existente... PrevDeclarationNumEnable := ReplaceDeclaration;
END;
BEGIN
END.
}
...Código de sustitución
...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.
}
...
Requisitos previos
Debe tener uno de los siguientes productos instalados para aplicar esta revisión:
-
La versión en español de Microsoft Dynamics NAV 2009 R2
-
La versión en español de Microsoft Dynamics NAV 2009 SP1
Información de eliminación
No se puede quitar este hotfix.
Estado
Microsoft ha confirmado que se trata de un problema de los productos de Microsoft que se enumeran en la sección "Aplicable a".
Nota: Es un artículo "Publicación rápida" creado directamente desde dentro de la organización de soporte técnico de Microsoft. La información contenida en este documento se proporciona como está en respuesta a nuevos problemas. Como consecuencia de la velocidad en la puesta a disposición, los materiales pueden incluir errores tipográficos y podrán revisarse en cualquier momento sin previo aviso. Para obtener información adicional, consulte Condiciones de uso.