update carton
This commit is contained in:
@@ -275,7 +275,7 @@
|
|||||||
"box.packages":"Packages",
|
"box.packages":"Packages",
|
||||||
"box.tracking.id":"Tracking ID",
|
"box.tracking.id":"Tracking ID",
|
||||||
"box.market":"Market",
|
"box.market":"Market",
|
||||||
"box.cargo.save.btn":"Select",
|
"box.cargo.save.btn":"Update Carton",
|
||||||
"box.type.title":"Carton types",
|
"box.type.title":"Carton types",
|
||||||
"box.shipment.boxes":"Cartons",
|
"box.shipment.boxes":"Cartons",
|
||||||
"box.shipment_number":"Shipment number",
|
"box.shipment_number":"Shipment number",
|
||||||
@@ -302,6 +302,8 @@
|
|||||||
"box.mix_type":"Mix Box Types",
|
"box.mix_type":"Mix Box Types",
|
||||||
"box.selection":"Carton Selection",
|
"box.selection":"Carton Selection",
|
||||||
"box.weight":"Weight",
|
"box.weight":"Weight",
|
||||||
|
"box.mix_carton.update.btn":"Update mix carton",
|
||||||
|
"box.cargo.select.btn":"Select",
|
||||||
"Boxes End ================================================================":"",
|
"Boxes End ================================================================":"",
|
||||||
|
|
||||||
"Delivery Start ================================================================":"",
|
"Delivery Start ================================================================":"",
|
||||||
|
|||||||
@@ -275,7 +275,7 @@
|
|||||||
"box.packages":"အထုပ်များ",
|
"box.packages":"အထုပ်များ",
|
||||||
"box.tracking.id":"Tracking ID",
|
"box.tracking.id":"Tracking ID",
|
||||||
"box.market":"အွန်လိုင်စျေးဆိုင်",
|
"box.market":"အွန်လိုင်စျေးဆိုင်",
|
||||||
"box.cargo.save.btn":"ရွေးမည်",
|
"box.cargo.save.btn":"သေတ္တာ ပြုပြင်မည်",
|
||||||
"box.type.title":"သေတ္တာအမျိုးအစားများ",
|
"box.type.title":"သေတ္တာအမျိုးအစားများ",
|
||||||
"box.shipment.boxes":"သေတ္တာများ",
|
"box.shipment.boxes":"သေတ္တာများ",
|
||||||
"box.shipment_number":"ပို့ဆောင်နံပါတ်",
|
"box.shipment_number":"ပို့ဆောင်နံပါတ်",
|
||||||
@@ -302,6 +302,8 @@
|
|||||||
"box.mix_type":"Mix Box Types",
|
"box.mix_type":"Mix Box Types",
|
||||||
"box.selection":"သေတ္တာ ရွေးချယ်ခြင်း",
|
"box.selection":"သေတ္တာ ရွေးချယ်ခြင်း",
|
||||||
"box.weight":"အလေးချိန်",
|
"box.weight":"အလေးချိန်",
|
||||||
|
"box.mix_carton.update.btn":"Update mix carton",
|
||||||
|
"box.cargo.select.btn":"ရွေးချယ်မည်",
|
||||||
"Boxes End ================================================================":"",
|
"Boxes End ================================================================":"",
|
||||||
|
|
||||||
"Delivery Start ================================================================":"",
|
"Delivery Start ================================================================":"",
|
||||||
|
|||||||
@@ -15,11 +15,7 @@ class Carton {
|
|||||||
String senderID;
|
String senderID;
|
||||||
String senderFCSID;
|
String senderFCSID;
|
||||||
String senderName;
|
String senderName;
|
||||||
String receiverID;
|
|
||||||
String receiverFCSID;
|
|
||||||
String receiverName;
|
|
||||||
String receiverAddress;
|
|
||||||
String receiverNumber;
|
|
||||||
String boxNumber;
|
String boxNumber;
|
||||||
String status;
|
String status;
|
||||||
String cargoDesc;
|
String cargoDesc;
|
||||||
@@ -65,8 +61,8 @@ class Carton {
|
|||||||
|
|
||||||
int get amount => rate != null && weight != null ? rate * weight : 0;
|
int get amount => rate != null && weight != null ? rate * weight : 0;
|
||||||
|
|
||||||
String get packageNumber =>
|
// String get packageNumber =>
|
||||||
shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
|
// shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
|
||||||
double get price => rate.toDouble() * weight;
|
double get price => rate.toDouble() * weight;
|
||||||
|
|
||||||
double get actualWeight =>
|
double get actualWeight =>
|
||||||
@@ -136,11 +132,6 @@ class Carton {
|
|||||||
this.senderID,
|
this.senderID,
|
||||||
this.senderFCSID,
|
this.senderFCSID,
|
||||||
this.senderName,
|
this.senderName,
|
||||||
this.receiverID,
|
|
||||||
this.receiverFCSID,
|
|
||||||
this.receiverName,
|
|
||||||
this.receiverNumber,
|
|
||||||
this.receiverAddress,
|
|
||||||
this.boxNumber,
|
this.boxNumber,
|
||||||
this.desc,
|
this.desc,
|
||||||
this.width,
|
this.width,
|
||||||
@@ -196,9 +187,6 @@ class Carton {
|
|||||||
'mix_carton_id': mixCartonID,
|
'mix_carton_id': mixCartonID,
|
||||||
'mix_box_type': mixBoxType,
|
'mix_box_type': mixBoxType,
|
||||||
'mix_cartons': _mixCartons,
|
'mix_cartons': _mixCartons,
|
||||||
'receiver_id': receiverID,
|
|
||||||
'receiver_fcs_id': receiverFCSID,
|
|
||||||
'receiver_name': receiverName,
|
|
||||||
'sender_id': senderID,
|
'sender_id': senderID,
|
||||||
'sender_fcs_id': senderFCSID,
|
'sender_fcs_id': senderFCSID,
|
||||||
'sender_name': senderName
|
'sender_name': senderName
|
||||||
@@ -223,7 +211,7 @@ class Carton {
|
|||||||
arrivedDate: _arrivedDate != null ? _arrivedDate.toDate() : null,
|
arrivedDate: _arrivedDate != null ? _arrivedDate.toDate() : null,
|
||||||
shipmentID: map['shipment_id'],
|
shipmentID: map['shipment_id'],
|
||||||
shipmentNumber: map['shipment_number'],
|
shipmentNumber: map['shipment_number'],
|
||||||
receiverNumber: map['receiver_number'],
|
// receiverNumber: map['receiver_number'],
|
||||||
boxNumber: map['box_number'],
|
boxNumber: map['box_number'],
|
||||||
length: double.tryParse(map['length']?.toString()),
|
length: double.tryParse(map['length']?.toString()),
|
||||||
width: double.tryParse(map['width']?.toString()),
|
width: double.tryParse(map['width']?.toString()),
|
||||||
@@ -244,9 +232,6 @@ class Carton {
|
|||||||
cargoTypes: cargoTypes,
|
cargoTypes: cargoTypes,
|
||||||
mixBoxType: map['mix_box_type'],
|
mixBoxType: map['mix_box_type'],
|
||||||
mixCartons: _mixCartons,
|
mixCartons: _mixCartons,
|
||||||
receiverID: map['receiver_id'],
|
|
||||||
receiverFCSID: map['receiver_fcs_id'],
|
|
||||||
receiverName: map['receiver_name'],
|
|
||||||
senderID: map['sender_id'],
|
senderID: map['sender_id'],
|
||||||
senderFCSID: map['sender_fcs_id'],
|
senderFCSID: map['sender_fcs_id'],
|
||||||
senderName: map['sender_name'],
|
senderName: map['sender_name'],
|
||||||
@@ -273,9 +258,6 @@ class Carton {
|
|||||||
'mix_carton_id': mixCartonID,
|
'mix_carton_id': mixCartonID,
|
||||||
'mix_box_type': mixBoxType,
|
'mix_box_type': mixBoxType,
|
||||||
'mix_cartons': _mixCartons,
|
'mix_cartons': _mixCartons,
|
||||||
'receiver_id': receiverID,
|
|
||||||
'receiver_fcs_id': receiverFCSID,
|
|
||||||
'receiver_name': receiverName,
|
|
||||||
'sender_id': senderID,
|
'sender_id': senderID,
|
||||||
'sender_fcs_id': senderFCSID,
|
'sender_fcs_id': senderFCSID,
|
||||||
'sender_name': senderName
|
'sender_name': senderName
|
||||||
|
|||||||
@@ -20,10 +20,6 @@ class Package {
|
|||||||
String shipmentNumber;
|
String shipmentNumber;
|
||||||
String senderFCSID;
|
String senderFCSID;
|
||||||
String senderName;
|
String senderName;
|
||||||
String receiverFCSID;
|
|
||||||
String receiverName;
|
|
||||||
String receiverAddress;
|
|
||||||
String receiverNumber;
|
|
||||||
String boxNumber;
|
String boxNumber;
|
||||||
String cargoDesc;
|
String cargoDesc;
|
||||||
String market;
|
String market;
|
||||||
@@ -43,8 +39,6 @@ class Package {
|
|||||||
|
|
||||||
int get amount => rate != null && weight != null ? rate * weight : 0;
|
int get amount => rate != null && weight != null ? rate * weight : 0;
|
||||||
|
|
||||||
String get packageNumber =>
|
|
||||||
shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
|
|
||||||
double get price => rate.toDouble() * weight;
|
double get price => rate.toDouble() * weight;
|
||||||
|
|
||||||
Package({
|
Package({
|
||||||
@@ -57,10 +51,6 @@ class Package {
|
|||||||
this.shipmentNumber,
|
this.shipmentNumber,
|
||||||
this.senderFCSID,
|
this.senderFCSID,
|
||||||
this.senderName,
|
this.senderName,
|
||||||
this.receiverFCSID,
|
|
||||||
this.receiverName,
|
|
||||||
this.receiverNumber,
|
|
||||||
this.receiverAddress,
|
|
||||||
this.boxNumber,
|
this.boxNumber,
|
||||||
this.rate,
|
this.rate,
|
||||||
this.weight,
|
this.weight,
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ class _CargoTypeAdditionState extends State<CargoTypeAddition> {
|
|||||||
|
|
||||||
final saveBtn = fcsButton(
|
final saveBtn = fcsButton(
|
||||||
context,
|
context,
|
||||||
getLocalString(context, 'box.cargo.save.btn'),
|
getLocalString(context, 'box.cargo.select.btn'),
|
||||||
callack: () {
|
callack: () {
|
||||||
List<CargoType> _cargos =
|
List<CargoType> _cargos =
|
||||||
this.cargos.where((c) => c.isChecked).toList();
|
this.cargos.where((c) => c.isChecked).toList();
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
//for carton from cargos
|
//for carton from cargos
|
||||||
User consignee;
|
User consignee;
|
||||||
User sender;
|
User sender;
|
||||||
List<Carton> _cartonsForCargos = [];
|
List<Carton> _cartonsFromCartons = [];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -95,17 +95,17 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
_heightController.text = _carton.height.toString();
|
_heightController.text = _carton.height.toString();
|
||||||
_lengthController.text = _carton.length.toString();
|
_lengthController.text = _carton.length.toString();
|
||||||
_selectedCartonType = _carton.cartonType;
|
_selectedCartonType = _carton.cartonType;
|
||||||
_cargoTypes = List.from(_carton.cargoTypes);
|
|
||||||
|
_cargoTypes = _carton.cargoTypes.map((e) => e.clone()).toList();
|
||||||
|
|
||||||
_isNew = false;
|
_isNew = false;
|
||||||
_user = User(
|
_user = User(
|
||||||
id: _carton.userID, fcsID: _carton.fcsID, name: _carton.userName);
|
id: _carton.userID, fcsID: _carton.fcsID, name: _carton.userName);
|
||||||
consignee = User(
|
consignee = User(
|
||||||
id: _carton.receiverID,
|
id: _carton.userID, fcsID: _carton.fcsID, name: _carton.userName);
|
||||||
fcsID: _carton.receiverFCSID,
|
|
||||||
name: _carton.receiverName);
|
|
||||||
sender = User(
|
sender = User(
|
||||||
id: _carton.senderID,
|
id: _carton.senderID,
|
||||||
fcsID: _carton.senderID,
|
fcsID: _carton.senderFCSID,
|
||||||
name: _carton.senderName);
|
name: _carton.senderName);
|
||||||
_selectedMixBoxType = _carton.mixBoxType ?? "";
|
_selectedMixBoxType = _carton.mixBoxType ?? "";
|
||||||
this._mixCartons =
|
this._mixCartons =
|
||||||
@@ -251,7 +251,7 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
));
|
));
|
||||||
|
|
||||||
final fcsIDBox = Container(
|
final fcsIDBox = Container(
|
||||||
padding: EdgeInsets.only(top: 10),
|
padding: EdgeInsets.only(top: 15),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -389,6 +389,7 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
boxModel.selectedIndexFilter = 1;
|
||||||
searchCarton(context, callbackCartonSelect: (c) {
|
searchCarton(context, callbackCartonSelect: (c) {
|
||||||
_addMixCarton(c);
|
_addMixCarton(c);
|
||||||
});
|
});
|
||||||
@@ -451,7 +452,7 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
final createMixCarton = LocalButton(
|
final createMixCarton = LocalButton(
|
||||||
textKey: _isNew ? "box.mix_carton_btn" : "btn.save",
|
textKey: _isNew ? "box.mix_carton_btn" : "box.mix_carton.update.btn",
|
||||||
callBack: _creatMixCarton,
|
callBack: _creatMixCarton,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -529,17 +530,9 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
icon:
|
||||||
onPressed: () {
|
new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
||||||
if (isDataChanged()) {
|
onPressed: () => Navigator.of(context).pop()),
|
||||||
showConfirmDialog(context, "back.button_confirm", () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
title: LocalText(
|
title: LocalText(
|
||||||
@@ -610,7 +603,7 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
context,
|
context,
|
||||||
isFromPackages
|
isFromPackages
|
||||||
? this._cartons
|
? this._cartons
|
||||||
: this._cartonsForCargos))
|
: this._cartonsFromCartons))
|
||||||
: Container(),
|
: Container(),
|
||||||
_isNew ? Container() : cargoTableTitleBox,
|
_isNew ? Container() : cargoTableTitleBox,
|
||||||
_isNew ? Container() : cargoTableBox,
|
_isNew ? Container() : cargoTableBox,
|
||||||
@@ -635,14 +628,9 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
builder: (context) =>
|
builder: (context) =>
|
||||||
DeliveryAddressSelection(
|
DeliveryAddressSelection(
|
||||||
deliveryAddress: _deliveryAddress,
|
deliveryAddress: _deliveryAddress,
|
||||||
user: isFromPackages
|
user: User(
|
||||||
? User(
|
id: _carton.userID,
|
||||||
id: _carton.userID,
|
name: _carton.userName))),
|
||||||
name: _carton.userName)
|
|
||||||
: User(
|
|
||||||
id: _carton.receiverID,
|
|
||||||
name: _carton
|
|
||||||
.receiverName))),
|
|
||||||
);
|
);
|
||||||
if (d == null) return;
|
if (d == null) return;
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -845,9 +833,9 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isFromCartons) {
|
if (isFromCartons) {
|
||||||
carton.receiverID = consignee?.id;
|
carton.userID = consignee?.id;
|
||||||
carton.receiverFCSID = consignee?.fcsID;
|
carton.fcsID = consignee?.fcsID;
|
||||||
carton.receiverName = consignee?.name;
|
carton.userName = consignee?.name;
|
||||||
carton.senderID = sender?.id;
|
carton.senderID = sender?.id;
|
||||||
carton.senderFCSID = sender?.fcsID;
|
carton.senderFCSID = sender?.fcsID;
|
||||||
carton.senderName = sender?.name;
|
carton.senderName = sender?.name;
|
||||||
@@ -877,7 +865,7 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isFromCartons) {
|
if (isFromCartons) {
|
||||||
_cartonsForCargos.add(_carton);
|
_cartonsFromCartons.add(_carton);
|
||||||
}
|
}
|
||||||
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
@@ -938,19 +926,19 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
|
|
||||||
_save() async {
|
_save() async {
|
||||||
bool isFromPackages = _selectedCartonType == carton_from_packages;
|
bool isFromPackages = _selectedCartonType == carton_from_packages;
|
||||||
bool isFromCargos = _selectedCartonType == carton_from_cartons;
|
bool isFromCartons = _selectedCartonType == carton_from_cartons;
|
||||||
if ((_cargoTypes?.length ?? 0) == 0 && (isFromPackages || isFromCargos)) {
|
if ((_cargoTypes?.length ?? 0) == 0 && (isFromPackages || isFromCartons)) {
|
||||||
showMsgDialog(context, "Error", "Expect at least one cargo type");
|
showMsgDialog(context, "Error", "Expect at least one cargo type");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
double l = double.parse(_lengthController.text, (s) => 0);
|
double l = double.parse(_lengthController.text, (s) => 0);
|
||||||
double w = double.parse(_widthController.text, (s) => 0);
|
double w = double.parse(_widthController.text, (s) => 0);
|
||||||
double h = double.parse(_heightController.text, (s) => 0);
|
double h = double.parse(_heightController.text, (s) => 0);
|
||||||
if ((l <= 0 || w <= 0 || h <= 0) && (isFromPackages || isFromCargos)) {
|
if ((l <= 0 || w <= 0 || h <= 0) && (isFromPackages || isFromCartons)) {
|
||||||
showMsgDialog(context, "Error", "Invalid dimension");
|
showMsgDialog(context, "Error", "Invalid dimension");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (_deliveryAddress == null && (isFromPackages || isFromCargos)) {
|
if (_deliveryAddress == null && (isFromPackages || isFromCartons)) {
|
||||||
showMsgDialog(context, "Error", "Invalid delivery address");
|
showMsgDialog(context, "Error", "Invalid delivery address");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -963,8 +951,8 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
carton.userID = _user?.id;
|
carton.userID = _user?.id;
|
||||||
carton.packages = _carton.packages.where((e) => e.isChecked).toList();
|
carton.packages = _carton.packages.where((e) => e.isChecked).toList();
|
||||||
}
|
}
|
||||||
if (isFromCargos) {
|
if (isFromCartons) {
|
||||||
carton.receiverID = consignee?.id;
|
carton.userID = consignee?.id;
|
||||||
carton.senderID = sender?.id;
|
carton.senderID = sender?.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -990,13 +978,4 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isDataChanged() {
|
|
||||||
if (_isNew) {
|
|
||||||
return false;
|
|
||||||
// return _fcsShipment != null || _user != null;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,8 +63,6 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_box = widget.box;
|
_box = widget.box;
|
||||||
// _box.cartonType = carton_from_cargos;
|
|
||||||
// _box.cartonType = carton_mix_box;
|
|
||||||
//for shipment weight
|
//for shipment weight
|
||||||
volumetricRatio = Provider.of<ShipmentRateModel>(context, listen: false)
|
volumetricRatio = Provider.of<ShipmentRateModel>(context, listen: false)
|
||||||
.rate
|
.rate
|
||||||
@@ -188,13 +186,13 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
final consigneefcsIDBox = DisplayText(
|
final consigneefcsIDBox = DisplayText(
|
||||||
text: _box.receiverFCSID != null ? _box.receiverFCSID : "",
|
text: _box.fcsID != null ? _box.fcsID : "",
|
||||||
labelTextKey: "processing.fcs.id",
|
labelTextKey: "processing.fcs.id",
|
||||||
icon: FcsIDIcon(),
|
icon: FcsIDIcon(),
|
||||||
);
|
);
|
||||||
|
|
||||||
final consigneeNameBox = DisplayText(
|
final consigneeNameBox = DisplayText(
|
||||||
text: _box.receiverName != null ? _box.receiverName : "",
|
text: _box.userName != null ? _box.userName : "",
|
||||||
labelTextKey: "processing.consignee.name",
|
labelTextKey: "processing.consignee.name",
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
iconData: Icons.person,
|
iconData: Icons.person,
|
||||||
|
|||||||
@@ -34,32 +34,32 @@ class CartonModel extends BaseModel {
|
|||||||
status: "Delivered", date: DateTime(2020, 6, 15), done: false)
|
status: "Delivered", date: DateTime(2020, 6, 15), done: false)
|
||||||
];
|
];
|
||||||
|
|
||||||
List<Carton> get completed {
|
// List<Carton> get completed {
|
||||||
return boxes.where((e) => e.status == "Delivered").toList()
|
// return boxes.where((e) => e.status == "Delivered").toList()
|
||||||
..sort((e1, e2) {
|
// ..sort((e1, e2) {
|
||||||
return e2.packageNumber.compareTo(e1.packageNumber);
|
// return e2.packageNumber.compareTo(e1.packageNumber);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
List<Carton> get processed {
|
// List<Carton> get processed {
|
||||||
return boxes.where((e) => e.status == "Packed").toList()
|
// return boxes.where((e) => e.status == "Packed").toList()
|
||||||
..sort((e1, e2) {
|
// ..sort((e1, e2) {
|
||||||
return e2.packageNumber.compareTo(e1.packageNumber);
|
// return e2.packageNumber.compareTo(e1.packageNumber);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
List<Carton> get upcoming {
|
// List<Carton> get upcoming {
|
||||||
return boxes
|
// return boxes
|
||||||
.where((e) =>
|
// .where((e) =>
|
||||||
e.status == "Packed" ||
|
// e.status == "Packed" ||
|
||||||
// e.status == "Received" ||
|
// // e.status == "Received" ||
|
||||||
e.status == "Shipped" ||
|
// e.status == "Shipped" ||
|
||||||
e.status == "Arrived")
|
// e.status == "Arrived")
|
||||||
.toList()
|
// .toList()
|
||||||
..sort((e1, e2) {
|
// ..sort((e1, e2) {
|
||||||
return e2.packageNumber.compareTo(e1.packageNumber);
|
// return e2.packageNumber.compareTo(e1.packageNumber);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
List<String> cartonTypes = [
|
List<String> cartonTypes = [
|
||||||
carton_from_packages,
|
carton_from_packages,
|
||||||
@@ -153,10 +153,10 @@ class CartonModel extends BaseModel {
|
|||||||
try {
|
try {
|
||||||
Query listenerQuery = Firestore.instance
|
Query listenerQuery = Firestore.instance
|
||||||
.collection("$path")
|
.collection("$path")
|
||||||
.where("carton_type",
|
.where("carton_type", whereIn: [
|
||||||
whereIn: [carton_from_packages, carton_from_cartons])
|
carton_from_packages,
|
||||||
.where("status", isEqualTo: carton_packed_status)
|
carton_from_cartons
|
||||||
.orderBy(orderName, descending: true);
|
]).where("status", isEqualTo: carton_packed_status);
|
||||||
|
|
||||||
Query pageQuery = Firestore.instance
|
Query pageQuery = Firestore.instance
|
||||||
.collection("$path")
|
.collection("$path")
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class _PackageCartonEditorState extends State<PackageCartonEditor> {
|
|||||||
_widthCtl.text = "0";
|
_widthCtl.text = "0";
|
||||||
_heightCtl.text = "0";
|
_heightCtl.text = "0";
|
||||||
} else {
|
} else {
|
||||||
_cargoTypes = List.from(widget.carton.cargoTypes);
|
_cargoTypes = widget.carton.cargoTypes.map((e) => e.clone()).toList();
|
||||||
_lengthCtl.text = _carton.length.toString();
|
_lengthCtl.text = _carton.length.toString();
|
||||||
_widthCtl.text = _carton.width.toString();
|
_widthCtl.text = _carton.width.toString();
|
||||||
_heightCtl.text = _carton.height.toString();
|
_heightCtl.text = _carton.height.toString();
|
||||||
@@ -158,12 +158,11 @@ class _PackageCartonEditorState extends State<PackageCartonEditor> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(
|
icon: new Icon(
|
||||||
CupertinoIcons.back,
|
CupertinoIcons.back,
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
),
|
),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop()),
|
||||||
),
|
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
title: LocalText(
|
title: LocalText(
|
||||||
@@ -192,13 +191,8 @@ class _PackageCartonEditorState extends State<PackageCartonEditor> {
|
|||||||
CupertinoPageRoute(
|
CupertinoPageRoute(
|
||||||
builder: (context) => DeliveryAddressSelection(
|
builder: (context) => DeliveryAddressSelection(
|
||||||
deliveryAddress: _deliveryAddress,
|
deliveryAddress: _deliveryAddress,
|
||||||
user: isFromPackages
|
user: User(
|
||||||
? User(
|
id: _carton.userID, name: _carton.userName),
|
||||||
id: _carton.userID,
|
|
||||||
name: _carton.userName)
|
|
||||||
: User(
|
|
||||||
id: _carton.receiverID,
|
|
||||||
name: _carton.receiverName),
|
|
||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
if (d == null) return;
|
if (d == null) return;
|
||||||
@@ -334,9 +328,9 @@ class _PackageCartonEditorState extends State<PackageCartonEditor> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isFromCartons) {
|
if (isFromCartons) {
|
||||||
carton.receiverID = _carton.receiverID;
|
carton.userID = _carton.userID;
|
||||||
carton.receiverFCSID = _carton.receiverFCSID;
|
carton.fcsID = _carton.fcsID;
|
||||||
carton.receiverName = _carton.receiverName;
|
carton.userName = _carton.userName;
|
||||||
carton.senderID = _carton.senderID;
|
carton.senderID = _carton.senderID;
|
||||||
carton.senderFCSID = _carton.senderFCSID;
|
carton.senderFCSID = _carton.senderFCSID;
|
||||||
carton.senderName = _carton.senderName;
|
carton.senderName = _carton.senderName;
|
||||||
|
|||||||
@@ -59,12 +59,13 @@ class _BoxAdditionState extends State<BoxAddition> {
|
|||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
labelText: 'Box Number',
|
labelText: 'Box Number',
|
||||||
icon: Icon(Icons.pages)),
|
icon: Icon(Icons.pages)),
|
||||||
items: boxModel.processed
|
items: [],
|
||||||
.map((e) => DropdownMenuItem(
|
// boxModel.processed
|
||||||
child: Text(
|
// .map((e) => DropdownMenuItem(
|
||||||
'${e.shipmentNumber}-${e.receiverNumber} #${e.boxNumber}'),
|
// child: Text(
|
||||||
value: e))
|
// '${e.shipmentNumber}-${e.receiverNumber} #${e.boxNumber}'),
|
||||||
.toList(),
|
// value: e))
|
||||||
|
// .toList(),
|
||||||
onChanged: (map) => {},
|
onChanged: (map) => {},
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
|
|||||||
@@ -24,8 +24,12 @@ dependencies:
|
|||||||
image_picker: ^0.6.0+9
|
image_picker: ^0.6.0+9
|
||||||
shared_preferences: ^0.5.7+3
|
shared_preferences: ^0.5.7+3
|
||||||
progress:
|
progress:
|
||||||
path:
|
git:
|
||||||
../flutter/packages/progress
|
url: https://git.mokkon.com/tzw/mokkon-flutter.git
|
||||||
|
ref: v1.0.0
|
||||||
|
path: packages/progress
|
||||||
|
# path:
|
||||||
|
# ../flutter/packages/progress
|
||||||
flutter_datetime_picker: ^1.3.8
|
flutter_datetime_picker: ^1.3.8
|
||||||
dio: ^3.0.9
|
dio: ^3.0.9
|
||||||
package_info: ^0.4.0+6
|
package_info: ^0.4.0+6
|
||||||
|
|||||||
Reference in New Issue
Block a user