久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

金蝶K3財務(wù)物流對帳

 庋藏天下 2013-06-22

根據(jù)物流系統(tǒng)生成的憑證與物流系統(tǒng)實(shí)際的單據(jù)進(jìn)行對帳,,以檢查出哪些單據(jù)的憑證和實(shí)際單據(jù)金額不符


/****** Object:  Stored Procedure dbo.stkd_財務(wù)_財務(wù)物流對帳    Script Date: 2006-12-11 14:55:39 ******/
create proc stkd_財務(wù)_財務(wù)物流對帳
@period int,
@year int,
@acc varchar(10)
as

set nocount on
create table #aa(
fvoucherid 
int,
fnumber 
int,
faccountid 
int,
faccountnumber 
varchar(10),
famount 
decimal(18,2),
fwamount 
decimal(18,2),
fdiff 
decimal(18,2)
)

insert into #aa(fvoucherid,fnumber,faccountid,faccountnumber,famount)
select t1.fvoucherid,t1.fnumber,t2.faccountid,T3.Fnumber,
sum(case when t2.fdc=1 then t2.famount when t2.fdc=0 then -t2.famount else 0 end)
from t_voucher t1,t_voucherentry t2,t_account t3
where t1.fvoucherid=t2.fvoucherid and t2.faccountid=t3.faccountid
and t1.fperiod=@period and t1.fyear=@year and t1.finternalind='industry' and t3.fnumber=@acc
group by t1.fvoucherid,t1.fnumber,t2.faccountid,t3.fnumber


update t1 set t1.fwamount=t2.famount
from #aa t1,(
select t1.fvchinterid,t3.facctid,
sum(case when t1.ftrantype in (1,2,3,5,10,40then t2.famount 
when t1.ftrantype in (21,24,28,29,43then -t2.famount else 0 endas famount
from icstockbill t1,icstockbillentry t2,t_icitem t3
where t1.finterid=t2.finterid and month(T1.fdate)=@period and year(t1.fdate)=@year
and t2.fitemid=t3.fitemid 
group by t1.fvchinterid,t3.facctid)
t2
where t1.fvoucherid=t2.fvchinterid and t1.faccountid=t2.facctid


UPDATE #aa set fdiff=famount-fwamount
select fnumber as 憑證號,faccountnumber as 科目代碼,famount as 憑證金額,fwamount as 單據(jù)金額,fdiff as 差異 from #aa order by fnumber

drop table #aa

 

GO

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,,不代表本站觀點(diǎn),。請注意甄別內(nèi)容中的聯(lián)系方式,、誘導(dǎo)購買等信息,謹(jǐn)防詐騙,。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,,請點(diǎn)擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多