mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-15 03:35:28 +00:00
Merge branch 'master' into create-part
This commit is contained in:
@ -514,6 +514,9 @@ class _QRViewState extends State<InvenTreeQRView> {
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(_handler.getOverlayText(context)),
|
||||
),
|
||||
body: Stack(
|
||||
children: <Widget>[
|
||||
Column(
|
||||
|
@ -220,6 +220,10 @@ class InvenTreeStockItem extends InvenTreeModel {
|
||||
|
||||
int get status => jsondata['status'] ?? -1;
|
||||
|
||||
String get packaging => jsondata["packaging"] ?? "";
|
||||
|
||||
String get batch => jsondata["batch"] ?? "";
|
||||
|
||||
int get partId => jsondata['part'] ?? -1;
|
||||
|
||||
String get purchasePrice => jsondata['purchase_price'] ?? "";
|
||||
@ -242,11 +246,11 @@ class InvenTreeStockItem extends InvenTreeModel {
|
||||
}
|
||||
}
|
||||
|
||||
String? get updatedDateString {
|
||||
String get updatedDateString {
|
||||
var _updated = updatedDate;
|
||||
|
||||
if (_updated == null) {
|
||||
return null;
|
||||
return "";
|
||||
}
|
||||
|
||||
final DateFormat _format = DateFormat("yyyy-MM-dd");
|
||||
@ -262,11 +266,11 @@ class InvenTreeStockItem extends InvenTreeModel {
|
||||
}
|
||||
}
|
||||
|
||||
String? get stocktakeDateString {
|
||||
String get stocktakeDateString {
|
||||
var _stocktake = stocktakeDate;
|
||||
|
||||
if (_stocktake == null) {
|
||||
return null;
|
||||
return "";
|
||||
}
|
||||
|
||||
final DateFormat _format = DateFormat("yyyy-MM-dd");
|
||||
|
2
lib/l10n
2
lib/l10n
Submodule lib/l10n updated: c19a9d9af4...ad2e43ea5e
@ -35,8 +35,8 @@ class _InvenTreeAppSettingsState extends State<InvenTreeAppSettingsWidget> {
|
||||
barcodeSounds = await InvenTreeSettingsManager().getValue("barcodeSounds", true) as bool;
|
||||
serverSounds = await InvenTreeSettingsManager().getValue("serverSounds", true) as bool;
|
||||
|
||||
partSubcategory = await InvenTreeSettingsManager().getValue("partSubcategory", false) as bool;
|
||||
stockSublocation = await InvenTreeSettingsManager().getValue("stockSublocation", false) as bool;
|
||||
partSubcategory = await InvenTreeSettingsManager().getValue("partSubcategory", true) as bool;
|
||||
stockSublocation = await InvenTreeSettingsManager().getValue("stockSublocation", true) as bool;
|
||||
|
||||
setState(() {
|
||||
});
|
||||
@ -62,7 +62,7 @@ class _InvenTreeAppSettingsState extends State<InvenTreeAppSettingsWidget> {
|
||||
|
||||
void setPartSubcategory(bool en) async {
|
||||
await InvenTreeSettingsManager().setValue("partSubcategory", en);
|
||||
partSubcategory = await InvenTreeSettingsManager().getValue("partSubcategory", false);
|
||||
partSubcategory = await InvenTreeSettingsManager().getValue("partSubcategory", true);
|
||||
|
||||
setState(() {
|
||||
});
|
||||
@ -70,7 +70,7 @@ class _InvenTreeAppSettingsState extends State<InvenTreeAppSettingsWidget> {
|
||||
|
||||
void setStockSublocation(bool en) async {
|
||||
await InvenTreeSettingsManager().setValue("stockSublocation", en);
|
||||
stockSublocation = await InvenTreeSettingsManager().getValue("stockSublocation", false);
|
||||
stockSublocation = await InvenTreeSettingsManager().getValue("stockSublocation", true);
|
||||
|
||||
setState(() {
|
||||
});
|
||||
|
@ -399,7 +399,7 @@ class _PaginatedPartListState extends State<PaginatedPartList> {
|
||||
|
||||
params["search"] = _searchTerm;
|
||||
|
||||
final bool cascade = await InvenTreeSettingsManager().getValue("partSubcategory", false);
|
||||
final bool cascade = await InvenTreeSettingsManager().getValue("partSubcategory", true);
|
||||
params["cascade"] = "${cascade}";
|
||||
|
||||
final page = await InvenTreePart().listPaginated(_pageSize, pageKey, filters: params);
|
||||
|
@ -3,7 +3,7 @@ import 'package:inventree/user_profile.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'file:///C:/inventree-app/lib/l10.dart';
|
||||
import 'package:inventree/l10.dart';
|
||||
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
|
@ -438,7 +438,7 @@ class _PaginatedStockListState extends State<PaginatedStockList> {
|
||||
params["search"] = "${_searchTerm}";
|
||||
|
||||
// Do we include stock items from sub-locations?
|
||||
final bool cascade = await InvenTreeSettingsManager().getValue("stockSublocation", false);
|
||||
final bool cascade = await InvenTreeSettingsManager().getValue("stockSublocation", true);
|
||||
params["cascade"] = "${cascade}";
|
||||
|
||||
final page = await InvenTreeStockItem().listPaginated(_pageSize, pageKey, filters: params);
|
||||
|
@ -97,7 +97,7 @@ abstract class RefreshableState<T extends StatefulWidget> extends State<T> {
|
||||
return Scaffold(
|
||||
key: refreshableKey,
|
||||
appBar: getAppBar(context),
|
||||
drawer: getDrawer(context),
|
||||
drawer: null, // getDrawer(context),
|
||||
floatingActionButton: getFab(context),
|
||||
body: Builder(
|
||||
builder: (BuildContext context) {
|
||||
|
@ -458,28 +458,44 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
// Last update?
|
||||
var update_date = item.updatedDateString;
|
||||
if (item.batch.isNotEmpty) {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text(L10().batchCode),
|
||||
subtitle: Text(item.batch),
|
||||
leading: FaIcon(FontAwesomeIcons.layerGroup),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (update_date != null) {
|
||||
if (item.packaging.isNotEmpty) {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text(L10().packaging),
|
||||
subtitle: Text(item.packaging),
|
||||
leading: FaIcon(FontAwesomeIcons.box),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Last update?
|
||||
if (item.updatedDateString.isNotEmpty) {
|
||||
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text(L10().lastUpdated),
|
||||
subtitle: Text(update_date),
|
||||
subtitle: Text(item.updatedDateString),
|
||||
leading: FaIcon(FontAwesomeIcons.calendarAlt)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Stocktake?
|
||||
var stocktake_date = item.stocktakeDateString;
|
||||
|
||||
if (stocktake_date != null) {
|
||||
if (item.stocktakeDateString.isNotEmpty) {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text(L10().lastStocktake),
|
||||
subtitle: Text(stocktake_date),
|
||||
subtitle: Text(item.stocktakeDateString),
|
||||
leading: FaIcon(FontAwesomeIcons.calendarAlt)
|
||||
)
|
||||
);
|
||||
|
Reference in New Issue
Block a user