Síntomas
Después de instalar la versión en español de Microsoft Dynamics NAV 2009, KB3034441 al aplicar un pago normal y una lista de movimientos de cliente o proveedor, los movimientos de contabilidad registrados refieren a ambos en la misma cuenta, que es incorrecta. 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 de la función PostDtldCustLedgEntries en el gen.-línea Post codeunit (12) como sigue:
Código existente 1...LOCAL PROCEDURE PostDtldCustLedgEntries@46(GenJnlLine2@1000 : Record 81;VAR DtldCVLedgEntryBuf@1001 : Record 383;CustPostingGr@1002 : Record 92;GLSetup@1003 : Record 98;NextTransactionNo@1004 : Integer;CustLedgEntryInserted@1012 : Boolean);
VAR
DtldCustLedgEntry@1005 : Record 379;
Currency@1007 : Record 4;
GenPostingSetup@1008 : Record 252;
TotalAmountLCY@1009 : Decimal;
TotalAmountAddCurr@1010 : Decimal;
PaymentDiscAcc@1011 : Code[20];
DtldCustLedgEntryNoOffset@1006 : Integer;
PaymentTolAcc@1013 : Code[20];
...Código nuevo 1
...LOCAL PROCEDURE PostDtldCustLedgEntries@46(GenJnlLine2@1000 : Record 81;VAR DtldCVLedgEntryBuf@1001 : Record 383;CustPostingGr@1002 : Record 92;GLSetup@1003 : Record 98;NextTransactionNo@1004 : Integer;CustLedgEntryInserted@1012 : Boolean);
VAR
DtldCustLedgEntry@1005 : Record 379;
Currency@1007 : Record 4;
GenPostingSetup@1008 : Record 252;
// Add the following line.
DtldCustLedgEntry3@1100044 : Record 379;
// End of the added line.
TotalAmountLCY@1009 : Decimal;
TotalAmountAddCurr@1010 : Decimal;
PaymentDiscAcc@1011 : Code[20];
DtldCustLedgEntryNoOffset@1006 : Integer;
PaymentTolAcc@1013 : Code[20];
...Código existente 2
...ReceivableAccAmtLCY@1100001 : Decimal;
ReceivableAccAmtAddCurr@1100000 : Decimal;
DtldCustLedgEntry2@1100003 : TEMPORARY Record 379;
ExistDtldCVLedgEntryBuf@1000003 : Boolean;
FindBill@1100004 : Boolean;
BEGIN
TotalAmountLCY := 0;
TotalAmountAddCurr := 0;
PositiveLCYAppAmt := 0;
PositiveACYAppAmt := 0;
...Código nuevo 2
...ReceivableAccAmtLCY@1100001 : Decimal;
ReceivableAccAmtAddCurr@1100000 : Decimal;
DtldCustLedgEntry2@1100003 : TEMPORARY Record 379;
ExistDtldCVLedgEntryBuf@1000003 : Boolean;
FindBill@1100004 : Boolean;
// Add the following line.
EntryUnapplied@1100051 : Boolean;
// End of the added line.
BEGIN
TotalAmountLCY := 0;
TotalAmountAddCurr := 0;
PositiveLCYAppAmt := 0;
PositiveACYAppAmt := 0;
...Código existente 3
... TotalAmountAddCurr := 0;
PositiveLCYAppAmt := 0;
PositiveACYAppAmt := 0;
NegativeLCYAppAmt := 0;
NegativeACYAppAmt := 0;
IF GenJnlLine2."Account Type" = GenJnlLine2."Account Type"::Customer THEN BEGIN
IF DtldCustLedgEntry.FINDLAST THEN
DtldCustLedgEntryNoOffset := DtldCustLedgEntry."Entry No."
ELSE
...Código nuevo 3
...TotalAmountAddCurr := 0;
PositiveLCYAppAmt := 0;
PositiveACYAppAmt := 0;
NegativeLCYAppAmt := 0;
NegativeACYAppAmt := 0;
// Add the following line.
EntryUnapplied := FALSE;
// End of the added line.
IF GenJnlLine2."Account Type" = GenJnlLine2."Account Type"::Customer THEN BEGIN
IF DtldCustLedgEntry.FINDLAST THEN
DtldCustLedgEntryNoOffset := DtldCustLedgEntry."Entry No."
ELSE
...Código existente 4
... END;
InsertGLEntry(TRUE);
GenJnlLine."Posting Date" := OriginalPostingDate;
END;
// Delete the following line.
PostReceivableDocs(GenJnlLine);
// End of the deleted line.
IF NOT GLEntryTmp.FINDFIRST AND ExistDtldCVLedgEntryBuf THEN BEGIN
InitGLEntry(CustPostingGr."Receivables Account",PositiveLCYAppAmt,PositiveACYAppAmt,FALSE,TRUE);
InsertGLEntry(FALSE);
InitGLEntry(CustPostingGr."Receivables Account",NegativeLCYAppAmt,NegativeACYAppAmt,FALSE,TRUE);
...Código nuevo 4
... END;
InsertGLEntry(TRUE);
GenJnlLine."Posting Date" := OriginalPostingDate;
END;
// Add the following lines.
WITH DtldCustLedgEntry3 DO BEGIN
SETCURRENTKEY("Cust. Ledger Entry No.");
SETRANGE("Cust. Ledger Entry No.",DtldCustLedgEntry."Cust. Ledger Entry No.");
SETFILTER("Applies-to Bill No.",'<>%1','');
SETRANGE(Unapplied,TRUE);
EntryUnapplied := NOT ISEMPTY;
END;
PostReceivableDocs(EntryUnapplied);
// End of the added lines.
IF NOT GLEntryTmp.FINDFIRST AND ExistDtldCVLedgEntryBuf THEN BEGIN
InitGLEntry(CustPostingGr."Receivables Account",PositiveLCYAppAmt,PositiveACYAppAmt,FALSE,TRUE);
InsertGLEntry(FALSE);
InitGLEntry(CustPostingGr."Receivables Account",NegativeLCYAppAmt,NegativeACYAppAmt,FALSE,TRUE);
... -
Cambie el código de la función PostDtldVendLedgEntries en el gen.-línea Post codeunit (12) como sigue:
Código existente 1... PROCEDURE PostDtldVendLedgEntries@32(GenJnlLine2@1000 : Record 81;VAR DtldCVLedgEntryBuf@1001 : Record 383;VendPostingGr@1002 : Record 93;NextTransactionNo@1003 : Integer;VendLedgEntryInserted@1011 : Boolean);
VAR
DtldVendLedgEntry@1004 : Record 380;
Currency@1006 : Record 4;
GenPostingSetup@1007 : Record 252;
TotalAmountLCY@1008 : Decimal;
TotalAmountAddCurr@1009 : Decimal;
PaymentDiscAcc@1010 : Code[20];
DtldVendLedgEntryNoOffset@1005 : Integer;
PaymentTolAcc@1012 : Code[20];
...Código nuevo 1
...PROCEDURE PostDtldVendLedgEntries@32(GenJnlLine2@1000 : Record 81;VAR DtldCVLedgEntryBuf@1001 : Record 383;VendPostingGr@1002 : Record 93;NextTransactionNo@1003 : Integer;VendLedgEntryInserted@1011 : Boolean);
VAR
DtldVendLedgEntry@1004 : Record 380;
Currency@1006 : Record 4;
GenPostingSetup@1007 : Record 252;
// Add the following line.
DtldVendLedgEntry3@1100055 : Record 380;
// End of the added line.
TotalAmountLCY@1008 : Decimal;
TotalAmountAddCurr@1009 : Decimal;
PaymentDiscAcc@1010 : Code[20];
DtldVendLedgEntryNoOffset@1005 : Integer;
PaymentTolAcc@1012 : Code[20];
...Código existente 2
...PayableAccAmtLCY@1100002 : Decimal;
PayableAccAmtAddCurr@1100010 : Decimal;
DtldVendLedgEntry2@1100003 : Record 380;
ExistDtldCVLedgEntryBuf@1100004 : Boolean;
FindBill@1100005 : Boolean;
BEGIN
TotalAmountLCY := 0;
TotalAmountAddCurr := 0;
PositiveLCYAppAmt := 0;
PositiveACYAppAmt := 0;
...Código nuevo 2
...PayableAccAmtLCY@1100002 : Decimal;
PayableAccAmtAddCurr@1100010 : Decimal;
DtldVendLedgEntry2@1100003 : Record 380;
ExistDtldCVLedgEntryBuf@1100004 : Boolean;
FindBill@1100005 : Boolean;
// Add the following line.
EntryUnapplied@1100051 : Boolean;
// End of the added line.
BEGIN
TotalAmountLCY := 0;
TotalAmountAddCurr := 0;
PositiveLCYAppAmt := 0;
PositiveACYAppAmt := 0;
...Código existente 3
...TotalAmountAddCurr := 0;
PositiveLCYAppAmt := 0;
PositiveACYAppAmt := 0;
NegativeLCYAppAmt := 0;
NegativeACYAppAmt := 0;
IF GenJnlLine2."Account Type" = GenJnlLine2."Account Type"::Vendor THEN BEGIN
IF DtldVendLedgEntry.FINDLAST THEN
DtldVendLedgEntryNoOffset := DtldVendLedgEntry."Entry No."
ELSE
...Código nuevo 3
...TotalAmountAddCurr := 0;
PositiveLCYAppAmt := 0;
PositiveACYAppAmt := 0;
NegativeLCYAppAmt := 0;
NegativeACYAppAmt := 0;
// Add the following line.
EntryUnapplied := FALSE;
// End of the added line.
IF GenJnlLine2."Account Type" = GenJnlLine2."Account Type"::Vendor THEN BEGIN
IF DtldVendLedgEntry.FINDLAST THEN
DtldVendLedgEntryNoOffset := DtldVendLedgEntry."Entry No."
ELSE
...Código existente 4
...END;
InsertGLEntry(TRUE);
GenJnlLine."Posting Date" := OriginalPostingDate;
END;
// Delete the following line.
PostPayableDocs(GenJnlLine);
// End of the deleted line.
IF NOT GLEntryTmp.FINDFIRST AND ExistDtldCVLedgEntryBuf THEN BEGIN
InitGLEntry(VendPostingGr."Payables Account",PositiveLCYAppAmt,PositiveACYAppAmt,FALSE,TRUE);
InsertGLEntry(FALSE);
InitGLEntry(VendPostingGr."Payables Account",NegativeLCYAppAmt,NegativeACYAppAmt,FALSE,TRUE);
...Código nuevo 4
...END;
InsertGLEntry(TRUE);
GenJnlLine."Posting Date" := OriginalPostingDate;
END;
// Add the following lines.
WITH DtldVendLedgEntry3 DO BEGIN
SETCURRENTKEY("Vendor Ledger Entry No.");
SETRANGE("Vendor Ledger Entry No.",DtldVendLedgEntry."Vendor Ledger Entry No.");
SETFILTER("Applies-to Bill No.",'<>%1','');
SETRANGE(Unapplied,TRUE);
EntryUnapplied := NOT ISEMPTY;
END;
PostPayableDocs(EntryUnapplied);
// End of the added lines.
IF NOT GLEntryTmp.FINDFIRST AND ExistDtldCVLedgEntryBuf THEN BEGIN
InitGLEntry(VendPostingGr."Payables Account",PositiveLCYAppAmt,PositiveACYAppAmt,FALSE,TRUE);
InsertGLEntry(FALSE);
InitGLEntry(VendPostingGr."Payables Account",NegativeLCYAppAmt,NegativeACYAppAmt,FALSE,TRUE);
... -
Cambie el código de la función PostPayableDocs en el gen.-línea Post codeunit (12) como sigue:
Código existente 1...ELSE
VATEntry."Bill-to/Pay-to No." := GenJnlLine2."Account No.";
END;
END;
// Delete the following line.
LOCAL PROCEDURE PostPayableDocs@1100009(VAR GenJnlLine@1100000 : Record 81);
// End of the deleted line.
BEGIN
IF (DocAmountLCY <> 0) OR (CollDocAmountLCY <> 0) THEN
IF NextEntryNo2 = NextEntryNo THEN
NextEntryNo := NextEntryNo - 1;
IF DocAmountLCY <> 0 THEN BEGIN
...Código nuevo 1
...ELSE
VATEntry."Bill-to/Pay-to No." := GenJnlLine2."Account No.";
END;
END;
// Add the following line.
LOCAL PROCEDURE PostPayableDocs@1100009(EntryUnapplied@1100001 : Boolean);
// End of the added line.
BEGIN
IF (DocAmountLCY <> 0) OR (CollDocAmountLCY <> 0) THEN
IF NextEntryNo2 = NextEntryNo THEN
NextEntryNo := NextEntryNo - 1;
IF DocAmountLCY <> 0 THEN BEGIN
...Código existente 2
...BEGIN
IF (DocAmountLCY <> 0) OR (CollDocAmountLCY <> 0) THEN
IF NextEntryNo2 = NextEntryNo THEN
NextEntryNo := NextEntryNo - 1;
IF DocAmountLCY <> 0 THEN BEGIN
// Delete the following lines.
// VSTF330588.begin
//IF (GenJnlLine."Applies-to Doc. Type" = GenJnlLine."Applies-to Doc. Type"::Invoice) THEN BEGIN
IF (GenJnlLine."Applies-to Doc. Type" = GenJnlLine."Applies-to Doc. Type"::Invoice) OR
(GenJnlLine."Applies-to Doc. Type" = GenJnlLine."Applies-to Doc. Type"::" ")
THEN BEGIN
// VSTF330588.end
// End of the deleted lines.
VendPostingGr.TESTFIELD("Payables Account");
InitGLEntry(VendPostingGr."Payables Account",DocAmountLCY,DocAmtCalcAddCurrency(DocAmountLCY),TRUE,TRUE);
GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
InsertGLEntry(TRUE);
...Código nuevo 2
...BEGIN
IF (DocAmountLCY <> 0) OR (CollDocAmountLCY <> 0) THEN
IF NextEntryNo2 = NextEntryNo THEN
NextEntryNo := NextEntryNo - 1;
IF DocAmountLCY <> 0 THEN BEGIN
// Add the following lines.
IF (GenJnlLine."Applies-to Doc. Type" = GenJnlLine."Applies-to Doc. Type"::Invoice) OR
EntryUnapplied
THEN BEGIN
// End of the added lines.
VendPostingGr.TESTFIELD("Payables Account");
InitGLEntry(VendPostingGr."Payables Account",DocAmountLCY,DocAmtCalcAddCurrency(DocAmountLCY),TRUE,TRUE);
GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
InsertGLEntry(TRUE);
... -
Cambie el código de la función PostReceivableDocs en el gen.-línea Post codeunit (12) como sigue:
Código existente 1... GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
InsertGLEntry(TRUE);
END;
END;
// Delete the following line.
LOCAL PROCEDURE PostReceivableDocs@1100003(VAR GenJnlLine@1100000 : Record 81);
// End of the deleted line.
BEGIN
IF (DocAmountLCY <> 0) OR (DiscDocAmountLCY <> 0) OR (CollDocAmountLCY <> 0) OR (RejDocAmountLCY <> 0) OR
(DiscRiskFactAmountLCY <> 0) OR (DiscUnriskFactAmountLCY <> 0) OR (CollFactAmountLCY <> 0) THEN
IF NextEntryNo2 = NextEntryNo THEN
NextEntryNo := NextEntryNo - 1;
...Código nuevo 1
...GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
InsertGLEntry(TRUE);
END;
END;
// Add the following line.
LOCAL PROCEDURE PostReceivableDocs@1100003(EntryUnapplied@1100001 : Boolean);
// End of the added line.
BEGIN
IF (DocAmountLCY <> 0) OR (DiscDocAmountLCY <> 0) OR (CollDocAmountLCY <> 0) OR (RejDocAmountLCY <> 0) OR
(DiscRiskFactAmountLCY <> 0) OR (DiscUnriskFactAmountLCY <> 0) OR (CollFactAmountLCY <> 0) THEN
IF NextEntryNo2 = NextEntryNo THEN
NextEntryNo := NextEntryNo - 1;
...Código existente 2
...IF (DocAmountLCY <> 0) OR (DiscDocAmountLCY <> 0) OR (CollDocAmountLCY <> 0) OR (RejDocAmountLCY <> 0) OR
(DiscRiskFactAmountLCY <> 0) OR (DiscUnriskFactAmountLCY <> 0) OR (CollFactAmountLCY <> 0) THEN
IF NextEntryNo2 = NextEntryNo THEN
NextEntryNo := NextEntryNo - 1;
IF DocAmountLCY <> 0 THEN BEGIN
// Delete the following lines.
// VSTF330588.begin
//IF (GenJnlLine."Applies-to Doc. Type" = GenJnlLine."Applies-to Doc. Type"::Invoice) THEN BEGIN
IF (GenJnlLine."Applies-to Doc. Type" = GenJnlLine."Applies-to Doc. Type"::Invoice) OR
(GenJnlLine."Applies-to Doc. Type" = GenJnlLine."Applies-to Doc. Type"::" ")
THEN BEGIN
// VSTF330588.end
// End of the deleted lines.
CustPostingGr.TESTFIELD("Receivables Account");
InitGLEntry(CustPostingGr."Receivables Account",DocAmountLCY,DocAmtCalcAddCurrency(DocAmountLCY),TRUE,TRUE);
GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
InsertGLEntry(TRUE);
...Código nuevo 2
...IF (DocAmountLCY <> 0) OR (DiscDocAmountLCY <> 0) OR (CollDocAmountLCY <> 0) OR (RejDocAmountLCY <> 0) OR
(DiscRiskFactAmountLCY <> 0) OR (DiscUnriskFactAmountLCY <> 0) OR (CollFactAmountLCY <> 0) THEN
IF NextEntryNo2 = NextEntryNo THEN
NextEntryNo := NextEntryNo - 1;
IF DocAmountLCY <> 0 THEN BEGIN
// Add the following lines.
IF (GenJnlLine."Applies-to Doc. Type" = GenJnlLine."Applies-to Doc. Type"::Invoice) OR
EntryUnapplied
THEN BEGIN
// End of the added lines.
CustPostingGr.TESTFIELD("Receivables Account");
InitGLEntry(CustPostingGr."Receivables Account",DocAmountLCY,DocAmtCalcAddCurrency(DocAmountLCY),TRUE,TRUE);
GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
InsertGLEntry(TRUE);
...
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
Además, debe tener KB3034441 instalado.
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.