Iniciar sessão com a Microsoft
Iniciar sessão ou criar uma conta.
Olá,
Selecione uma conta diferente.
Tem várias contas
Selecione a conta com a qual pretende iniciar sessão.

Sintomas

Depois de instalar KB3034441 na versão espanhola do Microsoft Dynamics NAV 2009, quando aplica um pagamento normal e uma lista de movimentos fornecedor ou cliente, os movimentos CG registados referem-se para a mesma conta, está incorrecta. Siga os passos na secção de alterações de código para resolver este problema. Este problema ocorre nos seguintes produtos:

  • A versão espanhola do Microsoft Dynamics NAV 2009 R2

  • A versão espanhola do Microsoft Dynamics NAV 2009 SP1

Resolução

Informações sobre correção

Agora tem uma correcção suportada disponível na Microsoft. Contudo, destina-se apenas a corrigir o problema descrito neste artigo. Aplique-a apenas em sistemas que tenham este problema específico. Esta correcção poderá ser submetida a testes adicionais. Por conseguinte, se não estiver a ser gravemente afectado por este problema, recomendamos que aguarde o próximo service pack do Microsoft Dynamics NAV 2009 ou a próxima versão do Microsoft Dynamics NAV que contenha esta correcção.

Nota Em casos especiais, os custos normalmente inerentes para suporte chamadas poderão ser anuladas se um técnico de suporte técnico do Microsoft Dynamics e produtos relacionados determina que uma actualização específica resolverá o problema. Os custos de normais do suporte serão aplicados a questões de suporte adicionais e problemas que não se enquadrem na atualização específica em questão.

Informações de instalação

A Microsoft fornece exemplos de programação apenas a título ilustrativo, sem garantia expressa ou implícita. Isto inclui, mas não está limitado a, garantias implícitas de comercialização ou adequação a um fim específico. Este artigo pressupõe que está familiarizado com a linguagem de programação que está a ser demonstrada e com as ferramentas que são utilizadas para criar e depurar procedimentos. Técnicos de suporte da Microsoft podem ajudar a explicar a funcionalidade de um determinado procedimento. No entanto, não modificarão estes exemplos para proporcionarem funcionalidades adicionais nem criarão procedimentos adaptados às necessidades específicas do utilizador.

Nota Antes de instalar esta correcção, certifique-se de que todos os utilizadores de cliente do Microsoft Dynamics NAV são registados no sistema. Isto inclui os serviços de servidor de aplicações (NAS) do Microsoft Dynamics NAV. Deve ser o único usuário do cliente que tem sessão iniciada quando implementar esta correcção.

Para implementar esta correcção, tem de ter uma licença de desenvolvedor.

Recomendamos que a conta de utilizador na janela Logins do Windows ou na janela Logins de base de dados seja atribuída a ID de função "SUPER". Se a conta de utilizador não é possível atribuir o ID de função "SUPER", tem de verificar que a conta de utilizador tem as seguintes permissões:

  • A permissão Modificar para o objecto que estará a alterar.

  • A permissão executar para o objecto 5210 de ID de objecto de sistema e para o 9015 de ID de objecto de sistema

    objecto.

Nota Não tem de ter direitos para os arquivos de dados, excepto se tiver de efectuar a reparação de dados.

Alterações de código

Nota Sempre o código de ensaio corrige num ambiente controlado antes de aplicar as correcções para os computadores de produção.

Para resolver este problema, siga estes passos:

  1. Alterar o código na função PostDtldCustLedgEntries no diário de Gr.-linha colocar codeunit (12), da seguinte forma:
    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 de substituição 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 de substituição 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 de substituição 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 de substituição 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);
    ...
  2. Alterar o código na função PostDtldVendLedgEntries no diário de Gr.-linha colocar codeunit (12), da seguinte forma:
    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 de substituição 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 de substituição 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 de substituição 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 de substituição 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);
    ...
  3. Alterar o código na função PostPayableDocs no diário de Gr.-linha colocar codeunit (12), da seguinte forma:
    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 de substituição 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 de substituição 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);
    ...
  4. Alterar o código na função PostReceivableDocs no diário de Gr.-linha colocar codeunit (12), da seguinte forma:
    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 de substituição 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 de substituição 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);
    ...

Pré-requisitos

Tem de ter um dos seguintes produtos instalado para aplicar esta correcção:

  • A versão espanhola do Microsoft Dynamics NAV 2009 R2

  • A versão espanhola do Microsoft Dynamics NAV 2009 SP1

Além disso, tem de ter KB3034441 instalado.

Informações de remoção

Não é possível remover esta correcção.

Estado

A Microsoft confirmou que este é um problema nos produtos da Microsoft listados na secção "Aplica-se a".

Nota Este é um artigo "Publicação rápida" criado diretamente a partir da organização de suporte da Microsoft. As informações contidas neste documento são fornecidas como-se em resposta a questões emergentes. Como resultado da urgência na sua disponibilização, os materiais podem incluir erros tipográficos e podem ser revistos em qualquer altura sem aviso prévio. Para outras considerações, consulte os Termos de utilização.

Precisa de mais ajuda?

Quer mais opções?

Explore os benefícios da subscrição, navegue em cursos de formação, saiba como proteger o seu dispositivo e muito mais.

As comunidades ajudam-no a colocar e a responder perguntas, a dar feedback e a ouvir especialistas com conhecimentos abrangentes.

Estas informações foram úteis?

Quão satisfeito está com a qualidade do idioma?
O que afetou a sua experiência?
Ao selecionar submeter, o seu feedback será utilizado para melhorar os produtos e serviços da Microsoft. O seu administrador de TI poderá recolher estes dados. Declaração de Privacidade.

Obrigado pelo seu feedback!

×