update package detal list and update cargo type input in carton section

This commit is contained in:
tzw
2025-03-25 17:38:51 +06:30
parent 3d4bc43de4
commit 2bd75f0333
14 changed files with 597 additions and 812 deletions

View File

@@ -1,3 +1,5 @@
import 'package:fcs/pages/main/util.dart';
class CargoType {
String? id;
String? name;
@@ -96,7 +98,7 @@ class CargoType {
Map<String, dynamic> toMapForCarton() {
return {
"id": id,
'weight': weight,
'weight': double.tryParse(twoDecimalFormatted(weight)) ?? 0.00,
"mix_cargo_type_ids": mixCargoes.map((e) => e.id).toList()
};
}
@@ -109,6 +111,22 @@ class CargoType {
return CargoType.fromMap(toMap(), id!);
}
CargoType cloneForCarton() {
return CargoType(
id: id,
name: name,
weight: weight,
isDefault: isDefault,
displayIndex: displayIndex,
isMixCargo: isMixCargo,
mixCargoIds: List.from(mixCargoIds),
mixCargoes: List.from(mixCargoes));
}
CargoType cloneForSurchage() {
return CargoType(id: id, name: name, qty: qty);
}
@override
bool operator ==(Object other) => other is CargoType && other.id == id;