Algumas entradas da contabilidade são lançadas incorretamente quando você lança um diário de recebimento de caixa com uma fatura e uma fatura rejeitada ao mesmo tempo na versão em português do Microsoft Dynamics NAV 2009

Aplica-se A
Dynamics NAV 2009

Este artigo aplica-se ao Microsoft Dynamics NAV para a região do idioma português (pt).

Sintomas

Quando você lança um diário de recebimento de caixa com uma fatura e uma fatura rejeitada ao mesmo tempo na versão em português do Microsoft Dynamics NAV 2009, todas as entradas contábeis lançadas são lançadas usando a Conta de Recibos Rejeitados. No entanto, a Conta de Recebíveis deve ser usada para a fatura e a Conta de Faturas Rejeitadas deve ser usada para o documento rejeitado. Esse problema ocorre nos seguintes produtos:

  • A versão em português do Microsoft Dynamics NAV 2009 R2
  • A versão portuguesa do Microsoft Dynamics NAV 2009 Service Pack 1

Resolução

Informações sobre o hotfix

Uma correção suportada está agora disponível na Microsoft. No entanto, destina-se apenas a corrigir o problema descrito neste artigo. Aplique-o apenas aos sistemas que estão enfrentando esse problema específico. Esse hotfix pode receber testes adicionais. Portanto, se você não tiver sido gravemente afetado por esse problema, recomendamos que você aguarde o próximo service pack do Microsoft Dynamics NAV 2009 ou a próxima versão do Microsoft Dynamics NAV que contém esse hotfix.

Observação Em casos especiais, os custos normalmente incorridos para chamadas de suporte podem ser cancelados se um profissional de suporte técnico para Microsoft Dynamics e produtos relacionados determinar que uma atualização específica resolverá o problema. Os custos normais do suporte serão aplicados a problemas e questões de suporte adicionais que não sejam qualificáveis para a atualização específica em questão.

          

Informações de instalação

A Microsoft fornece exemplos de programação apenas para ilustração, sem garantia expressa ou implícita. Isto inclui, mas não se limita às garantias implícitas de comercialização ou adequação a um fim específico. Este artigo parte do princípio de que está familiarizado com a linguagem de programação que está a ser demonstrada e com as ferramentas utilizadas para criar e depurar procedimentos. Os engenheiros de suporte da Microsoft podem ajudar a explicar a funcionalidade de um determinado procedimento. No entanto, não modificarão estes exemplos para fornecer funcionalidades adicionais ou construir procedimentos para cumprir os seus requisitos específicos.

Observação Antes de instalar esse hotfix, verifique se todos os usuários do cliente Microsoft Navision estão desconectados do sistema. Isto inclui os utilizadores clientes do Microsoft Navision Application Services (NAS). Você deve ser o único usuário cliente que está conectado quando você implementa esse hotfix.

Para implementar esse hotfix, você deve ter uma licença de desenvolvedor.

Recomendamos que a conta de usuário na janela Logins do Windows ou na janela Logins do Banco de Dados receba o ID de função "SUPER". Se não for possível atribuir à conta de utilizador o ID de função "SUPER", tem de verificar se a conta de utilizador tem as seguintes permissões:

  • A permissão Modificar do objeto que irá alterar.
  • A permissão de execução para o objeto ID 5210 do objeto System Object e para o objeto System Object ID 9015.

                
Observação Você não precisa ter direitos sobre os armazenamentos de dados, a menos que tenha que executar o reparo de dados.

Alterações de código

Observação Sempre teste correções de código em um ambiente controlado antes de aplicar as correções aos computadores de produção.
Para resolver esse problema, altere o código no Gen. Jnl.-Unidade de código da linha postal (12) . Para fazê-lo, siga estes passos:

  1. Adicione a seguinte variável global:

    TempRejCustLedgEntry@1100047 : TEMPORARY Record 21;
    
  2. Altere o código na função PostCust da seguinte maneira:
    Código existente 1

    ...
              DiscRiskFactAmountLCY := 0;
              DiscUnriskFactAmountLCY := 0;
              CollFactAmountLCY := 0;
            //--------
    
              IF Cust."No." <> "Account No." THEN
                Cust.GET("Account No.");
              Cust.CheckBlockedCustOnJnls(Cust,"Document Type",TRUE);
    
              IF "Posting Group" = '' THEN BEGIN
    ...
    
    

    Código de substituição 1

    ...
              DiscRiskFactAmountLCY := 0;
              DiscUnriskFactAmountLCY := 0;
              CollFactAmountLCY := 0;
            //--------
    
    // Add the following lines. 
             TempRejCustLedgEntry.RESET;
             TempRejCustLedgEntry.DELETEALL;
    // End of the lines.
    
              IF Cust."No." <> "Account No." THEN
                Cust.GET("Account No.");
              Cust.CheckBlockedCustOnJnls(Cust,"Document Type",TRUE);
    
              IF "Posting Group" = '' THEN BEGIN
    ...
    
    

    Código 2 existente

    ...
                END;
    
              // Post the application
              ApplyCustLedgEntry(
                CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,GLSetup."Appln. Rounding Precision");
    
    // Delete the following lines.
             IF GenJnlLine."Applies-to Doc. Type" = GenJnlLine."Applies-to Doc. Type"::" " THEN
               GenJnlLine."Applies-to Doc. Type" := AppliesToDocType;
    // End of the lines.
    
              IF AppManagement.AccessToCartera AND NOT GenJnlLine.Prepayment THEN BEGIN
                IF "Document Type" = "Document Type"::Bill THEN BEGIN
                  DocPost.CreateReceivableDoc(GenJnlLine,CVLedgEntryBuf);
                  CustLedgEntry."Document Situation" := CustLedgEntry."Document Situation"::Cartera;
    ...
    
    

    Código de substituição 2

    ...
                END;
    
              // Post the application
              ApplyCustLedgEntry(
                CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,GLSetup."Appln. Rounding Precision");
    
    // Add the following lines.
             IF ("Applies-to ID" = '') AND ("Applies-to Doc. Type" = "Applies-to Doc. Type"::" ") THEN
               "Applies-to Doc. Type" := AppliesToDocType;
    // End of the lines.
    
              IF AppManagement.AccessToCartera AND NOT GenJnlLine.Prepayment THEN BEGIN
                IF "Document Type" = "Document Type"::Bill THEN BEGIN
                  DocPost.CreateReceivableDoc(GenJnlLine,CVLedgEntryBuf);
                  CustLedgEntry."Document Situation" := CustLedgEntry."Document Situation"::Cartera;
    ...
    
    
  3. Altere o código na função PostVend da seguinte maneira:
    Código existente

    ...
              // Post the application
              ApplyVendLedgEntry(
                CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,
                GLSetup."Appln. Rounding Precision");
    
    // Delete the following lines.
             IF GenJnlLine."Applies-to Doc. Type" = GenJnlLine."Applies-to Doc. Type"::" " THEN
               GenJnlLine."Applies-to Doc. Type" := AppliesToDocType;
    // End of the lines.
    
              IF AppManagement.AccessToCartera AND NOT GenJnlLine.Prepayment THEN BEGIN
                IF "Document Type" = "Document Type"::Bill THEN BEGIN
                  DocPost.CreatePayableDoc(GenJnlLine,CVLedgEntryBuf);
                  VendLedgEntry."Document Situation" := VendLedgEntry."Document Situation"::Cartera;
    ...
    
    

    Código de substituição

    ...
              // Post the application
              ApplyVendLedgEntry(
                CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,
                GLSetup."Appln. Rounding Precision");
    
    // Add the following lines.
             IF ("Applies-to ID" = '') AND ("Applies-to Doc. Type" = "Applies-to Doc. Type"::" ") THEN
               "Applies-to Doc. Type" := AppliesToDocType;
    // End of the lines.
    
              IF AppManagement.AccessToCartera AND NOT GenJnlLine.Prepayment THEN BEGIN
                IF "Document Type" = "Document Type"::Bill THEN BEGIN
                  DocPost.CreatePayableDoc(GenJnlLine,CVLedgEntryBuf);
                  VendLedgEntry."Document Situation" := VendLedgEntry."Document Situation"::Cartera;
    ...
    
    
  4. Altere o código na função ApplyCustLedgEntry da seguinte maneira:
    Código existente

    ...
                    OldCustLedgEntry."Document Situation"::"Closed Documents",
                    OldCustLedgEntry."Document Situation"::"Closed BG/PO"]) THEN
                    FromClosedDoc := TRUE
                  ELSE
                    FromClosedDoc := FALSE;
                  DocPost.UpdateReceivableDoc(
                    OldCustLedgEntry,GenJnlLine,AppliedAmountLCY + DeltaUnrealAmount + DeltaAmountLCY,
                    DocAmountLCY,RejDocAmountLCY,DiscDocAmountLCY,CollDocAmountLCY,
                    DiscRiskFactAmountLCY,DiscUnriskFactAmountLCY,CollFactAmountLCY);
                END;
    ...
    
    

    Código de substituição

    ...
                    OldCustLedgEntry."Document Situation"::"Closed Documents",
                    OldCustLedgEntry."Document Situation"::"Closed BG/PO"]) THEN
                    FromClosedDoc := TRUE
                  ELSE
                    FromClosedDoc := FALSE;
    
    // Add the following lines.
                 IF OldCustLedgEntry."Document Status" = OldCustLedgEntry."Document Status"::Rejected THEN BEGIN
                   TempRejCustLedgEntry := OldCustLedgEntry;
                   TempRejCustLedgEntry."Remaining Amount (LCY) stats." := AppliedAmountLCY + DeltaUnrealAmount + DeltaAmountLCY;
                   TempRejCustLedgEntry.INSERT;
                 END;
    // End of the lines.
    
                  DocPost.UpdateReceivableDoc(
                    OldCustLedgEntry,GenJnlLine,AppliedAmountLCY + DeltaUnrealAmount + DeltaAmountLCY,
                    DocAmountLCY,RejDocAmountLCY,DiscDocAmountLCY,CollDocAmountLCY,
                    DiscRiskFactAmountLCY,DiscUnriskFactAmountLCY,CollFactAmountLCY);
                END;
    ...
    
    
  5. Altere o código na função PostDtldCustLedgEntries da seguinte maneira:
    Código existente

    ...
                  AccNo := CustPostingGr."Bills Account";
                END ELSE BEGIN
                  CustPostingGr.TESTFIELD("Receivables Account");
                  AccNo := CustPostingGr."Receivables Account";
                END;
    
    // Delete the following lines.
               IF DiscDocAmountLCY <> 0 THEN BEGIN
                 CustPostingGr.TESTFIELD("Discted. Bills Acc.");
                 AccNo := CustPostingGr."Discted. Bills Acc.";
               END;
               IF CollDocAmountLCY <> 0 THEN BEGIN
                 CustPostingGr.TESTFIELD("Bills on Collection Acc.");
                 AccNo := CustPostingGr."Bills on Collection Acc.";
               END;
               IF RejDocAmountLCY <> 0 THEN BEGIN
                 CASE GenJnlLine."Applies-to Doc. Type" OF
                   GenJnlLine."Applies-to Doc. Type"::Bill:
                     BEGIN
                       CustPostingGr.TESTFIELD("Rejected Bills Acc.");
                       AccNo := CustPostingGr."Rejected Bills Acc.";
                     END;
                   GenJnlLine."Applies-to Doc. Type"::Invoice:
                     BEGIN
                       CustPostingGr.TESTFIELD("Rejected Factoring Acc.");
                       AccNo := CustPostingGr."Rejected Factoring Acc.";
                     END;
                   ELSE
                     IF (GenJnlLine."Document Type" IN [GenJnlLine."Document Type"::"Credit Memo",GenJnlLine."Document Type"::Payment]) AND
                       (OldCVLedgEntryBuf4."Applies-to ID" <> '') THEN BEGIN
                       CASE OldCVLedgEntryBuf4."Document Type" OF
                         OldCVLedgEntryBuf4."Document Type"::Bill:
                           BEGIN
                             CustPostingGr.TESTFIELD("Receivables Account");
                             AccNo := CustPostingGr."Receivables Account";
                           END;
                         OldCVLedgEntryBuf4."Document Type"::Invoice:
                           BEGIN
                             CustPostingGr.TESTFIELD("Receivables Account");
                             AccNo := CustPostingGr."Receivables Account";
                           END;
                       END;
                     END;
                 END;
               END;
               IF (DiscRiskFactAmountLCY <> 0) OR (DiscUnriskFactAmountLCY <> 0) THEN BEGIN
                 CustPostingGr.TESTFIELD("Factoring for Discount Acc.");
                 AccNo := CustPostingGr."Factoring for Discount Acc.";
               END;
               IF CollFactAmountLCY <> 0 THEN BEGIN
                 CustPostingGr.TESTFIELD("Factoring for Collection Acc.");
                 AccNo := CustPostingGr."Factoring for Collection Acc.";
               END;
    // End of the lines.
    
                ReceivableAccAmtLCY :=
                  TotalAmountLCY -
                  (DocAmountLCY + DiscDocAmountLCY +
                   CollDocAmountLCY + RejDocAmountLCY + DiscRiskFactAmountLCY +
    ...
    
    

    Código de substituição

    ...
                  AccNo := CustPostingGr."Bills Account";
                END ELSE BEGIN
                  CustPostingGr.TESTFIELD("Receivables Account");
                  AccNo := CustPostingGr."Receivables Account";
                END;
    
                ReceivableAccAmtLCY :=
                  TotalAmountLCY -
                  (DocAmountLCY + DiscDocAmountLCY +
                   CollDocAmountLCY + RejDocAmountLCY + DiscRiskFactAmountLCY +
    ...
    
    
  6. Altere o código na função PostReceivableDocs da seguinte forma:
    Código existente

    ...
              GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
              GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
              InsertGLEntry(TRUE);
            END;
            IF RejDocAmountLCY <> 0 THEN BEGIN
    
    // Delete the following lines.
             CASE GenJnlLine."Applies-to Doc. Type" OF
               GenJnlLine."Applies-to Doc. Type"::Bill:
                 BEGIN
                   CustPostingGr.TESTFIELD("Rejected Bills Acc.");
                   InitGLEntry(CustPostingGr."Rejected Bills Acc.",RejDocAmountLCY,DocAmtCalcAddCurrency(RejDocAmountLCY),TRUE,TRUE);
                   GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
                   GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
                   InsertGLEntry(TRUE);
                 END;
               GenJnlLine."Applies-to Doc. Type"::Invoice:
                 BEGIN
                   CustPostingGr.TESTFIELD("Rejected Factoring Acc.");
                   InitGLEntry(CustPostingGr."Rejected Factoring Acc.",RejDocAmountLCY,DocAmtCalcAddCurrency(RejDocAmountLCY),TRUE,TRUE);
                   GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
                   GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
                   InsertGLEntry(TRUE);
                 END;
               ELSE
                 IF (GenJnlLine."Document Type" IN [GenJnlLine."Document Type"::"Credit Memo",GenJnlLine."Document Type"::Payment]) AND
                   (OldCVLedgEntryBuf4."Applies-to ID" <> '') THEN BEGIN
                   CASE OldCVLedgEntryBuf4."Document Type" OF
                     OldCVLedgEntryBuf4."Document Type"::Bill:
                       BEGIN
                         CustPostingGr.TESTFIELD("Rejected Bills Acc.");
                         InitGLEntry(CustPostingGr."Rejected Bills Acc.",RejDocAmountLCY,DocAmtCalcAddCurrency(RejDocAmountLCY),TRUE,TRUE);
                         GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
                         GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
                         InsertGLEntry(TRUE);
                       END;
                     OldCVLedgEntryBuf4."Document Type"::Invoice:
                       BEGIN
                         CustPostingGr.TESTFIELD("Rejected Factoring Acc.");
                         InitGLEntry(CustPostingGr."Rejected Factoring Acc.",RejDocAmountLCY,DocAmtCalcAddCurrency(RejDocAmountLCY),TRUE,TRUE
           );
    
                         GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
                         GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
                         InsertGLEntry(TRUE);
                       END;
                   END;
                 END;
    // End of the lines.
    
              END;
            END;
            IF DiscRiskFactAmountLCY <> 0 THEN BEGIN
              CustPostingGr.TESTFIELD("Factoring for Discount Acc.");
              InitGLEntry(CustPostingGr."Factoring for Discount Acc.",
    ...
    
    

    Código de substituição

    ...
              GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
              GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
              InsertGLEntry(TRUE);
            END;
            IF RejDocAmountLCY <> 0 THEN BEGIN
    
    // Add the following lines.
             WITH TempRejCustLedgEntry DO BEGIN
               RESET;
               SETCURRENTKEY("Customer No.","Document Type","Document Situation","Document Status");
               SETRANGE("Document Type","Document Type"::Bill);
               CALCSUMS("Remaining Amount (LCY) stats.");
               IF "Remaining Amount (LCY) stats." <> 0 THEN BEGIN
                 CustPostingGr.TESTFIELD("Rejected Bills Acc.");
                 InitGLEntry(
                   CustPostingGr."Rejected Bills Acc.","Remaining Amount (LCY) stats.",
                   DocAmtCalcAddCurrency("Remaining Amount (LCY) stats."),TRUE,TRUE);
                 GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
                 GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
                 InsertGLEntry(TRUE);
               END;
               SETRANGE("Document Type","Document Type"::Invoice);
               CALCSUMS("Remaining Amount (LCY) stats.");
               IF "Remaining Amount (LCY) stats." <> 0 THEN BEGIN
                 CustPostingGr.TESTFIELD("Rejected Factoring Acc.");
                 InitGLEntry(
                   CustPostingGr."Rejected Factoring Acc.","Remaining Amount (LCY) stats.",
                   DocAmtCalcAddCurrency("Remaining Amount (LCY) stats."),TRUE,TRUE);
                 GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
                 GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
                 InsertGLEntry(TRUE);
               END;
    // End of the lines.
    
              END;
            END;
            IF DiscRiskFactAmountLCY <> 0 THEN BEGIN
              CustPostingGr.TESTFIELD("Factoring for Discount Acc.");
              InitGLEntry(CustPostingGr."Factoring for Discount Acc.",
    ...
    
    

Pré-requisitos

Você deve ter um dos seguintes produtos instalados para aplicar esse hotfix:

  • A versão em português do Microsoft Dynamics NAV 2009 R2
  • A versão portuguesa do Microsoft Dynamics NAV 2009 Service Pack 1

Informações sobre remoção

Não é possível remover esse hotfix.

Estado

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

Nota: Este é um artigo de "PUBLICAÇÃO RÁPIDA", criado diretamente pela organização de suporte da Microsoft. As informações contidas no presente documento são fornecidas tal como estão em resposta a problemas emergentes. Em consequência da velocidade de disponibilização, os materiais poderão conter erros tipográficos e poderão ser revistos a qualquer momento, sem aviso antecipado. Consulte os Termos de Utilização para obter informações sobre outras considerações.