Bugfix for fees / Oauth 2 implementation
This commit is contained in:
@@ -247,6 +247,10 @@ const createNegativeFeeForDiscount = (memberData, dateRange) => {
|
||||
}
|
||||
});
|
||||
|
||||
if (membershipFeeForDiscount === 0){
|
||||
return null; //This member's plan is not eligible for a discount
|
||||
}
|
||||
|
||||
const totalChargeFee = membershipFeeForDiscount + totalBookingChargedFee;
|
||||
|
||||
let discount = 0;
|
||||
@@ -261,7 +265,7 @@ const createNegativeFeeForDiscount = (memberData, dateRange) => {
|
||||
const discountRate = discountPercentage / 100;
|
||||
discount = totalChargeFee * discountRate;
|
||||
}else{
|
||||
return null;
|
||||
return null; //Not enough hours to earn a discount
|
||||
}
|
||||
|
||||
const formattedName = `[Discount] Total booked : ${totalBookedHours.toFixed(2)} hrs, Total charged : ${totalChargedHours.toFixed(2)} hrs, Discount : ${discountPercentage} %`;
|
||||
@@ -317,7 +321,7 @@ const getMembersFeesForDateRange = (dateRange, memberIds) => {
|
||||
membersMap[member.memberId] = {
|
||||
member,
|
||||
bookingData: Object.assign({}, oneMemberObject),
|
||||
membershipFees: membershipsMap[member.memberId],
|
||||
membershipFees: membershipsMap[member.memberId] || [],
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user