Show inventory stock amount in product dropdown

This commit is contained in:
Hillel Coren 2024-01-03 17:27:44 +02:00
parent 0104bde234
commit 532e35affc
1 changed files with 13 additions and 0 deletions

View File

@ -821,6 +821,19 @@ class _InvoiceEditItemsDesktopState extends State<InvoiceEditItemsDesktop> {
EntityAutocompleteListTile(
onTap: (entity) => onSelected(
entity as ProductEntity),
overrideSuggestedLabel:
(entity) {
var label =
entity.listDisplayName;
if (state.company
.trackInventory) {
final product = entity
as ProductEntity;
label +=
' [${product.stockQuantity}]';
}
return label;
},
overrideSuggestedAmount:
(entity) {
final product =