Commit 4b064fde by huluobin

bug fix

parent bee0a147
...@@ -102,14 +102,15 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme ...@@ -102,14 +102,15 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
costPlanDomain.setLendBalance(BigDecimal.ZERO); costPlanDomain.setLendBalance(BigDecimal.ZERO);
CostDomain costDomain = planToCost(costPlanDomain.getCostPlanNo()); CostDomain costDomain = planToCost(costPlanDomain.getCostPlanNo());
costDomain.setCostNo(getCostNo()); costDomain.setCostNo(getCostNo());
//待提交
costDomain.setCostStatus(0); costDomain.setCostStatus(0);
//费用单金额 costDomain.setAmount(costDomain.getCounteract());
costDomain.setAmount(counteract); costDomain.setLendBalance(BigDecimal.ZERO);
//关联借支单币种 ->人民币 汇率 costDomain.setPayPlanAmount(costDomain.getPayCounteract());
costDomain.setPayLendBalance(BigDecimal.ZERO);
BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY"); BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY");
costDomain.setToRmbRate(toRmbRate); costDomain.setToRmbRate(toRmbRate);
costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP)); costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP));
costDao.insert(costDomain); costDao.insert(costDomain);
//更新借支单申请归还金额 //更新借支单申请归还金额
...@@ -225,14 +226,17 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme ...@@ -225,14 +226,17 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
throw new BizRuntimeException("冲销后归还金额 > 借支单待归还金额"); throw new BizRuntimeException("冲销后归还金额 > 借支单待归还金额");
} }
costPlanDomain.setCounteract(BigDecimal.ZERO);
CostDomain costDomain = planToCost(costPlanDomain.getCostPlanNo()); CostDomain costDomain = planToCost(costPlanDomain.getCostPlanNo());
costDomain.setCostNo(getCostNo()); costDomain.setCostNo(getCostNo());
costDomain.setCostStatus(0); costDomain.setCostStatus(0);
costDomain.setAmount(lendBalance); costDomain.setAmount(costDomain.getLendBalance());
BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY"); costDomain.setCounteract(new BigDecimal(0));
costDomain.setToRmbRate(toRmbRate); costDomain.setPayPlanAmount(costDomain.getPayLendBalance());
costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP)); costDomain.setPayCounteract(new BigDecimal(0));
BigDecimal toRmbRate1 = CurUtils.getCur(costDomain.getDic(), "CNY");
costDomain.setToRmbRate(toRmbRate1);
costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate1).setScale(2, BigDecimal.ROUND_HALF_UP));
costDao.insert(costDomain); costDao.insert(costDomain);
//更新借支单申请归还金额 //更新借支单申请归还金额
......
Markdown is supported
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