Extract stocktake and last updated date

This commit is contained in:
Oliver Walters committed 2021-02-13 22:38:01 +11:00
1 parent 90664bfe14
commit 57eae6f065
2 files changed
+16 -1

No files matched your search

+15
View File
@@ -223,6 +223,21 @@ class InvenTreeStockItem extends InvenTreeModel {
int get trackingItemCount => jsondata['tracking_items'] as int ?? 0;
// Date of last update
String get updated => jsondata["updated"] ?? "";
DateTime get stocktakeDate {
if (jsondata.containsKey("stocktake_date")) {
if (jsondata["stocktake_date"] == null) {
return null;
}
return DateTime.tryParse(jsondata["stocktake_date"]) ?? null;
} else {
return null;
}
}
String get partName {
String nm = '';
Submodule lib/l10n updated: cf76a2a70e...8114d3a69d.