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

@@ -17,6 +17,8 @@ import 'package:path/path.dart' as Path;
class CartonModel extends BaseModel {
final log = Logger('CartonModel');
var defaultShipment =FcsShipment(shipmentNumber: "All shipments", id: all);
PaginatorListener<Carton>? cartonsByFilter;
PaginatorListener<Carton>? getBoxes;
@@ -56,7 +58,8 @@ class CartonModel extends BaseModel {
_loadPaginationCartons();
}
filterCarton(User? consignee, User? sender, String? status) async {
filterCarton(FcsShipment? fcsShipment, User? consignee, User? sender,
String? status) async {
filterByStatus = status;
if (status == all_status) {
@@ -77,6 +80,12 @@ class CartonModel extends BaseModel {
filterBySender = sender;
}
if (fcsShipment?.id == all) {
shipment = null;
} else {
shipment = fcsShipment;
}
loadPaginationCartons();
notifyListeners();
}