Commit 06b90012 authored by 季圣华's avatar 季圣华
Browse files

给出库单据中对于sku商品换个方式计算库存

parent 8108d639
......@@ -539,6 +539,10 @@ public class DepotItemService {
continue;
}
BigDecimal stock = getStockByParam(depotItem.getDepotId(),depotItem.getMaterialId(),null,null);
if(StringUtil.isNotEmpty(depotItem.getSku())) {
//对于sku商品要换个方式计算库存
stock = getSkuStockByParam(depotItem.getDepotId(),depotItem.getMaterialExtendId(),null,null);
}
BigDecimal thisBasicNumber = depotItem.getBasicNumber()==null?BigDecimal.ZERO:depotItem.getBasicNumber();
if(systemConfigService.getMinusStockFlag() == false && stock.compareTo(thisBasicNumber)<0){
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment