update carton filter and merge api for shipment

This commit is contained in:
tzw
2024-03-02 18:15:05 +06:30
parent b1e45debc7
commit c63353636a
22 changed files with 410 additions and 150 deletions

View File

@@ -87,7 +87,7 @@ class FcsShipmentModel extends BaseModel {
try {
var snaps = await FirebaseFirestore.instance
.collection("/$fcs_shipment_collection")
// .where("status", isEqualTo: fcs_shipment_confirmed_status)
.where("status", isEqualTo: fcs_shipment_processing_status)
.get(const GetOptions(source: Source.server));
fcsShipments = snaps.docs.map((documentSnapshot) {
var fcs =
@@ -199,12 +199,20 @@ class FcsShipmentModel extends BaseModel {
return Services.instance.fcsShipmentService.report(fcsShipment);
}
Future<List<FcsShipment>> getAllShipments() async {
Future<List<FcsShipment>> getShipments() async {
List<FcsShipment> fcsShipments = [];
try {
var snaps = await FirebaseFirestore.instance
.collection("/$fcs_shipment_collection")
.where("status", whereIn: [
fcs_shipment_processing_status,
fcs_shipment_shipped_status,
fcs_shipment_arrived_status,
fcs_shipment_invoiced_status
])
.where("is_deleted", isEqualTo: false)
.orderBy("update_time", descending: true)
.limit(shipmentCountForCartonFilter)
.get(const GetOptions(source: Source.server));
fcsShipments = snaps.docs.map((documentSnapshot) {
var fcs =