在包含 AddOn 付款的德国版 Microsoft Dynamics NAV 中创建国外付款文件时,遇到不正确的导出问题

应用对象
Dynamics NAV 2009 Service Pack 1 Dynamics NAV 2009 R2

本文适用于德语 (de) 语言区域设置的 Microsoft Dynamics NAV。

症状

在包含 AddOn 付款的 Microsoft Dynamics NAV 的德语版本中,创建外部付款文件时,会遇到以下不正确的导出问题:

  • 假设你创建了具有费用帐户的国外付款文件。 如果费用帐户与用于付款的银行帐户不同,则你注意到付款文件中写入了不正确的银行帐号。
  • 文件中 (10) 的 V-Satz 字段意外填写了“N”。 你预期字段中的数据为空。
  • 文件中 (10a) 的 T-Satz 字段意外填写了“DE”。 你预期字段中的数据为“US”,因为供应商来自美国,并且只有银行帐户位于 DE 中。

以下产品中会出现此问题:

  • Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)
  • Microsoft Dynamics NAV 2009 R2 的德语版本

解决方法

修补程序信息

Microsoft现在提供了受支持的修补程序。 但是,它仅用于更正本文中所述的问题。 仅将其应用于遇到此特定问题的系统。 此修补程序可能会收到其他测试。 因此,如果你没有受到此问题的严重影响,我们建议你等待下一个Microsoft Dynamics NAV 2009 Service Pack 或包含此修补程序的下一Microsoft Dynamics NAV 版本。

注意 在特殊情况下,如果 Microsoft Dynamics 和相关产品的技术支持专业人员确定特定更新将解决你的问题,则通常由支持呼叫产生的费用可能会被取消。 对于相关特定升级无法解决的其他支持问题和事项,将照常收取支持费用。

            
          

安装信息

Microsoft 的编程示例仅用于说明,不做任何明示或暗示的保证。 这包括但不限于特定用途的适销性或适用性的隐含保证。 本文假定你熟悉所演示的编程语言以及用于创建和调试过程的工具。 Microsoft 支持工程师可以帮助解释特定过程的功能,但他们不会修改这些示例以提供新增功能或构建步骤以满足你的特定需要。

注意 在安装此修补程序之前,请验证所有 Microsoft Navision 客户端用户是否已从系统注销。 这包括 Microsoft Navision Application Services (NAS) 客户端用户。 实现此修补程序时,应是唯一登录的客户端用户。

若要实现此修补程序,必须具有开发人员许可证。

建议为 Windows 登录窗口或数据库登录名窗口中的用户帐户分配“SUPER”角色 ID。 如果无法为用户帐户分配“SUPER”角色 ID,则必须验证该用户帐户是否具有以下权限:

  • 要更改的 对象的“修改”权限。
  • 系统对象 ID 5210 对象和系统对象 ID 9015 对象的 Execute 权限。

                
注意 除非必须执行数据修复,否则您不必拥有数据存储的权限。

代码更改

注意 在将修补程序应用到生产计算机之前,始终在受控环境中测试代码修复。
要解决此问题,请按照下列步骤操作:

  1. 更改 AZV codeunit (5001905) Open Exportfile 函数中的代码,如下所示:
    更改全局变量的定义,如下所示

    • 旧定义: Dtaus : Code[150];

    • 新定义: Dtaus: Code[260];

    现有代码

    ...
         CompanyInfo.GET;
    // Delete the following line.  
      NameOfCompany := CheckFormat(FORMAT(UPPERCASE(CompanyInfo.Name),27));
    
      FormatAddr.BankAcc(AddrArray,BankAccount); 
    ...
    

    替换代码

    ...
       CompanyInfo.GET;
    // Add the following line. 
      NameOfCompany := COPYSTR(CheckFormat(FORMAT(UPPERCASE(CompanyInfo.Name),27)),1,MAXSTRLEN(NameOfCompany));
    
      FormatAddr.BankAcc(AddrArray,BankAccount);
    ...
    
  2. 更改 AZV codeunit (5001905) FormatBankAcc 函数中的代码,如下所示:
    创建一个新的本地变量 BankAccount3,如下所示:

    BankAccount3@:记录 270

    现有代码

    ...
       IF (PaymLedgEntry."Account No. Charges"<>") AND (PaymLedgEntry."Account No. Charges"<>PaymLedgEntry."Bank Account No.") THEN
      BEGIN
    // Delete the following lines.  
        BankAccount.GET(PaymLedgEntry."Account No. Charges");
        "Bank Code" := BankAccount."Bank Branch No.";
        IF STRLEN("Bank Code") = 0 THEN
          ERROR(Text1105400002,BankAccount."No.");
        BankCodeBank := FormatBankCode("Bank Code");
        IF STRLEN(BankCodeBank) <> 8 THEN
          ERROR(Text1105400003,BankAccount."No.");
        BankCodeRec3 := BankCodeBank;
        Account := BankAccount."Bank Account No.";
        IF STRLEN(Account) = 0 THEN
          ERROR(Text1105400004,BankAccount."No.");
        AccountBank := FormatAccount(Account);
        IF STRLEN(AccountBank) >10 THEN
          ERROR(
             Text1105400005,BankAccount."No.");
        AccountRec3 := AccountBank;
    // End of the deleted lines.   
    
      END ELSE BEGIN
        BankCodeRec3 := PADSTR('',8,'0');
        AccountRec3 := PADSTR('',10,'0');
      END; 
    ...
    

    替换代码

    ...
       IF (PaymLedgEntry."Account No. Charges"<>") AND (PaymLedgEntry."Account No. Charges"<>PaymLedgEntry."Bank Account No.") THEN
      BEGIN
    
    // Add the following lines.  
        BankAccount3.GET(PaymLedgEntry."Account No. Charges");
        IF STRLEN(BankAccount3."Bank Branch No.") = 0 THEN
          ERROR(Text1105400002,BankAccount3."No.");
        BankCodeRec3 := FormatBankCode(BankAccount3."Bank Branch No.");
        IF STRLEN(BankCodeRec3) <> 8 THEN
          ERROR(Text1105400003,BankAccount3."No.");
        IF STRLEN(BankAccount3."Bank Account No.") = 0 THEN
          ERROR(Text1105400004,BankAccount3."No.");
        AccountRec3 := FormatAccount(BankAccount3."Bank Account No.");
        IF STRLEN(AccountRec3) >10 THEN  
          ERROR(
             Text1105400005,BankAccount3."No.");
    //End of the added lines. 
    
      END ELSE BEGIN
        BankCodeRec3 := PADSTR('',8,'0');
        AccountRec3 := PADSTR('',10,'0');
      END;
    ...
    
  3. 更改 AZV codeunit (5001905) 中的 VendBankFormat 函数中的代码,如下所示:
    现有代码

    ...
            ERROR(Text1105400129,Country."Bank Country Code");
      END;
    
    // Delete the following line.
      VendCountry := Country."Bank Country Code";
    
      IF PostedAZV.IBAN <>'' THEN BEGIN
        Account := DELCHR(PostedAZV.IBAN);
        Account := CheckFormat(UPPERCASE(PADSTR(Account,34,' ')));  
    ...
    

    替换代码

    ...
             ERROR(Text1105400129,Country."Bank Country Code");
      END;
    
    // Add the following line.
      VendCountry := PostedAZV."Country Code";
    
      IF PostedAZV.IBAN <> '' THEN BEGIN
        Account := DELCHR(PostedAZV.IBAN);
        Account := CheckFormat(UPPERCASE(PADSTR(Account,34,' ')));
    ...
    
  4. 更改 AZV codeunit (5001905) PaymFileHeader 函数中的代码,如下所示:
    现有代码

    ...
         IF STRLEN(CompanyNo) <>8 THEN
          ERROR(Text1105400137,BankAccount."No.");
      END;
    
      Account := BankAccount."Bank Account No.";
      IF STRLEN(Account) = 0 THEN  
    ...
    

    替换代码

    ...
           IF STRLEN(CompanyNo) <>8 THEN
          ERROR(Text1105400137,BankAccount."No.");
    
    // Add the following lines.          
      END ELSE BEGIN
        IF CompanyNo = '' THEN
          CompanyNo := PADSTR('',8,'0');
    // End of the added lines.           
    
      END;
    
      Account := BankAccount."Bank Account No.";
      IF STRLEN(Account) = 0 THEN
    ...
    
  5. 更改 AZV codeunit (5001905) CreateRegistration 函数中的代码,如下所示:
    删除本地变量 InfoTransitUnsalableInvL: Code[1]

    现有代码

    ...
           PassagingTransitL := 'N';
       BrokenTransitL := 'N';
    // Delete the following line.   
       InfoTransitUnsalableInvL := 'N';
       InfoTransitUnsalableForeignL := 'N';
       IF RegistrationSet."Passaging Transit" THEN
         PassagingTransitL := 'J';
       IF RegistrationSet."Broken Transit" THEN BEGIN
         BrokenTransitL := 'J';
         RegistrationSet.TESTFIELD("Add. Information Transit");
         Transit := COPYSTR(Transit,1,62) +
         PADSTR(CheckFormat(FORMAT(UPPERCASE(RegistrationSet."Add. Information Transit"),40)),40,' ');
       END;
    
    // Delete the following lines.   
       IF RegistrationSet."Info Transit unsalable Inv" THEN
         InfoTransitUnsalableInvL := 'J';
    // End of the deleted lines.     
    
       IF RegistrationSet."Info Transit unsalable forei." THEN
         InfoTransitUnsalableForeignL := 'J';
    
       Z := Text1105400025 +
            PADSTR(RegistrationSet."Itemname Trading Goods",27,' ') +
            NumToString(RegistrationSet."Capitel No. Goods",2,'0') +
            PADSTR('',7,'0') +
            PADSTR(BankCountries."Bank Country Short Name",7,' ') +
            PADSTR(RegistrationSet."Country Code",3,' ') +
            NumToString(FORMAT(ROUND(MAmount,1,'<'),12,1),12,'0') +
            PassagingTransitL +
            BrokenTransitL +
    // Delete the following line.        
            InfoTransitUnsalableInvL +
            InfoTransitUnsalableForeignL +
            Transit;
       Exportfile.SEEK(Exportfile.POS-2);
    ...
    

    替换代码

    ...
        PassagingTransitL := 'N';
       BrokenTransitL := 'N';
       InfoTransitUnsalableForeignL := 'N';
       IF RegistrationSet."Passaging Transit" THEN
         PassagingTransitL := 'J';
       IF RegistrationSet."Broken Transit" THEN BEGIN
         BrokenTransitL := 'J';
         RegistrationSet.TESTFIELD("Add. Information Transit");
         Transit := COPYSTR(Transit,1,62) +
         PADSTR(CheckFormat(FORMAT(UPPERCASE(RegistrationSet."Add. Information Transit"),40)),40,' ');
       END;
       IF RegistrationSet."Info Transit unsalable forei." THEN
         InfoTransitUnsalableForeignL := 'J';
    
       Z := Text1105400025 +
            PADSTR(RegistrationSet."Itemname Trading Goods",27,' ') +
            NumToString(RegistrationSet."Capitel No. Goods",2,'0') +
            PADSTR('',7,'0') +
            PADSTR(BankCountries."Bank Country Short Name",7,' ') +
            PADSTR(RegistrationSet."Country Code",3,' ') +
            NumToString(FORMAT(ROUND(MAmount,1,'<'),12,1),12,'0') +
            PassagingTransitL +
            BrokenTransitL +
    // Add the following line.        
            PADSTR('',1,' ') +
            InfoTransitUnsalableForeignL +
            Transit;
       Exportfile.SEEK(Exportfile.POS-2);  
    ...
    
  6. 更改 AZV codeunit (5001905) CheckFormat 函数中的代码,如下所示:
    现有代码

    ...
        WHILE STRPOS(FieldContent,'š') >0 DO
        FieldContent := COPYSTR(FieldContent,1,STRPOS(FieldContent,'š')-1) + Text1105400035 +
                      COPYSTR(FieldContent,STRPOS(FieldContent,'š')+1,MAXSTRLEN(FieldContent));
    
      CheckRec := DELCHR(FieldContent,'=',Text1105400036); 
    ...
    

    替换代码

    ...
         WHILE STRPOS(FieldContent,'š') >0 DO
        FieldContent := COPYSTR(FieldContent,1,STRPOS(FieldContent,'š')-1) + Text1105400035 +
                      COPYSTR(FieldContent,STRPOS(FieldContent,'š')+1,MAXSTRLEN(FieldContent));
    
    // Add the following lines.      
      WHILE STRPOS(FieldContent,'&') > 0 DO
        FieldContent := COPYSTR(FieldContent,1,STRPOS(FieldContent,'&')-1) + ' ' +
                      COPYSTR(FieldContent,STRPOS(FieldContent,'&')+1,MAXSTRLEN(FieldContent));
      WHILE STRPOS(FieldContent,'$') > 0 DO
        FieldContent := COPYSTR(FieldContent,1,STRPOS(FieldContent,'$')-1) + ' ' +
                      COPYSTR(FieldContent,STRPOS(FieldContent,'$')+1,MAXSTRLEN(FieldContent));
      WHILE STRPOS(FieldContent,'*') > 0 DO
        FieldContent := COPYSTR(FieldContent,1,STRPOS(FieldContent,'*')-1) + ' ' +
                      COPYSTR(FieldContent,STRPOS(FieldContent,'*')+1,MAXSTRLEN(FieldContent));
      WHILE STRPOS(FieldContent,'%') > 0 DO
        FieldContent := COPYSTR(FieldContent,1,STRPOS(FieldContent,'%')-1) + ' ' +
                      COPYSTR(FieldContent,STRPOS(FieldContent,'%')+1,MAXSTRLEN(FieldContent));
    //End of the added lines.                       
    
      CheckRec := DELCHR(FieldContent,'=',Text1105400036);
    ...
    
  7. 更改 AZV codeunit (5001905) CheckPaymFile 函数中 Drive 参数的定义,如下所示:

    • 旧定义: Dtaus : Drive : Code[150];

    • 新定义:Dtaus: Drive: Code[250];

  8. 更改 AZV codeunit (5001905) TestCompanyInfo 函数中的代码,如下所示:
    现有代码

    ...
        CompanyInfo.GET;
    // Delete the following line. 
      CompName := CheckFormat(FORMAT(UPPERCASE(CompanyInfo.Name),27));
      BankAccount.GET(Bacc);
      "Bank Code" := BankAccount."Bank Branch No.";
      IF STRLEN("Bank Code") = 0 THEN 
    ...
    

    替换代码

    ...
       CompanyInfo.GET;
    // Add the following line.  
      CompName := COPYSTR(CheckFormat(FORMAT(UPPERCASE(CompanyInfo.Name),27)),1,MAXSTRLEN(CompName));
      BankAccount.GET(Bacc);
      "Bank Code" := BankAccount."Bank Branch No.";
      IF STRLEN("Bank Code") = 0 THEN  
    ...
    

          

先决条件

必须安装以下产品之一才能应用此修补程序:

  • Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)
  • Microsoft Dynamics NAV 2009 R2 的德语版本

                
              

删除信息

无法删除此修补程序。

状态

Microsoft 已确认在 "适用于" 部分中所列的 Microsoft 产品中存在问题。

参考资料

VSTF DynamicsNAV SE:245257;254071;277428

注意这是一篇由 Microsoft 支持组织直接创建的“快速发布”文章。 本文所包含的信息是按原样提供的,以应对新出现的问题。 由于发布速度较快,这些材料可能包含印刷错误,无需通知即可随时修改。 有关其他注意事项,请参阅使用条款