|
@@ -475,7 +475,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
public ResponseResultVO<?> saleOrderOutboundInsertCollection(OutboundVO outboundVO) {
|
|
public ResponseResultVO<?> saleOrderOutboundInsertCollection(OutboundVO outboundVO) {
|
|
|
//新建销售出库
|
|
//新建销售出库
|
|
|
saleOrderOutboundInsert(outboundVO);
|
|
saleOrderOutboundInsert(outboundVO);
|
|
|
- //新建退款
|
|
|
|
|
|
|
+ //新建收款退款
|
|
|
RecPayVO recPayVO = new RecPayVO();
|
|
RecPayVO recPayVO = new RecPayVO();
|
|
|
recPayVO.setObjectId(outboundVO.getObjectId());
|
|
recPayVO.setObjectId(outboundVO.getObjectId());
|
|
|
recPayVO.setOrgId(outboundVO.getOrgId());
|
|
recPayVO.setOrgId(outboundVO.getOrgId());
|
|
@@ -531,9 +531,8 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
BigDecimal sumAmt = outboundVO.getItemList().stream().map(OutboundItemVO::getOutingAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
BigDecimal sumAmt = outboundVO.getItemList().stream().map(OutboundItemVO::getOutingAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
- //region 自动办理参数为true 已入库编辑
|
|
|
|
|
- //自动办理参数为true
|
|
|
|
|
- if (Constant.FlgHandleSetting.TRUE.getValue().equals(outboundVO.getFlgHandleSetting())) {
|
|
|
|
|
|
|
+ //region 已入库编辑
|
|
|
|
|
+ if (Constant.OutStatus.YICHUKU.getName().equals(outboundVO.getOutStatus())) {
|
|
|
//region 应收反记账
|
|
//region 应收反记账
|
|
|
if (outboundVO.getReceivableId() != null) {
|
|
if (outboundVO.getReceivableId() != null) {
|
|
|
accountService.reverseReceivable(outboundVO.getOutId(), Constant.InventoryDocCode.OUTBOUND.getTableName());
|
|
accountService.reverseReceivable(outboundVO.getOutId(), Constant.InventoryDocCode.OUTBOUND.getTableName());
|
|
@@ -735,14 +734,12 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
inventoryService.operatingInventoryInformation(invMap);
|
|
inventoryService.operatingInventoryInformation(invMap);
|
|
|
}
|
|
}
|
|
|
//endregion
|
|
//endregion
|
|
|
- } else {
|
|
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_OUT.getMessage());
|
|
|
|
|
}
|
|
}
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
- //region 自动办理参数false 入库中编辑
|
|
|
|
|
- //自动办理标识为false 并且 自动办理参数为false 入库中
|
|
|
|
|
- if (!outboundVO.getFlgAutoHandle() && Constant.FlgHandleSetting.FALSE.getValue().equals(outboundVO.getFlgHandleSetting())) {
|
|
|
|
|
|
|
+ //region 入库中编辑
|
|
|
|
|
+ if (Constant.OutStatus.CHUKUZHONG.getName().equals(outboundVO.getOutStatus()) ||
|
|
|
|
|
+ Constant.OutStatus.DAICHUKU.getName().equals(outboundVO.getOutStatus())) {
|
|
|
//region 修改明细
|
|
//region 修改明细
|
|
|
List<OutboundItemVO> itemList = outboundVO.getItemList();
|
|
List<OutboundItemVO> itemList = outboundVO.getItemList();
|
|
|
for (OutboundItemVO outboundItemVO : itemList) {
|
|
for (OutboundItemVO outboundItemVO : itemList) {
|
|
@@ -877,8 +874,6 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//endregion
|
|
//endregion
|
|
|
- } else {
|
|
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.FLG_HANDLE_SETTING_NOT_ENABLED_OUT.getMessage());
|
|
|
|
|
}
|
|
}
|
|
|
//endregion
|
|
//endregion
|
|
|
}
|
|
}
|