|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
T6单据新打印数据顺序错乱 魏雯
【问题现象】业务单据使用新打印,表体存货顺序错乱,见下图:
【问题分析】软件前台没有新打印顺序设置功能节点,一般新打印顺序是按照录入顺序,不会错乱,考虑是存储过程异常导致的。
【解决方案】备份好账套数据,使用事件跟踪器查询正常账套在新打印预览时的存储过程,在查询分析器中针对问题账套执行即可。以下以销售出库单新打印表体顺序错乱为例:
1.备份好账套数据,进入软件,打开销售出库单,点击打印-新设计,将新打印模板打开,使用事件跟踪器查询正常账套在打开新打印模板时的存储过程:
2. 进入查询分析器执行查看存储过程的命令:sp_helptext newprint_SaleOutVouch_body
3.在查询分析器中针对问题账套执行以下语句:
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
alter PROCEDURE [dbo].[NewPrint_SaleOutVouch_Body]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from KCSaleOutB where id='''+@parm+'''' +'order by autoid')
--select * from KCSaleOutB where id=@parm order by AutoID
end
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
PS:语句中红色字体是需要自己在执行语句时加入的,“order by autoid”的意思是按照录入顺序自动排序,也可以根据自己的个性化要求进行排序,比如根据存货编码排序加“order by cInvCode”。
附件:以下附各单据的存储过程模块
单据
存储过程
采购
采购请购单
CREATE PROCEDURE [dbo].[NewPrint_PU_AppVouch_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from pu_AppHead with(nolock) where id='''+@parm+'''')
--select * from pu_AppHead where id=@parm
end
采购订单
采购订单存储过程
--采购订单
CREATE PROCEDURE [dbo].[NewPrint_PurOrder_body]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+',ginvpicture from zpurpotail with(nolock)
left join (select cinvcode as piccode,ginvpicture from InventoryPicture where cpictype is not null) as A on A.piccode=zpurpotail.cInvCode where poid='''+@parm+'''')
--SELECT * from zpurpotail where poid=@parm
end
采购到货单
采购到货单存储过程
CREATE PROCEDURE [dbo].[NewPrint_PU_ArrivalVouch_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from pu_ArrHead with(nolock) where id='''+@parm+'''')
--select * from pu_ArrHead where id=@parm
end
采购入库单
采购入库单存储过程
--采购入库单
CREATE PROCEDURE [dbo].[NewPrint_VoucherRD_Body]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+',ginvpicture from zpurRkdTail with(nolock)
left join (select cinvcode as gpiccode,ginvpicture from InventoryPicture where cpictype is not null) A on A.gpiccode=zpurRkdTail.cinvcode where id='''+@parm+'''' )
--SELECT * from zpurRkdTail where id=@parm
end
专用采购发票
CREATE PROCEDURE [dbo].[NewPrint_zhpurBillVouch_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from zhpurBillHead with(nolock) where pbvid='''+@parm+'''' )
--select * from zhpurBillHead where pbvid=@parm
end
红字专用采购发票
CREATE PROCEDURE [dbo].[NewPrint_zhpurBillVouch_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from zhpurBillHead with(nolock) where pbvid='''+@parm+'''' )
--select * from zhpurBillHead where pbvid=@parm
end
普通采购发票
CREATE PROCEDURE [dbo].[NewPrint_PpurBillVouch_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from PpurBillHead with(nolock) where pbvid='''+@parm+'''')
--select * from PpurBillHead where pbvid=@parm
end
红字普通采购发票
CREATE PROCEDURE [dbo].[NewPrint_PpurBillVouch_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from PpurBillHead with(nolock) where pbvid='''+@parm+'''')
--select * from PpurBillHead where pbvid=@parm
end
采购普通运费发票
CREATE PROCEDURE [dbo].[NewPrint_YpurBillVouch_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from YpurBillHead with(nolock) where pbvid='''+@parm+'''' )
--select * from YpurBillHead where pbvid=@parm
end
采购专用运费发票
Create PROCEDURE [dbo].[NewPrint_Z_YPurBillVouch_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from zypurBillhead with(nolock) where pbvid='''+@parm+'''' )
end
红字采购普通运费发票
CREATE PROCEDURE [dbo].[NewPrint_YpurBillVouch_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from YpurBillHead with(nolock) where pbvid='''+@parm+'''' )
--select * from YpurBillHead where pbvid=@parm
end
红字采购专用运费发票
Create PROCEDURE [dbo].[NewPrint_Z_YPurBillVouch_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from zypurBillhead with(nolock) where pbvid='''+@parm+'''' )
end
采购检验单
采购检验单存储过程
CREATE PROCEDURE [dbo].[NewPrint_QM_NCV10Vouch_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from QM_NCV10_H with(nolock) where id='''+@parm+'''')
--select * from QM_NCV10_H where id=@parm
end
销售
销售报价单
销售报价单
CREATE PROCEDURE [dbo].[NewPrint_SA_QuoVouch_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from SA_QuoHead with(nolock) where id='''+@parm+'''' )
--select * from SA_QuoHead where id=@parm
end
样品接单管理
样品接单管理
CREATE PROCEDURE [dbo].[NewPrint_SA_ManageSampleVouch_body]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from SA_ManageSample_V with(nolock) where iautoid='''+@parm+'''' )
--SELECT * from SA_ManageSample_V where iautoid=@parm
end
销售订单
销售订单存储过程
CREATE PROCEDURE [dbo].[NewPrint_SaleOrder_Title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from SaleOrderQ with(nolock) where id='''+@parm+'''' )
--select * from SaleOrderQ where id=convert(int,@parm)
end
发货单
发货单存储过程
CREATE PROCEDURE [dbo].[NewPrint_Dispvch_Title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from Sales_FHD_T with(nolock) where DLID='''+@parm+'''')
--select * from Sales_FHD_T where DLID=@parm
end
退货单
退货单存储过程
CREATE PROCEDURE [dbo].[newprint_ReDispatchList_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from Sales_FHD_T with(nolock) where dlid='''+@parm+'''' )
--select * from Sales_FHD_T where dlid=@parm
end
销售专用发票
销售专用发票存储过程
CREATE PROCEDURE [dbo].[NewPrint_SaleBillVouch_body]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from SaleBillVouchZW with(nolock) where sbvid='''+@parm+'''' )
--SELECT * from SaleBillVouchZW where sbvid=@parm
end
红字专用销售发票
CREATE PROCEDURE [dbo].[NewPrint_SaleBillVouch_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from SaleBillVouchZT with(nolock) where sbvid='''+@parm+'''' )
--select * from SaleBillVouchZT where sbvid=@parm
end
销售普通发票
销售普通发票存储过程
CREATE PROCEDURE [dbo].[NewPrint_SaleBillVouch_body]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from SaleBillVouchZW with(nolock) where sbvid='''+@parm+'''' )
--SELECT * from SaleBillVouchZW where sbvid=@parm
end
红字普通销售发票
CREATE PROCEDURE [dbo].[NewPrint_SaleBillVouch_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from SaleBillVouchZT with(nolock) where sbvid='''+@parm+'''' )
--select * from SaleBillVouchZT where sbvid=@parm
end
委托代销发货单
委托代销发货单
CREATE PROCEDURE [dbo].[NewPrint_Sales_DXFH_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from Sales_DXFH_T with(nolock) where dlid='''+@parm+'''' )
--select * from Sales_DXFH_T where dlid=@parm
end
委托代销发货退回单
委托代销发货退回单
CREATE PROCEDURE [dbo].[NewPrint_Sales_DXFH_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from Sales_DXFH_T with(nolock) where dlid='''+@parm+'''' )
--select * from Sales_DXFH_T where dlid=@parm
end
委托代销结算单
委托代销结算单
CREATE PROCEDURE [dbo].[NewPrint_Sales_DXJS_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from Sales_DXJS_T with(nolock) where id='''+@parm+'''' )
--select * from Sales_DXJS_T where id=@parm
end
委托代销结算退回单
CREATE PROCEDURE [dbo].[NewPrint_Sales_DXJS_title]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsection)
exec('SELECT '+@strname+' from Sales_DXJS_T with(nolock) where id='''+@parm+'''' )
--select * from Sales_DXJS_T where id=@parm
end
委托代销调整单
CREATE PROCEDURE [dbo].[NewPrint_Sales_DXFH_body]
@parm varchar(100) ,@user varchar(100) ,@cardnumber varchar(100), @cardsection varchar (100)
AS
begin
declare @strname varchar(4000)
set @strname=dbo.NPrint_GetFldName(@user,@cardnumber,@cardsecti |
|