add prompt confirmation and update carton
This commit is contained in:
@@ -5,6 +5,7 @@ class CargoType {
|
||||
double weight;
|
||||
bool isChecked;
|
||||
int qty;
|
||||
bool isCutomDuty = false;
|
||||
|
||||
double get calAmount => (calRate ?? 0) * (calWeight ?? 0);
|
||||
|
||||
@@ -29,7 +30,8 @@ class CargoType {
|
||||
this.calWeight,
|
||||
this.calRate,
|
||||
this.isChecked = false,
|
||||
this.qty = 0});
|
||||
this.qty = 0,
|
||||
this.isCutomDuty = false});
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
@@ -56,4 +58,8 @@ class CargoType {
|
||||
String toString() {
|
||||
return name;
|
||||
}
|
||||
|
||||
bool isChangedForEdit(CargoType cargoType) {
|
||||
return cargoType.name != this.name || cargoType.rate != this.rate;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ class CartonSize {
|
||||
double height;
|
||||
CartonSize({this.id, this.name, this.length, this.width, this.height});
|
||||
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
'id': id,
|
||||
@@ -27,4 +26,10 @@ class CartonSize {
|
||||
);
|
||||
}
|
||||
|
||||
bool isChangedForEdit(CartonSize cartonSize) {
|
||||
return cartonSize.name != this.name ||
|
||||
cartonSize.length != this.length ||
|
||||
cartonSize.width != this.width ||
|
||||
cartonSize.height != this.height;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@ class CustomDuty {
|
||||
String productType;
|
||||
String desc;
|
||||
double fee;
|
||||
CustomDuty({this.id, this.productType, this.desc, this.fee});
|
||||
double shipmentRate;
|
||||
CustomDuty(
|
||||
{this.id, this.productType, this.desc, this.fee, this.shipmentRate});
|
||||
|
||||
factory CustomDuty.fromMap(Map<String, dynamic> map, String id) {
|
||||
return CustomDuty(
|
||||
@@ -28,4 +30,11 @@ class CustomDuty {
|
||||
|
||||
@override
|
||||
int get hashCode => id.hashCode;
|
||||
|
||||
bool isChangedForEdit(CustomDuty customDuty) {
|
||||
return customDuty.productType != this.productType ||
|
||||
customDuty.fee != this.fee
|
||||
// ||customDuty.shipmentRate != this.shipmentRate
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,4 +35,10 @@ class Discount {
|
||||
status: map['status'],
|
||||
);
|
||||
}
|
||||
|
||||
bool isChangedForEdit(Discount discount) {
|
||||
return discount.code != this.code ||
|
||||
discount.amount != this.amount ||
|
||||
discount.customerId != this.customerId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,4 +20,9 @@ class DiscountByWeight {
|
||||
'discount': discount,
|
||||
};
|
||||
}
|
||||
|
||||
bool isChangedForEdit(DiscountByWeight discountByWeight) {
|
||||
return discountByWeight.weight != this.weight ||
|
||||
discountByWeight.discount != this.discount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,4 +66,14 @@ class FcsShipment {
|
||||
bool isConfirmed() {
|
||||
return status == fcs_shipment_confirmed_status;
|
||||
}
|
||||
|
||||
bool isChangedForEdit(FcsShipment fcsShipment) {
|
||||
return fcsShipment.shipmentNumber != this.shipmentNumber ||
|
||||
fcsShipment.cutoffDate != this.cutoffDate ||
|
||||
fcsShipment.arrivalDate != this.arrivalDate ||
|
||||
fcsShipment.shipType != this.shipType ||
|
||||
fcsShipment.consignee != this.consignee ||
|
||||
fcsShipment.port != this.port ||
|
||||
fcsShipment.destination != this.destination;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +131,12 @@ class Package {
|
||||
currentStatusDate: DateTime.parse(json['status_date']));
|
||||
}
|
||||
|
||||
bool isChangedForEdit(Package package) {
|
||||
return package.trackingID != this.trackingID ||
|
||||
package.remark != this.remark ||
|
||||
package.fcsID != this.fcsID;
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => other is Package && other.id == id;
|
||||
|
||||
|
||||
@@ -29,6 +29,12 @@ class Processing {
|
||||
@override
|
||||
int get hashCode => id.hashCode;
|
||||
|
||||
bool isChangedForEdit(Processing processing) {
|
||||
return processing.userID != this.userID ||
|
||||
processing.fcsID != this.fcsID ||
|
||||
processing.packages != this.packages;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Processing{id: $id}';
|
||||
|
||||
@@ -44,6 +44,12 @@ class Rate {
|
||||
};
|
||||
}
|
||||
|
||||
bool isChangedForEdit(Rate rate) {
|
||||
return rate.freeDeliveryWeight != this.freeDeliveryWeight ||
|
||||
rate.deliveryFee != this.deliveryFee ||
|
||||
rate.volumetricRatio != this.volumetricRatio;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Rate{deliveryFee:$deliveryFee,freeDeliveryWeight:$freeDeliveryWeight,volumetricRatio:$volumetricRatio}';
|
||||
|
||||
Reference in New Issue
Block a user