modify package list
This commit is contained in:
@@ -11,6 +11,9 @@ class Invoice {
|
||||
String paymentAttachment;
|
||||
|
||||
List<Package> packages;
|
||||
List<Receipt> receipts;
|
||||
List<String> receiptPhotos;
|
||||
|
||||
Invoice(
|
||||
{this.invoiceNumber,
|
||||
this.invoiceDate,
|
||||
@@ -20,7 +23,16 @@ class Invoice {
|
||||
this.discount,
|
||||
this.status,
|
||||
this.paymentAttachment,
|
||||
this.packages});
|
||||
this.packages,
|
||||
this.receiptPhotos,
|
||||
this.receipts});
|
||||
|
||||
double get getAmount => packages.fold(0, (p, e) => (e.rate * e.weight) + p);
|
||||
}
|
||||
|
||||
class Receipt {
|
||||
int amount;
|
||||
DateTime date;
|
||||
|
||||
Receipt({this.amount, this.date});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user