update package detal list and update cargo type input in carton section
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user