|
|
@@ -186,11 +186,14 @@ public class invbal extends Controller {
|
|
|
SQLFactory sqlFactory1 =new SQLFactory(this,"商品发货数量汇总");
|
|
|
sqlFactory1.addParameter("siteid", siteid);
|
|
|
where=" 1=1 ";
|
|
|
+ sqlFactory1.addParameter_SQL("where", where);
|
|
|
+ Rows sumQtyRows = dbConnect.runSqlQuery(sqlFactory1);
|
|
|
+ RowsMap sumAllQtyRowsMap= sumQtyRows.toRowsMap("itemno");
|
|
|
if(!StringUtils.isBlank(agentinfo)){
|
|
|
where=where+" and (t6.agentnum like '%"+agentinfo+"%' or t5.enterprisename like '%"+agentinfo+"%') ";
|
|
|
}
|
|
|
sqlFactory1.addParameter_SQL("where", where);
|
|
|
- Rows sumQtyRows = dbConnect.runSqlQuery(sqlFactory1);
|
|
|
+ sumQtyRows = dbConnect.runSqlQuery(sqlFactory1);
|
|
|
RowsMap sumQtyRowsMap= sumQtyRows.toRowsMap("itemno");
|
|
|
|
|
|
SQLFactory sqlFactory2 =new SQLFactory(this,"商品未发货数量汇总");
|
|
|
@@ -246,12 +249,16 @@ public class invbal extends Controller {
|
|
|
row.put("undelqty", BigDecimal.ZERO.stripTrailingZeros().toPlainString());
|
|
|
row.put("qty", BigDecimal.ZERO.stripTrailingZeros().toPlainString());
|
|
|
}
|
|
|
-// if(sumUnAllQtyRowsMap.get(row.getString("itemno")).isNotEmpty()){
|
|
|
-// row.put("undelqtysum", sumUnAllQtyRowsMap.get(row.getString("itemno")).get(0).getBigDecimal("undeliqty").stripTrailingZeros().toPlainString());
|
|
|
-// }else {
|
|
|
-// row.put("undelqtysum", BigDecimal.ZERO.stripTrailingZeros().toPlainString());
|
|
|
-// }
|
|
|
-
|
|
|
+ if(sumUnAllQtyRowsMap.get(row.getString("itemno")).isNotEmpty()){
|
|
|
+ row.put("undelqtysum", sumUnAllQtyRowsMap.get(row.getString("itemno")).get(0).getBigDecimal("undeliqty").stripTrailingZeros().toPlainString());
|
|
|
+ }else {
|
|
|
+ row.put("undelqtysum", BigDecimal.ZERO.stripTrailingZeros().toPlainString());
|
|
|
+ }
|
|
|
+ if(sumAllQtyRowsMap.get(row.getString("itemno")).isNotEmpty()){
|
|
|
+ row.put("unsoldqtysum", sumAllQtyRowsMap.get(row.getString("itemno")).get(0).getBigDecimal("qty").stripTrailingZeros().toPlainString());
|
|
|
+ }else {
|
|
|
+ row.put("unsoldqtysum", BigDecimal.ZERO.stripTrailingZeros().toPlainString());
|
|
|
+ }
|
|
|
|
|
|
if(!row.containsKey("invbalqty")){
|
|
|
row.put("invbalqty",BigDecimal.ZERO.stripTrailingZeros().toPlainString());
|