hu 2 лет назад
Родитель
Сommit
14f8fe9443

+ 2 - 2
src/custom/restcontroller/webmanage/sale/rebateaccount/rebateaccounthead.java

@@ -153,13 +153,13 @@ public class rebateaccounthead extends Controller {
             String enddate =null;
             String billdate =null;
             int count=1;
-            Rows agentdecorationtrebateRows  = dbConnect.runSqlQuery("select t1.* from sa_agentdecorationtrebate t1 inner join sys_enterprise t2 on t1.sys_enterpriseid=t2.sys_enterpriseid and t1.siteid=t2.siteid  where t1.siteid='" + siteid + "'");
+            Rows agentdecorationtrebateRows  = dbConnect.runSqlQuery("select t1.* from sa_agentdecorationtrebate t1 inner join sys_enterprise t2 on t1.sys_enterpriseid=t2.sys_enterpriseid and t1.siteid=t2.siteid  where t1.siteid='" + siteid + "' ");
             for (Row row: agentdecorationtrebateRows) {
                 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                 begindate = sdf.format(row.getDate("begindate"));
                 enddate = sdf.format(row.getDate("enddate"));
                 billdate = sdf.format(rows.get(0).getDate("billdate"));
-                if (begindate.compareTo(billdate) <= 0 && billdate.compareTo(enddate) <= 0) {
+                if ((begindate.compareTo(billdate) <= 0 && billdate.compareTo(enddate) <= 0) && row.getBigDecimal("balance").compareTo(BigDecimal.ZERO)>0) {
                     SQLFactory sqlFactory = new SQLFactory(this, "返利结算单表体明细新增");
                     sqlFactory.addParameter("siteid", siteid);
                     sqlFactory.addParameter("sa_rebateaccountid", createTableID("sa_rebateaccount"));