@if (yearDropdownOpen()) {
}

{{ 'financial_year.title' | translate }}

@if (currentFY()) {

{{ currentFY()!.owner_type === 'household' ? ('financial_year.owner_household' | translate) : ('financial_year.owner_personal' | translate) }}

}
@if (years().length > 0) {
@if (yearDropdownOpen()) {
@for (y of years(); track y.year) { }
}
} @if (canCreateNewYear()) { }
@if (loading()) {
} @if (!loading() && years().length === 0) {

{{ 'financial_year.no_years' | translate }}

} @if (!loading() && currentFY()) {

{{ 'financial_year.total_income' | translate }}

CHF {{ formatChf(totalAnnualIncome()) }}

CHF {{ formatChf(totalAnnualIncome() / 12) }} / {{ 'financial_year.per_month' | translate }}

{{ 'financial_year.total_fixed_costs' | translate }}

CHF {{ formatChf(totalAnnualBudget()) }}

CHF {{ formatChf(totalMonthlyBudget()) }} / {{ 'financial_year.per_month' | translate }}

{{ 'financial_year.total_expenses_year' | translate }} {{ selectedYear() }}

CHF {{ formatChf(totalYearExpenses()) }}

Ø CHF {{ formatChf(avgMonthlyExpenses()) }} / {{ 'financial_year.per_month' | translate }}

@if (activeTab() === 'incomes') { @if (revenueAccounts().length === 0) {

{{ 'financial_year.no_revenue_accounts' | translate }}

} @for (account of revenueAccounts(); track account.id) {

{{ account.name }}

CHF {{ formatChf(account.balance) }}/Mt. @if (account.owner_email && !account.is_mine) { · {{ account.owner_email }} }

CHF {{ formatChf(account.balance * (account.salary_months ?? 12)) }}

{{ 'financial_year.annual_label' | translate }}

} @if (revenueAccounts().length > 0) {
{{ 'financial_year.total_annual_income' | translate }} CHF {{ formatChf(totalAnnualIncome()) }}
} } @if (activeTab() === 'budget_items') { @if (budgetItems().length === 0 && !showForm()) {

{{ 'financial_year.no_budget_items' | translate }}

} @for (item of budgetItems(); track item.id) {

{{ item.name }}

@if (item.notes) {

{{ item.notes }}

}

CHF {{ formatChf(item.amount) }}

CHF {{ formatChf(perMonth(item.amount)) }}/Mt.

@if (!item.active) { Inaktiv }
} } @if (showForm() && activeTab() !== 'incomes') {

{{ editingId ? ('common.edit' | translate) : ('common.add' | translate) }}

@if (formError) {

{{ 'financial_year.error_' + formError | translate }}

}
} @if (!showForm() && activeTab() !== 'incomes') {
}
}

{{ 'household.title' | translate }}

@if (households().length === 0) {

{{ 'household.none' | translate }}

{{ 'household.none_hint' | translate }}

@if (!showCreateHouseholdForm()) { } @if (showCreateHouseholdForm()) {
@if (householdError) {

{{ 'household.error_' + householdError | translate }}

}
}
} @for (h of households(); track h.id) { @let myM = myMembership(h); @let amFounder = isFounder(h); @let isPending = myM?.status === 'pending';

{{ h.name }}

{{ 'household.created_by' | translate }}: {{ h.created_by_email }}

@if (!isPending && canInvite(h) && inviteHouseholdId() !== h.id) { }
@if (isPending) {

{{ 'household.pending_invitation' | translate }}

{{ 'household.pending_from' | translate }}: {{ myM?.invited_by_email }} · {{ 'household.effective_from' | translate }} {{ myM?.effective_from_year }}

} @if (!isPending) {
@for (m of activeMembers(h); track m.id) {

{{ m.user_email }} @if (m.user_email === userEmail) { ({{ 'household.you' | translate }}) } @if (m.user_email === h.created_by_email) { ({{ 'household.founder' | translate }}) }

{{ 'household.status_' + m.status | translate }} {{ 'household.role_' + m.role | translate }} @if (amFounder && m.user_email !== userEmail && m.status === 'active') { }
}
} @if (!isPending && (h.pending_invites?.length ?? 0) > 0) {
@for (pi of h.pending_invites; track pi.id) {

{{ pi.invited_email }}

{{ 'household.status_unregistered' | translate }}
}
} @if (inviteHouseholdId() === h.id) {
@if (inviteError) {

{{ 'household.error_' + inviteError | translate }}

}
} @if (!amFounder && myM?.status === 'active') {
}
}
@if (showNewYearModal()) {

{{ 'financial_year.confirm_new_year' | translate: { year: nextYear() } }}

@if (activeHouseholds().length > 0) {
@for (h of activeHouseholds(); track h.id) { }
} @if (years().length > 0) {

{{ 'financial_year.confirm_copy' | translate: { source: selectedYear() } }}

} @else {

{{ 'financial_year.first_year_hint' | translate: { year: nextYear() } }}

}
} @if (showLeaveModal()) {

{{ 'household.leave_confirm_title' | translate }}

{{ 'household.leave_confirm_text' | translate }}

} @if (showDeleteModal()) {

{{ 'common.delete_confirm_title' | translate }}

{{ 'common.delete_confirm_text' | translate }}

}