hxh 4 месяцев назад
Родитель
Сommit
1327e6bb9d

+ 4 - 4
src/custom/restcontroller/webmanage/sale/tpartreimbursement/tpartreimbursement.java

@@ -468,14 +468,14 @@ public class tpartreimbursement extends Controller {
         Rows sumamountRows = dbConnect.runSqlQuery("select min(t1.payamount) payamount, min(t1.paydiscountamount) paydiscountamount,t1.st_stockbillid from st_stockbill t1 " +
                 "inner join st_stockbill_items t2 on t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid  " +
                 "inner join sa_order t3 on t2.sa_orderid=t3.sa_orderid and t2.siteid=t3.siteid" +
-                " where t1.siteid='" + siteid + "' and t1.status='审核' and t1.rb=1 and t1.type='销售出库' and t3.type='配件订单' and t3.sys_enterpriseid='" + sys_enterpriseid + "' and DATE_FORMAT( t1.checkdate, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )  group by t1.st_stockbillid");
+                " where t1.siteid='" + siteid + "' and t1.status='审核' and t1.rb=1 and t1.type='销售出库' and t3.type='配件订单' and t3.sys_enterpriseid='" + sys_enterpriseid + "' and DATE_FORMAT( t1.billdate, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )  group by t1.st_stockbillid");
 
         QuerySQL querySQL = SQLFactory.createQuerySQL(this, "st_stockbill","payamount","paydiscountamount");
         querySQL.setTableAlias("t1");
         querySQL.addJoinTable(JOINTYPE.left, "st_stockbill_items", "t2", "t2.st_stockbillid = t1.st_stockbillid AND t2.siteid = t1.siteid","amount");
         querySQL.setSiteid(siteid);
         querySQL.setWhere("t1.sys_enterpriseid", sys_enterpriseid);
-        querySQL.setWhere("t1.departmentid=(select departmentid from sys_department where depname='售后部') and t1.rb=0 and t1.status='审核' and t1.type='销售出库' and DATE_FORMAT(t1.checkdate, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )");
+        querySQL.setWhere("t1.departmentid=(select departmentid from sys_department where depname='售后部') and t1.rb=0 and t1.status='审核' and t1.type='销售出库' and DATE_FORMAT(t1.billdate, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )");
         Rows rows = querySQL.query();
 
         HashMap<String,BigDecimal> map =new HashMap<>();
@@ -511,14 +511,14 @@ public class tpartreimbursement extends Controller {
         Rows sumamountRows = dbConnect.runSqlQuery("select min(t1.payamount) payamount, min(t1.paydiscountamount) paydiscountamount,t1.st_stockbillid from st_stockbill t1 " +
                 "inner join st_stockbill_items t2 on t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid  " +
                 "inner join sa_order t3 on t2.sa_orderid=t3.sa_orderid and t2.siteid=t3.siteid" +
-                " where t1.siteid='" + siteid + "' and t1.status='审核' and t1.rb=1 and t1.type='销售出库' and t3.type='配件订单' and t3.sys_enterpriseid='" + sys_enterpriseid + "' and DATE_FORMAT( t1.checkdate, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )  group by t1.st_stockbillid");
+                " where t1.siteid='" + siteid + "' and t1.status='审核' and t1.rb=1 and t1.type='销售出库' and t3.type='配件订单' and t3.sys_enterpriseid='" + sys_enterpriseid + "' and DATE_FORMAT( t1.billdate, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )  group by t1.st_stockbillid");
 
         QuerySQL querySQL1 = SQLFactory.createQuerySQL(this, "st_stockbill","payamount","paydiscountamount");
         querySQL1.setTableAlias("t1");
         querySQL1.addJoinTable(JOINTYPE.left, "st_stockbill_items", "t2", "t2.st_stockbillid = t1.st_stockbillid AND t2.siteid = t1.siteid","amount");
         querySQL1.setSiteid(siteid);
         querySQL1.setWhere("t1.sys_enterpriseid", sys_enterpriseid);
-        querySQL1.setWhere("t1.departmentid=(select departmentid from sys_department where depname='售后部') and t1.rb=0 and t1.status='审核' and t1.type='销售出库' and DATE_FORMAT(t1.checkdate, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )");
+        querySQL1.setWhere("t1.departmentid=(select departmentid from sys_department where depname='售后部') and t1.rb=0 and t1.status='审核' and t1.type='销售出库' and DATE_FORMAT(t1.billdate, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )");
         Rows rows1 = querySQL1.query();
 
         HashMap<String,BigDecimal> map =new HashMap<>();

+ 3 - 3
src/custom/restcontroller/webmanage/sale/tpartreimbursement/tpartreimbursementdetail.java

@@ -43,21 +43,21 @@ public class tpartreimbursementdetail extends Controller {
         Rows sumamountRows_whx= dbConnect.runSqlQuery("select t2.sys_enterpriseid,sum(t3.price*t1.checkqty) amount from sa_tpartreimbursementdetail t1 " +
                 "inner join sa_tpartreimbursement t2 on t1.sa_tpartreimbursementid=t2.sa_tpartreimbursementid and t1.siteid=t2.siteid  " +
                 "inner join sa_orderitems t3 on t3.sa_orderitemsid=t1.sa_orderitemsid and t3.siteid=t1.siteid  " +
-                " where t2.siteid='" + siteid + "' and t2.status='审核' and t1.isverified=0 and t2.sys_enterpriseid in" + sys_enterpriseidList.toString().replace("[", "(").replace("]", ")") + " and DATE_FORMAT( t2.checkdate, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )  group by t2.sys_enterpriseid");
+                " where t2.siteid='" + siteid + "' and t2.status='审核' and t1.isverified=0 and t2.sys_enterpriseid in" + sys_enterpriseidList.toString().replace("[", "(").replace("]", ")") + " and DATE_FORMAT( t2.billdate, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )  group by t2.sys_enterpriseid");
         RowsMap sumamountRowsMap_whx=sumamountRows_whx.toRowsMap("sys_enterpriseid");
 
 
         Rows sumamountRows= dbConnect.runSqlQuery("select min(t1.payamount) payamount, min(t1.paydiscountamount) paydiscountamount,t1.st_stockbillid,t1.sys_enterpriseid from st_stockbill t1 " +
                 "inner join st_stockbill_items t2 on t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid  " +
                 "inner join sa_order t3 on t2.sa_orderid=t3.sa_orderid and t2.siteid=t3.siteid" +
-                " where t1.siteid='" + siteid + "' and t1.status='审核' and t1.rb=1 and t1.type='销售出库' and t3.type='配件订单' and t3.sys_enterpriseid in" + sys_enterpriseidList.toString().replace("[", "(").replace("]", ")") + " and DATE_FORMAT( t1.checkdate, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )  group by t1.st_stockbillid,t1.sys_enterpriseid");
+                " where t1.siteid='" + siteid + "' and t1.status='审核' and t1.rb=1 and t1.type='销售出库' and t3.type='配件订单' and t3.sys_enterpriseid in" + sys_enterpriseidList.toString().replace("[", "(").replace("]", ")") + " and DATE_FORMAT( t1.billdate, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )  group by t1.st_stockbillid,t1.sys_enterpriseid");
         RowsMap sumamountRowsMap=sumamountRows.toRowsMap("sys_enterpriseid");
 
         QuerySQL querySQL_yhx  = SQLFactory.createQuerySQL(this, "st_stockbill","sys_enterpriseid","payamount","paydiscountamount");
         querySQL_yhx.setTableAlias("t1");
         querySQL_yhx.setSiteid(siteid);
         querySQL_yhx.setWhere("t1.sys_enterpriseid", rows.toArrayList("sys_enterpriseid"));
-        querySQL_yhx.setWhere("t1.departmentid=(select departmentid from sys_department where depname='售后部') and t1.rb=0 and t1.status='审核' and t1.type='销售出库' and DATE_FORMAT(t1.checkdate, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )");
+        querySQL_yhx.setWhere("t1.departmentid=(select departmentid from sys_department where depname='售后部') and t1.rb=0 and t1.status='审核' and t1.type='销售出库' and DATE_FORMAT(t1.billdate, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )");
         Rows rows_yhx = querySQL_yhx .query();
         RowsMap rowsMap_yhx=rows_yhx.toRowsMap("sys_enterpriseid");