抓已开票的销货单和退货单 关联INVLA抓取相关的数据
/*
*用途:统计销售实际 已开票抓INVLA档抓成本
*作者:龚德辉
*日期:2010-05--23
*/
CREATE Procedure UP_SALRealyCost
(
@year as char(4)='2010'
)
as
begin
declare @plan Table
(
type nvarchar(20)
,area nvarchar(20)
,sort int
,acct_month1 decimal(18,9)
,acct_month2 decimal(18,9)
,acct_month3 decimal(18,9)
,acct_month4 decimal(18,9)
,acct_month5 decimal(18,9)
,acct_month6 decimal(18,9)
,acct_month7 decimal(18,9)
,acct_month8 decimal(18,9)
,acct_month9 decimal(18,9)
,acct_month10 decimal(18,9)
,acct_month11 decimal(18,9)
,acct_month12 decimal(18,9)
)
declare @account as decimal(18,9),@date as nvarchar(8),@type as nvarchar(20),@area as nvarchar(