update invoice page
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user