update invoice page
This commit is contained in:
@@ -89,14 +89,16 @@ class _CartonEditorState extends State<CartonEditor> {
|
||||
_user = User(fcsID: _carton.fcsID, name: _carton.userName);
|
||||
_loadPackages();
|
||||
} else {
|
||||
_carton = Carton(cargoTypes: [], packages: [], cartons: []);
|
||||
_carton = Carton(
|
||||
cargoTypes: [],
|
||||
packages: [],
|
||||
);
|
||||
_lengthController.text = "12";
|
||||
_widthController.text = "12";
|
||||
_heightController.text = "12";
|
||||
_isNew = true;
|
||||
_selectedCartonType = carton_from_packages;
|
||||
_loadFcsShipments();
|
||||
_loadMixCartons();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,16 +114,6 @@ class _CartonEditorState extends State<CartonEditor> {
|
||||
});
|
||||
}
|
||||
|
||||
_loadMixCartons() async {
|
||||
if (_fcsShipment == null) return;
|
||||
CartonModel cartonModel = Provider.of<CartonModel>(context, listen: false);
|
||||
var mixCartons =
|
||||
await cartonModel.getMixCartonsByFcsShipment(_fcsShipment.id);
|
||||
setState(() {
|
||||
_mixCartons = mixCartons;
|
||||
});
|
||||
}
|
||||
|
||||
_loadPackages() async {
|
||||
if (_user == null) return;
|
||||
PackageModel packageModel =
|
||||
@@ -159,19 +151,6 @@ class _CartonEditorState extends State<CartonEditor> {
|
||||
_populateDeliveryAddress();
|
||||
}
|
||||
|
||||
_loadCartons() async {
|
||||
if (_fcsShipment == null) return;
|
||||
CartonModel cartonModel = Provider.of<CartonModel>(context, listen: false);
|
||||
List<Carton> cartons =
|
||||
await cartonModel.getCartonsByFcsShipment(_fcsShipment.id);
|
||||
cartons.forEach((c) {
|
||||
c.isChecked = true;
|
||||
});
|
||||
setState(() {
|
||||
_carton.cartons = cartons;
|
||||
});
|
||||
}
|
||||
|
||||
_populateDeliveryAddress() {
|
||||
if (_carton.packages == null) return;
|
||||
var d = _carton.packages
|
||||
@@ -217,12 +196,6 @@ class _CartonEditorState extends State<CartonEditor> {
|
||||
setState(() {
|
||||
_fcsShipment = v;
|
||||
});
|
||||
if (_selectedCartonType == carton_mix_box) {
|
||||
_loadCartons();
|
||||
}
|
||||
if (_selectedCartonType == carton_small_bag) {
|
||||
_loadMixCartons();
|
||||
}
|
||||
},
|
||||
labelKey: "shipment.pack.fcs.shipment",
|
||||
iconData: Ionicons.ios_airplane,
|
||||
@@ -322,9 +295,6 @@ class _CartonEditorState extends State<CartonEditor> {
|
||||
setState(() {
|
||||
_selectedCartonType = v;
|
||||
});
|
||||
if (_selectedCartonType == carton_mix_box) {
|
||||
_loadCartons();
|
||||
}
|
||||
});
|
||||
|
||||
final cargoTableTitleBox = LocalTitle(
|
||||
@@ -507,9 +477,6 @@ class _CartonEditorState extends State<CartonEditor> {
|
||||
carton.width = w;
|
||||
carton.height = h;
|
||||
carton.deliveryAddress = _deliveryAddress;
|
||||
carton.cartons = _carton.cartons == null
|
||||
? []
|
||||
: _carton.cartons.where((c) => c.isChecked).toList();
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user