update carton and fcs shipment

This commit is contained in:
tzw
2025-02-17 20:13:30 +06:30
parent ffaa715333
commit 0295a29c44
33 changed files with 171 additions and 2383 deletions

View File

@@ -16,35 +16,38 @@ class FcsShipment {
String? destinationPortName;
String? status;
String? reportName;
int packageCount;
int cartonCount;
FcsShipment({
this.id,
this.shipmentNumber,
this.cutoffDate,
this.shipmentTypeId,
this.shipmentTypeName,
this.status,
this.etaDate,
this.departureDate,
this.consigneeId,
this.consigneeName,
this.loadingPortId,
this.loadingPortName,
this.destinationPortId,
this.destinationPortName,
this.reportName,
});
FcsShipment(
{this.id,
this.shipmentNumber,
this.cutoffDate,
this.shipmentTypeId,
this.shipmentTypeName,
this.status,
this.etaDate,
this.departureDate,
this.consigneeId,
this.consigneeName,
this.loadingPortId,
this.loadingPortName,
this.destinationPortId,
this.destinationPortName,
this.reportName,
this.packageCount = 0,
this.cartonCount = 0});
factory FcsShipment.fromMap(Map<String, dynamic> map, String docID) {
var _cutoffDate =
var cutoffDate =
map['cutoff_date'] == null ? null : (map['cutoff_date'] as Timestamp);
var _arrivalDate =
var arrivalDate =
map['eta_date'] == null ? null : (map['eta_date'] as Timestamp);
return FcsShipment(
id: docID,
cutoffDate: _cutoffDate != null ? _cutoffDate.toDate() : null,
etaDate: _arrivalDate != null ? _arrivalDate.toDate() : null,
cutoffDate: cutoffDate?.toDate(),
etaDate: arrivalDate?.toDate(),
shipmentNumber: map['shipment_number'],
shipmentTypeId: map['shipment_type_id'] ?? "",
shipmentTypeName: map['shipment_type_name'],
@@ -54,7 +57,9 @@ class FcsShipment {
loadingPortId: map['loading_port_id'],
loadingPortName: map['loading_port_name'],
destinationPortId: map['destination_port_id'],
destinationPortName: map['destination_port_name']);
destinationPortName: map['destination_port_name'],
packageCount: map['package_count'] ?? 0,
cartonCount: map['carton_count'] ?? 0);
}
Map<String, dynamic> toMap() {
@@ -71,13 +76,13 @@ class FcsShipment {
}
bool isChangedForEdit(FcsShipment fcsShipment) {
return fcsShipment.shipmentNumber != this.shipmentNumber ||
fcsShipment.cutoffDate != this.cutoffDate ||
fcsShipment.etaDate != this.etaDate ||
fcsShipment.shipmentTypeId != this.shipmentTypeId ||
fcsShipment.consigneeId != this.consigneeId ||
fcsShipment.loadingPortId != this.loadingPortId ||
fcsShipment.destinationPortId != this.destinationPortId;
return fcsShipment.shipmentNumber != shipmentNumber ||
fcsShipment.cutoffDate != cutoffDate ||
fcsShipment.etaDate != etaDate ||
fcsShipment.shipmentTypeId != shipmentTypeId ||
fcsShipment.consigneeId != consigneeId ||
fcsShipment.loadingPortId != loadingPortId ||
fcsShipment.destinationPortId != destinationPortId;
}
@override