feat: add more detailed history and group per day
This commit is contained in:
+12
-11
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user