fix errors

This commit is contained in:
Sai Naw Wun
2020-10-22 04:14:53 +06:30
parent 2021f74872
commit e5540c5491
32 changed files with 1069 additions and 811 deletions

View File

@@ -96,6 +96,25 @@ class CustomerModel extends BaseModel {
return User.fromMap(snap.data, snap.documentID);
}
Future<List<User>> getInvoiceUsers(String fcsShipmentID) async {
List<User> users = [];
try {
var snaps = await Firestore.instance
.collection(
"/$fcs_shipment_collection/$fcsShipmentID/$user_collection")
.where("pending_invoice_carton_count", isGreaterThan: 0)
.getDocuments(source: Source.server);
users = snaps.documents.map((documentSnapshot) {
var user =
User.fromMap(documentSnapshot.data, documentSnapshot.documentID);
return user;
}).toList();
} catch (e) {
log.warning("Error!! $e");
}
return users;
}
Future<void> enableUser(User user, bool enabled) {
return Services.instance.userService.enableUser(user.id, enabled);
}