Browse Source

修改单车预提推凭证8

master
fanzongzhe0036 3 months ago
parent
commit
8a4342ba57
  1. 30
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyService.java

30
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyService.java

@ -557,18 +557,28 @@ public class ScmVehRebateWithApplyService extends MybatisBaseService<ScmVehRebat
}
}
//添加成本调整单
BigDecimal esRebate = BigDecimal.ZERO;//预计返利
BigDecimal expectTreatCost = BigDecimal.ZERO;//其中待支付
BigDecimal expectSuppCost = BigDecimal.ZERO;//其中抵顶
BigDecimal pushMoney = BigDecimal.ZERO;//推送费用
if (StringUtils.isNotBlank(rebate.getEstimateRebate())) {
BigDecimal esRebate = new BigDecimal(rebate.getEstimateRebate());
if (esRebate.compareTo(BigDecimal.ZERO) != 0) {
CostAdjustmentsBill.CostAdjustmentsBillDetailDto dto = new CostAdjustmentsBill.CostAdjustmentsBillDetailDto();
dto.setCompanyCode(useOrgCode);
dto.setMaterialID(vinCode);
dto.setDeptCode(deptCode);
dto.setAmount(esRebate.negate().toString());
resultDetails.add(dto);
}
esRebate = new BigDecimal(rebate.getEstimateRebate());
}
if (rebate.getExpectTreatCost() != null) {
expectTreatCost = rebate.getExpectTreatCost();
}
if (rebate.getExpectSuppCost() != null) {
expectSuppCost = rebate.getExpectSuppCost();
}
pushMoney = esRebate.subtract(expectTreatCost).subtract(expectSuppCost);
if (pushMoney.compareTo(BigDecimal.ZERO) != 0) {
CostAdjustmentsBill.CostAdjustmentsBillDetailDto dto = new CostAdjustmentsBill.CostAdjustmentsBillDetailDto();
dto.setCompanyCode(useOrgCode);
dto.setMaterialID(vinCode);
dto.setDeptCode(deptCode);
dto.setAmount(pushMoney.negate().toString());
resultDetails.add(dto);
}
} else {
String salesDeptCode = ""; //销售部门编码
String customerCode = ""; //出库单客户编码

Loading…
Cancel
Save