mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +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:
parent
221920cbbe
commit
347e80d8e2
9 changed files with 311 additions and 236 deletions
|
|
@ -89,6 +89,18 @@ class InvenTreePurchaseOrder extends InvenTreeModel {
|
|||
|
||||
bool get isFailed => status == PO_STATUS_CANCELLED || status == PO_STATUS_LOST || status == PO_STATUS_RETURNED;
|
||||
|
||||
double? get totalPrice {
|
||||
String price = (jsondata["total_price"] ?? "") as String;
|
||||
|
||||
if (price.isEmpty) {
|
||||
return null;
|
||||
} else {
|
||||
return double.tryParse(price);
|
||||
}
|
||||
}
|
||||
|
||||
String get totalPriceCurrency => (jsondata["total_price_currency"] ?? "") as String;
|
||||
|
||||
Future<List<InvenTreePOLineItem>> getLineItems() async {
|
||||
|
||||
final results = await InvenTreePOLineItem().list(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue