|
|
@@ -196,11 +196,14 @@ public class invbal extends Controller {
|
|
|
SQLFactory sqlFactory2 =new SQLFactory(this,"商品未发货数量汇总");
|
|
|
sqlFactory2.addParameter("siteid", siteid);
|
|
|
where=" 1=1 ";
|
|
|
+ sqlFactory2.addParameter_SQL("where", where);
|
|
|
+ Rows sumUnQtyRows = dbConnect.runSqlQuery(sqlFactory2);
|
|
|
+ RowsMap sumUnAllQtyRowsMap= sumUnQtyRows.toRowsMap("itemno");
|
|
|
if(!StringUtils.isBlank(agentinfo)){
|
|
|
where=where+" and (t6.agentnum like '%"+agentinfo+"%' or t5.enterprisename like '%"+agentinfo+"%') ";
|
|
|
}
|
|
|
sqlFactory2.addParameter_SQL("where", where);
|
|
|
- Rows sumUnQtyRows = dbConnect.runSqlQuery(sqlFactory2);
|
|
|
+ sumUnQtyRows = dbConnect.runSqlQuery(sqlFactory2);
|
|
|
RowsMap sumUnQtyRowsMap= sumUnQtyRows.toRowsMap("itemno");
|
|
|
|
|
|
|
|
|
@@ -237,7 +240,14 @@ public class invbal extends Controller {
|
|
|
row.put("undelqty", BigDecimal.ZERO.stripTrailingZeros().toPlainString());
|
|
|
row.put("qty", BigDecimal.ZERO.stripTrailingZeros().toPlainString());
|
|
|
}
|
|
|
- if(!row.containsKey("invbalqty")){
|
|
|
+ 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(!row.containsKey("invbalqty")){
|
|
|
row.put("invbalqty",BigDecimal.ZERO.stripTrailingZeros().toPlainString());
|
|
|
}
|
|
|
|