2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-13 10:45:29 +00:00

Adds support for currency display (#277)

* Adds a helper function for rendering currency data

* Update helper functions for StockItem model

* Render purchasePrice correctly for stockitem

* Use currency_formatter library instead of money_formatter

* Add total price display for purchase order

* icon fix
This commit is contained in:
Oliver
2023-03-08 23:42:26 +11:00
committed by GitHub
parent 221920cbbe
commit 347e80d8e2
9 changed files with 311 additions and 236 deletions

View File

@ -158,6 +158,14 @@ class _PurchaseOrderDetailState extends RefreshableState<PurchaseOrderDetailWidg
},
));
tiles.add(ListTile(
title: Text(L10().totalPrice),
leading: FaIcon(FontAwesomeIcons.dollarSign),
trailing: Text(
renderCurrency(widget.order.totalPrice, widget.order.totalPriceCurrency)
),
));
tiles.add(ListTile(
title: Text(L10().received),
leading: FaIcon(FontAwesomeIcons.clipboardCheck, color: COLOR_CLICK),
@ -407,7 +415,7 @@ class _PurchaseOrderDetailState extends RefreshableState<PurchaseOrderDetailWidg
onTap: onTabSelectionChanged,
items: [
BottomNavigationBarItem(
icon: FaIcon(FontAwesomeIcons.info),
icon: FaIcon(FontAwesomeIcons.circleInfo),
label: L10().details
),
BottomNavigationBarItem(

View File

@ -4,6 +4,7 @@ import "package:font_awesome_flutter/font_awesome_flutter.dart";
import "package:inventree/app_colors.dart";
import "package:inventree/barcode.dart";
import "package:inventree/helpers.dart";
import "package:inventree/l10.dart";
import "package:inventree/api.dart";
import "package:inventree/api_form.dart";
@ -675,7 +676,9 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
ListTile(
title: Text(L10().purchasePrice),
leading: FaIcon(FontAwesomeIcons.dollarSign),
trailing: Text(widget.item.purchasePrice),
trailing: Text(
renderCurrency(widget.item.purchasePrice, widget.item.purchasePriceCurrency)
)
)
);
}