浏览代码

Merge remote-tracking branch 'origin/develop' into develop

郭齐峰 1 年之前
父节点
当前提交
d8f5741474

+ 2 - 2
src/custom/restcontroller/sale/salestarget/SQL/企业-收款.sql

@@ -1,6 +1,6 @@
 with sa_salestarget as (
-   select point,year,sys_enterpriseid,sum(amount) amount from (SELECT 0+CAST(amount AS CHAR) amount, MONTH(billdate) point,YEAR(billdate) year,sys_enterpriseid FROM sa_cashbill
-    WHERE siteid =$siteid$ AND status in('审核') and ($where1$) and type=1 and YEAR (billdate)=$year$ and sys_enterpriseid in $sys_enterpriseid$) a
+   select point,year,sys_enterpriseid,sum(amount) amount from (SELECT 0+CAST(amount AS CHAR) amount, MONTH(period) point,YEAR(period) year,sys_enterpriseid FROM sa_cashbill
+    WHERE siteid =$siteid$ AND status in('审核') and ($where1$) and type=1 and YEAR (period)=$year$ and sys_enterpriseid in $sys_enterpriseid$) a
     GROUP BY point,year,sys_enterpriseid
     )
 SELECT DISTINCT m.year,

+ 2 - 2
src/custom/restcontroller/webmanage/sale/salestarget/SQL/人员目标统计-收款.sql

@@ -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 (