Part pricing detail (#655)

* Implement part pricing data and new part pricing widget

* improve part pricing widget and part pricing data. Add part pricing setting.

* Refactor helper func

* Tweak translated string

* Refactor part pricing page

* Update release notes

* Fixes

* More cleanup

---------

Co-authored-by: JarEXE <eykenj@gmail.com>
This commit is contained in:
Oliver
2025-06-14 10:56:56 +10:00
committed by GitHub
co-authored by JarEXE
parent 13cb2f9164
commit 13abcae84c
10 changed files with 437 additions and 13 deletions
+6 -1
View File
@@ -142,7 +142,7 @@ class InvenTreeModel {
}
// Helper function to get double value from JSON data
double getDouble(String key, {double backup = 0.0, String subKey = ""}) {
double? getDoubleOrNull(String key, {double? backup, String subKey = ""}) {
dynamic value = getValue(key, backup: backup, subKey: subKey);
if (value == null) {
@@ -152,6 +152,11 @@ class InvenTreeModel {
return double.tryParse(value.toString()) ?? backup;
}
double getDouble(String key, {double backup = 0.0, String subkey = "" }) {
double? value = getDoubleOrNull(key, backup: backup, subKey: subkey);
return value ?? backup;
}
// Helper function to get boolean value from json data
bool getBool(String key, {bool backup = false, String subKey = ""}) {
dynamic value = getValue(key, backup: backup, subKey: subKey);