用BOS2.0,采用SQL方式生成一张已开票的出库统计表
set nocount on
create table #temp (fdate datetime NULL default '', fnumber varchar(80) NULL default '',
fname varchar(80) NULL default '',fqty decimal(13,2) NULL default '',fprice decimal(13,2) NULL default '',famount decimal(13,2) NULL default '')
insert into #temp select v3.fdate as fdate,v1.fnumber as fnumber,v1.fname as fname,sum(v2.fqty) as fqty ,avg(v2.fprice) as fprice,sum(v2.famount) as famount
from icstockbillentry v2 inner join t_icitem v1 on v1.fitemID=v2.fitemid
inner join icstockbill v3 on v2.finterid=v3.finterid
where v3.ftrantype='21' and v3.fhookstatus='2'
and {strDateFrom} and {strDateTo}
and {strNumberFrom} and {StrNumberTo}
group by v1.fnumber,v1.fname,v3.fdate
select * from #temp
drop table #temp
set nocount off
www.qxhui.com.cn
QQ群:14086362
有事点这里