1、首购记录无法记录可开票金额问题修复;2、审核开票相关购买记录无法显示问题修复;

This commit is contained in:
gaoqr
2025-09-23 15:53:34 +08:00
parent 91ee86c3c2
commit 8b1421310a
2 changed files with 29 additions and 4 deletions
@@ -265,7 +265,7 @@ public class InvoiceServiceImpl implements InvoiceService {
// 查询关联的购买记录
List<PurchaseRecordDO> purchaseRecordDOS = purchaseRecordMapper.selectList(new LambdaQueryWrapper<PurchaseRecordDO>()
.eq(PurchaseRecordDO::getOrganId, getUserOrganId())
.eq(PurchaseRecordDO::getOrganId, invoiceRecordsDO.getOrganId())
.in(PurchaseRecordDO::getId, purchaseIdList));
List<InvoicePurchaseRecord> invoicePurchaseRecords = new ArrayList<>();
@@ -335,6 +335,10 @@ public class InvoiceServiceImpl implements InvoiceService {
purchaseRecordDOS.forEach(f -> f.setIsInvocing(InvoiceStatusEnum.INVOICABLE.getCode()));
}
// 更新开票人信息
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
invoiceRecordsDO.setInvoicePerson(loginUser.getNickname());
invoiceRecordsDO.setInvoicePersonId(loginUser.getId());
invoiceRecordsMapper.updateById(invoiceRecordsDO);
@@ -14,9 +14,30 @@
<!-- 查询机构下开票金额统计:可开票、开票中、已开票-->
<select id="getOrgInvoiceAmountStatistics" resultType="com.cf.imes.module.system.controller.admin.funds.invoice.vo.InvoiceAmountRespVO">
select sum(case when is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICABLE.code}' then account_balance_spent else 0 end) as invocable,
sum(case when is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@PENDINGINVOICING.code}' then account_balance_spent else 0 end) as inTheInvoice,
sum(case when is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICINGSUCCESSFUL.code}' then account_balance_spent else 0 end) as invoiced
SELECT
SUM(
CASE
WHEN is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICABLE.code}'
THEN CASE WHEN initial = TRUE THEN total_amount ELSE account_balance_spent END
ELSE 0
END
) AS invocable,
SUM(
CASE
WHEN is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@PENDINGINVOICING.code}'
THEN CASE WHEN initial = TRUE THEN total_amount ELSE account_balance_spent END
ELSE 0
END
) AS inTheInvoice,
SUM(
CASE
WHEN is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICINGSUCCESSFUL.code}'
THEN CASE WHEN initial = TRUE THEN total_amount ELSE account_balance_spent END
ELSE 0
END
) AS invoiced
from purchase_record
where organ_id = #{organId} and deleted = false;
</select>