modify package list

This commit is contained in:
PhyoThandar
2020-06-24 16:06:15 +06:30
parent 3c147e0ecd
commit 76235bed4b
17 changed files with 52727 additions and 190 deletions

View File

@@ -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});
}

View File

@@ -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});
}