|
|
@@ -517,6 +517,17 @@ public class sendplandetail extends Controller {
|
|
|
querySQL_ck.setWhere("t1.itemid", rows.toArrayList("itemid"));
|
|
|
Rows rows_ck = querySQL_ck.query();
|
|
|
RowsMap rowsCkRowsMap = rows_ck.toRowsMap("stockno");
|
|
|
+
|
|
|
+
|
|
|
+ QuerySQL querySQL_cksale = SQLFactory.createQuerySQL(this, "st_invbal_sale", "itemid", "qty");
|
|
|
+ querySQL_cksale.setTableAlias("t1");
|
|
|
+ querySQL_cksale.setSiteid(siteid);
|
|
|
+ querySQL_cksale.setWhere("t1.itemid", rows.toArrayList("itemid"));
|
|
|
+ Rows rows_cksale = querySQL_cksale.query();
|
|
|
+ RowsMap rows_cksaleRowsMap = rows_cksale.toRowsMap("itemid");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
for (Row row : rows) {
|
|
|
if (rowsCkRowsMap.containsKey("101")) {
|
|
|
if (rowsCkRowsMap.get("101").toRowsMap("itemid").containsKey(row.getString("itemid"))) {
|
|
|
@@ -548,6 +559,12 @@ public class sendplandetail extends Controller {
|
|
|
row.put("qty_mq", 0);
|
|
|
}
|
|
|
|
|
|
+ if (rows_cksaleRowsMap.containsKey(row.getString("itemid"))) {
|
|
|
+ row.put("qty_total", rows_cksaleRowsMap.get(row.getString("itemid")).get(0).getBigDecimal("qty"));
|
|
|
+ } else{
|
|
|
+ row.put("qty_total", 0);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|