Ver Fonte

订单自动审核检测新增当天是否有负数的支出凭证

shenjingwei há 6 meses atrás
pai
commit
96fa4081fd
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      src/custom/service/OrderAutoCheck.java

+ 1 - 1
src/custom/service/OrderAutoCheck.java

@@ -19,7 +19,7 @@ public class OrderAutoCheck extends ServiceController {
                 "inner join sa_orderitems t2 on t1.sa_orderid=t2.sa_orderid \n" +
                 "inner join sa_orderitems t2 on t1.sa_orderid=t2.sa_orderid \n" +
                 "inner join sa_agents t3 on t1.sys_enterpriseid=t3.sys_enterpriseid and t3.submitautocheck=1 \n" +
                 "inner join sa_agents t3 on t1.sys_enterpriseid=t3.sys_enterpriseid and t3.submitautocheck=1 \n" +
                 "where t1.status='提交' and not exists(select * from sa_orderitems t4 where t1.sa_orderid=t4.sa_orderid and t4.remarks is not null)\n" +
                 "where t1.status='提交' and not exists(select * from sa_orderitems t4 where t1.sa_orderid=t4.sa_orderid and t4.remarks is not null)\n" +
-                "  and exists(select * from sa_cashbill t5 where t5.type=1 and t5.status='审核' and t5.sys_enterpriseid=t1.sys_enterpriseid and t5.billdate>=date(now()))\n" +
+                "  and exists(select * from sa_cashbill t5 where ((t5.type=1 and t5.amount>0) or (t5.type=0 and t5.amount<0)) and t5.status='审核' and t5.sys_enterpriseid=t1.sys_enterpriseid and t5.billdate>=date(now()))\n" +
                 "group by t1.sa_orderid,t1.sa_accountclassid,t1.sys_enterpriseid,t1.sonum having sum(t2.amount)>0 order by t1.sys_enterpriseid,sum(t2.amount)");
                 "group by t1.sa_orderid,t1.sa_accountclassid,t1.sys_enterpriseid,t1.sonum having sum(t2.amount)>0 order by t1.sys_enterpriseid,sum(t2.amount)");
         logger.info("监测到有{}个订单待审核", orderRows.size());
         logger.info("监测到有{}个订单待审核", orderRows.size());