update shipment filter
This commit is contained in:
@@ -28,18 +28,48 @@ class FcsShipmentModel extends BaseModel {
|
||||
Query col = FirebaseFirestore.instance.collection(path);
|
||||
Query pageQuery = FirebaseFirestore.instance.collection(path);
|
||||
|
||||
// pending status
|
||||
if (index == 1) {
|
||||
col = col.where("status", isEqualTo: fcs_shipment_confirmed_status);
|
||||
col = col.where("status", isEqualTo: fcs_shipment_pending_status);
|
||||
pageQuery =
|
||||
pageQuery.where("status", isEqualTo: fcs_shipment_confirmed_status);
|
||||
pageQuery.where("status", isEqualTo: fcs_shipment_pending_status);
|
||||
}
|
||||
|
||||
// processing status
|
||||
if (index == 2) {
|
||||
col = col.where("status", isEqualTo: fcs_shipment_processing_status);
|
||||
pageQuery =
|
||||
pageQuery.where("status", isEqualTo: fcs_shipment_processing_status);
|
||||
}
|
||||
|
||||
// shipped status
|
||||
if (index == 3) {
|
||||
col = col.where("status", isEqualTo: fcs_shipment_shipped_status);
|
||||
pageQuery =
|
||||
pageQuery.where("status", isEqualTo: fcs_shipment_shipped_status);
|
||||
}
|
||||
|
||||
// arrived status
|
||||
if (index == 4) {
|
||||
col = col.where("status", isEqualTo: fcs_shipment_arrived_status);
|
||||
pageQuery =
|
||||
pageQuery.where("status", isEqualTo: fcs_shipment_arrived_status);
|
||||
}
|
||||
|
||||
// invoiced status
|
||||
if (index == 5) {
|
||||
col = col.where("status", isEqualTo: fcs_shipment_invoiced_status);
|
||||
pageQuery =
|
||||
pageQuery.where("status", isEqualTo: fcs_shipment_invoiced_status);
|
||||
}
|
||||
|
||||
// canceled status
|
||||
if (index == 6) {
|
||||
col = col.where("status", isEqualTo: fcs_shipment_canceled_status);
|
||||
pageQuery =
|
||||
pageQuery.where("status", isEqualTo: fcs_shipment_canceled_status);
|
||||
}
|
||||
|
||||
pageQuery = pageQuery.orderBy("shipment_number", descending: true);
|
||||
|
||||
fcsShipments?.close();
|
||||
|
||||
Reference in New Issue
Block a user