feat: add more detailed history and group per day

This commit is contained in:
2026-08-07 05:07:41 +02:00
parent 1dd7e69aa8
commit 799c1c4045
23 changed files with 2506 additions and 346 deletions
+12 -11
View File
@@ -9,7 +9,7 @@ class ClosedTab {
final String originalTabId;
final String customerName;
final DateTime closedAt;
final PaymentMethod paymentMethod;
final PaymentMethod paymentMethod;
final List<ClosedTabItem> items;
const ClosedTab({
@@ -21,10 +21,11 @@ final PaymentMethod paymentMethod;
required this.items,
});
int get itemCount => items.fold(0, (sum, item) => sum + item.quantity);
int get itemCount =>
items.fold(0, (sum, item) => sum + (item.isRemoved ? 0 : item.quantity));
int get totalInCents =>
items.fold(0, (sum, item) => sum + item.quantity * item.unitPriceInCents);
items.fold(0, (sum, item) => sum + item.lineTotalInCents);
String get formattedTotal =>
NumberFormat.simpleCurrency().format(totalInCents / 100);
@@ -44,13 +45,13 @@ final PaymentMethod paymentMethod;
@override
int get hashCode => Object.hash(
id,
originalTabId,
customerName,
closedAt,
paymentMethod,
Object.hashAll(items),
);
id,
originalTabId,
customerName,
closedAt,
paymentMethod,
Object.hashAll(items),
);
}
// _listEquals moved to utils/collection_utils.dart
// _listEquals moved to utils/collection_utils.dart