update invoice page

This commit is contained in:
Sai Naw Wun
2020-10-24 06:14:07 +06:30
parent d0d664e004
commit feec3c8687
22 changed files with 996 additions and 637 deletions

View File

@@ -148,6 +148,30 @@ class ShipmentModel extends BaseModel {
return null;
}
Future<List<Shipment>> getShipmentWithHandlingFee(
String fcsShipmentID, String userID) async {
String path = "/$shipments_collection";
try {
var q = Firestore.instance
.collection("$path")
.where("user_id", isEqualTo: userID)
.where("is_deleted", isEqualTo: false)
.where("handling_fee", isGreaterThan: 0)
.where("fcs_shipment_id", isEqualTo: fcsShipmentID);
var snaps = await q.getDocuments(source: Source.server);
List<Shipment> shipments = snaps.documents.map((snap) {
if (snap.exists) {
var s = Shipment.fromMap(snap.data, snap.documentID);
return s;
}
}).toList();
return shipments;
} catch (e) {
log.warning("Error!! $e");
}
return null;
}
void initUser(user) {
super.initUser(user);
}