费用报销单提交报错:税务下载发票至全票池失败
1、问题描述
背景:费用报销单关联了飞机票,且备注大于40
场景一: 费用报销单提交报错:税务下载发票至全票池失败
场景二:费用报销单提交时工作流挂起,日志提示如下:
2、原因分析
分析税务下载发票的TMTrace日志发现,飞机票的签注字段值太大,需扩容;日志截图如下:
3、操作步骤
需在查询分析器执行扩容脚本:
alter table T_TM_PLANEINVOICE alter FENDORSEMENT NVARCHAR(100);
4、注意
如果在TMTrace日志发现是别的票种的字段需扩容,可自行在测试环境更新IM开收票最新补丁后测试。
如果无法确认或无法更新补丁,可在税务交流群联系总部老师或提单。
5、从21年后扩容的脚本如下,建议还没更新到23年的TM全票池补丁,或无法更新补丁的可以执行。从而避免客户出现字段扩容问题而导致无法提交费用报销单的情况。(此为扩容脚本,不影响现有数据)
-- 勾选信息表 发票代码扩容到40,和各发票保持一致;比如已知的海关缴款书是22位
--江龙辉 2023.1.3
IF EXISTS(SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_CheckAbs' AND KSQL_COL_NAME = 'FInvoiceCode')
alter table T_TM_CheckAbs add FInvoiceCode_bak NVARCHAR(40);
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_CheckAbs' and KSQL_COL_Name = 'FInvoiceCode_bak')
update T_TM_CheckAbs set FInvoiceCode_bak = FInvoiceCode;
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_CheckAbs' and KSQL_COL_Name = 'FInvoiceCode_bak')
alter table T_TM_CheckAbs drop default for FInvoiceCode;
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_CheckAbs' and KSQL_COL_Name = 'FInvoiceCode_bak')
update T_TM_CheckAbs set FInvoiceCode=null;
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_CheckAbs' and KSQL_COL_Name = 'FInvoiceCode_bak')
alter table T_TM_CheckAbs alter column FInvoiceCode NVARCHAR(40);
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_CheckAbs' and KSQL_COL_Name = 'FInvoiceCode_bak')
update T_TM_CheckAbs set FInvoiceCode = FInvoiceCode_bak;
if exists (select * from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_CheckAbs' and KSQL_COL_Name = 'FInvoiceCode_bak')
alter table T_TM_CheckAbs drop column FInvoiceCode_bak;
-- 勾选信息表 发票号码扩容到40
--江龙辉 2023.1.3
IF EXISTS(SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_CheckAbs' AND KSQL_COL_NAME = 'FInvoiceNo')
alter table T_TM_CheckAbs add FInvoiceNo_bak NVARCHAR(40);
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_CheckAbs' and KSQL_COL_Name = 'FInvoiceNo_bak')
update T_TM_CheckAbs set FInvoiceNo_bak = FInvoiceNo;
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_CheckAbs' and KSQL_COL_Name = 'FInvoiceNo_bak')
alter table T_TM_CheckAbs drop default for FInvoiceNo;
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_CheckAbs' and KSQL_COL_Name = 'FInvoiceNo_bak')
update T_TM_CheckAbs set FInvoiceNo=null;
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_CheckAbs' and KSQL_COL_Name = 'FInvoiceNo_bak')
alter table T_TM_CheckAbs alter column FInvoiceNo NVARCHAR(40);
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_CheckAbs' and KSQL_COL_Name = 'FInvoiceNo_bak')
update T_TM_CheckAbs set FInvoiceNo = FInvoiceNo_bak;
if exists (select * from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_CheckAbs' and KSQL_COL_Name = 'FInvoiceNo_bak')
alter table T_TM_CheckAbs drop column FInvoiceNo_bak;
--火车票的印刷序号扩容到32位
IF EXISTS(SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_TrainInvoice' AND KSQL_COL_NAME = 'FPrintingSequenceNo')
alter table T_TM_TrainInvoice add FPrintingSequenceNo_bak NVARCHAR(32);
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_TrainInvoice' and KSQL_COL_Name = 'FPrintingSequenceNo_bak')
update T_TM_TrainInvoice set FPrintingSequenceNo_bak = FPrintingSequenceNo;
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_TrainInvoice' and KSQL_COL_Name = 'FPrintingSequenceNo_bak')
alter table T_TM_TrainInvoice drop default for FPrintingSequenceNo;
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_TrainInvoice' and KSQL_COL_Name = 'FPrintingSequenceNo_bak')
update T_TM_TrainInvoice set FPrintingSequenceNo=null;
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_TrainInvoice' and KSQL_COL_Name = 'FPrintingSequenceNo_bak')
alter table T_TM_TrainInvoice alter column FPrintingSequenceNo NVARCHAR(32);
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_TrainInvoice' and KSQL_COL_Name = 'FPrintingSequenceNo_bak')
update T_TM_TrainInvoice set FPrintingSequenceNo = FPrintingSequenceNo_bak;
if exists (select * from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_TrainInvoice' and KSQL_COL_Name = 'FPrintingSequenceNo_bak')
alter table T_TM_TrainInvoice drop column FPrintingSequenceNo_bak;
--火车票的身份证号扩容25位
IF EXISTS(SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_TrainInvoice' AND KSQL_COL_NAME = 'FCustomerIdentityNum')
alter table T_TM_TrainInvoice add FCustomerIdentityNum_bak NVARCHAR(25);
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_TrainInvoice' and KSQL_COL_Name = 'FCustomerIdentityNum_bak')
update T_TM_TrainInvoice set FCustomerIdentityNum_bak = FCustomerIdentityNum;
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_TrainInvoice' and KSQL_COL_Name = 'FCustomerIdentityNum_bak')
alter table T_TM_TrainInvoice drop default for FCustomerIdentityNum;
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_TrainInvoice' and KSQL_COL_Name = 'FCustomerIdentityNum_bak')
update T_TM_TrainInvoice set FCustomerIdentityNum=null;
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_TrainInvoice' and KSQL_COL_Name = 'FCustomerIdentityNum_bak')
alter table T_TM_TrainInvoice alter column FCustomerIdentityNum NVARCHAR(25);
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_TrainInvoice' and KSQL_COL_Name = 'FCustomerIdentityNum_bak')
update T_TM_TrainInvoice set FCustomerIdentityNum = FCustomerIdentityNum_bak;
if exists (select * from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_TrainInvoice' and KSQL_COL_Name = 'FCustomerIdentityNum_bak')
alter table T_TM_TrainInvoice drop column FCustomerIdentityNum_bak;
--完税证明的税务机关名称扩容到100
IF EXISTS(SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_PurchaseInvoice' AND KSQL_COL_NAME = 'FTAXAUTHORITYNAME')
alter table T_TM_PurchaseInvoice add FTAXAUTHORITYNAME_bak NVARCHAR(100);
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_PurchaseInvoice' and KSQL_COL_Name = 'FTAXAUTHORITYNAME_bak')
update T_TM_PurchaseInvoice set FTAXAUTHORITYNAME_bak = FTAXAUTHORITYNAME;
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_PurchaseInvoice' and KSQL_COL_Name = 'FTAXAUTHORITYNAME_bak')
alter table T_TM_PurchaseInvoice drop default for FTAXAUTHORITYNAME;
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_PurchaseInvoice' and KSQL_COL_Name = 'FTAXAUTHORITYNAME_bak')
update T_TM_PurchaseInvoice set FTAXAUTHORITYNAME=null;
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_PurchaseInvoice' and KSQL_COL_Name = 'FTAXAUTHORITYNAME_bak')
alter table T_TM_PurchaseInvoice alter column FTAXAUTHORITYNAME NVARCHAR(100);
if exists (select 1 from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_PurchaseInvoice' and KSQL_COL_Name = 'FTAXAUTHORITYNAME_bak')
update T_TM_PurchaseInvoice set FTAXAUTHORITYNAME = FTAXAUTHORITYNAME_bak;
if exists (select * from KSQL_USERCOLUMNS where KSQL_COL_TABNAME = 'T_TM_PurchaseInvoice' and KSQL_COL_Name = 'FTAXAUTHORITYNAME_bak')
alter table T_TM_PurchaseInvoice drop column FTAXAUTHORITYNAME_bak;
6、85版本发现已知问题,需执行以下扩容脚本(更新了2022.6的IM补丁)
IF EXISTS(SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_FullElectricInvoice' AND KSQL_COL_NAME = 'FSalerName')
alter table T_TM_FullElectricInvoice alter column FSalerName nvarchar(100);
IF EXISTS(SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_FullElectricInvoice' AND KSQL_COL_NAME = 'FBuyerName')
alter table T_TM_FullElectricInvoice alter column FBuyerName nvarchar(100);
IF EXISTS(SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_FINANCIALINVOICE' AND KSQL_COL_NAME = 'FINVOICINGPARTYNAME')
alter table T_TM_FINANCIALINVOICE alter column FINVOICINGPARTYNAME nvarchar(100);
附件:
费用报销单提交报错:税务下载发票至全票池失败
本文2024-09-22 19:22:57发表“eas cloud知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-eas-106838.html