From e69dc34457a700a27659d17501957ed1dd5be66c Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期五, 27 六月 2025 17:03:12 +0800
Subject: [PATCH] 2025-06-27 bug修改

---
 src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java b/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
index 95a51ff..c7753c2 100644
--- a/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
+++ b/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
@@ -99,11 +99,12 @@
         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()));
@@ -121,8 +122,8 @@
         }
 
         LoginUser loginUser = SecurityUtils.getLoginUser();
-        Integer tenantId = loginUser.getTenantId();
-        paymentRegistration.setTenantId(tenantId.longValue());
+        Long tenantId = loginUser.getTenantId();
+        paymentRegistration.setTenantId(tenantId);
         paymentRegistration.setRegistrantId(loginUser.getUserId());
         paymentRegistration.setCreateTime(DateUtils.getNowDate());
         paymentRegistration.setUpdateTime(DateUtils.getNowDate());
@@ -397,7 +398,7 @@
                 paymentHistoryRecordVo.setHappenTime(localDate);
                 paymentHistoryRecordVo.setCurrentPaymentAmount(currentPaymentAmount);
                 paymentHistoryRecordVo.setInvoiceAmount(invoiceAmount);
-                amountTotal = amountTotal.add(currentDateTotal);
+                amountTotal = paymentHistoryRecordVo.getInvoiceAmount().subtract(paymentHistoryRecordVo.getCurrentPaymentAmount());
                 paymentHistoryRecordVo.setPayableAmount(amountTotal);
                 result.add(paymentHistoryRecordVo);
             }

--
Gitblit v1.9.3