merge
This commit is contained in:
@@ -69,6 +69,7 @@ const privilege_delivery = "deli";
|
|||||||
const privilege_invoice = "inv";
|
const privilege_invoice = "inv";
|
||||||
const privilege_processing = "pr";
|
const privilege_processing = "pr";
|
||||||
const privilege_receiving = "rc";
|
const privilege_receiving = "rc";
|
||||||
|
const privilege_pickup = "pku";
|
||||||
|
|
||||||
// Pickup types
|
// Pickup types
|
||||||
const shipment_local_pickup = "Local pickup";
|
const shipment_local_pickup = "Local pickup";
|
||||||
|
|||||||
@@ -109,7 +109,6 @@ class Carton {
|
|||||||
double wd = sw - aw;
|
double wd = sw - aw;
|
||||||
wd = wd - rate.diffDiscountWeight;
|
wd = wd - rate.diffDiscountWeight;
|
||||||
double wdAmount = wd > 0 ? wd * rate.diffWeightRate : 0;
|
double wdAmount = wd > 0 ? wd * rate.diffWeightRate : 0;
|
||||||
|
|
||||||
DiscountByWeight discountByWeight = rate.getDiscountByWeight(aw);
|
DiscountByWeight discountByWeight = rate.getDiscountByWeight(aw);
|
||||||
|
|
||||||
double total = 0;
|
double total = 0;
|
||||||
|
|||||||
@@ -16,10 +16,12 @@ class Rate {
|
|||||||
|
|
||||||
DiscountByWeight getDiscountByWeight(double weight) {
|
DiscountByWeight getDiscountByWeight(double weight) {
|
||||||
discountByWeights.sort((d1, d2) => d2.weight.compareTo(d1.weight));
|
discountByWeights.sort((d1, d2) => d2.weight.compareTo(d1.weight));
|
||||||
return discountByWeights.firstWhere((e) => e.weight < weight);
|
return discountByWeights.firstWhere((e) => e.weight < weight,
|
||||||
|
orElse: () => DiscountByWeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
CargoType get defaultCargoType => cargoTypes.firstWhere((e) => e.name == "General");
|
CargoType get defaultCargoType =>
|
||||||
|
cargoTypes.firstWhere((e) => e.name == "General");
|
||||||
|
|
||||||
Rate(
|
Rate(
|
||||||
{this.deliveryFee = 0,
|
{this.deliveryFee = 0,
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ class Privilege {
|
|||||||
iconData = FontAwesome.dropbox;
|
iconData = FontAwesome.dropbox;
|
||||||
} else if (this.id == privilege_receiving) {
|
} else if (this.id == privilege_receiving) {
|
||||||
iconData = MaterialCommunityIcons.inbox_arrow_down;
|
iconData = MaterialCommunityIcons.inbox_arrow_down;
|
||||||
|
} else if (this.id == privilege_pickup) {
|
||||||
|
iconData = FontAwesome.dropbox;
|
||||||
} else {
|
} else {
|
||||||
iconData = MaterialCommunityIcons.account_question;
|
iconData = MaterialCommunityIcons.account_question;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ Future<void> showConfirmDialog(
|
|||||||
child: LocalText(
|
child: LocalText(
|
||||||
context,
|
context,
|
||||||
translationKey,
|
translationKey,
|
||||||
translationVariables: translationVariables!,
|
translationVariables: translationVariables,
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ class _ProcessingInfoState extends State<ProcessingInfo> {
|
|||||||
initPackage(widget.package!);
|
initPackage(widget.package!);
|
||||||
}
|
}
|
||||||
|
|
||||||
initPackage(Package package) {
|
initPackage(Package? package) {
|
||||||
|
if (package == null) return;
|
||||||
setState(() {
|
setState(() {
|
||||||
_package = package;
|
_package = package;
|
||||||
multiImgController.setImageUrls = package.photoUrls;
|
multiImgController.setImageUrls = package.photoUrls;
|
||||||
@@ -223,7 +224,7 @@ class _ProcessingInfoState extends State<ProcessingInfo> {
|
|||||||
PackageModel packageModel =
|
PackageModel packageModel =
|
||||||
Provider.of<PackageModel>(context, listen: false);
|
Provider.of<PackageModel>(context, listen: false);
|
||||||
Package? p = await packageModel.getPackage(_package!.id!);
|
Package? p = await packageModel.getPackage(_package!.id!);
|
||||||
initPackage(p!);
|
initPackage(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ class _ReceivingInfoState extends State<ReceivingInfo> {
|
|||||||
initPackage(widget.package!);
|
initPackage(widget.package!);
|
||||||
}
|
}
|
||||||
|
|
||||||
initPackage(Package package) {
|
initPackage(Package? package) {
|
||||||
|
if (package == null) return;
|
||||||
multiImgController.setImageUrls = package.photoUrls;
|
multiImgController.setImageUrls = package.photoUrls;
|
||||||
setState(() {
|
setState(() {
|
||||||
_package = package;
|
_package = package;
|
||||||
@@ -150,7 +151,7 @@ class _ReceivingInfoState extends State<ReceivingInfo> {
|
|||||||
PackageModel packageModel =
|
PackageModel packageModel =
|
||||||
Provider.of<PackageModel>(context, listen: false);
|
Provider.of<PackageModel>(context, listen: false);
|
||||||
var pkg = await packageModel.getPackage(widget.package!.id!);
|
var pkg = await packageModel.getPackage(widget.package!.id!);
|
||||||
initPackage(pkg!);
|
initPackage(pkg);
|
||||||
}
|
}
|
||||||
|
|
||||||
_delete() {
|
_delete() {
|
||||||
|
|||||||
23
pubspec.lock
23
pubspec.lock
@@ -7,14 +7,14 @@ packages:
|
|||||||
name: _fe_analyzer_shared
|
name: _fe_analyzer_shared
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "22.0.0"
|
version: "25.0.0"
|
||||||
analyzer:
|
analyzer:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: analyzer
|
name: analyzer
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.1"
|
version: "2.2.0"
|
||||||
args:
|
args:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -28,7 +28,7 @@ packages:
|
|||||||
name: async
|
name: async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.6.1"
|
version: "2.8.1"
|
||||||
barcode_scan2:
|
barcode_scan2:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -91,7 +91,7 @@ packages:
|
|||||||
name: charcode
|
name: charcode
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.3.1"
|
||||||
cli_util:
|
cli_util:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -434,6 +434,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "9.1.0"
|
version: "9.1.0"
|
||||||
|
frontend_server_client:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: frontend_server_client
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.2"
|
||||||
glob:
|
glob:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -531,7 +538,7 @@ packages:
|
|||||||
name: meta
|
name: meta
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.7.0"
|
||||||
mime:
|
mime:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -893,21 +900,21 @@ packages:
|
|||||||
name: test
|
name: test
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.16.8"
|
version: "1.17.10"
|
||||||
test_api:
|
test_api:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.0"
|
version: "0.4.2"
|
||||||
test_core:
|
test_core:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_core
|
name: test_core
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.19"
|
version: "0.4.0"
|
||||||
timeline_list:
|
timeline_list:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|||||||
Reference in New Issue
Block a user