U813.0账套间单据格式模版复制导入导出后修复问题
场景:我们使用账套实施工具导出模型,然后再登陆需要更新账套导入模型,如果该模型为UAP设置,此时会显示导入成功,但单据格式中无法查看导入的单据模版。
进行如下操作:
1--从其他正常账套导入模版: UFDATA_102_2022.dbo 这里需要换为你自己的账套 同样,条件内表单名也需要更换为自己的。
insert into vouchers_base(CardNumber, Shield, Name, CardType, ItemTblName, itemCol, BTTblName, BTQName, BWTblName, BWQName, VchListQName, HaveBodyGrid, BodyModify, VoucherWidth, 
               VoucherHeight, BodyTop, BodyLeft, BodyWidth, BodyHeight, SelfDef1, SelfDef2, SelfDef3, DEF_ID, DEF_ID_PRN, cSub_Id, Memo, iOrder, cIndustry, bAllowMulTemp, cDefWhere,
               vchtblPrimarykeyNames, ReceiptNoFieldName, IsPrintLimited, AllowDateTimeFormat, NotAppiesAuth, InventoryFieldName, UpdateTime, cHeadBusObjectId, cBodyBusObjectId, 
               cHeadFuncName, cBodyFuncName, cFieldAuthid, vchBodyPKName, BodyFKName, BodyDefaultConditionFieldName, IsAuditedPrint, IsAlertAuditedPrint, AuditFieldName, AlertFieldName, 
               AlertAuditFieldName, PrintCountFieldName, iVT_IDFieldName, cSub_IdLocation, bApplyWordTemplate, cBarCodeFieldNames, cParentKey, cKey
)
select CardNumber, Shield, Name, CardType, ItemTblName, itemCol, BTTblName, BTQName, BWTblName, BWQName, VchListQName, HaveBodyGrid, BodyModify, VoucherWidth, 
               VoucherHeight, BodyTop, BodyLeft, BodyWidth, BodyHeight, SelfDef1, SelfDef2, SelfDef3, DEF_ID, DEF_ID_PRN, cSub_Id, Memo, iOrder, cIndustry, bAllowMulTemp, cDefWhere,
               vchtblPrimarykeyNames, ReceiptNoFieldName, IsPrintLimited, AllowDateTimeFormat, NotAppiesAuth, InventoryFieldName, UpdateTime, cHeadBusObjectId, cBodyBusObjectId, 
               cHeadFuncName, cBodyFuncName, cFieldAuthid, vchBodyPKName, BodyFKName, BodyDefaultConditionFieldName, IsAuditedPrint, IsAlertAuditedPrint, AuditFieldName, AlertFieldName, 
               AlertAuditFieldName, PrintCountFieldName, iVT_IDFieldName, cSub_IdLocation, bApplyWordTemplate, cBarCodeFieldNames, cParentKey, cKey
 from UFDATA_102_2022.dbo.vouchers_base where name='UFSD_Cus' or name='ufsd_item'
insert into vouchers_lang(cardnumber, localeid, ccardname, appname)
 select cardnumber, localeid, ccardname, appname
  from UFDATA_102_2022.dbo.vouchers_lang where cardnumber='UFSD_Cus' or cardnumber='ufsd_item'
	
	
--表:vouchertemplates_base	
--模版字段说明:模版类型:VT_templateMode
   模版 0表示显示模版
	 模版 1表示打印模版 
2--查询导入表单打印模版ID及显示模版ID  字段:DEF_ID  显示模版ID   DEF_ID_PRN 打印模版ID
select * from vouchers_base where name='UFSD_Cus' or name='ufsd_item'
3--查询导入表ID及模版类型 
select * from vouchertemplates_base where VT_CardNumber='UFSD_Cus' or VT_CardNumber='UFSD_item'
select VT_ID from vouchertemplates_base where VT_CardNumber='UFSD_Cus' and VT_TemplateMode=0	
select VT_ID from vouchertemplates_base where VT_CardNumber='UFSD_Cus' and VT_TemplateMode=1		
select VT_ID from vouchertemplates_base where VT_CardNumber='UFSD_item' and VT_TemplateMode=0	
select VT_ID from vouchertemplates_base where VT_CardNumber='UFSD_item' and VT_TemplateMode=1		
4--更新表ID字段和插入表一致:	
update vouchers_base set DEF_ID=(select VT_ID from vouchertemplates_base where VT_CardNumber='UFSD_Cus' and VT_TemplateMode=0),DEF_ID_PRN=(select VT_ID from vouchertemplates_base where VT_CardNumber='UFSD_Cus' and VT_TemplateMode=1)   where name='UFSD_Cus' 
update vouchers_base set DEF_ID=(select VT_ID from vouchertemplates_base where VT_CardNumber='UFSD_item' and VT_TemplateMode=0)	,DEF_ID_PRN=(select VT_ID from vouchertemplates_base where VT_CardNumber='UFSD_item' and VT_TemplateMode=1	)   where name='ufsd_item'
	
	
	
                    
                
                
            
        
浙公网安备 33010602011771号