--delete System_ModuleFormat where module='ARAP_Report_APDetail_AR'
--插入[应收明细账]报表界面格式
if(select count(1) from System_ModuleFormat where module='ARAP_Report_APDetail_AR' and field='apd_id')=0
begin
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'apd_id' as field,
	'应收ID' as field_name,'应收ID' as title,
	60 as width,1 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'new_date' as field,
	'生成日期' as field_name,'新增日期' as title,
	70 as width,100 as sort,1 as show,0 as hidden,0 as sum_field,'date' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'bus_order_number' as field,
	'销售订单号' as field_name,'销售订单号' as title,
	120 as width,110 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'cus_name' as field,
	'客户名称' as field_name,'客户名称' as title,
	80 as width,130 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'i_code' as field,
	'存货编码' as field_name,'存货编码' as title,
	98 as width,140 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'i_name' as field,
	'存货名称' as field_name,'存货名称' as title,
	120 as width,150 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'free1' as field,
	'自由项1' as field_name,'自由项1' as title,
	80 as width,170 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'free2' as field,
	'自由项2' as field_name,'自由项2' as title,
	80 as width,180 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_APDetail_AR' as module,'tax_total_price' as field,
	'原币应收金额' as field_name,'原币应收金额' as title,
	80 as width,250 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_APDetail_AR' as module,'acc_hx_amount' as field,
	'原币已收金额' as field_name,'原币已收金额' as title,
	80 as width,260 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
		
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_APDetail_AR' as module,'nat_tax_total_price' as field,
	'本币应收金额' as field_name,'应收金额' as title,
	80 as width,270 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_APDetail_AR' as module,'acc_hx_nat_amount' as field,
	'本币已收金额' as field_name,'已收金额' as title,
	80 as width,280 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_APDetail_AR' as module,'wait_hx_nat_amount' as field,
	'本币余额' as field_name,'余额' as title,
	80 as width,290 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'crc_name' as field,
	'币种' as field_name,'币种' as title,
	40 as width,395 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'tax_rate' as field,
	'税率' as field_name,'税率' as title,
	60 as width,400 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'dep_name' as field,
	'部门' as field_name,'部门' as title,
	60 as width,410 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
		
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'exchange_rate' as field,
	'汇率' as field_name,'汇率' as title,
	40 as width,420 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'from_type' as field,
	'单据来源' as field_name,'单据来源' as title,
	70 as width,430 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
		insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'from_id' as field,
	'来源单据ID' as field_name,'来源单据ID' as title,
	100 as width,440 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'from_order_number' as field,
	'来源单据号' as field_name,'来源单据号' as title,
	120 as width,450 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'standard' as field,
	'规格型号' as field_name,'规格型号' as title,
	120 as width,480 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'munit' as field,
	'单位' as field_name,'单位' as title,
	40 as width,490 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'aunit' as field,
	'辅计单位' as field_name,'辅计量单位' as title,
	60 as width,500 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'remark' as field,
	'备注' as field_name,'备注' as title,
	100 as width,510 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'new_user' as field,
	'新增人' as field_name,'新增人' as title,
	50 as width,515 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'verify_user' as field,
	'审核人' as field_name,'审核人' as title,
	50 as width,520 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'d_sdefine1' as field,
	'子表字符自定义项1' as field_name,'子表字符自定义项1' as title,
	120 as width,1010 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'d_sdefine2' as field,
	'子表字符自定义项2' as field_name,'子表字符自定义项2' as title,
	60 as width,1020 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'d_sdefine3' as field,
	'子表字符自定义项3' as field_name,'子表字符自定义项3' as title,
	60 as width,1030 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'d_sdefine4' as field,
	'子表字符自定义项4' as field_name,'子表字符自定义项4' as title,
	60 as width,1040 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'d_sdefine5' as field,
	'子表字符自定义项5' as field_name,'子表字符自定义项5' as title,
	60 as width,1050 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'d_ndefine1' as field,
	'子表数值自定义项1' as field_name,'子表数值自定义项1' as title,
	60 as width,1110 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'d_ndefine2' as field,
	'子表数值自定义项2' as field_name,'子表数值自定义项2' as title,
	60 as width,1120 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'d_ndefine3' as field,
	'子表数值自定义项3' as field_name,'子表数值自定义项3' as title,
	60 as width,1130 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'d_ndefine4' as field,
	'子表数值自定义项4' as field_name,'子表数值自定义项4' as title,
	60 as width,1140 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'d_ndefine5' as field,
	'子表数值自定义项5' as field_name,'子表数值自定义项5' as title,
	60 as width,1150 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'inv_sdefine1' as field,
	'存货字符自定义项1' as field_name,'存货字符自定义项1' as title,
	80 as width,3010 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'inv_sdefine2' as field,
	'存货字符自定义项2' as field_name,'存货字符自定义项2' as title,
	80 as width,3020 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'inv_sdefine3' as field,
	'存货字符自定义项3' as field_name,'存货字符自定义项3' as title,
	80 as width,3030 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'inv_sdefine4' as field,
	'存货字符自定义项4' as field_name,'存货字符自定义项4' as title,
	80 as width,3040 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'inv_sdefine5' as field,
	'存货字符自定义项5' as field_name,'存货字符自定义项5' as title,
	80 as width,3050 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'inv_ndefine1' as field,
	'存货数值自定义项1' as field_name,'存货数值自定义项1' as title,
	80 as width,3110 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'inv_ndefine2' as field,
	'存货数值自定义项2' as field_name,'存货数值自定义项2' as title,
	80 as width,3120 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'inv_ndefine3' as field,
	'存货数值自定义项3' as field_name,'存货数值自定义项3' as title,
	80 as width,3130 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'inv_ndefine4' as field,
	'存货数值自定义项4' as field_name,'存货数值自定义项4' as title,
	80 as width,3140 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AR' as module,'inv_ndefine5' as field,
	'存货数值自定义项5' as field_name,'存货数值自定义项5' as title,
	80 as width,3150 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
end
/**/GO

--delete System_ModuleFormat where module='ARAP_Report_APDetail_AP'
--插入[应付明细账]报表界面格式
if(select count(1) from System_ModuleFormat where module='ARAP_Report_APDetail_AP' and field='apd_id')=0
begin
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'apd_id' as field,
	'应付ID' as field_name,'应付ID' as title,
	60 as width,1 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'new_date' as field,
	'生成日期' as field_name,'新增日期' as title,
	70 as width,100 as sort,1 as show,0 as hidden,0 as sum_field,'date' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'bus_order_number' as field,
	'采购订单号' as field_name,'采购订单号' as title,
	120 as width,110 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'vd_name' as field,
	'供应商名称' as field_name,'供应商名称' as title,
	80 as width,130 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'i_code' as field,
	'存货编码' as field_name,'存货编码' as title,
	98 as width,140 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'i_name' as field,
	'存货名称' as field_name,'存货名称' as title,
	120 as width,150 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'free1' as field,
	'自由项1' as field_name,'自由项1' as title,
	80 as width,170 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'free2' as field,
	'自由项2' as field_name,'自由项2' as title,
	80 as width,180 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_APDetail_AP' as module,'tax_total_price' as field,
	'原币应付金额' as field_name,'原币应付金额' as title,
	80 as width,250 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_APDetail_AP' as module,'acc_hx_amount' as field,
	'原币已付金额' as field_name,'原币已付金额' as title,
	80 as width,260 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
		
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_APDetail_AP' as module,'nat_tax_total_price' as field,
	'本币应付金额' as field_name,'应付金额' as title,
	80 as width,270 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_APDetail_AP' as module,'acc_hx_nat_amount' as field,
	'本币已付金额' as field_name,'已付金额' as title,
	80 as width,280 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_APDetail_AP' as module,'wait_hx_nat_amount' as field,
	'本币' as field_name,'余额' as title,
	80 as width,290 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'crc_name' as field,
	'币种' as field_name,'币种' as title,
	40 as width,395 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'tax_rate' as field,
	'税率' as field_name,'税率' as title,
	60 as width,400 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'dep_name' as field,
	'部门' as field_name,'部门' as title,
	60 as width,380 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
		
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'exchange_rate' as field,
	'汇率' as field_name,'汇率' as title,
	40 as width,400 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'from_type' as field,
	'单据来源' as field_name,'单据来源' as title,
	70 as width,410 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'from_id' as field,
	'来源单据ID' as field_name,'来源单据ID' as title,
	100 as width,410 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'from_order_number' as field,
	'来源单据号' as field_name,'来源单据号' as title,
	120 as width,420 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'standard' as field,
	'规格型号' as field_name,'规格型号' as title,
	120 as width,480 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'munit' as field,
	'单位' as field_name,'单位' as title,
	40 as width,490 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'aunit' as field,
	'辅计单位' as field_name,'辅计量单位' as title,
	60 as width,500 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'remark' as field,
	'备注' as field_name,'备注' as title,
	100 as width,510 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'new_user' as field,
	'新增人' as field_name,'新增人' as title,
	50 as width,515 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'verify_user' as field,
	'审核人' as field_name,'审核人' as title,
	50 as width,520 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'d_sdefine1' as field,
	'子表字符自定义项1' as field_name,'子表字符自定义项1' as title,
	120 as width,1010 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'d_sdefine2' as field,
	'子表字符自定义项2' as field_name,'子表字符自定义项2' as title,
	60 as width,1020 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'d_sdefine3' as field,
	'子表字符自定义项3' as field_name,'子表字符自定义项3' as title,
	60 as width,1030 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'d_sdefine4' as field,
	'子表字符自定义项4' as field_name,'子表字符自定义项4' as title,
	60 as width,1040 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'d_sdefine5' as field,
	'子表字符自定义项5' as field_name,'子表字符自定义项5' as title,
	60 as width,1050 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'d_ndefine1' as field,
	'子表数值自定义项1' as field_name,'子表数值自定义项1' as title,
	60 as width,1110 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'d_ndefine2' as field,
	'子表数值自定义项2' as field_name,'子表数值自定义项2' as title,
	60 as width,1120 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'d_ndefine3' as field,
	'子表数值自定义项3' as field_name,'子表数值自定义项3' as title,
	60 as width,1130 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'d_ndefine4' as field,
	'子表数值自定义项4' as field_name,'子表数值自定义项4' as title,
	60 as width,1140 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'d_ndefine5' as field,
	'子表数值自定义项5' as field_name,'子表数值自定义项5' as title,
	60 as width,1150 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'inv_sdefine1' as field,
	'存货字符自定义项1' as field_name,'存货字符自定义项1' as title,
	80 as width,3010 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'inv_sdefine2' as field,
	'存货字符自定义项2' as field_name,'存货字符自定义项2' as title,
	80 as width,3020 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'inv_sdefine3' as field,
	'存货字符自定义项3' as field_name,'存货字符自定义项3' as title,
	80 as width,3030 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'inv_sdefine4' as field,
	'存货字符自定义项4' as field_name,'存货字符自定义项4' as title,
	80 as width,3040 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'inv_sdefine5' as field,
	'存货字符自定义项5' as field_name,'存货字符自定义项5' as title,
	80 as width,3050 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'inv_ndefine1' as field,
	'存货数值自定义项1' as field_name,'存货数值自定义项1' as title,
	80 as width,3110 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'inv_ndefine2' as field,
	'存货数值自定义项2' as field_name,'存货数值自定义项2' as title,
	80 as width,3120 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'inv_ndefine3' as field,
	'存货数值自定义项3' as field_name,'存货数值自定义项3' as title,
	80 as width,3130 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'inv_ndefine4' as field,
	'存货数值自定义项4' as field_name,'存货数值自定义项4' as title,
	80 as width,3140 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_APDetail_AP' as module,'inv_ndefine5' as field,
	'存货数值自定义项5' as field_name,'存货数值自定义项5' as title,
	80 as width,3150 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
end
/**/GO

--delete System_ModuleFormat where module='ARAP_Report_ShouKuan_List'
--插入[收款单列表]报表界面格式
if(select count(1) from System_ModuleFormat where module='ARAP_Report_ShouKuan_List' and field='sfk_id')=0
begin
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'sfk_id' as field,
	'收款单ID' as field_name,'收款单ID' as title,
	60 as width,1 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'new_date' as field,
	'生成日期' as field_name,'新增日期' as title,
	70 as width,100 as sort,1 as show,0 as hidden,0 as sum_field,'date' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'order_number' as field,
	'收款单号' as field_name,'收款单号' as title,
	120 as width,110 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'cus_name' as field,
	'客户名称' as field_name,'客户名称' as title,
	80 as width,130 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_ShouKuan_List' as module,'amount' as field,
	'收款金额' as field_name,'收款金额' as title,
	60 as width,200 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_ShouKuan_List' as module,'acc_hx_amount' as field,
	'已核销金额' as field_name,'已核销金额' as title,
	60 as width,210 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_ShouKuan_List' as module,'wait_hx_amount' as field,
	'未核销金额' as field_name,'未核销金额' as title,
	60 as width,215 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_ShouKuan_List' as module,'nat_amount' as field,
	'本币收款金额' as field_name,'本币收款金额' as title,
	85 as width,220 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_ShouKuan_List' as module,'acc_hx_nat_amount' as field,
	'本币已核销金额' as field_name,'本币已核销金额' as title,
	85 as width,230 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_ShouKuan_List' as module,'wait_hx_nat_amount' as field,
	'本币未核销金额' as field_name,'本币未核销金额' as title,
	85 as width,235 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'crc_name' as field,
	'币种' as field_name,'币种' as title,
	40 as width,250 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'exchange_rate' as field,
	'汇率' as field_name,'汇率' as title,
	40 as width,260 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'dep_name' as field,
	'部门' as field_name,'部门' as title,
	60 as width,270 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'ele_name' as field,
	'业务员' as field_name,'业务员' as title,
	60 as width,280 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'invoice_no' as field,
	'发票号' as field_name,'发票号' as title,
	120 as width,290 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'remark' as field,
	'备注' as field_name,'备注' as title,
	100 as width,510 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'new_user' as field,
	'新增人' as field_name,'新增人' as title,
	50 as width,515 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'verify_user' as field,
	'审核人' as field_name,'审核人' as title,
	50 as width,520 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'sdefine1' as field,
	'主表字符自定义项1' as field_name,'主表字符自定义项1' as title,
	120 as width,1010 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'sdefine2' as field,
	'主表字符自定义项2' as field_name,'主表字符自定义项2' as title,
	60 as width,1020 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'sdefine3' as field,
	'主表字符自定义项3' as field_name,'主表字符自定义项3' as title,
	60 as width,1030 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'sdefine4' as field,
	'主表字符自定义项4' as field_name,'主表字符自定义项4' as title,
	60 as width,1040 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'sdefine5' as field,
	'主表字符自定义项5' as field_name,'主表字符自定义项5' as title,
	60 as width,1050 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'ndefine1' as field,
	'主表数值自定义项1' as field_name,'主表数值自定义项1' as title,
	60 as width,1110 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'ndefine2' as field,
	'主表数值自定义项2' as field_name,'主表数值自定义项2' as title,
	60 as width,1120 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'ndefine3' as field,
	'主表数值自定义项3' as field_name,'主表数值自定义项3' as title,
	60 as width,1130 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'ndefine4' as field,
	'主表数值自定义项4' as field_name,'主表数值自定义项4' as title,
	60 as width,1140 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_ShouKuan_List' as module,'ndefine5' as field,
	'主表数值自定义项5' as field_name,'主表数值自定义项5' as title,
	60 as width,1150 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
end
/**/GO

--delete System_ModuleFormat where module='ARAP_Report_FuKuan_List'
--插入[付款单列表]报表界面格式
if(select count(1) from System_ModuleFormat where module='ARAP_Report_FuKuan_List' and field='sfk_id')=0
begin
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'sfk_id' as field,
	'付款单ID' as field_name,'付款单ID' as title,
	60 as width,1 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'new_date' as field,
	'生成日期' as field_name,'新增日期' as title,
	70 as width,100 as sort,1 as show,0 as hidden,0 as sum_field,'date' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'order_number' as field,
	'付款单号' as field_name,'付款单号' as title,
	120 as width,110 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'vd_name' as field,
	'供应商名称' as field_name,'供应商名称' as title,
	80 as width,130 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_FuKuan_List' as module,'amount' as field,
	'付款金额' as field_name,'付款金额' as title,
	60 as width,200 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_FuKuan_List' as module,'acc_hx_amount' as field,
	'已核销金额' as field_name,'已核销金额' as title,
	60 as width,210 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_FuKuan_List' as module,'wait_hx_amount' as field,
	'未核销金额' as field_name,'未核销金额' as title,
	60 as width,215 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_FuKuan_List' as module,'nat_amount' as field,
	'本币付款金额' as field_name,'本币付款金额' as title,
	85 as width,220 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_FuKuan_List' as module,'acc_hx_nat_amount' as field,
	'本币已核销金额' as field_name,'本币已核销金额' as title,
	85 as width,230 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_FuKuan_List' as module,'wait_hx_nat_amount' as field,
	'本币未核销金额' as field_name,'本币未核销金额' as title,
	85 as width,235 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
	

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'crc_name' as field,
	'币种' as field_name,'币种' as title,
	40 as width,250 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'exchange_rate' as field,
	'汇率' as field_name,'汇率' as title,
	40 as width,260 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'dep_name' as field,
	'部门' as field_name,'部门' as title,
	60 as width,270 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'ele_name' as field,
	'业务员' as field_name,'业务员' as title,
	60 as width,280 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'invoice_no' as field,
	'发票号' as field_name,'发票号' as title,
	120 as width,290 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'remark' as field,
	'备注' as field_name,'备注' as title,
	100 as width,510 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'new_user' as field,
	'新增人' as field_name,'新增人' as title,
	50 as width,515 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'verify_user' as field,
	'审核人' as field_name,'审核人' as title,
	50 as width,520 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'sdefine1' as field,
	'主表字符自定义项1' as field_name,'主表字符自定义项1' as title,
	120 as width,1010 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'sdefine2' as field,
	'主表字符自定义项2' as field_name,'主表字符自定义项2' as title,
	60 as width,1020 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'sdefine3' as field,
	'主表字符自定义项3' as field_name,'主表字符自定义项3' as title,
	60 as width,1030 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'sdefine4' as field,
	'主表字符自定义项4' as field_name,'主表字符自定义项4' as title,
	60 as width,1040 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'sdefine5' as field,
	'主表字符自定义项5' as field_name,'主表字符自定义项5' as title,
	60 as width,1050 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'ndefine1' as field,
	'主表数值自定义项1' as field_name,'主表数值自定义项1' as title,
	60 as width,1110 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'ndefine2' as field,
	'主表数值自定义项2' as field_name,'主表数值自定义项2' as title,
	60 as width,1120 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'ndefine3' as field,
	'主表数值自定义项3' as field_name,'主表数值自定义项3' as title,
	60 as width,1130 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'ndefine4' as field,
	'主表数值自定义项4' as field_name,'主表数值自定义项4' as title,
	60 as width,1140 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_FuKuan_List' as module,'ndefine5' as field,
	'主表数值自定义项5' as field_name,'主表数值自定义项5' as title,
	60 as width,1150 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
end
/**/GO

--delete System_ModuleFormat where module='ARAP_Report_CustomerBalance'
--插入[客户应收余额表]报表界面格式
if(select count(1) from System_ModuleFormat where module='ARAP_Report_CustomerBalance' and field='cus_id')=0
begin
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_CustomerBalance' as module,'cus_id' as field,
	'客户ID' as field_name,'客户ID' as title,
	60 as width,10 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_CustomerBalance' as module,'cus_code' as field,
	'客户编码' as field_name,'客户编码' as title,
	80 as width,20 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_CustomerBalance' as module,'cus_name' as field,
	'客户名称' as field_name,'客户名称' as title,
	120 as width,30 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_CustomerBalance' as module,'qi_chu' as field,
	'期初' as field_name,'期初' as title,
	80 as width,40 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_CustomerBalance' as module,'ying_shou' as field,
	'本期应收' as field_name,'本期应收' as title,
	80 as width,50 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
		
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_CustomerBalance' as module,'shou_kuan' as field,
	'本期收款' as field_name,'本期收款' as title,
	80 as width,60 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_CustomerBalance' as module,'yu_e' as field,
	'余额' as field_name,'余额' as title,
	80 as width,80 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
end
/**/GO

--delete System_ModuleFormat where module='ARAP_Report_VendorBalance'
--插入[供应商应付余额表]报表界面格式
if(select count(1) from System_ModuleFormat where module='ARAP_Report_VendorBalance' and field='vd_id')=0
begin
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_VendorBalance' as module,'vd_id' as field,
	'供应商ID' as field_name,'供应商ID' as title,
	60 as width,10 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_VendorBalance' as module,'vd_code' as field,
	'供应商编码' as field_name,'供应商编码' as title,
	80 as width,20 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_VendorBalance' as module,'vd_name' as field,
	'供应商名称' as field_name,'供应商名称' as title,
	120 as width,30 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_VendorBalance' as module,'qi_chu' as field,
	'期初' as field_name,'期初' as title,
	80 as width,40 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_VendorBalance' as module,'ying_fu' as field,
	'本期应付' as field_name,'本期应付' as title,
	80 as width,50 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
		
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_VendorBalance' as module,'fu_kuan' as field,
	'本期付款' as field_name,'本期付款' as title,
	80 as width,60 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view)
	select 'ARAP_Report_VendorBalance' as module,'yu_e' as field,
	'余额' as field_name,'余额' as title,
	80 as width,80 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view;
end
/**/GO

--delete System_ModuleFormat where module='ARAP_Report_OtherRP_AR_List'
--插入[收款单列表]报表界面格式
if(select count(1) from System_ModuleFormat where module='ARAP_Report_OtherRP_AR_List' and field='orp_id')=0
begin
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'orp_id' as field,
	'其它应收单ID' as field_name,'其它应收单ID' as title,
	60 as width,1 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'new_date' as field,
	'新增日期' as field_name,'新增日期' as title,
	70 as width,100 as sort,1 as show,0 as hidden,0 as sum_field,'date' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'order_number' as field,
	'其它应收单号' as field_name,'其它应收单号' as title,
	120 as width,110 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'cus_name' as field,
	'客户名称' as field_name,'客户名称' as title,
	80 as width,130 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view,auth_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'total_price' as field,
	'原币无税金额' as field_name,'原币无税金额' as title,
	80 as width,150 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view,
	'' as auth_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view,auth_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'tax_total_price' as field,
	'原币含税金额' as field_name,'原币含税金额' as title,
	80 as width,160 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view,
	'' as auth_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view,auth_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'nat_total_price' as field,
	'本币无税金额' as field_name,'无税金额' as title,
	80 as width,170 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,0 as can_edit,
	'' as auth_view,
	'' as auth_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view,auth_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'nat_tax_total_price' as field,
	'本币含税金额' as field_name,'含税金额' as title,
	80 as width,180 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,0 as can_edit,
	'' as auth_view,
	'' as auth_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'crc_name' as field,
	'币种' as field_name,'币种' as title,
	40 as width,250 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'exchange_rate' as field,
	'汇率' as field_name,'汇率' as title,
	40 as width,260 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'dep_name' as field,
	'部门' as field_name,'部门' as title,
	60 as width,270 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'ele_name' as field,
	'业务员' as field_name,'业务员' as title,
	60 as width,280 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'remark' as field,
	'备注' as field_name,'备注' as title,
	100 as width,510 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'new_user' as field,
	'新增人' as field_name,'新增人' as title,
	50 as width,515 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'verify_user' as field,
	'审核人' as field_name,'审核人' as title,
	50 as width,520 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'sdefine1' as field,
	'主表字符自定义项1' as field_name,'主表字符自定义项1' as title,
	120 as width,1010 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'sdefine2' as field,
	'主表字符自定义项2' as field_name,'主表字符自定义项2' as title,
	60 as width,1020 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'sdefine3' as field,
	'主表字符自定义项3' as field_name,'主表字符自定义项3' as title,
	60 as width,1030 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'sdefine4' as field,
	'主表字符自定义项4' as field_name,'主表字符自定义项4' as title,
	60 as width,1040 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'sdefine5' as field,
	'主表字符自定义项5' as field_name,'主表字符自定义项5' as title,
	60 as width,1050 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'ndefine1' as field,
	'主表数值自定义项1' as field_name,'主表数值自定义项1' as title,
	60 as width,1110 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'ndefine2' as field,
	'主表数值自定义项2' as field_name,'主表数值自定义项2' as title,
	60 as width,1120 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'ndefine3' as field,
	'主表数值自定义项3' as field_name,'主表数值自定义项3' as title,
	60 as width,1130 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'ndefine4' as field,
	'主表数值自定义项4' as field_name,'主表数值自定义项4' as title,
	60 as width,1140 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AR_List' as module,'ndefine5' as field,
	'主表数值自定义项5' as field_name,'主表数值自定义项5' as title,
	60 as width,1150 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
end
/**/GO
--delete System_ModuleFormat where module='ARAP_Report_OtherRP_AP_List'
--插入[付款单列表]报表界面格式
if(select count(1) from System_ModuleFormat where module='ARAP_Report_OtherRP_AP_List' and field='orp_id')=0
begin
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'orp_id' as field,
	'其它应付单ID' as field_name,'其它应付单ID' as title,
	60 as width,1 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'new_date' as field,
	'新增日期' as field_name,'新增日期' as title,
	70 as width,100 as sort,1 as show,0 as hidden,0 as sum_field,'date' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'order_number' as field,
	'其它应付单号' as field_name,'其它应付单号' as title,
	120 as width,110 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'cus_name' as field,
	'客户名称' as field_name,'客户名称' as title,
	80 as width,130 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view,auth_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'total_price' as field,
	'原币无税金额' as field_name,'原币无税金额' as title,
	80 as width,150 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view,
	'' as auth_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view,auth_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'tax_total_price' as field,
	'原币含税金额' as field_name,'原币含税金额' as title,
	80 as width,160 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,
	'' as auth_view,
	'' as auth_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view,auth_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'nat_total_price' as field,
	'本币无税金额' as field_name,'无税金额' as title,
	80 as width,170 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,0 as can_edit,
	'' as auth_view,
	'' as auth_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,auth_view,auth_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'nat_tax_total_price' as field,
	'本币含税金额' as field_name,'含税金额' as title,
	80 as width,180 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,0 as can_edit,
	'' as auth_view,
	'' as auth_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'crc_name' as field,
	'币种' as field_name,'币种' as title,
	40 as width,250 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'exchange_rate' as field,
	'汇率' as field_name,'汇率' as title,
	40 as width,260 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'dep_name' as field,
	'部门' as field_name,'部门' as title,
	60 as width,270 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'ele_name' as field,
	'业务员' as field_name,'业务员' as title,
	60 as width,280 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'remark' as field,
	'备注' as field_name,'备注' as title,
	100 as width,510 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'new_user' as field,
	'新增人' as field_name,'新增人' as title,
	50 as width,515 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'verify_user' as field,
	'审核人' as field_name,'审核人' as title,
	50 as width,520 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'sdefine1' as field,
	'主表字符自定义项1' as field_name,'主表字符自定义项1' as title,
	120 as width,1010 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'sdefine2' as field,
	'主表字符自定义项2' as field_name,'主表字符自定义项2' as title,
	60 as width,1020 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'sdefine3' as field,
	'主表字符自定义项3' as field_name,'主表字符自定义项3' as title,
	60 as width,1030 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'sdefine4' as field,
	'主表字符自定义项4' as field_name,'主表字符自定义项4' as title,
	60 as width,1040 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'sdefine5' as field,
	'主表字符自定义项5' as field_name,'主表字符自定义项5' as title,
	60 as width,1050 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'ndefine1' as field,
	'主表数值自定义项1' as field_name,'主表数值自定义项1' as title,
	60 as width,1110 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'ndefine2' as field,
	'主表数值自定义项2' as field_name,'主表数值自定义项2' as title,
	60 as width,1120 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'ndefine3' as field,
	'主表数值自定义项3' as field_name,'主表数值自定义项3' as title,
	60 as width,1130 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'ndefine4' as field,
	'主表数值自定义项4' as field_name,'主表数值自定义项4' as title,
	60 as width,1140 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_OtherRP_AP_List' as module,'ndefine5' as field,
	'主表数值自定义项5' as field_name,'主表数值自定义项5' as title,
	60 as width,1150 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
end
/**/GO

--插入核销单_主表界面格式
--delete System_ModuleFormat where module='ARAP_Report_CancelOrder_List'
if(select count(1) from System_ModuleFormat where module='ARAP_Report_CancelOrder_List' and field='co_id')=0
begin
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_CancelOrder_List' as module,'co_id' as field,
	'核销单主表ID' as field_name,'核销单主表ID' as title,
	120 as width,80 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,color)
	select 'ARAP_Report_CancelOrder_List' as module,'order_number' as field,
	'核销单号' as field_name,'核销单号' as title,
	120 as width,100 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit,'' as color;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,color)
	select 'ARAP_Report_CancelOrder_List' as module,'new_date' as field,
	'单据日期' as field_name,'单据日期' as title,
	70 as width,110 as sort,1 as show,0 as hidden,0 as sum_field,'date' as type,1 as can_edit,'' as color;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,color)
	select 'ARAP_Report_CancelOrder_List' as module,'cl_type_name' as field,
	'核销类型' as field_name,'核销类型' as title,
	70 as width,120 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit,'' as color;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,color)
	select 'ARAP_Report_CancelOrder_List' as module,'cus_name' as field,
	'客户名称' as field_name,'客户名称' as title,
	150 as width,140 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit,'' as color;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,color)
	select 'ARAP_Report_CancelOrder_List' as module,'vd_name' as field,
	'供应商名称' as field_name,'供应商名称' as title,
	150 as width,160 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit,'' as color;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,color)
	select 'ARAP_Report_CancelOrder_List' as module,'total_amount' as field,
	'原币冲销金额合计' as field_name,'原币冲销金额合计' as title,
	100 as width,170 as sort,0 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,'' as color;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,color)
	select 'ARAP_Report_CancelOrder_List' as module,'total_nat_amount' as field,
	'本币冲销金额合计' as field_name,'冲销金额合计' as title,
	100 as width,180 as sort,1 as show,0 as hidden,1 as sum_field,'text' as type,1 as can_edit,'' as color;
	
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit,color)
	select 'ARAP_Report_CancelOrder_List' as module,'crc_name' as field,
	'币种' as field_name,'币种' as title,
	60 as width,216 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit,'' as color;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_CancelOrder_List' as module,'exchange_rate' as field,
	'汇率' as field_name,'汇率' as title,
	60 as width,217 as sort,0 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
		
	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_CancelOrder_List' as module,'new_user' as field,
	'新增人' as field_name,'新增人' as title,
	60 as width,400 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_CancelOrder_List' as module,'verify_user' as field,
	'审核人' as field_name,'审核人' as title,
	60 as width,430 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,0 as can_edit;

	insert System_ModuleFormat(module,field,field_name,
	title,width,sort,show,hidden,sum_field,type,can_edit)
	select 'ARAP_Report_CancelOrder_List' as module,'remark' as field,
	'备注' as field_name,'备注' as title,
	120 as width,440 as sort,1 as show,0 as hidden,0 as sum_field,'text' as type,1 as can_edit;
end
/**/GO
