hxh hai 4 meses
pai
achega
94221d7e21

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

@@ -436,10 +436,10 @@ public class tpartreimbursement extends Controller {
     @CACHEING
     public String queryReimbursableAmount() throws YosException {
         sys_enterpriseid = content.getLong("sys_enterpriseid");
-        Rows sumamountRows = dbConnect.runSqlQuery("select t1.payamount,t1.paydiscountamount from st_stockbill t1 " +
+        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' )");
+                " 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");
 
         QuerySQL querySQL = SQLFactory.createQuerySQL(this, "st_stockbill","payamount","paydiscountamount");
         querySQL.setTableAlias("t1");