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;
|
||||
}
|
||||
|
||||
@@ -73,8 +73,7 @@ export const loadAccountBenefitStatistics = async (
|
||||
.select('*')
|
||||
.eq('company_id', accountId)
|
||||
.eq('is_active', true)
|
||||
.single()
|
||||
.throwOnError();
|
||||
.single();
|
||||
|
||||
const scheduleAmount = benefitDistributionSchedule?.benefit_amount || 0;
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user