mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 13:42:07 +08:00
1、软件购买金额字段赋值问题修复;2、手工调账单个金额提交异常问题修复;3、可开票金额获取来源错误修复;
This commit is contained in:
+17
-5
@@ -1,6 +1,8 @@
|
|||||||
package com.cf.imes.module.system.dal.mysql.funds.purchase;
|
package com.cf.imes.module.system.dal.mysql.funds.purchase;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.cf.imes.framework.common.pojo.PageResult;
|
import com.cf.imes.framework.common.pojo.PageResult;
|
||||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
@@ -61,16 +63,26 @@ public interface PurchaseRecordMapper extends BaseMapperX<PurchaseRecordDO> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
default PageResult<PurchaseRecordDO> selectPage(InvoiceAmountAndAvailablePageReqVO pageReqVO) {
|
default PageResult<PurchaseRecordDO> selectPage(InvoiceAmountAndAvailablePageReqVO pageReqVO) {
|
||||||
return selectPage(pageReqVO, new LambdaQueryWrapperX<PurchaseRecordDO>()
|
LambdaQueryWrapper<PurchaseRecordDO> queryWrapper = new LambdaQueryWrapperX<PurchaseRecordDO>()
|
||||||
.betweenIfPresent(PurchaseRecordDO::getCreateTime, pageReqVO.getCreateTime())
|
.betweenIfPresent(PurchaseRecordDO::getCreateTime, pageReqVO.getCreateTime())
|
||||||
.geIfPresent(PurchaseRecordDO::getTotalAmount, ObjectUtil.isNotNull(pageReqVO.getInvoiceAmount()) ? pageReqVO.getInvoiceAmount()[0] : null)
|
|
||||||
.leIfPresent(PurchaseRecordDO::getTotalAmount, ObjectUtil.isNotNull(pageReqVO.getInvoiceAmount()) ? pageReqVO.getInvoiceAmount()[1] : null)
|
|
||||||
.eq(PurchaseRecordDO::getOrganId, SecurityFrameworkUtils.getUserOrganId())
|
.eq(PurchaseRecordDO::getOrganId, SecurityFrameworkUtils.getUserOrganId())
|
||||||
.eq(PurchaseRecordDO::getDeleted, false)
|
.eq(PurchaseRecordDO::getDeleted, false)
|
||||||
.in(PurchaseRecordDO::getIsInvocing, InvoiceStatusEnum.INVOICABLE.getCode(), InvoiceStatusEnum.INVOICINGFAILED.getCode())
|
.in(PurchaseRecordDO::getIsInvocing, InvoiceStatusEnum.INVOICABLE.getCode(), InvoiceStatusEnum.INVOICINGFAILED.getCode())
|
||||||
.ne(PurchaseRecordDO::getInitial, true)
|
.ne(PurchaseRecordDO::getInitial, true)
|
||||||
.orderByDesc(PurchaseRecordDO::getCreateTime)
|
.orderByDesc(PurchaseRecordDO::getCreateTime);
|
||||||
);
|
Integer[] invoiceAmount = pageReqVO.getInvoiceAmount();
|
||||||
|
if (ArrayUtil.isNotEmpty(invoiceAmount) && invoiceAmount.length == 2) {
|
||||||
|
queryWrapper.and(w ->
|
||||||
|
w.between(PurchaseRecordDO::getAccountBalanceSpent,
|
||||||
|
ObjectUtil.isNotNull(pageReqVO.getInvoiceAmount()) ? pageReqVO.getInvoiceAmount()[0] : null,
|
||||||
|
ObjectUtil.isNotNull(pageReqVO.getInvoiceAmount()) ? pageReqVO.getInvoiceAmount()[1] : null)
|
||||||
|
.or()
|
||||||
|
.between(PurchaseRecordDO::getExternalSpent,
|
||||||
|
ObjectUtil.isNotNull(pageReqVO.getInvoiceAmount()) ? pageReqVO.getInvoiceAmount()[0] : null,
|
||||||
|
ObjectUtil.isNotNull(pageReqVO.getInvoiceAmount()) ? pageReqVO.getInvoiceAmount()[1] : null)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return selectPage(pageReqVO, queryWrapper);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -81,6 +81,7 @@ public class IncomeExpenseServiceImpl implements IncomeExpenseService {
|
|||||||
// 手工调账算到充值
|
// 手工调账算到充值
|
||||||
respVO.setTradeType(TradeTypeEnum.RECHARGE.getCode());
|
respVO.setTradeType(TradeTypeEnum.RECHARGE.getCode());
|
||||||
respVO.setPaymentMethod(TradeTypeEnum.MANUAL_ADJUST.getDesc());
|
respVO.setPaymentMethod(TradeTypeEnum.MANUAL_ADJUST.getDesc());
|
||||||
|
respVO.setOrderNo(i.getOrderNo());
|
||||||
}
|
}
|
||||||
// 查询操作组织名
|
// 查询操作组织名
|
||||||
OrganizationDO organ = organService.getOrganWithDeleted(i.getOrganId());
|
OrganizationDO organ = organService.getOrganWithDeleted(i.getOrganId());
|
||||||
|
|||||||
+6
-6
@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
import cn.hutool.core.io.IoUtil;
|
import cn.hutool.core.io.IoUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
@@ -42,6 +41,7 @@ import com.cf.imes.module.system.enums.pay.InvoiceStatusEnum;
|
|||||||
import com.cf.imes.module.system.enums.pay.TradeTypeEnum;
|
import com.cf.imes.module.system.enums.pay.TradeTypeEnum;
|
||||||
import com.cf.imes.module.system.service.organ.OrganService;
|
import com.cf.imes.module.system.service.organ.OrganService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@@ -205,8 +205,8 @@ public class InvoiceServiceImpl implements InvoiceService {
|
|||||||
availablePageRespVO.setId(i.getId());
|
availablePageRespVO.setId(i.getId());
|
||||||
availablePageRespVO.setCreateTime(i.getCreateTime());
|
availablePageRespVO.setCreateTime(i.getCreateTime());
|
||||||
availablePageRespVO.setTradeType(TradeTypeEnum.PRODUCT.getCode());
|
availablePageRespVO.setTradeType(TradeTypeEnum.PRODUCT.getCode());
|
||||||
// 可开票金额=总额扣除赠送金
|
// 可开票金额=余额支付+扫码支付
|
||||||
availablePageRespVO.setAvailableAmount(i.getTotalAmount().subtract(i.getGiftMoneySpent()));
|
availablePageRespVO.setAvailableAmount(i.getAccountBalanceSpent().add(i.getExternalSpent()));
|
||||||
availablePageRespVO.setProductName(i.getProductName());
|
availablePageRespVO.setProductName(i.getProductName());
|
||||||
availablePageRespVO.setTotalAmount(i.getTotalAmount());
|
availablePageRespVO.setTotalAmount(i.getTotalAmount());
|
||||||
availablePageRespVOS.add(availablePageRespVO);
|
availablePageRespVOS.add(availablePageRespVO);
|
||||||
@@ -231,7 +231,7 @@ public class InvoiceServiceImpl implements InvoiceService {
|
|||||||
boolean uninvoicableExist = purchaseRecordDOS.stream().filter(p -> !InvoiceStatusEnum.INVOICABLE.getCode().equals(p.getIsInvocing())).findAny().isPresent();
|
boolean uninvoicableExist = purchaseRecordDOS.stream().filter(p -> !InvoiceStatusEnum.INVOICABLE.getCode().equals(p.getIsInvocing())).findAny().isPresent();
|
||||||
AssertUtils.isTrue(uninvoicableExist, INVOICE_APPLY_UNINVOICEABLE_EXIST);
|
AssertUtils.isTrue(uninvoicableExist, INVOICE_APPLY_UNINVOICEABLE_EXIST);
|
||||||
|
|
||||||
// 查询可开票金额
|
// 查询可开票金额:余额支付+扫码支付
|
||||||
BigDecimal invoicableAmount = purchaseRecordMapper.getInvoicableAmount(organId, purchaseRecordId);
|
BigDecimal invoicableAmount = purchaseRecordMapper.getInvoicableAmount(organId, purchaseRecordId);
|
||||||
// 可开票金额不能为0
|
// 可开票金额不能为0
|
||||||
AssertUtils.isTrue(ObjectUtils.isNull(invoicableAmount) || invoicableAmount.compareTo(BigDecimal.ZERO) == 0, INVOICE_AMOUNT_ZERO_ERROR);
|
AssertUtils.isTrue(ObjectUtils.isNull(invoicableAmount) || invoicableAmount.compareTo(BigDecimal.ZERO) == 0, INVOICE_AMOUNT_ZERO_ERROR);
|
||||||
@@ -387,8 +387,8 @@ public class InvoiceServiceImpl implements InvoiceService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String getFileExtension(String fileName) {
|
public static String getFileExtension(String fileName) {
|
||||||
if (StrUtil.isEmpty(fileName)) {
|
if (StringUtils.isEmpty(fileName)) {
|
||||||
return ""; // 或者返回 null,看你需求
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
int lastDotIndex = fileName.lastIndexOf('.');
|
int lastDotIndex = fileName.lastIndexOf('.');
|
||||||
|
|||||||
+11
-7
@@ -128,6 +128,7 @@ public class ManualAdjustAccountBalanceServiceImpl implements ManualAdjustAccoun
|
|||||||
IncomeExpenseDetailsDO incomeExpenseDetailsDO = IncomeExpenseDetailsDO.builder()
|
IncomeExpenseDetailsDO incomeExpenseDetailsDO = IncomeExpenseDetailsDO.builder()
|
||||||
.organId(organId)
|
.organId(organId)
|
||||||
.businessNo(snowflakeSerialNoWorker3rd.nextSerialNo())
|
.businessNo(snowflakeSerialNoWorker3rd.nextSerialNo())
|
||||||
|
.orderNo(String.valueOf(payOrderDO.getId()))
|
||||||
.tradeType(TradeTypeEnum.MANUAL_ADJUST.getCode())
|
.tradeType(TradeTypeEnum.MANUAL_ADJUST.getCode())
|
||||||
.incomeExpenseType(incomeExpenseType)
|
.incomeExpenseType(incomeExpenseType)
|
||||||
.cashAmountChange(rechargeAmount)
|
.cashAmountChange(rechargeAmount)
|
||||||
@@ -152,7 +153,7 @@ public class ManualAdjustAccountBalanceServiceImpl implements ManualAdjustAccoun
|
|||||||
Long payOrderId = IdUtil.getSnowflake(mybatisIdProperties.getWorkerId(), mybatisIdProperties.getDatacenterId()).nextId();
|
Long payOrderId = IdUtil.getSnowflake(mybatisIdProperties.getWorkerId(), mybatisIdProperties.getDatacenterId()).nextId();
|
||||||
payOrderDO.setId(payOrderId);
|
payOrderDO.setId(payOrderId);
|
||||||
payOrderDO.setStatus(PayOrderStatusEnum.SUCCESS);
|
payOrderDO.setStatus(PayOrderStatusEnum.SUCCESS);
|
||||||
payOrderDO.setPrice(recharge);
|
payOrderDO.setPrice(ObjectUtil.isNull(recharge) ? BigDecimal.ZERO : recharge);
|
||||||
payOrderDO.setSubject("手工调账");
|
payOrderDO.setSubject("手工调账");
|
||||||
payOrderDO.setChannelCode(PayChannelCodeEnum.MANUAL_ADJUST);
|
payOrderDO.setChannelCode(PayChannelCodeEnum.MANUAL_ADJUST);
|
||||||
payOrderDO.setOrganId(organId);
|
payOrderDO.setOrganId(organId);
|
||||||
@@ -168,8 +169,11 @@ public class ManualAdjustAccountBalanceServiceImpl implements ManualAdjustAccoun
|
|||||||
*/
|
*/
|
||||||
private OrganRechargeAmountRespVO recharge(OrganAmountDO organAmountDO, BigDecimal price, BigDecimal gift) {
|
private OrganRechargeAmountRespVO recharge(OrganAmountDO organAmountDO, BigDecimal price, BigDecimal gift) {
|
||||||
Long organId = organAmountDO.getOrganId();
|
Long organId = organAmountDO.getOrganId();
|
||||||
BigDecimal newAmount = organAmountDO.getAmount().add(price);
|
BigDecimal newAmount = organAmountDO.getAmount();
|
||||||
BigDecimal newGift = null;
|
if (ObjectUtil.isNotNull(price)) {
|
||||||
|
newAmount = organAmountDO.getAmount().add(price);
|
||||||
|
}
|
||||||
|
BigDecimal newGift = organAmountDO.getGiftAmount();
|
||||||
if (ObjectUtil.isNotNull(gift)) {
|
if (ObjectUtil.isNotNull(gift)) {
|
||||||
newGift = organAmountDO.getGiftAmount().add(gift);
|
newGift = organAmountDO.getGiftAmount().add(gift);
|
||||||
}
|
}
|
||||||
@@ -177,7 +181,7 @@ public class ManualAdjustAccountBalanceServiceImpl implements ManualAdjustAccoun
|
|||||||
int updated = organAmountMapper.update(new LambdaUpdateWrapperX<OrganAmountDO>()
|
int updated = organAmountMapper.update(new LambdaUpdateWrapperX<OrganAmountDO>()
|
||||||
.eq(OrganAmountDO::getOrganId, organId)
|
.eq(OrganAmountDO::getOrganId, organId)
|
||||||
.eq(OrganAmountDO::getVersion, organAmountDO.getVersion())
|
.eq(OrganAmountDO::getVersion, organAmountDO.getVersion())
|
||||||
.setIfPresent(OrganAmountDO::getGiftAmount, newGift)
|
.set(OrganAmountDO::getGiftAmount, newGift)
|
||||||
.set(OrganAmountDO::getAmount, newAmount)
|
.set(OrganAmountDO::getAmount, newAmount)
|
||||||
.set(OrganAmountDO::getVersion, organAmountDO.getVersion() + 1));
|
.set(OrganAmountDO::getVersion, organAmountDO.getVersion() + 1));
|
||||||
// 1. 首次更新失败,认为出现并发,再查一次再更新
|
// 1. 首次更新失败,认为出现并发,再查一次再更新
|
||||||
@@ -189,17 +193,17 @@ public class ManualAdjustAccountBalanceServiceImpl implements ManualAdjustAccoun
|
|||||||
updated = organAmountMapper.update(new LambdaUpdateWrapperX<OrganAmountDO>()
|
updated = organAmountMapper.update(new LambdaUpdateWrapperX<OrganAmountDO>()
|
||||||
.eq(OrganAmountDO::getOrganId, organId)
|
.eq(OrganAmountDO::getOrganId, organId)
|
||||||
.eq(OrganAmountDO::getVersion, organAmountDO.getVersion())
|
.eq(OrganAmountDO::getVersion, organAmountDO.getVersion())
|
||||||
.setIfPresent(OrganAmountDO::getGiftAmount, newGift)
|
.set(OrganAmountDO::getGiftAmount, newGift)
|
||||||
.set(OrganAmountDO::getAmount, newAmount)
|
.set(OrganAmountDO::getAmount, newAmount)
|
||||||
.set(OrganAmountDO::getVersion, organAmountDO.getVersion() + 1));
|
.set(OrganAmountDO::getVersion, organAmountDO.getVersion() + 1));
|
||||||
// 2. 第二次更新失败,资金表可能不存在
|
// 2. 第二次更新失败,资金表可能不存在
|
||||||
if (updated == 0) {
|
if (updated == 0) {
|
||||||
throw exception(ORGAN_RECHARGE_AMOUNT_UPDATE_ERROR);
|
throw exception(ORGAN_RECHARGE_AMOUNT_UPDATE_ERROR);
|
||||||
} else {
|
} else {
|
||||||
return new OrganRechargeAmountRespVO(ObjectUtil.isNull(newGift) ? newAmount : newAmount.add(newGift), newAmount, newGift);
|
return new OrganRechargeAmountRespVO(newAmount.add(newGift), newAmount, newGift);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return new OrganRechargeAmountRespVO(ObjectUtil.isNull(newGift) ? newAmount : newAmount.add(newGift), newAmount, newGift);
|
return new OrganRechargeAmountRespVO(newAmount.add(newGift), newAmount, newGift);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-1
@@ -101,6 +101,9 @@ public class PayProductProcessorNew {
|
|||||||
private Long previousPurchaseRecordId;
|
private Long previousPurchaseRecordId;
|
||||||
|
|
||||||
// 产品支付价格
|
// 产品支付价格
|
||||||
|
private BigDecimal productPrice;
|
||||||
|
|
||||||
|
// 按序流转价格
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
|
||||||
// 组织赠送金
|
// 组织赠送金
|
||||||
@@ -163,8 +166,10 @@ public class PayProductProcessorNew {
|
|||||||
boolean initialPurchaseExist = ObjectUtil.isNotNull(orgInitialPurchaseRecord);
|
boolean initialPurchaseExist = ObjectUtil.isNotNull(orgInitialPurchaseRecord);
|
||||||
if (initialPurchaseExist) {
|
if (initialPurchaseExist) {
|
||||||
price = computePrice();
|
price = computePrice();
|
||||||
|
productPrice = price;
|
||||||
} else {
|
} else {
|
||||||
price = computeInitialProductPayAmount();
|
price = computeInitialProductPayAmount();
|
||||||
|
productPrice = price;
|
||||||
// 首次购买记录是空,那么当前就是首次订购
|
// 首次购买记录是空,那么当前就是首次订购
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
@@ -270,9 +275,11 @@ public class PayProductProcessorNew {
|
|||||||
.startTime(startTime)
|
.startTime(startTime)
|
||||||
.endTime(endTime)
|
.endTime(endTime)
|
||||||
.paymentMethod(payType)
|
.paymentMethod(payType)
|
||||||
.totalAmount(price)
|
.totalAmount(productPrice)
|
||||||
.originalAmount(originalPrice)
|
.originalAmount(originalPrice)
|
||||||
.monthAverageAmount(monthAverageAmount)
|
.monthAverageAmount(monthAverageAmount)
|
||||||
|
.accountBalanceSpent(usedBalance)
|
||||||
|
.giftMoneySpent(usedGift)
|
||||||
.isInvocing(justPayGift ? null : InvoiceStatusEnum.INVOICABLE.getCode())
|
.isInvocing(justPayGift ? null : InvoiceStatusEnum.INVOICABLE.getCode())
|
||||||
.initial(initialized)
|
.initial(initialized)
|
||||||
.status(PurchaseRecordStatusEnum.ACTIVE.getStatus())
|
.status(PurchaseRecordStatusEnum.ACTIVE.getStatus())
|
||||||
|
|||||||
+8
-6
@@ -15,7 +15,7 @@
|
|||||||
AND i.business_no = #{reqVO.businessNo}
|
AND i.business_no = #{reqVO.businessNo}
|
||||||
</if>
|
</if>
|
||||||
<if test="reqVO.orderNo != null and reqVO.orderNo != ''">
|
<if test="reqVO.orderNo != null and reqVO.orderNo != ''">
|
||||||
AND i.order_no = #{reqVO.orderNo}
|
AND (i.order_no = #{reqVO.orderNo} or i.purchase_id = #{reqVO.orderNo})
|
||||||
</if>
|
</if>
|
||||||
<if test="reqVO.tradeType != null">
|
<if test="reqVO.tradeType != null">
|
||||||
<choose>
|
<choose>
|
||||||
@@ -33,17 +33,19 @@
|
|||||||
<if test="reqVO.incomeExpenseType != null">
|
<if test="reqVO.incomeExpenseType != null">
|
||||||
AND i.income_expense_type = #{reqVO.incomeExpenseType}
|
AND i.income_expense_type = #{reqVO.incomeExpenseType}
|
||||||
</if>
|
</if>
|
||||||
<if test="reqVO.createTime != null and reqVO.createTime.size() == 2">
|
<if test="reqVO.createTime != null and reqVO.createTime.length == 2">
|
||||||
AND i.create_time between #{reqVo.createTime[0]} and #{reqVo.createTime[1]}
|
AND i.create_time between #{reqVO.createTime[0]} and #{reqVO.createTime[1]}
|
||||||
</if>
|
</if>
|
||||||
<if test="reqVO.productPrice != null">
|
<if test="reqVO.productPrice != null">
|
||||||
AND p.total_amount = #{reqVo.productPrice}
|
AND p.total_amount = #{reqVO.productPrice}
|
||||||
</if>
|
</if>
|
||||||
<if test="reqVO.rechargeAmount != null">
|
<if test="reqVO.rechargeAmount != null">
|
||||||
AND i.cash_amount_change = #{reqVo.rechargeAmount}
|
AND i.cash_amount_change = #{reqVO.rechargeAmount}
|
||||||
|
AND (i.trade_type = '${@com.cf.imes.module.system.enums.pay.TradeTypeEnum@RECHARGE.code}' or i.trade_type = '${@com.cf.imes.module.system.enums.pay.TradeTypeEnum@MANUAL_ADJUST.code}')
|
||||||
</if>
|
</if>
|
||||||
<if test="reqVO.giftAmount != null">
|
<if test="reqVO.giftAmount != null">
|
||||||
AND i.gift_amount_change = #{reqVo.giftAmount}
|
AND i.gift_amount_change = #{reqVO.giftAmount}
|
||||||
|
AND (i.trade_type = '${@com.cf.imes.module.system.enums.pay.TradeTypeEnum@RECHARGE.code}' or i.trade_type = '${@com.cf.imes.module.system.enums.pay.TradeTypeEnum@MANUAL_ADJUST.code}')
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
+4
-4
@@ -18,7 +18,7 @@
|
|||||||
SUM(
|
SUM(
|
||||||
CASE
|
CASE
|
||||||
WHEN is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICABLE.code}'
|
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
|
THEN account_balance_spent + external_spent
|
||||||
ELSE 0
|
ELSE 0
|
||||||
END
|
END
|
||||||
) AS invocable,
|
) AS invocable,
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
SUM(
|
SUM(
|
||||||
CASE
|
CASE
|
||||||
WHEN is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@PENDINGINVOICING.code}'
|
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
|
THEN account_balance_spent + external_spent
|
||||||
ELSE 0
|
ELSE 0
|
||||||
END
|
END
|
||||||
) AS inTheInvoice,
|
) AS inTheInvoice,
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
SUM(
|
SUM(
|
||||||
CASE
|
CASE
|
||||||
WHEN is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICINGSUCCESSFUL.code}'
|
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
|
THEN account_balance_spent + external_spent
|
||||||
ELSE 0
|
ELSE 0
|
||||||
END
|
END
|
||||||
) AS invoiced
|
) AS invoiced
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getInvoicableAmount" resultType="java.math.BigDecimal">
|
<select id="getInvoicableAmount" resultType="java.math.BigDecimal">
|
||||||
select sum(total_amount - gift_money_spent) from purchase_record
|
select sum(account_balance_spent + external_spent) from purchase_record
|
||||||
where organ_id = #{organId} and is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICABLE.code}'
|
where organ_id = #{organId} and is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICABLE.code}'
|
||||||
and id in
|
and id in
|
||||||
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
||||||
|
|||||||
Reference in New Issue
Block a user