+
+
+
+
+
+
+
+
+
{formatDate(toDate(cycle.billing_start_date))} –
{formatDate(toDate(cycle.billing_end_date))}
-
-
- {Object.keys(cycle.billing_ids).length} billing
- {Object.keys(cycle.billing_ids).length === 1 ? 'record' : 'records'}
- {#if cycle.overdue_date}
- • Due: {formatDate(toDate(cycle.overdue_date))}
- {/if}
-
+
+
{getCycleMeterGroupName(cycle)}
+
{cycleUtilityType}
+
+
+ {Object.keys(cycle.billing_ids).length} billing
+ {Object.keys(cycle.billing_ids).length === 1 ? 'record' : 'records'}
+ {#if cycle.overdue_date}
+ • Due: {formatDate(toDate(cycle.overdue_date))}
+ {/if}
+
Consumption
@@ -1752,18 +1879,30 @@
{/if}
{/each}
-
- {/each}
- {#if cycles.hasMore}
-
-
+
+ {#if totalPages > 1}
+
+
+ Page {currentPage} of {totalPages} ({filteredCycles.length} cycles)
+
+
+
+
+
{/if}
{/if}
diff --git a/ui/src/routes/(app)/dashboard/+page.svelte b/ui/src/routes/(app)/dashboard/+page.svelte
index 44da38b..19a101b 100644
--- a/ui/src/routes/(app)/dashboard/+page.svelte
+++ b/ui/src/routes/(app)/dashboard/+page.svelte
@@ -5,7 +5,7 @@
import { getBillings } from '$lib/api/billings';
import { getBillingCycles } from '$lib/api/billing-cycles';
import { getMeterGroups } from '$lib/api/meter-groups';
- import { formatCurrency, formatDate } from '$lib/utils/format';
+ import { formatCurrency, formatDate, getReadingUnit } from '$lib/utils/format';
import { toDate } from '$lib/utils/timestamp';
import { getCyclePaidAmount, getCycleOutstandingAmount } from '$lib/utils/billing-cycle.util';
import { getUtilityTypeBadgeClasses } from '$lib/utils/utility-colors';
@@ -19,47 +19,74 @@
let propertyCount = $state(0);
let tenantCount = $state(0);
- let totalBilled = $state(0);
- let totalCollected = $state(0);
- let totalOutstanding = $state(0);
- let recentCycles = $state
([]);
+ let allCycles = $state([]);
let meterGroups = $state([]);
let billingMap = $state