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});
|
||||
}
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
// class Status {
|
||||
// String status;
|
||||
// DateTime date;
|
||||
// bool done;
|
||||
// Status({this.status, this.date, this.done});
|
||||
// }
|
||||
import 'box.dart';
|
||||
|
||||
class Package {
|
||||
String id;
|
||||
@@ -34,7 +29,7 @@ class Package {
|
||||
shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
|
||||
double get price => rate.toDouble() * weight;
|
||||
|
||||
// List<Status> statusHistory;
|
||||
List<Status> statusHistory;
|
||||
|
||||
Package(
|
||||
{this.id,
|
||||
@@ -55,7 +50,6 @@ class Package {
|
||||
this.arrivedDate,
|
||||
this.cargoDesc,
|
||||
this.market,
|
||||
this.trackingID
|
||||
// this.statusHistory
|
||||
});
|
||||
this.trackingID,
|
||||
this.statusHistory});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user