parser logic added

This commit is contained in:
davmar
2026-08-30 12:24:29 +02:00
parent 35d5c90d81
commit 3b698a3667
28 changed files with 3018 additions and 346 deletions
+8
View File
@@ -8,20 +8,27 @@ class LineItem {
required this.price,
this.quantity,
this.unitPrice,
this.discount = 0,
});
final String id;
final String name;
/// Line total after any discount.
final double price;
final int? quantity;
final double? unitPrice;
/// Negative amount when a discount was folded into [price].
final double discount;
LineItem copyWith({
String? id,
String? name,
double? price,
int? quantity,
double? unitPrice,
double? discount,
bool clearQuantity = false,
}) {
return LineItem(
@@ -30,6 +37,7 @@ class LineItem {
price: price ?? this.price,
quantity: clearQuantity ? null : (quantity ?? this.quantity),
unitPrice: clearQuantity ? null : (unitPrice ?? this.unitPrice),
discount: discount ?? this.discount,
);
}
}