diff --git a/lib/inventree/stock.dart b/lib/inventree/stock.dart index 85755fc9..4dd212f0 100644 --- a/lib/inventree/stock.dart +++ b/lib/inventree/stock.dart @@ -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 = ''; diff --git a/lib/l10n b/lib/l10n index cf76a2a7..8114d3a6 160000 --- a/lib/l10n +++ b/lib/l10n @@ -1 +1 @@ -Subproject commit cf76a2a70e96e49991a63bbde6d45911caaaf05f +Subproject commit 8114d3a69dd90421e546d9cf08e10512eb5ca066