Aplica-se a
Dynamics NAV 2009

Sintomas

As bases e os valores incorretamente são agrupados para a mesma porcentagem de IVA e período na declaração 340 à vista de IVA envolvida na versão espanhola do Microsoft Dynamics NAV 2009.O mesmo cenário com IVA normal funciona conforme o esperado, separando cada fatura, independentemente de terem a mesma porcentagem de IVA. Siga as etapas na seção alterações de código para resolver o problema. Esse problema ocorre nos seguintes produtos:

  • A versão em espanhol do Microsoft Dynamics NAV 2009 R2

  • A versão em espanhol do Microsoft Dynamics NAV 2009 SP1

Resolução

Informações sobre o hotfix

Um hotfix suportado está disponível agora na Microsoft. No entanto, apenas destina-se a corrigir o problema descrito neste artigo. Aplique-o somente aos sistemas que apresentarem esse problema específico. Esta correção poderá ser submetida a testes adicionais. Portanto, se esse problema não o prejudicar, 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 alguns casos, as taxas cobradas para suporte a chamadas podem ser canceladas se um profissional de suporte técnico do Microsoft Dynamics e produtos relacionados determina que uma atualização específica resolverá o problema. Os custos normais de suporte serão aplicados para questões de suporte adicionais e problemas que não se qualificam à atualização específica em questão.

Informações sobre a instalação

A Microsoft fornece exemplos de programação somente para ilustração, sem garantia expressa ou implícita. Isso inclui, mas não está limitado a, garantias implícitas de comercialização ou adequação a um propósito específico. Este artigo presume que você esteja familiarizado com a linguagem de programação que está sendo demonstrada e com as ferramentas usadas para criar e depurar procedimentos. Os engenheiros de suporte da Microsoft podem ajudar a explicar a funcionalidade de um determinado procedimento. No entanto, eles não modificarão esses exemplos para fornecer funcionalidades adicionais ou construir procedimentos para atender às suas necessidades específicas.Observação: Antes de instalar esse hotfix, verifique se todos os usuários do cliente do Microsoft Dynamics NAV estiver desconectados do sistema. Isso inclui os serviços do Microsoft Dynamics NAV Application Server (NAS). Você deve ser o único usuário do cliente conectado ao implementar esse hotfix.Para implementar esse hotfix, você deve ter uma licença de desenvolvedor.É recomendável que a conta de usuário na janela de Logins do Windows ou na janela banco de dados seja atribuída a ID de função "SUPER". Se a conta de usuário não pode ser atribuída a ID de função "SUPER", você deverá verificar se a conta de usuário tem as seguintes permissões:

  • A permissão Modificar para o objeto que será alterado.

  • A permissão de execução para o objeto 5210 de identificação de objeto de sistema e o sistema 9015 de identificação de objetoobjeto.

Observação: Você não precisa ter direitos para os armazenamentos de dados, a menos que você precise executar o reparo de dados.

Alterações de código

Observação: Sempre teste código correções em um ambiente controlado antes de aplicar as correções para os computadores de produção.Para resolver esse problema, execute as seguintes etapas:

  1. Altere o código no relatório de fazer declaração 340 (10743) da seguinte forma:1 de código existente

    ...   END;                      END;// Delete the following line.OnAfterGetRecord=BEGIN// End of the deleted line.                           OperationCode := GetOperationCode(VATEntry2);                           VATBuffer."VAT %" := "VAT %";...

    1 código de substituição

    ... END;                      END;// Add the following lines.OnAfterGetRecord=VARVendLedgEntryAppl@1100000 : Record 25;NewEntry@1100001 : Boolean;BEGIN// End of the added lines.                           OperationCode := GetOperationCode(VATEntry2);                           VATBuffer."VAT %" := "VAT %";...

    2 de código existente

    ... VATBuffer.Amount := Amount;                             END;                             VATBuffer.INSERT;// Delete the following lines.IF Type = VATEntry.Type::Purchase THEN BEGINVATEntryTemporary := VATEntry2;VATEntryTemporary.INSERT;END;END;// End of the deleted lines.                         END;        TotalFields=Base,Amount;...

    Código de substituição 2

    ...VATBuffer.Amount := Amount;                             END;                             VATBuffer.INSERT;// Add the following lines.END;IF Type = VATEntry.Type::Purchase THENIF HasBeenRealized("Entry No.") OR ("Unrealized VAT Entry No." <> 0) THEN BEGINNewEntry := 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 BEGINVATEntryTemporary.Base += Base;VATEntryTemporary.Amount += Amount;VATEntryTemporary.MODIFY;END ELSE BEGINVATEntryTemporary := VATEntry2;VATEntryTemporary.INSERT;END;END ELSE BEGINVATEntryTemporary := VATEntry2;VATEntryTemporary.INSERT;END;// End of the added lines.                         END;        TotalFields=Base,Amount;...

    3 de código existente

    ...  DataItemVarName=<Integer2>;        OnPreDataItem=BEGIN                        VATBuffer.FIND('-');                       VATEntryTemporary.SETCURRENTKEY("VAT %","EC %");                        IF VATEntryTemporary.FINDFIRST THEN;                        CurrReport.CREATETOTALS(VATBuffer2.Base,VATBuffer2.Amount);                        Fin := FALSE;...

    Código de substituição 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;...

    4 de código existente

    ...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 de substituição 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;REPEATRecordTypePurchase(VATEntryTemporary);UNTIL VATEntryTemporary.NEXT = 0;// End of the added lines.                           END;                           Fin := VATBuffer.NEXT = 0;                         END;...
  2. Altere o código em variáveis globais no relatório fazer declaração 340 (10743) da seguinte forma: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 substituição

    ...  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];...
  3. Altere o código da função RecordTypePurchase no relatório fazer declaração 340 (10743) da seguinte forma: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 BEGINUnrealizedVATEntryNo := VATEntryRec."Unrealized VAT Entry No.";DocumentDate := VATEntryRec."Posting Date";IF UnrealizedVATEntryNo <> 0 THEN BEGINUnrealizedVATEntry.GET(UnrealizedVATEntryNo);OperationDateText := FormatDate(UnrealizedVATEntry."Posting Date");DocumentDate := UnrealizedVATEntry."Document Date";// End of the deleted lines.        END;      END ELSE        UnrealizedVATEntryNo := 0;...

    Código de substituição

    ... 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 BEGINUnrealizedVATEntryNo := VATEntryTemporary."Unrealized VAT Entry No.";DocumentDate := VATEntryTemporary."Posting Date";IF UnrealizedVATEntryNo <> 0 THEN BEGINUnrealizedVATEntry.GET(UnrealizedVATEntryNo);OperationDateText := FormatDate(UnrealizedVATEntry."Posting Date");DocumentDate := UnrealizedVATEntry."Document Date";IF FindPmtOrderBillGrBankAcc(VATEntry.Type,VATEntry."Document No.") = '' THEN BEGINVendorDocumentNo := UnrealizedVATEntry."External Document No.";VATBuffer2.Base := VATEntryTemporary.Base;VATBuffer2.Amount := VATEntryTemporary.Amount;END;// End of the added lines.        END;      END ELSE        UnrealizedVATEntryNo := 0;...
  4. Altere o código da função CheckVLEApplication no relatório fazer declaração 340 (10743) da seguinte forma:Código existente

    ...  PrevDeclarationNumEnable := ReplaceDeclaration;    END;    BEGIN    END.  }...

    Código de substituição

    ...PrevDeclarationNumEnable := ReplaceDeclaration;    END;// Add the following lines.LOCAL PROCEDURE CheckVLEApplication@1100074(VATEntry@1100000 : Record 254) : Boolean;VARVendorLedgerEntry@1100001 : Record 25;DtldVendLedgEntry@1100002 : Record 380;CheckVendLedgEntry@1100003 : Record 25;UnrealizedVendLedgEntry@1100004 : Integer;BEGINFilterVendLedgerEntryByVATEntry(VendorLedgerEntry,VATEntry);UnrealizedVendLedgEntry := GetUnrealizedInvoiceVLENo(VATEntry."Unrealized VAT Entry No.");IF VendorLedgerEntry.FINDSET THENREPEATDtldVendLedgEntry.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 THENDtldVendLedgEntry.SETRANGE("Vendor Ledger Entry No.",UnrealizedVendLedgEntry);IF DtldVendLedgEntry.FINDSET THENREPEATIF (DtldVendLedgEntry."Vendor Ledger Entry No." <> DtldVendLedgEntry."Applied Vend. Ledger Entry No.") ANDCheckVendLedgEntry.GET(DtldVendLedgEntry."Vendor Ledger Entry No.")THEN BEGINIF ExistDtldVLE(DtldVendLedgEntry."Vendor Ledger Entry No.",DtldVendLedgEntry."Applied Vend. Ledger Entry No.") THENEXIT(FALSE);InsertTempDtldVLE(DtldVendLedgEntry."Vendor Ledger Entry No.",DtldVendLedgEntry."Applied Vend. Ledger Entry No.");EXIT(TRUE);END;UNTIL DtldVendLedgEntry.NEXT = 0ELSE BEGINDtldVendLedgEntry.SETRANGE("Applied Vend. Ledger Entry No.");DtldVendLedgEntry.SETRANGE("Vendor Ledger Entry No.",VendorLedgerEntry."Entry No.");IF UnrealizedVendLedgEntry <> 0 THENDtldVendLedgEntry.SETRANGE("Applied Vend. Ledger Entry No.",UnrealizedVendLedgEntry);IF DtldVendLedgEntry.FINDSET THENREPEATIF CheckVendLedgEntry.GET(DtldVendLedgEntry."Applied Vend. Ledger Entry No.") THEN BEGINIF ExistDtldVLE(DtldVendLedgEntry."Applied Vend. Ledger Entry No.",DtldVendLedgEntry."Vendor Ledger Entry No.") THENEXIT(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;VARVATEntry@1100002 : Record 254;VendLedgEntry@1100001 : Record 25;BEGINIF NOT VATEntry.GET(VATEntryNo) THENEXIT(0);FilterVendLedgerEntryByVATEntry(VendLedgEntry,VATEntry);IF VendLedgEntry.FINDFIRST THENEXIT(VendLedgEntry."Entry No.");EXIT(0);END;LOCAL PROCEDURE FilterVendLedgerEntryByVATEntry@1100087(VAR VendLedgEntry@1100001 : Record 25;VATEntry@1100000 : Record 254);BEGINVendLedgEntry.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;VARUnrealizedVATEntry@1100001 : Record 254;BEGINUnrealizedVATEntry.SETRANGE("Unrealized VAT Entry No.",VATEntryNo);EXIT(NOT UnrealizedVATEntry.ISEMPTY);END;LOCAL PROCEDURE ExistDtldVLE@1100195(VLENo@1100001 : Integer;AppliedVLENo@1100000 : Integer) : Boolean;BEGINTempDtldVendLedgerEntry.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);BEGINTempDtldVendLedgerEntry.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.  }...

Pré-requisitos:

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

  • A versão em espanhol do Microsoft Dynamics NAV 2009 R2

  • A versão em espanhol do Microsoft Dynamics NAV 2009 SP1

Informações sobre remoção

Você não pode remover esse hotfix.

Status

A Microsoft confirma que este é um problema em seus produtos listados na seção "Aplica-se a".

Observação: Este é um artigo de "PUBLICAÇÃO RÁPIDA" criado diretamente de dentro da organização de suporte da Microsoft. As informações contidas neste documento são fornecidas desta maneira, em resposta a problemas emergentes. Como um dos resultados da velocidade da publicação, os materiais podem incluir erros tipográficos e podem ser revisados a qualquer momento sem aviso prévio. Consulte os Termos de usopara outras considerações.

Precisa de mais ajuda?

Quer mais opções

Explore os benefícios da assinatura, procure cursos de treinamento, saiba como proteger seu dispositivo e muito mais.