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