2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-29 14:06:47 +00:00

Merge branch 'master' into api-forms

This commit is contained in:
Oliver 2021-07-22 17:00:13 +10:00
commit 885df45138
7 changed files with 80 additions and 15 deletions

View File

@ -1,6 +1,13 @@
## InvenTree App Release Notes ## InvenTree App Release Notes
--- ---
### 0.2.10 - July 2021
---
- Add "last updated" date to StockDetail view
- Add "stocktake" date to StockDetail view
- Display location of stock items in list view
### 0.2.9 - July 2021 ### 0.2.9 - July 2021
--- ---

View File

@ -6,8 +6,8 @@ export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib\main.dart" export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build" export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build\ios" export "SYMROOT=${SOURCE_ROOT}/../build\ios"
export "FLUTTER_BUILD_NAME=0.2.9" export "FLUTTER_BUILD_NAME=0.2.10"
export "FLUTTER_BUILD_NUMBER=17" export "FLUTTER_BUILD_NUMBER=18"
export "DART_OBFUSCATION=false" export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false" export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false" export "TREE_SHAKE_ICONS=false"

View File

@ -1,3 +1,4 @@
import 'package:intl/intl.dart';
import 'package:inventree/inventree/part.dart'; import 'package:inventree/inventree/part.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
@ -222,20 +223,46 @@ class InvenTreeStockItem extends InvenTreeModel {
int get trackingItemCount => (jsondata['tracking_items'] ?? 0) as int; int get trackingItemCount => (jsondata['tracking_items'] ?? 0) as int;
// Date of last update // Date of last update
String get updated => jsondata["updated"] ?? ""; DateTime? get updatedDate {
if (jsondata.containsKey("updated")) {
DateTime? get stocktakeDate { return DateTime.tryParse(jsondata["updated"] ?? '');
if (jsondata.containsKey("stocktake_date")) {
if (jsondata["stocktake_date"] == null) {
return null;
}
return DateTime.tryParse(jsondata["stocktake_date"]) ?? null;
} else { } else {
return null; return null;
} }
} }
String? get updatedDateString {
var _updated = updatedDate;
if (_updated == null) {
return null;
}
final DateFormat _format = DateFormat("yyyy-MM-dd");
return _format.format(_updated);
}
DateTime? get stocktakeDate {
if (jsondata.containsKey("stocktake_date")) {
return DateTime.tryParse(jsondata["stocktake_date"] ?? '');
} else {
return null;
}
}
String? get stocktakeDateString {
var _stocktake = stocktakeDate;
if (_stocktake == null) {
return null;
}
final DateFormat _format = DateFormat("yyyy-MM-dd");
return _format.format(_stocktake);
}
String get partName { String get partName {
String nm = ''; String nm = '';
@ -388,7 +415,13 @@ class InvenTreeStockItem extends InvenTreeModel {
if (locationId == -1 || !jsondata.containsKey('location_detail')) return L10().locationNotSet; if (locationId == -1 || !jsondata.containsKey('location_detail')) return L10().locationNotSet;
return jsondata['location_detail']['pathstring'] ?? ''; String _loc = jsondata['location_detail']['pathstring'] ?? '';
if (_loc.isNotEmpty) {
return _loc;
} else {
return locationName;
}
} }
String get displayQuantity { String get displayQuantity {

@ -1 +1 @@
Subproject commit 0870256fb97a27ccf0ab73b4665b886ca0abb4aa Subproject commit af4cd9026a96d44d60f9187119f5ce19c74738d3

View File

@ -517,7 +517,7 @@ class _PaginatedStockListState extends State<PaginatedStockList> {
Widget _buildItem(BuildContext context, InvenTreeStockItem item) { Widget _buildItem(BuildContext context, InvenTreeStockItem item) {
return ListTile( return ListTile(
title: Text("${item.partName}"), title: Text("${item.partName}"),
subtitle: Text("${item.partDescription}"), subtitle: Text("${item.locationPathString}"),
leading: InvenTreeAPI().getImage( leading: InvenTreeAPI().getImage(
item.partThumbnail, item.partThumbnail,
width: 40, width: 40,

View File

@ -418,7 +418,32 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
); );
} }
// Last update?
var update_date = item.updatedDateString;
if (update_date != null) {
tiles.add(
ListTile(
title: Text(L10().lastUpdated),
subtitle: Text(update_date),
leading: FaIcon(FontAwesomeIcons.calendarAlt)
)
);
}
// Stocktake? // Stocktake?
var stocktake_date = item.stocktakeDateString;
if (stocktake_date != null) {
tiles.add(
ListTile(
title: Text(L10().lastStocktake),
subtitle: Text(stocktake_date),
leading: FaIcon(FontAwesomeIcons.calendarAlt)
)
);
}
// Supplier part? // Supplier part?
// TODO: Display supplier part info page? // TODO: Display supplier part info page?

View File

@ -7,7 +7,7 @@ description: InvenTree stock management
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.2.9+17 version: 0.2.10+18
environment: environment:
sdk: ">=2.12.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"