From 98e0106a8127be16871d75c92cabe02c16be75b1 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 3 Oct 2021 23:36:26 +1100 Subject: [PATCH] Update company detail display page --- lib/inventree/company.dart | 4 ++++ lib/widget/company_detail.dart | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/lib/inventree/company.dart b/lib/inventree/company.dart index 8d89a5a4..59246769 100644 --- a/lib/inventree/company.dart +++ b/lib/inventree/company.dart @@ -48,6 +48,10 @@ class InvenTreeCompany extends InvenTreeModel { bool get isCustomer => (jsondata["is_customer"] ?? false) as bool; + int get partSuppliedCount => (jsondata["parts_supplied"] ?? 0) as int; + + int get partManufacturedCount => (jsondata["parts_manufactured"] ?? 0) as int; + // Request a list of purchase orders against this company Future> getPurchaseOrders({bool? outstanding}) async { diff --git a/lib/widget/company_detail.dart b/lib/widget/company_detail.dart index 608dc578..058249ba 100644 --- a/lib/widget/company_detail.dart +++ b/lib/widget/company_detail.dart @@ -174,6 +174,17 @@ class _CompanyDetailState extends RefreshableState { } ) ); + + // TODO: Display "supplied parts" count (click through to list of supplier parts) + /* + tiles.add( + ListTile( + title: Text(L10().suppliedParts), + leading: FaIcon(FontAwesomeIcons.shapes), + trailing: Text("${company.partSuppliedCount}"), + ) + ); + */ } if (company.isManufacturer) {