fix: 比例计算根据可退金额计算

This commit is contained in:
张松 2024-11-22 17:21:12 +08:00
parent b1c0e73049
commit d50d511c71
1 changed files with 3 additions and 2 deletions

View File

@ -214,9 +214,10 @@ public class TbCashierCart implements Serializable {
totalAmount = packFee;
} else {
if (isMember != null && isMember == 1 && memberPrice != null && memberPrice.compareTo(BigDecimal.ZERO) > 0) {
totalAmount = totalNumber.multiply(memberPrice).add(packFee).multiply(discountRadio);
totalAmount = totalNumber.multiply(memberPrice).add(packFee).multiply(discountRadio).setScale(2, RoundingMode.HALF_UP);
} else {
totalAmount = totalNumber.multiply(discountSaleAmount != null ? discountSaleAmount : salePrice).add(packFee).multiply(discountRadio);
totalAmount = totalNumber.multiply(discountSaleAmount != null ? discountSaleAmount : salePrice)
.add(packFee).multiply(discountRadio).setScale(2, RoundingMode.HALF_UP);
}
}
}