O mapa de "Declaração de fornecedor" mostra um valor incorrecto quando uma factura for liquidada por um pagamento em que os descontos de pagamento foi deduzido na versão portuguesa do Microsoft Dynamics NAV 2009. O valor de desconto de pagamento é apresentado como o saldo total. Siga os passos na secção de alterações de código para resolver este problema. Este problema ocorre no seguinte produto:
-
A versão portuguesa do Microsoft Dynamics NAV 2009 R2
-
A versão portuguesa 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 testar sempre correções de código num ambiente controlado antes de aplicar as correcções para os computadores de produção. Antes de aplicar a alteração, volte a importar todas as actualizações SEPA.
Para resolver este problema, siga estes passos:-
Altere o código no 1 do número de Item de dados no relatório de declaração de fornecedor (13377) do seguinte modo:
Código existente 1... Currency2.INSERT;
UNTIL Currency.NEXT = 0; END; // Delete the following line. OnAfterGetRecord=BEGIN // End of the deleted line. CurrReport.LANGUAGE := Language.GetLanguageID("Language Code"); PrintLine := FALSE; Vend2 := Vendor; COPYFILTER("Currency Filter",Currency2.Code); ...Código de substituição 1
... Currency2.INSERT;
UNTIL Currency.NEXT = 0; END; // Add the following lines. OnAfterGetRecord=VAR VendLedgEntry@1000 : Record 25; BEGIN // End of the added lines. CurrReport.LANGUAGE := Language.GetLanguageID("Language Code"); PrintLine := FALSE; Vend2 := Vendor; COPYFILTER("Currency Filter",Currency2.Code); ...Código existente 2
...PrintLine := Vend2."Net Change" <> 0;
UNTIL (Currency2.NEXT = 0) OR PrintLine; END; IF (NOT PrintLine) AND PrintAllHavingEntry THEN BEGIN // Delete the following lines. "Vendor Ledger Entry".RESET; "Vendor Ledger Entry".SETCURRENTKEY("Vendor No.","Posting Date"); "Vendor Ledger Entry".SETRANGE("Vendor No.",Vendor."No."); "Vendor Ledger Entry".SETRANGE("Posting Date",StartDate,EndDate); Vendor.COPYFILTER("Currency Filter","Vendor Ledger Entry"."Currency Code"); PrintLine := "Vendor Ledger Entry".FIND('-'); // End of the deleted lines. END; IF NOT PrintLine THEN CurrReport.SKIP; ...Código de substituição 2
... PrintLine := Vend2."Net Change" <> 0;
UNTIL (Currency2.NEXT = 0) OR PrintLine; END; IF (NOT PrintLine) AND PrintAllHavingEntry THEN BEGIN // Add the following lines. VendLedgEntry.SETCURRENTKEY("Vendor No.","Posting Date"); VendLedgEntry.SETRANGE("Vendor No.",Vendor."No."); VendLedgEntry.SETRANGE("Posting Date",StartDate,EndDate); Vendor.COPYFILTER("Currency Filter",VendLedgEntry."Currency Code"); PrintLine := NOT VendLedgEntry.ISEMPTY; // End of the added lines. END; IF NOT PrintLine THEN CurrReport.SKIP; ... -
Altere o código no 4 do número de Item de dados no relatório de declaração de fornecedor (13377) do seguinte modo:
Código existente 1... }
{ PROPERTIES { DataItemIndent=3; // Delete the following lines. DataItemTable=Table25; DataItemTableView=SORTING(Vendor No.,Posting Date); OnPreDataItem=BEGIN SETRANGE("Posting Date",StartDate,EndDate); SETRANGE("Currency Code",Currency2.Code); CurrReport.CREATETOTALS("Remaining Amount"); // End of the deleted lines. IF Currency2.Code = '' THEN BEGIN GLSetup.TESTFIELD("LCY Code"); CurrencyCode3 := GLSetup."LCY Code" END ELSE ...Código de substituição 1
... }
{ PROPERTIES { DataItemIndent=3; // Add the following lines. DataItemTable=Table2000000026; DataItemTableView=SORTING(Number) WHERE(Number=CONST(1)); DataItemVarName=VendLedEntryHdr; PrintOnlyIfDetail=Yes; } SECTIONS { } } { PROPERTIES { DataItemIndent=4; DataItemTable=Table380; DataItemTableView=SORTING(Vendor No.,Posting Date,Entry Type,Currency Code) WHERE(Excluded from calculation=CONST(No), Entry Type=FILTER(<>Application&<>Redrawal)); DataItemVarName=DtldVendLedgEntry; PrintOnlyIfDetail=No; OnPreDataItem=BEGIN SETRANGE("Vendor No.",Vendor."No."); SETRANGE("Posting Date",StartDate,EndDate); SETRANGE("Currency Code",Currency2.Code); // End of the added lines. IF Currency2.Code = '' THEN BEGIN GLSetup.TESTFIELD("LCY Code"); CurrencyCode3 := GLSetup."LCY Code" END ELSE ...Código existente 2
...END ELSE
CurrencyCode3 := Currency2.Code END; // Delete the following lines. OnAfterGetRecord=BEGIN // PT0002.begin // VendBalance := VendBalance + "Remaining Amount"; VendBalance := VendBalance + "Original Amount"; // PT0002.end // End of the deleted lines. END; DataItemLinkReference=Vendor; DataItemLink=Vendor No.=FIELD(No.); ...Código de substituição 2
... END ELSE
CurrencyCode3 := Currency2.Code END; // Add the following lines. OnAfterGetRecord=VAR VendLedgEntry@1000 : Record 25; DtldVendLedgEntry1@1001 : Record 380; BEGIN RemainingAmount := 0; PrintLine := TRUE; CASE "Entry Type" OF "Entry Type"::"Initial Entry": BEGIN VendLedgEntry.GET("Vendor Ledger Entry No."); Description := VendLedgEntry.Description; DueDate := VendLedgEntry."Due Date"; VendLedgEntry.SETRANGE("Date Filter",0D, EndDate); VendLedgEntry.CALCFIELDS("Remaining Amount"); RemainingAmount := VendLedgEntry."Remaining Amount"; END; "Entry Type"::"Payment Discount", "Entry Type"::"Payment Discount (VAT Excl.)", "Entry Type"::"Payment Discount (VAT Adjustment)", "Entry Type"::"Payment Discount Tolerance", "Entry Type"::"Payment Discount Tolerance (VAT Excl.)", "Entry Type"::"Payment Discount Tolerance (VAT Adjustment)": BEGIN Description := Text006; DueDate := 0D; END; "Entry Type"::"Payment Tolerance", "Entry Type"::"Payment Tolerance (VAT Excl.)", "Entry Type"::"Payment Tolerance (VAT Adjustment)": BEGIN Description := Text014; DueDate := 0D; END; "Entry Type"::"Appln. Rounding", "Entry Type"::"Correction of Remaining Amount": BEGIN Description := Text007; DueDate := 0D; END; END; IF PrintLine THEN VendBalance := VendBalance + Amount; // End of the added lines. END; DataItemLinkReference=Vendor; DataItemLink=Vendor No.=FIELD(No.); ... -
Altere o código nas secções de 4 de número de Item de dados no relatório de declaração de fornecedor (13377) do seguinte modo:
Código existente 1... DataSetFieldName=Vendor_Ledger_Entry_Description }
{ 47 ;TextBox ;7980 ;0 ;1680 ;423 ;HorzAlign=Left; FontSize=9; CaptionML=ENU=Due Date; // Delete the following lines. SourceExpr=FORMAT("Due Date",0,4); DataSetFieldName=Vendor_Ledger_Entry__Due_Date_ } { 48 ;TextBox ;13230;0 ;2310 ;423 ;FontSize=9; CaptionML=ENU=Remaining Amount; SourceExpr="Remaining Amount"; // End of the deleted lines. AutoFormatType=1; AutoFormatExpr="Currency Code"; DataSetFieldName=Vendor_Ledger_Entry__Remaining_Amount_ } { 49 ;TextBox ;15750;0 ;2310 ;423 ;FontSize=9; ...Código de substituição 1
... DataSetFieldName=Vendor_Ledger_Entry_Description }
{ 47 ;TextBox ;7980 ;0 ;1680 ;423 ;HorzAlign=Left; FontSize=9; CaptionML=ENU=Due Date; // Add the following lines. SourceExpr=FORMAT(DueDate,0,4); DataSetFieldName=Vendor_Ledger_Entry__Due_Date_ } { 48 ;TextBox ;13230;0 ;2310 ;423 ;FontSize=9; CaptionML=ENU=Remaining Amount; SourceExpr=RemainingAmount; // End of the added lines. AutoFormatType=1; AutoFormatExpr="Currency Code"; DataSetFieldName=Vendor_Ledger_Entry__Remaining_Amount_ } { 49 ;TextBox ;15750;0 ;2310 ;423 ;FontSize=9; ...Código existente 2
...AutoFormatType=1;
AutoFormatExpr="Currency Code"; DataSetFieldName=VendBalance_Control49 } { 54 ;TextBox ;10710;0 ;2310 ;423 ;FontSize=9; // Delete the following line. SourceExpr="Original Amount"; // End of the deleted line. AutoFormatType=1; AutoFormatExpr="Currency Code"; DataSetFieldName=Vendor_Ledger_Entry__Original_Amount_ } { 78 ;TextBox ;9870 ;0 ;840 ;423 ;FontSize=9; ...Código de substituição 2
... AutoFormatType=1;
AutoFormatExpr="Currency Code"; DataSetFieldName=VendBalance_Control49 } { 54 ;TextBox ;10710;0 ;2310 ;423 ;FontSize=9; // Add the following line. SourceExpr=Amount; // End of the added line. AutoFormatType=1; AutoFormatExpr="Currency Code"; DataSetFieldName=Vendor_Ledger_Entry__Original_Amount_ } { 78 ;TextBox ;9870 ;0 ;840 ;423 ;FontSize=9; ... -
Altere o código do 5 de número de Item de dados no relatório de declaração de fornecedor (13377) do seguinte modo:
Código existente...END;
OnAfterGetRecord=BEGIN IF ISSERVICETIER THEN // Delete the following lines. VendBalance2 := VendBalance2 + "Remaining Amount" ELSE VendBalance := VendBalance + "Remaining Amount"; // End of the deleted lines. END; DataItemLinkReference=Vendor; DataItemLink=Vendor No.=FIELD(No.); ...Código de substituição
... END;
OnAfterGetRecord=BEGIN IF ISSERVICETIER THEN // Add the following lines. VendBalance2 := VendBalance2 + RemainingAmount ELSE VendBalance := VendBalance + RemainingAmount; // End of the added lines. END; DataItemLinkReference=Vendor; DataItemLink=Vendor No.=FIELD(No.); ... -
Altere o código nas secções de 5 de número de Item de dados no relatório de declaração de fornecedor (13377) do seguinte modo:
Código existente...SourceExpr=Description;
DataSetFieldName=VendorLedgEntry2_Description } { 60 ;TextBox ;7980 ;0 ;1680 ;423 ;HorzAlign=Left; FontSize=9; // Delete the following lines. SourceExpr=FORMAT("Due Date",0,4); DataSetFieldName=VendorLedgEntry2__Due_Date_ } { 61 ;TextBox ;13230;0 ;2310 ;423 ;FontSize=9; SourceExpr="Remaining Amount"; // End of the deleted lines. AutoFormatType=1; AutoFormatExpr="Currency Code"; DataSetFieldName=VendorLedgEntry2__Remaining_Amount_ } { 62 ;TextBox ;15750;0 ;2310 ;423 ;FontSize=9; ...Código de substituição
... SourceExpr=Description;
DataSetFieldName=VendorLedgEntry2_Description } { 60 ;TextBox ;7980 ;0 ;1680 ;423 ;HorzAlign=Left; FontSize=9; // Add the following lines. SourceExpr=FORMAT(DueDate,0,4); DataSetFieldName=VendorLedgEntry2__Due_Date_ } { 61 ;TextBox ;13230;0 ;2310 ;423 ;FontSize=9; SourceExpr=RemainingAmount; // End of the added lines. AutoFormatType=1; AutoFormatExpr="Currency Code"; DataSetFieldName=VendorLedgEntry2__Remaining_Amount_ } { 62 ;TextBox ;15750;0 ;2310 ;423 ;FontSize=9; ... -
Altere o código a variáveis globais no relatório de declaração de fornecedor (13377) do seguinte modo:
Código existente 1...Text000@1000 : TextConst 'ENU=Page %1';
Text001@1001 : TextConst 'ENU=Open Entries %1'; Text002@1002 : TextConst 'ENU=Overdue Entries %1'; Text003@1003 : TextConst 'ENU="Statement "'; GLSetup@1004 : Record 98; CompanyInfo@1005 : Record 79; Vend2@1006 : Record 23; Currency@1007 : Record 4; ...Código de substituição 1
...Text000@1000 : TextConst 'ENU=Page %1';
Text001@1001 : TextConst 'ENU=Open Entries %1'; Text002@1002 : TextConst 'ENU=Overdue Entries %1'; Text003@1003 : TextConst 'ENU="Statement "'; // Add the following lines. Text005@1030 : TextConst 'ENU=Multicurrency Application'; Text006@1031 : TextConst 'ENU=Payment Discount'; Text007@1032 : TextConst 'ENU=Rounding'; Text014@1033 : TextConst 'ENU=Application Writeoffs'; // End of the added lines. GLSetup@1004 : Record 98; CompanyInfo@1005 : Record 79; Vend2@1006 : Record 23; Currency@1007 : Record 4; ...Código existente 2
...PrintAllHavingEntry@1010 : Boolean;
PrintAllHavingBal@1011 : Boolean; PrintEntriesDue@1012 : Boolean; PrintLine@1013 : Boolean; StartDate@1014 : Date; EndDate@1015 : Date; VendAddr@1016 : ARRAY [8] OF Text[50]; CompanyAddr@1017 : ARRAY [8] OF Text[50]; ...Código de substituição 2
...
PrintAllHavingEntry@1010 : Boolean; PrintAllHavingBal@1011 : Boolean; PrintEntriesDue@1012 : Boolean; PrintLine@1013 : Boolean; // Add the following line. DueDate@1038 : Date; // End of the added line. StartDate@1014 : Date; EndDate@1015 : Date; VendAddr@1016 : ARRAY [8] OF Text[50]; CompanyAddr@1017 : ARRAY [8] OF Text[50]; ...Código existente 3
...StartDate@1014 : Date;
EndDate@1015 : Date; VendAddr@1016 : ARRAY [8] OF Text[50]; CompanyAddr@1017 : ARRAY [8] OF Text[50]; StartBalance@1018 : Decimal; VendBalance@1019 : Decimal; FormatAddr@1020 : Codeunit 365; CurrencyCode3@1022 : Code[10]; ...Código de substituição 3
...StartDate@1014 : Date;
EndDate@1015 : Date; VendAddr@1016 : ARRAY [8] OF Text[50]; CompanyAddr@1017 : ARRAY [8] OF Text[50]; // Add the following lines. Description@1039 : Text[50]; RemainingAmount@1040 : Decimal; // End of the added lines. StartBalance@1018 : Decimal; VendBalance@1019 : Decimal; FormatAddr@1020 : Codeunit 365; CurrencyCode3@1022 : Code[10]; ...Código existente 4
... </ReportItems>
</TableCell> </TableCells> <Visibility> // Delete the following line. <Hidden>=IIF(Fields!Vendor_Ledger_Entry_Vendor_No_.Value = "",TRUE,FALSE)</Hidden> // End of the deleted line. </Visibility> </TableRow> </TableRows> </Details> ...Código de substituição 4
...</ReportItems>
</TableCell> </TableCells> <Visibility> // Add the following line. <Hidden>=IIF(Fields!DtldVendLedgEntry_Vendor_No_.Value = "",TRUE,FALSE)</Hidden> // End of the added line. </Visibility> </TableRow> </TableRows> </Details> ...Código existente 5
...<FontWeight>700</FontWeight>
<TextAlign>Right</TextAlign> <VerticalAlign>Middle</VerticalAlign> </Style> // Delete the following line. <Value>=iif(Last(Fields!Vendor_Ledger_Entry_Vendor_No_.Value) = "" ,Last(Fields!VendBalance_Control66Caption.Value), // End of the deleted line. Last(Fields!VendBalance_Control53Caption.Value))</Value> </Textbox> </ReportItems> </TableCell> ...Código de substituição 5
...<FontWeight>700</FontWeight>
<TextAlign>Right</TextAlign> <VerticalAlign>Middle</VerticalAlign> </Style> // Add the following line. <Value>=iif(Last(Fields!DtldVendLedgEntry_Vendor_No_.Value) = "" ,Last(Fields!VendBalance_Control66Caption.Value), // End of the added line. Last(Fields!VendBalance_Control53Caption.Value))</Value> </Textbox> </ReportItems> </TableCell> ...Código existente 6
...<FontWeight>700</FontWeight>
<TextAlign>Right</TextAlign> <VerticalAlign>Middle</VerticalAlign> </Style> // Delete the following line. <Value>=iif(Last(Fields!Vendor_Ledger_Entry_Vendor_No_.Value) = "" ,Last(Fields!CurrencyCode3_Control73.Value), // End of the deleted line. Last(Fields!CurrencyCode3.Value))</Value> </Textbox> </ReportItems> </TableCell> ...Código de substituição 6
... <FontWeight>700</FontWeight>
<TextAlign>Right</TextAlign> <VerticalAlign>Middle</VerticalAlign> </Style> // Add the following line. <Value>=iif(Last(Fields!DtldVendLedgEntry_Vendor_No_.Value) = "" ,Last(Fields!CurrencyCode3_Control73.Value), // End of the added line. Last(Fields!CurrencyCode3.Value))</Value> </Textbox> </ReportItems> </TableCell> ...Código existente 7
...FontWeight>700</FontWeight>
<Format>=Fields!VendBalance_Control49Format.Value</Format> <VerticalAlign>Middle</VerticalAlign> </Style> // Delete the following line. <Value>=iif(Last(Fields!Vendor_Ledger_Entry_Vendor_No_.Value) = "" ,Last(Fields!VendBalance_Control56.Value), // End of the deleted line. LAST(Fields!VendBalance.Value))</Value> </Textbox> </ReportItems> </TableCell> ...Código de substituição 7
...<FontWeight>700</FontWeight>
<Format>=Fields!VendBalance_Control49Format.Value</Format> <VerticalAlign>Middle</VerticalAlign> </Style> // Add the following line. <Value>=iif(Last(Fields!DtldVendLedgEntry_Vendor_No_.Value) = "" ,Last(Fields!VendBalance_Control56.Value), // End of the added line. LAST(Fields!VendBalance.Value))</Value> </Textbox> </ReportItems> </TableCell> ...Código existente 8
...</Field>
<Field Name="CurrencyCode3"> <DataField>CurrencyCode3</DataField> </Field> // Delete the following lines. <Field Name="Vendor_Ledger_Entry_Entry_No_"> <DataField>Vendor_Ledger_Entry_Entry_No_</DataField> </Field> <Field Name="Vendor_Ledger_Entry_Vendor_No_"> <DataField>Vendor_Ledger_Entry_Vendor_No_</DataField> // End of the deleted lines. </Field> <Field Name="STRSUBSTNO_Text002_Currency2_Code_"> <DataField>STRSUBSTNO_Text002_Currency2_Code_</DataField> </Field> ...Código de substituição 8
...</Field>
<Field Name="CurrencyCode3"> <DataField>CurrencyCode3</DataField> </Field> // Add the following lines. <Field Name="DtldVendLedgEntry_Entry_No_"> <DataField>DtldVendLedgEntry_Entry_No_</DataField> </Field> <Field Name="DtldVendLedgEntry_Vendor_No_"> <DataField>DtldVendLedgEntry_Vendor_No_</DataField> // End of the added lines. </Field> <Field Name="STRSUBSTNO_Text002_Currency2_Code_"> <DataField>STRSUBSTNO_Text002_Currency2_Code_</DataField> </Field> ...
Pré-requisitos
Tem de ter um dos seguintes produtos instalado para aplicar esta correcção:
-
A versão portuguesa do Microsoft Dynamics NAV 2009 R2
-
A versão portuguesa do Microsoft Dynamics NAV 2009 SP1
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.