mirror of
				https://github.com/inventree/inventree-app.git
				synced 2025-11-04 15:25:48 +00:00 
			
		
		
		
	Display purcahse price for stock item
This commit is contained in:
		@@ -9,6 +9,7 @@
 | 
			
		||||
- Improvements for PartCategory editing form
 | 
			
		||||
- Improvements for StockLocation editing form
 | 
			
		||||
- Adds ability to edit StockItem
 | 
			
		||||
- Display purchase price (where available) for StockItem
 | 
			
		||||
- Updated translations 
 | 
			
		||||
 | 
			
		||||
### 0.2.10 - July 2021
 | 
			
		||||
 
 | 
			
		||||
@@ -60,6 +60,8 @@ class InvenTreeStockItem extends InvenTreeModel {
 | 
			
		||||
 | 
			
		||||
  String statusLabel(BuildContext context) {
 | 
			
		||||
 | 
			
		||||
    // TODO: Delete me - The translated status values are provided by the API!
 | 
			
		||||
 | 
			
		||||
    switch (status) {
 | 
			
		||||
      case OK:
 | 
			
		||||
        return L10().ok;
 | 
			
		||||
@@ -220,6 +222,15 @@ class InvenTreeStockItem extends InvenTreeModel {
 | 
			
		||||
 | 
			
		||||
  int get partId => jsondata['part'] ?? -1;
 | 
			
		||||
 | 
			
		||||
  String get purchasePrice => jsondata['purchase_price'];
 | 
			
		||||
 | 
			
		||||
  bool get hasPurchasePrice {
 | 
			
		||||
 | 
			
		||||
    String pp = purchasePrice;
 | 
			
		||||
 | 
			
		||||
    return pp.isNotEmpty && pp.trim() != "-";
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  int get trackingItemCount => (jsondata['tracking_items'] ?? 0) as int;
 | 
			
		||||
 | 
			
		||||
  // Date of last update
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								lib/l10n
									
									
									
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								lib/l10n
									
									
									
									
									
								
							 Submodule lib/l10n updated: 4dccf7c37f...46d08c9cc0
									
								
							@@ -534,6 +534,18 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
 | 
			
		||||
      );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (item.hasPurchasePrice) {
 | 
			
		||||
      tiles.add(
 | 
			
		||||
        ListTile(
 | 
			
		||||
          title: Text(L10().purchasePrice),
 | 
			
		||||
          leading: FaIcon(FontAwesomeIcons.dollarSign),
 | 
			
		||||
          trailing: Text(item.purchasePrice),
 | 
			
		||||
        )
 | 
			
		||||
      );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // TODO - Is this stock item linked to a PurchaseOrder?
 | 
			
		||||
 | 
			
		||||
    // TODO - Re-enable stock item history display
 | 
			
		||||
    if (false && item.trackingItemCount > 0) {
 | 
			
		||||
      tiles.add(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user