diff --git a/backend/api/services/SpreadSheetBuilder.py b/backend/api/services/SpreadSheetBuilder.py index 4f3f205a2..d868e068e 100644 --- a/backend/api/services/SpreadSheetBuilder.py +++ b/backend/api/services/SpreadSheetBuilder.py @@ -181,7 +181,7 @@ def add_credit_transfers(self, credit_trades, user): worksheet.col(8).width = 3500 worksheet.col(9).width = 10000 - def add_fuel_suppliers(self, fuel_suppliers): + def add_fuel_suppliers(self, fuel_suppliers, include_actions=False): """ Adds a spreadsheet for fuel suppliers """ @@ -189,9 +189,10 @@ def add_fuel_suppliers(self, fuel_suppliers): row_index = 0 columns = [ - "ID", "Organization Name", "Compliance Units", "Registered", "Actions" + "ID", "Organization Name", "Compliance Units", "Registered" ] - + if include_actions: + columns.append("Actions") header_style = xlwt.easyxf('font: bold on') # Build Column Headers @@ -211,12 +212,14 @@ def add_fuel_suppliers(self, fuel_suppliers): # Adjust the value for the 'Registered' column based on the status registered_status = 'Yes' if fuel_supplier.status.status.lower() == 'active' else 'No' worksheet.write(row_index, 3, registered_status) - worksheet.write(row_index, 4, fuel_supplier.actions_type.the_type) + if include_actions: + worksheet.write(row_index, 4, fuel_supplier.actions_type.the_type) # set the widths for the columns that we expect to be longer worksheet.col(1).width = 7500 worksheet.col(2).width = 3500 - worksheet.col(4).width = 3500 + if include_actions: + worksheet.col(4).width = 3500 def add_users(self, fuel_supplier_users): """ diff --git a/backend/api/viewsets/CreditTrade.py b/backend/api/viewsets/CreditTrade.py index 7253d5012..04997bc7b 100644 --- a/backend/api/viewsets/CreditTrade.py +++ b/backend/api/viewsets/CreditTrade.py @@ -274,7 +274,7 @@ def xls(self, request): type="Part3FuelSupplier")) \ .order_by('lower_name') - workbook.add_fuel_suppliers(fuel_suppliers) + workbook.add_fuel_suppliers(fuel_suppliers, include_actions=True) workbook.save(response) diff --git a/backend/api/viewsets/Organization.py b/backend/api/viewsets/Organization.py index 39b4463ec..4c89d5a1a 100644 --- a/backend/api/viewsets/Organization.py +++ b/backend/api/viewsets/Organization.py @@ -251,7 +251,7 @@ def xls(self, request): .order_by('lower_name') workbook = SpreadSheetBuilder() - workbook.add_fuel_suppliers(fuel_suppliers) + workbook.add_fuel_suppliers(fuel_suppliers, include_actions=False) workbook.save(response) return response diff --git a/frontend/src/organizations/components/OrganizationsTable.js b/frontend/src/organizations/components/OrganizationsTable.js index bba5f9ab7..b21e1ea27 100644 --- a/frontend/src/organizations/components/OrganizationsTable.js +++ b/frontend/src/organizations/components/OrganizationsTable.js @@ -67,29 +67,8 @@ const OrganizationsTable = (props) => { } return false } - }, { - accessor: item => item.actionsTypeDisplay, - className: 'col-actions-type-display', - Header: 'Actions', - id: 'actions', - minWidth: 75 - }, { - accessor: item => item.organizationBalance.creditTradeId, - Cell: (row) => { - const viewUrl = CREDIT_TRANSACTIONS.DETAILS.replace(':id', row.value) - - return {row.value} - }, - className: 'col-last-transaction', - Header: 'Last Transaction', - id: 'lastTransaction', - minWidth: 75 - }, { - className: 'col-actions', - filterable: false, - id: 'actions', - width: 50 - }] + } +] const filterMethod = (filter, row, column) => { const id = filter.pivotId || filter.id