| | |
| | | * @param supplierId 供应商编号 |
| | | */ |
| | | private void validateInvoiceForPayment(Long invoiceId, Long supplierId) { |
| | | // 未关联来票时跳过校验(付款单允许不关联来票) |
| | | if (invoiceId == null) { |
| | | return; |
| | | } |
| | | // 1. 校验来票存在 |
| | | ErpPurchaseInvoiceDO invoice = invoiceService.getPurchaseInvoice(invoiceId); |
| | | if (invoice == null) { |
| | |
| | | * @param oldPaymentPrice 更新场景下,该付款单自身当前的付款金额(用于排除自身),创建场景传 null |
| | | */ |
| | | private void validatePaymentPriceExceedsInvoiceRemaining(Long invoiceId, BigDecimal paymentPrice, BigDecimal oldPaymentPrice) { |
| | | // 未关联来票时无剩余可付金额可校验 |
| | | if (invoiceId == null) { |
| | | return; |
| | | } |
| | | ErpPurchaseInvoiceDO invoice = invoiceService.getPurchaseInvoice(invoiceId); |
| | | BigDecimal paidPrice = financePaymentMapper.selectPaymentPriceMapByInvoiceId(List.of(invoiceId)) |
| | | .getOrDefault(invoiceId, BigDecimal.ZERO); |