| | |
| | | PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(paymentRegistration.getPurchaseLedgerId()); |
| | | SalesLedger salesLedger = salesLedgerMapper.selectOne(new QueryWrapper<SalesLedger>(). |
| | | eq("sales_contract_no", purchaseLedger.getSalesContractNo())); |
| | | if (salesLedger == null) { |
| | | throw new RuntimeException("关联销售合同号不存在"); |
| | | // if (salesLedger == null) { |
| | | // throw new RuntimeException("关联销售合同号不存在"); |
| | | // } |
| | | if (salesLedger != null) { |
| | | paymentRegistration.setSaleLedgerId(salesLedger.getId()); |
| | | } |
| | | |
| | | paymentRegistration.setSaleLedgerId(salesLedger.getId()); |
| | | paymentRegistration.setSupplierId(purchaseLedger.getSupplierId()); |
| | | |
| | | TicketRegistration tr = ticketRegistrationMapper.selectOne(new LambdaQueryWrapper<TicketRegistration>().eq(TicketRegistration::getId, paymentRegistration.getTicketRegistrationId())); |
| | |
| | | public List<PaymentHistoryRecordVo> getPaymentRecordList(Long supplierId) { |
| | | List<PaymentHistoryRecordVo> paymentRecordList = paymentRegistrationMapper.getPaymentRecordList(supplierId); |
| | | List<PaymentHistoryRecordVo> result = new ArrayList<>(); |
| | | List<PaymentHistoryRecordVo> newResult = new ArrayList<>(); |
| | | // 应付总金额金额计算 |
| | | BigDecimal amountTotal = BigDecimal.ZERO; |
| | | if(CollectionUtils.isNotEmpty(paymentRecordList)) { |
| | |
| | | result.add(paymentHistoryRecordVo); |
| | | } |
| | | |
| | | |
| | | for (int i = 0; i < result.size(); i++) { |
| | | PaymentHistoryRecordVo paymentHistoryRecordVo = result.get(i); |
| | | if (i == 0) { |
| | | paymentHistoryRecordVo.setPayableAmount(paymentHistoryRecordVo.getInvoiceAmount().subtract(paymentHistoryRecordVo.getCurrentPaymentAmount())); |
| | | }else { |
| | | PaymentHistoryRecordVo paymentHistoryRecordVo1 = result.get(i-1); |
| | | paymentHistoryRecordVo.setPayableAmount(paymentHistoryRecordVo1.getPayableAmount() |
| | | .add(paymentHistoryRecordVo.getInvoiceAmount()).subtract(paymentHistoryRecordVo.getCurrentPaymentAmount())); |
| | | } |
| | | newResult.add(paymentHistoryRecordVo); |
| | | } |
| | | } |
| | | return result; |
| | | return newResult; |
| | | } |
| | | |
| | | /** |