refactor(so): 移除销售订单变更中的排产数量校验
This commit is contained in:
parent
cdd49483ac
commit
2435980c97
|
@ -1621,7 +1621,7 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
|||
* 行数量、金额减少时,销售订单行金额不得小于行累计确认应收金额,销售订单数量不得小于销售订单行累计开票主数量;不允许删除已开票的物料行(判断累计开票主数量是否大于0);
|
||||
* 3.实际收款和累计开票主数量、累计确认应收金额 >0
|
||||
* 变更行金额和行数量时,销售订单行金额不得小于行累计确认应收金额,销售订单行数量不得小于销售订单行累计开票主数量;
|
||||
* 4.累计出库主数量 or 累计安排生产订单主数量 or 累计发货主数量 or 累计排产主数量 >0
|
||||
* 4.累计出库主数量 or 累计安排生产订单主数量 or 累计发货主数量 >0
|
||||
* 不可替换物料,不可删除订单明细行(删除就是把子表VO的dr赋值1,0表示未删除);
|
||||
* 行数量减少后的值不可小于 累计出库主数量,累计安排生产订单主数量,累计发货主数量,累计排产主数量
|
||||
* 行金额不得小于行累计确认应收金额与收款金额的最小值
|
||||
|
@ -1703,11 +1703,10 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
|||
}
|
||||
}
|
||||
|
||||
// 1.2 累计出库/安排生产/发货/排产
|
||||
// 1.2 累计出库/安排生产/发货
|
||||
boolean hasOutOrArrange = (ntotaloutnum != null && ntotaloutnum.doubleValue() > 0) ||
|
||||
(narrangemonum != null && narrangemonum.doubleValue() > 0) ||
|
||||
(ntotalsendnum != null && ntotalsendnum.doubleValue() > 0) ||
|
||||
(vbdef12 != null && vbdef12.doubleValue() > 0);
|
||||
(ntotalsendnum != null && ntotalsendnum.doubleValue() > 0);
|
||||
if (hasOutOrArrange) {
|
||||
if (newNnum != null && oldNnum != null && newNnum.doubleValue() < oldNnum.doubleValue()) {
|
||||
if (ntotaloutnum != null && ntotaloutnum.doubleValue() > 0 && newNnum.doubleValue() < ntotaloutnum.doubleValue()) {
|
||||
|
@ -1719,9 +1718,9 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
|||
if (ntotalsendnum != null && ntotalsendnum.doubleValue() > 0 && newNnum.doubleValue() < ntotalsendnum.doubleValue()) {
|
||||
throw new BusinessException("行号:" + crowno + ", 行数量(" + newNnum + ")不可小于累计发货主数量(" + ntotalsendnum + ")");
|
||||
}
|
||||
if (vbdef12 != null && vbdef12.doubleValue() > 0 && newNnum.doubleValue() < vbdef12.doubleValue()) {
|
||||
/*if (vbdef12 != null && vbdef12.doubleValue() > 0 && newNnum.doubleValue() < vbdef12.doubleValue()) {
|
||||
throw new BusinessException("行号:" + crowno + ", 行数量(" + newNnum + ")不可小于累计排产主数量(" + vbdef12 + ")");
|
||||
}
|
||||
}*/
|
||||
}
|
||||
// 金额校验
|
||||
if (ntotalarmny != null && ntotalarmny.doubleValue() > 0) {
|
||||
|
@ -1735,7 +1734,7 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
|||
}
|
||||
// 1.4 物料替换校验
|
||||
if (StringUtils.isNotEmpty(oldCmaterialvid) && !newCmaterialvid.equals(oldCmaterialvid)) {
|
||||
throw new BusinessException("行号:" + crowno + ",存在累计出库/安排生产订单/发货/排产主数量,请勿修改物料");
|
||||
throw new BusinessException("行号:" + crowno + ",存在累计出库/安排生产订单/发货主数量,请勿修改物料");
|
||||
}
|
||||
}
|
||||
// 1.3 累计安排生产订单主数量 & 累计排产主数量 >0
|
||||
|
@ -1757,9 +1756,9 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
|||
}
|
||||
if ((ntotaloutnum != null && ntotaloutnum.doubleValue() > 0) ||
|
||||
(narrangemonum != null && narrangemonum.doubleValue() > 0) ||
|
||||
(ntotalsendnum != null && ntotalsendnum.doubleValue() > 0) ||
|
||||
(vbdef12 != null && vbdef12.doubleValue() > 0)) {
|
||||
throw new BusinessException("行号:" + crowno + ", 不可删除已有累计出库、安排生产、发货或排产的订单明细行");
|
||||
(ntotalsendnum != null && ntotalsendnum.doubleValue() > 0)
|
||||
) {
|
||||
throw new BusinessException("行号:" + crowno + ", 不可删除已有累计出库、安排生产、发货的订单明细行");
|
||||
}
|
||||
}
|
||||
// 3. 新增行校验
|
||||
|
|
Loading…
Reference in New Issue