fix fcs shipment query
This commit is contained in:
@@ -31,9 +31,6 @@ class FcsShipmentModel extends BaseModel {
|
|||||||
void privilegeChanged() {
|
void privilegeChanged() {
|
||||||
super.privilegeChanged();
|
super.privilegeChanged();
|
||||||
_loadFcsShipments();
|
_loadFcsShipments();
|
||||||
|
|
||||||
if (_shipped != null) _shipped.close();
|
|
||||||
_shipped = _getShipped();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initData() {
|
initData() {
|
||||||
@@ -42,6 +39,7 @@ class FcsShipmentModel extends BaseModel {
|
|||||||
|
|
||||||
if (_shipped != null) _shipped.close();
|
if (_shipped != null) _shipped.close();
|
||||||
_shipped = _getShipped();
|
_shipped = _getShipped();
|
||||||
|
_shipped.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _loadFcsShipments() async {
|
Future<void> _loadFcsShipments() async {
|
||||||
@@ -52,8 +50,9 @@ class FcsShipmentModel extends BaseModel {
|
|||||||
try {
|
try {
|
||||||
listener = Firestore.instance
|
listener = Firestore.instance
|
||||||
.collection("$path")
|
.collection("$path")
|
||||||
.orderBy("shipment_number", descending: true)
|
|
||||||
.where("status", isEqualTo: fcs_shipment_confirmed_status)
|
.where("status", isEqualTo: fcs_shipment_confirmed_status)
|
||||||
|
.where("is_deleted", isEqualTo: false)
|
||||||
|
.orderBy("shipment_number", descending: true)
|
||||||
.snapshots()
|
.snapshots()
|
||||||
.listen((QuerySnapshot snapshot) {
|
.listen((QuerySnapshot snapshot) {
|
||||||
_fcsShipments.clear();
|
_fcsShipments.clear();
|
||||||
@@ -76,7 +75,7 @@ class FcsShipmentModel extends BaseModel {
|
|||||||
.collection("/$fcs_shipment_collection")
|
.collection("/$fcs_shipment_collection")
|
||||||
.where("status", isEqualTo: fcs_shipment_shipped_status)
|
.where("status", isEqualTo: fcs_shipment_shipped_status)
|
||||||
.where("is_deleted", isEqualTo: false)
|
.where("is_deleted", isEqualTo: false)
|
||||||
.orderBy("status_date", descending: true);
|
.orderBy("shipment_number", descending: true);
|
||||||
var paginator = new Paginator(pageQuery, rowPerLoad: 20, toObj: (data, id) {
|
var paginator = new Paginator(pageQuery, rowPerLoad: 20, toObj: (data, id) {
|
||||||
return FcsShipment.fromMap(data, id);
|
return FcsShipment.fromMap(data, id);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user