2
0
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:
Oliver Walters 2021-01-21 00:09:11 +11:00
parent 4445973548
commit 034ef89ac3
2 changed files with 9 additions and 1 deletions

View File

@ -280,6 +280,14 @@ class InvenTreeStockItem extends InvenTreeModel {
bool isSerialized() => serialNumber != null && quantity.toInt() == 1;
String serialOrQuantityDisplay() {
if (isSerialized()) {
return 'SN ${serialNumber}';
}
return '${quantity}';
}
String get locationName {
String loc = '';

View File

@ -91,7 +91,7 @@ class PartStockList extends StatelessWidget {
return ListTile(
title: Text("${item.locationName}"),
subtitle: Text("${item.locationPathString}"),
trailing: Text("${item.quantity}"),
trailing: Text(item.serialOrQuantityDisplay()),
leading: FaIcon(FontAwesomeIcons.mapMarkerAlt),
onTap: () {
_openItem(context, item.pk);