K3中 报表汇总行颜色不同

CREATE PROCEDURE proc_weber_seorder_sum
@datefrom datetime,
@dateto datetime
AS

SET NOCOUNT ON

--销售订单明细表
select c.fnumber cust_number,m.fbillno,''+convert(char(10),m.fdate,121) fdate,d.fentryid,i.fnumber,i.fname,i.fmodel,d.fqty,99 as FSumSort
into #tmp_weber
from SEOrder m,SEOrderentry d,t_icitem i,t_Organization c
where m.finterid=d.finterid and d.fitemid=i.fitemid and m.fcustid=c.fitemid and m.fdate between @datefrom and @dateto

union
select c.fnumber,m.fbillno,'','','','','',sum(d.fqty) qty,99 as fsumsort
from SEOrder m,SEOrderentry d,t_icitem i,t_Organization c
where m.finterid=d.finterid and d.fitemid=i.fitemid and m.fcustid=c.fitemid and m.fdate between @datefrom and @dateto
group by c.fnumber,c.fname,m.fbillno WITH ROLLUP


update #tmp_weber
set cust_number='总 计▼',fbillno=convert(char(10),@dateto,121),fentryid=(null),fsumsort=101
from #tmp_weber
where cust_number is null

update #tmp_weber
set fbillno='客户小计▼',fdate=convert(char(10),@dateto,121),fentryid=(null),fsumsort=100
from #tmp_weber
where fbillno is null

update #tmp_weber
set fdate='订单小计▼',fentryid=(null),fsumsort=101
from #tmp_weber
where fentryid=0


select t.cust_number,c.fname as cfname,t.fbillno,t.fentryid,t.fdate,t.fnumber,t.fname,t.fmodel,t.fqty,t.fsumsort
from #tmp_weber t
left join t_Organization c on t.cust_number=c.fnumber

drop table #tmp_weber
SET NOCOUNT OFF

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值