|
@@ -822,7 +822,17 @@ public class dispatch extends Controller {
|
|
|
|
|
|
for (Row row : rowsDispatchDetailGroupByItem) {
|
|
|
if (sumQtyRowsMap.containsKey(row.getString("itemno"))) {
|
|
|
- row.put("delinvbalqty", (row.containsKey("invbalqty") ? row.getBigDecimal("invbalqty") : BigDecimal.ZERO).subtract(sumQtyRowsMap.get(row.getString("itemno")).get(0).getBigDecimal("qty")));
|
|
|
+ RowsMap rowsMapByBatchno = sumQtyRowsMap.get(row.getString("itemno")).toRowsMap("batchno");
|
|
|
+ if(rowsMapByBatchno.containsKey(row.getString("batchno"))){
|
|
|
+ for(Row row1 :sumQtyRowsMap.get(row.getString("itemno"))){
|
|
|
+ if(row.getString("batchno").equals(row1.getString("batchno"))){
|
|
|
+ row.put("delinvbalqty", (row.containsKey("invbalqty") ? row.getBigDecimal("invbalqty") : BigDecimal.ZERO).subtract(row1.getBigDecimal("qty")));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ row.put("delinvbalqty", row.containsKey("invbalqty") ? row.getBigDecimal("invbalqty") : BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
row.put("delinvbalqty", row.containsKey("invbalqty") ? row.getBigDecimal("invbalqty") : BigDecimal.ZERO);
|
|
|
}
|