feat(MED-97): small fixes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { getSupabaseServerClient } from "@/packages/supabase/src/clients/server-client";
|
||||
import { loadAccountBenefitStatistics, loadCompanyPersonalAccountsBalanceEntries } from "./load-team-account-benefit-statistics";
|
||||
import { loadCompanyPersonalAccountsBalanceEntries } from "./load-team-account-benefit-statistics";
|
||||
|
||||
export interface TeamAccountBenefitExpensesOverview {
|
||||
benefitAmount: number | null;
|
||||
@@ -65,7 +65,7 @@ export async function loadTeamAccountBenefitExpensesOverview({
|
||||
return benefitAmount * employeeCount * monthsLeft;
|
||||
} else if (benefitOccurrence === 'quarterly') {
|
||||
const quartersLeft = isCreatedThisYear
|
||||
? QUARTERS - (createdAt.getMonth() / 3)
|
||||
? QUARTERS - Math.ceil(createdAt.getMonth() / 3)
|
||||
: QUARTERS;
|
||||
return benefitAmount * employeeCount * quartersLeft;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user