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.

Este artigo aplica-se para o Microsoft Dynamics NAV para todos os países e todos os idiomas.

Sintomas

Suponha que defina aplicam-se por antiguidade como o Método de liquidação para um fornecedor no Microsoft Dynamics NAV 2009. E registar a nota de crédito e duas facturas, utilizando um diário. Como resultado, o sistema aplica-se a nota de crédito a ambas as facturas. Mais tarde, anular todos os documentos. Nesta situação, quando executa a função de transacção de reversão de linha de nota de crédito, o sistema cria movimentos de contabilidade desnecessários.

Este problema ocorre nos seguintes produtos:

  • Microsoft Dynamics NAV 2009

  • Microsoft Dynamics NAV 2009 R2


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. Altere o código na função InsertReversalEntry da tabela de entrada de inversão (179) do seguinte modo:
    Código existente 1

    ...CLEAR(DtldCustLedgEntry);
    DtldCustLedgEntry.SETCURRENTKEY("Transaction No.","Customer No.","Entry Type");
    DtldCustLedgEntry.SETRANGE(DtldCustLedgEntry."Transaction No.",CustLedgEntry."Transaction No.");
    DtldCustLedgEntry.SETRANGE(DtldCustLedgEntry."Customer No.",CustLedgEntry."Customer No.");
    DtldCustLedgEntry.SETFILTER(
    DtldCustLedgEntry."Entry Type",'<>%1',DtldCustLedgEntry."Entry Type"::"Initial Entry");

    // Delete the following line.
    IF DtldCustLedgEntry.FIND('-') THEN BEGIN
    // End of the deleted line.

    IF RevType = RevType::Register THEN
    ERROR(Text012,Number);

    // Delete the following lines.
    CLEAR(DtldCustLedgEntry);
    DtldCustLedgEntry.SETCURRENTKEY("Cust. Ledger Entry No.");
    DtldCustLedgEntry.SETRANGE("Cust. Ledger Entry No.",CustLedgEntry."Entry No.");
    DtldCustLedgEntry.SETRANGE(Unapplied,TRUE);
    IF DtldCustLedgEntry.FIND('-') THEN BEGIN
    REPEAT
    TempRevertTransactionNo.Number := DtldCustLedgEntry."Transaction No.";
    IF TempRevertTransactionNo.INSERT THEN;
    UNTIL DtldCustLedgEntry.NEXT = 0;
    END;
    END;
    // End of the deleted lines.

    UNTIL CustLedgEntry.NEXT = 0;

    IF VendLedgEntry.FIND('-') THEN
    REPEAT
    CLEAR(ReversalEntry);
    ...

    Código de substituição 1

    ...CLEAR(DtldCustLedgEntry);
    DtldCustLedgEntry.SETCURRENTKEY("Transaction No.","Customer No.","Entry Type");
    DtldCustLedgEntry.SETRANGE(DtldCustLedgEntry."Transaction No.",CustLedgEntry."Transaction No.");
    DtldCustLedgEntry.SETRANGE(DtldCustLedgEntry."Customer No.",CustLedgEntry."Customer No.");
    DtldCustLedgEntry.SETFILTER(
    DtldCustLedgEntry."Entry Type",'<>%1',DtldCustLedgEntry."Entry Type"::"Initial Entry");

    // Add the following line.
    IF NOT DtldCustLedgEntry.ISEMPTY THEN
    // End of the added line.

    IF RevType = RevType::Register THEN
    ERROR(Text012,Number);

    // Add the following line.
    CheckDtldCustLedgEntry(CustLedgEntry);
    // End of the added line.

    UNTIL CustLedgEntry.NEXT = 0;

    IF VendLedgEntry.FIND('-') THEN
    REPEAT
    CLEAR(ReversalEntry);
    ...

    Código existente 2

    ...CLEAR(DtldVendLedgEntry);
    DtldVendLedgEntry.SETCURRENTKEY("Transaction No.","Vendor No.","Entry Type");
    DtldVendLedgEntry.SETRANGE(DtldVendLedgEntry."Transaction No.",VendLedgEntry."Transaction No.");
    DtldVendLedgEntry.SETRANGE(DtldVendLedgEntry."Vendor No.",VendLedgEntry."Vendor No.");
    DtldVendLedgEntry.SETFILTER(
    DtldVendLedgEntry."Entry Type",'<>%1',DtldVendLedgEntry."Entry Type"::"Initial Entry");

    // Delete the following line.
    IF DtldVendLedgEntry.FIND('-') THEN BEGIN
    // End of the deleted line.

    IF RevType = RevType::Register THEN
    ERROR(Text012,Number);

    // Delete the following lines.
    CLEAR(DtldVendLedgEntry);
    DtldVendLedgEntry.SETCURRENTKEY("Vendor Ledger Entry No.");
    DtldVendLedgEntry.SETRANGE("Vendor Ledger Entry No.",VendLedgEntry."Entry No.");
    DtldVendLedgEntry.SETRANGE(Unapplied,TRUE);
    IF DtldVendLedgEntry.FIND('-') THEN BEGIN
    REPEAT
    TempRevertTransactionNo.Number := DtldVendLedgEntry."Transaction No.";
    IF TempRevertTransactionNo.INSERT THEN;
    UNTIL DtldVendLedgEntry.NEXT = 0;
    END;
    END;
    // End of the deleted lines.

    UNTIL VendLedgEntry.NEXT = 0;

    IF BankAccLedgEntry.FIND('-') THEN
    REPEAT
    CLEAR(ReversalEntry);
    ...

    Código de substituição 2

    ...CLEAR(DtldVendLedgEntry);
    DtldVendLedgEntry.SETCURRENTKEY("Transaction No.","Vendor No.","Entry Type");
    DtldVendLedgEntry.SETRANGE(DtldVendLedgEntry."Transaction No.",VendLedgEntry."Transaction No.");
    DtldVendLedgEntry.SETRANGE(DtldVendLedgEntry."Vendor No.",VendLedgEntry."Vendor No.");
    DtldVendLedgEntry.SETFILTER(
    DtldVendLedgEntry."Entry Type",'<>%1',DtldVendLedgEntry."Entry Type"::"Initial Entry");

    // Add the following line.
    IF NOT DtldVendLedgEntry.ISEMPTY THEN
    // End of the added line.

    IF RevType = RevType::Register THEN
    ERROR(Text012,Number);

    // Add the following line.
    CheckDtldVendLedgEntry(VendLedgEntry);
    // End of the added line.

    UNTIL VendLedgEntry.NEXT = 0;

    IF BankAccLedgEntry.FIND('-') THEN
    REPEAT
    CLEAR(ReversalEntry);
    ...
  2. Altere o código na função CheckDtldCustLedgEntry da tabela de entrada de inversão (179) do seguinte modo:
    Código existente

    ...LOCAL PROCEDURE CheckDtldCustLedgEntry@2(CustLedgEntry@1000 : Record 21) : Boolean;
    VAR
    DtldCustLedgEntry@1001 : Record 379;
    BEGIN

    // Delete the following lines.
    DtldCustLedgEntry.SETCURRENTKEY("Cust. Ledger Entry No.");
    DtldCustLedgEntry.SETRANGE("Cust. Ledger Entry No.",CustLedgEntry."Entry No.");
    IF DtldCustLedgEntry.FIND('-') THEN
    REPEAT
    IF (DtldCustLedgEntry."Entry Type" <> DtldCustLedgEntry."Entry Type"::"Initial Entry") AND
    (NOT DtldCustLedgEntry.Unapplied)
    THEN
    ERROR(
    Text000,CustLedgEntry.TABLECAPTION,CustLedgEntry."Entry No.");
    UNTIL DtldCustLedgEntry.NEXT = 0;
    // End of the deleted lines.

    END;
    ...

    Código de substituição

    ...LOCAL PROCEDURE CheckDtldCustLedgEntry@2(CustLedgEntry@1000 : Record 21) : Boolean;
    VAR
    DtldCustLedgEntry@1001 : Record 379;
    BEGIN

    // Add the following lines.
    DtldCustLedgEntry.SETCURRENTKEY("Cust. Ledger Entry No.","Entry Type");
    DtldCustLedgEntry.SETRANGE("Cust. Ledger Entry No.",CustLedgEntry."Entry No.");
    DtldCustLedgEntry.SETFILTER("Entry Type",'<>%1',DtldCustLedgEntry."Entry Type"::"Initial Entry");
    DtldCustLedgEntry.SETRANGE(Unapplied,FALSE);
    IF NOT DtldCustLedgEntry.ISEMPTY THEN
    ERROR(Text000,CustLedgEntry.TABLECAPTION,CustLedgEntry."Entry No.");
    // End of the added lines.

    END;
    ...
  3. Altere o código na função CheckDtldVendLedgEntry da tabela de entrada de inversão (179) do seguinte modo:
    Código existente

    ...LOCAL PROCEDURE CheckDtldVendLedgEntry@28(VendLedgEntry@1000 : Record 25) : Boolean;
    VAR
    DtldVendLedgEntry@1001 : Record 380;
    BEGIN

    // Delete the following lines.
    DtldVendLedgEntry.SETCURRENTKEY("Vendor Ledger Entry No.");
    DtldVendLedgEntry.SETRANGE("Vendor Ledger Entry No.",VendLedgEntry."Entry No.");
    IF DtldVendLedgEntry.FIND('-') THEN
    REPEAT
    IF (DtldVendLedgEntry."Entry Type" <> DtldVendLedgEntry."Entry Type"::"Initial Entry") AND
    (NOT DtldVendLedgEntry.Unapplied)
    THEN
    ERROR(
    Text000,VendLedgEntry.TABLECAPTION,VendLedgEntry."Entry No.");
    UNTIL DtldVendLedgEntry.NEXT = 0;
    // End of the deleted lines.

    END;
    ...

    Código de substituição

    ...LOCAL PROCEDURE CheckDtldVendLedgEntry@28(VendLedgEntry@1000 : Record 25) : Boolean;
    VAR
    DtldVendLedgEntry@1001 : Record 380;
    BEGIN

    // Add the following lines.
    DtldVendLedgEntry.SETCURRENTKEY("Vendor Ledger Entry No.","Entry Type");
    DtldVendLedgEntry.SETRANGE("Vendor Ledger Entry No.",VendLedgEntry."Entry No.");
    DtldVendLedgEntry.SETFILTER("Entry Type",'<>%1',DtldVendLedgEntry."Entry Type"::"Initial Entry");
    DtldVendLedgEntry.SETRANGE(Unapplied,FALSE);
    IF NOT DtldVendLedgEntry.ISEMPTY THEN
    ERROR(Text000,VendLedgEntry.TABLECAPTION,VendLedgEntry."Entry No.");
    // End of the added lines.

    END;
    ...


Pré-requisitos

Tem de ter o Microsoft Dynamics NAV 2009 instalado para aplicar esta correcção.

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!

×