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

Display number of items on order

This commit is contained in:
Oliver 2021-08-02 20:07:29 +10:00
parent 71ef6b3c5a
commit 48d5c2e560
2 changed files with 10 additions and 1 deletions

View File

@ -215,6 +215,15 @@ class InvenTreePart extends InvenTreeModel {
// Get the number of stock on order for this Part // Get the number of stock on order for this Part
double get onOrder => double.tryParse(jsondata['ordering'].toString()) ?? 0; double get onOrder => double.tryParse(jsondata['ordering'].toString()) ?? 0;
String get onOrderString {
if (onOrder == onOrder.toInt()) {
return onOrder.toInt().toString();
} else {
return onOrder.toString();
}
}
// Get the stock count for this Part // Get the stock count for this Part
double get inStock => double.tryParse(jsondata['in_stock'].toString()) ?? 0; double get inStock => double.tryParse(jsondata['in_stock'].toString()) ?? 0;

View File

@ -346,7 +346,7 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
title: Text(L10().onOrder), title: Text(L10().onOrder),
subtitle: Text(L10().onOrderDetails), subtitle: Text(L10().onOrderDetails),
leading: FaIcon(FontAwesomeIcons.shoppingCart), leading: FaIcon(FontAwesomeIcons.shoppingCart),
trailing: Text("${part.onOrder}"), trailing: Text("${part.onOrderString}"),
onTap: () { onTap: () {
// TODO - Order views // TODO - Order views
}, },