update shipment filter

This commit is contained in:
tzw
2024-01-31 17:54:22 +06:30
parent 9f88d4e525
commit a592413449
5 changed files with 50 additions and 27 deletions

View File

@@ -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();