update cargo type form from rate, update carton info and form

This commit is contained in:
tzw
2024-09-25 21:49:09 +06:30
parent 1be18c08a9
commit 02e079c514
51 changed files with 1407 additions and 643 deletions

View File

@@ -4,13 +4,16 @@ class FcsShipment {
String? id;
String? shipmentNumber;
DateTime? cutoffDate;
DateTime? etaDate;
String? shipmentTypeId;
String? shipTypeName;
DateTime? arrivalDate;
String? shipmentTypeName;
DateTime? departureDate;
String? consignee;
String? port;
String? destination;
String? consigneeId;
String? consigneeName;
String? loadingPortId;
String? loadingPortName;
String? destinationPortId;
String? destinationPortName;
String? status;
String? reportName;
@@ -19,13 +22,16 @@ class FcsShipment {
this.shipmentNumber,
this.cutoffDate,
this.shipmentTypeId,
this.shipTypeName,
this.shipmentTypeName,
this.status,
this.arrivalDate,
this.etaDate,
this.departureDate,
this.consignee,
this.port,
this.destination,
this.consigneeId,
this.consigneeName,
this.loadingPortId,
this.loadingPortName,
this.destinationPortId,
this.destinationPortName,
this.reportName,
});
@@ -33,45 +39,45 @@ class FcsShipment {
var _cutoffDate =
map['cutoff_date'] == null ? null : (map['cutoff_date'] as Timestamp);
var _arrivalDate =
map['arrival_date'] == null ? null : (map['arrival_date'] as Timestamp);
map['eta_date'] == null ? null : (map['eta_date'] as Timestamp);
return FcsShipment(
id: docID,
cutoffDate: _cutoffDate != null ? _cutoffDate.toDate() : null,
arrivalDate: _arrivalDate != null ? _arrivalDate.toDate() : null,
shipmentNumber: map['shipment_number'],
shipTypeName: map['shipment_type_name'],
shipmentTypeId: map['shipment_type_id'] ?? "",
status: map['status'],
consignee: map['consignee'],
port: map['port'],
destination: map['destination'],
);
id: docID,
cutoffDate: _cutoffDate != null ? _cutoffDate.toDate() : null,
etaDate: _arrivalDate != null ? _arrivalDate.toDate() : null,
shipmentNumber: map['shipment_number'],
shipmentTypeId: map['shipment_type_id'] ?? "",
shipmentTypeName: map['shipment_type_name'],
status: map['status'],
consigneeId: map['shipment_consignee_id'],
consigneeName: map['shipment_consignee_name'],
loadingPortId: map['loading_port_id'],
loadingPortName: map['loading_port_name'],
destinationPortId: map['destination_port_id'],
destinationPortName: map['destination_port_name']);
}
Map<String, dynamic> toMap() {
return {
'id': id,
'shipment_number': shipmentNumber,
'shipment_type_id': shipmentTypeId,
'cutoff_date': cutoffDate?.toUtc().toIso8601String(),
'arrival_date': arrivalDate?.toUtc().toIso8601String(),
'consignee': consignee,
'port': port,
'destination': destination,
// 'status': status,
// 'report_name': reportName,
'eta_date': etaDate?.toUtc().toIso8601String(),
'shipment_type_id': shipmentTypeId,
'shipment_consignee_id': consigneeId,
'loading_port_id': loadingPortId,
'destination_port_id': destinationPortId
};
}
bool isChangedForEdit(FcsShipment fcsShipment) {
return fcsShipment.shipmentNumber != this.shipmentNumber ||
fcsShipment.cutoffDate != this.cutoffDate ||
fcsShipment.arrivalDate != this.arrivalDate ||
fcsShipment.etaDate != this.etaDate ||
fcsShipment.shipmentTypeId != this.shipmentTypeId ||
fcsShipment.consignee != this.consignee ||
fcsShipment.port != this.port ||
fcsShipment.destination != this.destination;
fcsShipment.consigneeId != this.consigneeId ||
fcsShipment.loadingPortId != this.loadingPortId ||
fcsShipment.destinationPortId != this.destinationPortId;
}
@override