|
@@ -91,6 +91,8 @@ public class XSCK extends BasicBill {
|
|
|
}
|
|
}
|
|
|
//库存校验
|
|
//库存校验
|
|
|
RowsMap invbalsRowsMap = SQLFactory.createQuerySQL(dbConnect, "st_invbal").setWhere("siteid", siteid).setWhere("itemid", itemRows.toArrayList("itemid")).query().toRowsMap("itemid");
|
|
RowsMap invbalsRowsMap = SQLFactory.createQuerySQL(dbConnect, "st_invbal").setWhere("siteid", siteid).setWhere("itemid", itemRows.toArrayList("itemid")).query().toRowsMap("itemid");
|
|
|
|
|
+ StringBuffer errmsg = new StringBuffer("");
|
|
|
|
|
+ boolean iserr = false;
|
|
|
for (Row row : itemRows) {
|
|
for (Row row : itemRows) {
|
|
|
if (!row.getBoolean("isnegative") && row.getBoolean("ismodule")) {
|
|
if (!row.getBoolean("isnegative") && row.getBoolean("ismodule")) {
|
|
|
long itemid = row.getLong("itemid");
|
|
long itemid = row.getLong("itemid");
|
|
@@ -98,17 +100,22 @@ public class XSCK extends BasicBill {
|
|
|
BigDecimal qty = row.getBigDecimal("qty");
|
|
BigDecimal qty = row.getBigDecimal("qty");
|
|
|
if (!isInStock(ischeck)) {
|
|
if (!isInStock(ischeck)) {
|
|
|
if (!invbalsRowsMap.containsKey(String.valueOf(itemid)) || !invbalsRowsMap.get(String.valueOf(itemid)).toRowsMap("stockid").containsKey(String.valueOf(stockid))) {
|
|
if (!invbalsRowsMap.containsKey(String.valueOf(itemid)) || !invbalsRowsMap.get(String.valueOf(itemid)).toRowsMap("stockid").containsKey(String.valueOf(stockid))) {
|
|
|
- throw new YosException("行【" + row.getString("rowno") + "】不能负库存出库");
|
|
|
|
|
|
|
+ errmsg.append("行【" + row.getString("rowno") + "】不能负库存出库;");
|
|
|
|
|
+ iserr = true;
|
|
|
} else {
|
|
} else {
|
|
|
BigDecimal invbalqty = invbalsRowsMap.get(String.valueOf(itemid)).toRowsMap("stockid").get(String.valueOf(stockid)).get(0).getBigDecimal("qty");
|
|
BigDecimal invbalqty = invbalsRowsMap.get(String.valueOf(itemid)).toRowsMap("stockid").get(String.valueOf(stockid)).get(0).getBigDecimal("qty");
|
|
|
if (invbalqty.compareTo(qty) < 0) {
|
|
if (invbalqty.compareTo(qty) < 0) {
|
|
|
- throw new YosException("行【" + row.getString("rowno") + "】不能负库存出库");
|
|
|
|
|
|
|
+ errmsg.append("行【" + row.getString("rowno") + "】不能负库存出库;");
|
|
|
|
|
+ iserr = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if (iserr) {
|
|
|
|
|
+ throw new YosException(String.valueOf(errmsg));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if ((ischeck && rb == 1) || (!ischeck && rb == 0)) {
|
|
if ((ischeck && rb == 1) || (!ischeck && rb == 0)) {
|
|
|
// if (order_paymentnode.equals("3") && !Accountbalance.judgeBalance(dbConnect, sys_enterpriseid, accountbalancerows.get(0).getLong("sa_accountclassid"), itemRows.toRowsMap("sa_orderitemsidnum").get("0").sum("amount"))) {
|
|
// if (order_paymentnode.equals("3") && !Accountbalance.judgeBalance(dbConnect, sys_enterpriseid, accountbalancerows.get(0).getLong("sa_accountclassid"), itemRows.toRowsMap("sa_orderitemsidnum").get("0").sum("amount"))) {
|