|
@@ -1,10 +1,10 @@
|
|
|
with sa_salestarget as
|
|
|
(
|
|
|
- select 0+CAST(sum(amount) AS CHAR) amount,point,sa_saleareaid,type from (SELECT t1.amount, MONTH (t1.createdate) point,ifnull(t4.sa_saleareaid,0) sa_saleareaid,'月' type
|
|
|
+ select 0+CAST(sum(amount) AS CHAR) amount,point,sa_saleareaid,type from (SELECT t1.amount, MONTH (t1.period) point,ifnull(t4.sa_saleareaid,0) sa_saleareaid,'月' type
|
|
|
FROM sa_cashbill t1
|
|
|
left join sys_enterprise_tradefield t3 on t1.sys_enterpriseid=t3.sys_enterpriseid and t1.siteid=t3.siteid
|
|
|
left join sa_salearea t4 on t4.sa_saleareaid=t3.sa_saleareaid and t4.siteid=t3.siteid
|
|
|
-WHERE YEAR (t1.createdate)=$year$ AND t1.siteid=$siteid$ AND t1.status in('审核') and t1.type=1 and ($where1$)) a
|
|
|
+WHERE YEAR (t1.period)=$year$ AND t1.siteid=$siteid$ AND t1.status in('审核') and t1.type=1 and ($where1$)) a
|
|
|
GROUP BY point,sa_saleareaid,type
|
|
|
)
|
|
|
, hrtarget as (
|