|
@@ -126,9 +126,10 @@ public class PurchaseFlow extends FlowDelegate {
|
|
|
p.getDataResource() == PurchaseDataResourceEnum.DATA_RESOURCE_1.getKey()) {//如果采购的是外销合同
|
|
|
ContractProduct contractProduct = contractProductService.getById(p.getDataResourceId());
|
|
|
BigDecimal expendQuantity = contractProduct.getExpendQuantity().subtract(p.getCount());
|
|
|
-// if (expendQuantity.compareTo(BigDecimal.ZERO) < 1) {//小于0不让继续执行
|
|
|
-// throw new ServiceException("采购数量不得大于合同剩余采购数量");
|
|
|
-// }
|
|
|
+ if (expendQuantity.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
+ //外销合同-交接单采购 如果采购数量大于大于合同数量 将待处理数量改为0
|
|
|
+ expendQuantity = BigDecimal.ZERO;
|
|
|
+ }
|
|
|
contractProduct.setExpendQuantity(expendQuantity);
|
|
|
upContractProduct.add(contractProduct);
|
|
|
}
|