2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 13:36:50 +00:00

Extract stocktake and last updated date

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

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 = '';

@ -1 +1 @@
Subproject commit cf76a2a70e96e49991a63bbde6d45911caaaf05f
Subproject commit 8114d3a69dd90421e546d9cf08e10512eb5ca066