|
|
@ -709,7 +709,13 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
customerNumber = busSalesOrderVehicle.getTemporaryNo(); |
|
|
|
} |
|
|
|
} |
|
|
|
AlrepaidAndArrVo alrepaidAndArrVo = loanRestoreReportApplyService.getAlrepaidAndArr2(loanReturnInboundApply.getBusVinSid()); |
|
|
|
//----------------------计算规则------------------------------------
|
|
|
|
//扣回入库推送凭证包含以下:
|
|
|
|
//1、累欠 = 该车的还款明细中是否转累欠状态为是0的逾期的未还金额+垫资方逾期利息余额
|
|
|
|
//2、未到期欠款 = 该车的还款明细中应还日期在当月之后的未还金额之和
|
|
|
|
//3、本金 = 该车的还款明细中是否转累欠状态为否1的且应还日期是本月的未还金额
|
|
|
|
//4、扣回车辆 = 累欠+未到期欠款+本金
|
|
|
|
|
|
|
|
//应收贷款车欠款_待处理欠款_扣回车辆
|
|
|
|
BigDecimal all = BigDecimal.ZERO; |
|
|
|
//应收贷款车欠款_到期欠款_累欠
|
|
|
@ -721,23 +727,17 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
String lq = loanRepaymentPlanDetailsService.getYqLq(loanReturnInboundApply.getBusVinSid()); |
|
|
|
lqMoney = lqMoney.add(new BigDecimal(StringUtils.isBlank(lq) ? "0" : lq)); |
|
|
|
//未到期欠款
|
|
|
|
String wdq = alrepaidAndArrVo.getUnexpiredMoney(); |
|
|
|
String wdq = loanRepaymentPlanDetailsService.getWdq(loanReturnInboundApply.getBusVinSid()); |
|
|
|
wdqMoney = wdqMoney.add(new BigDecimal(StringUtils.isBlank(wdq) ? "0" : wdq)); |
|
|
|
String bj = loanRepaymentPlanDetailsService.getBj(loanReturnInboundApply.getBusVinSid()); |
|
|
|
bjMoney = bjMoney.add(new BigDecimal(StringUtils.isBlank(bj) ? "0" : bj)); |
|
|
|
all = lqMoney.add(wdqMoney).add(bjMoney); |
|
|
|
|
|
|
|
|
|
|
|
List<Voucher.VoucherResultDetailDto> voucherResultDetailDtos = new ArrayList<>(); |
|
|
|
//借方
|
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoJf = new Voucher.VoucherResultDetailDto(); |
|
|
|
//贷方
|
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf2 = new Voucher.VoucherResultDetailDto(); |
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf3 = new Voucher.VoucherResultDetailDto(); |
|
|
|
|
|
|
|
//-------------------------------------------应收贷款车欠款_待处理欠款_扣回车辆
|
|
|
|
if (all.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
//借方
|
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoJf = new Voucher.VoucherResultDetailDto(); |
|
|
|
voucherResultDetailDtoJf.setSummary("扣回车辆入库"); |
|
|
|
voucherResultDetailDtoJf.setSubjectNo("1201.03.01"); |
|
|
|
//核算部门
|
|
|
@ -747,9 +747,10 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
voucherResultDetailDtoJf.setDebit(all.toString()); |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoJf); |
|
|
|
} |
|
|
|
|
|
|
|
//---------------------------------------------应收贷款车欠款_到期欠款_累欠
|
|
|
|
//---------------------------------------------应收贷款车欠款_到期欠款_累欠---是否转累欠状态为0的未还金额+垫资方逾期利息月
|
|
|
|
if (lqMoney.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
//贷方
|
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf1 = new Voucher.VoucherResultDetailDto(); |
|
|
|
voucherResultDetailDtoDf1.setSummary("扣回车辆入库"); |
|
|
|
voucherResultDetailDtoDf1.setSubjectNo("1201.02.03"); |
|
|
|
//核算部门
|
|
|
@ -760,8 +761,9 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf1); |
|
|
|
} |
|
|
|
|
|
|
|
//--------------------------------------------应收贷款车欠款_未到期欠款_未到期欠款
|
|
|
|
//--------------------------------------------应收贷款车欠款_未到期欠款_未到期欠款--按当月算,应还日期在当月之后的
|
|
|
|
if (wdqMoney.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf2 = new Voucher.VoucherResultDetailDto(); |
|
|
|
voucherResultDetailDtoDf2.setSummary("扣回车辆入库"); |
|
|
|
voucherResultDetailDtoDf2.setSubjectNo("1201.01.00"); |
|
|
|
//核算部门
|
|
|
@ -772,8 +774,9 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf2); |
|
|
|
} |
|
|
|
|
|
|
|
//-------------------------------------------应收贷款车欠款_到期欠款_本金
|
|
|
|
//-------------------------------------------应收贷款车欠款_到期欠款_本金-----应还日期是本月的都算本金,没有转累欠的
|
|
|
|
if (bjMoney.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf3 = new Voucher.VoucherResultDetailDto(); |
|
|
|
voucherResultDetailDtoDf3.setSummary("扣回车辆入库"); |
|
|
|
voucherResultDetailDtoDf3.setSubjectNo("1201.02.01"); |
|
|
|
//核算部门
|
|
|
@ -806,6 +809,16 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
stkMiscellaneousEntry.setFSTOCKID("ARZSCK"); |
|
|
|
stkMiscellaneousEntry.setFOWNERID(sysOrg.getOrgCode()); |
|
|
|
stkMiscellaneousEntryList.add(stkMiscellaneousEntry); |
|
|
|
if ("是".equals(loanReturnInboundApply.getTralier())) {//挂车
|
|
|
|
LoanReturnInboundTrailer loanReturnInboundTrailer = loanReturnInboundTrailerService.selectByMainSid(loanReturnInboundApply.getSid()); |
|
|
|
stkMiscellaneousEntry = new StkMiscellaneous.StkMiscellaneousEntry(); |
|
|
|
stkMiscellaneousEntry.setFMATERIALID(loanReturnInboundTrailer.getVinNo()); |
|
|
|
stkMiscellaneousEntry.setFUnitID("liang"); |
|
|
|
stkMiscellaneousEntry.setFSTOCKID("ARZSCK"); |
|
|
|
stkMiscellaneousEntry.setFOWNERID(sysOrg.getOrgCode()); |
|
|
|
stkMiscellaneousEntryList.add(stkMiscellaneousEntry); |
|
|
|
} |
|
|
|
|
|
|
|
stkMiscellaneous.setStkMiscellaneousEntry(stkMiscellaneousEntryList); |
|
|
|
ResultBean resultBean = finKingDeeFeign.draftStkMiscellaneous(stkMiscellaneous); |
|
|
|
|
|
|
|