mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 13:36:50 +00:00
Display serial number for serialized stock
This commit is contained in:
parent
4445973548
commit
034ef89ac3
@ -280,6 +280,14 @@ class InvenTreeStockItem extends InvenTreeModel {
|
|||||||
|
|
||||||
bool isSerialized() => serialNumber != null && quantity.toInt() == 1;
|
bool isSerialized() => serialNumber != null && quantity.toInt() == 1;
|
||||||
|
|
||||||
|
String serialOrQuantityDisplay() {
|
||||||
|
if (isSerialized()) {
|
||||||
|
return 'SN ${serialNumber}';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '${quantity}';
|
||||||
|
}
|
||||||
|
|
||||||
String get locationName {
|
String get locationName {
|
||||||
String loc = '';
|
String loc = '';
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ class PartStockList extends StatelessWidget {
|
|||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text("${item.locationName}"),
|
title: Text("${item.locationName}"),
|
||||||
subtitle: Text("${item.locationPathString}"),
|
subtitle: Text("${item.locationPathString}"),
|
||||||
trailing: Text("${item.quantity}"),
|
trailing: Text(item.serialOrQuantityDisplay()),
|
||||||
leading: FaIcon(FontAwesomeIcons.mapMarkerAlt),
|
leading: FaIcon(FontAwesomeIcons.mapMarkerAlt),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
_openItem(context, item.pk);
|
_openItem(context, item.pk);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user