2020-06-02 14:56:51 +06:30
|
|
|
import 'package.dart';
|
|
|
|
|
|
|
|
|
|
class Invoice {
|
|
|
|
|
String invoiceNumber;
|
|
|
|
|
DateTime invoiceDate;
|
|
|
|
|
String customerName;
|
|
|
|
|
String customerPhoneNumber;
|
|
|
|
|
double amount;
|
|
|
|
|
String discount;
|
|
|
|
|
String status;
|
|
|
|
|
String paymentAttachment;
|
|
|
|
|
|
|
|
|
|
List<Package> packages;
|
2020-06-24 16:06:15 +06:30
|
|
|
List<Receipt> receipts;
|
|
|
|
|
List<String> receiptPhotos;
|
|
|
|
|
|
2020-06-02 14:56:51 +06:30
|
|
|
Invoice(
|
|
|
|
|
{this.invoiceNumber,
|
|
|
|
|
this.invoiceDate,
|
|
|
|
|
this.customerName,
|
|
|
|
|
this.customerPhoneNumber,
|
|
|
|
|
this.amount,
|
|
|
|
|
this.discount,
|
|
|
|
|
this.status,
|
|
|
|
|
this.paymentAttachment,
|
2020-06-24 16:06:15 +06:30
|
|
|
this.packages,
|
|
|
|
|
this.receiptPhotos,
|
|
|
|
|
this.receipts});
|
2020-06-03 00:42:31 +06:30
|
|
|
|
|
|
|
|
double get getAmount => packages.fold(0, (p, e) => (e.rate * e.weight) + p);
|
2020-06-02 14:56:51 +06:30
|
|
|
}
|
2020-06-24 16:06:15 +06:30
|
|
|
|
|
|
|
|
class Receipt {
|
|
|
|
|
int amount;
|
|
|
|
|
DateTime date;
|
|
|
|
|
|
|
|
|
|
Receipt({this.amount, this.date});
|
|
|
|
|
}
|