From 65fe403866d0b92ee8ed4c46920a328264136bf4 Mon Sep 17 00:00:00 2001 From: Nicolas di Rago Date: Tue, 11 Oct 2022 07:53:08 -0700 Subject: [PATCH] Financial Types Screen Added --- .../ang/afsearchFinancialTypes.aff.html | 14 ++ .../ang/afsearchFinancialTypes.aff.json | 18 ++ .../SavedSearch_Financial_Types.mgd.php | 200 ++++++++++++++++++ 3 files changed, 232 insertions(+) create mode 100644 ext/civicrm_admin_ui/ang/afsearchFinancialTypes.aff.html create mode 100644 ext/civicrm_admin_ui/ang/afsearchFinancialTypes.aff.json create mode 100644 ext/civicrm_admin_ui/managed/SavedSearch_Financial_Types.mgd.php diff --git a/ext/civicrm_admin_ui/ang/afsearchFinancialTypes.aff.html b/ext/civicrm_admin_ui/ang/afsearchFinancialTypes.aff.html new file mode 100644 index 0000000000..42956c23b1 --- /dev/null +++ b/ext/civicrm_admin_ui/ang/afsearchFinancialTypes.aff.html @@ -0,0 +1,14 @@ +
+
+
+

{{:: ts('Financial types are used to categorize contributions for reporting and accounting purposes. You may set up as many as needed, including commonly used types such as Donation, Campaign Contribution or Membership Dues. Additionally, financial types can account for the inventory and expense of premiums.', {1: CRM.url('civicrm/admin/contribute/managePremiums')}) }} +

+

+ {{:: ts('Each financial type relates to a number of financial accounts to track income, accounts receivable, and fees.', {1: CRM.url('civicrm/admin/financial/financialAccount')})}} +

+
+ +
+ +
+ diff --git a/ext/civicrm_admin_ui/ang/afsearchFinancialTypes.aff.json b/ext/civicrm_admin_ui/ang/afsearchFinancialTypes.aff.json new file mode 100644 index 0000000000..fb689cbac6 --- /dev/null +++ b/ext/civicrm_admin_ui/ang/afsearchFinancialTypes.aff.json @@ -0,0 +1,18 @@ +{ + "type": "search", + "title": "Financial Types", + "icon": "fa-list-alt", + "server_route": "civicrm/admin/financial/financialType", + "permission": "administer CiviCRM", + "requires": [], + "description": "", + "is_dashlet": false, + "is_public": false, + "is_token": false, + "entity_type": null, + "join_entity": null, + "contact_summary": null, + "redirect": null, + "create_submission": null, + "navigation": null +} diff --git a/ext/civicrm_admin_ui/managed/SavedSearch_Financial_Types.mgd.php b/ext/civicrm_admin_ui/managed/SavedSearch_Financial_Types.mgd.php new file mode 100644 index 0000000000..cb03b95ace --- /dev/null +++ b/ext/civicrm_admin_ui/managed/SavedSearch_Financial_Types.mgd.php @@ -0,0 +1,200 @@ + 'SavedSearch_Financial_Types', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Financial_Types', + 'label' => E::ts('Financial Types'), + 'form_values' => NULL, + 'mapping_id' => NULL, + 'search_custom_id' => NULL, + 'api_entity' => 'FinancialType', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'name', + 'description', + 'GROUP_CONCAT(DISTINCT FinancialType_EntityFinancialAccount_FinancialAccount_01.name) AS GROUP_CONCAT_FinancialType_EntityFinancialAccount_FinancialAccount_01_name', + 'is_deductible', + 'is_reserved', + 'is_active', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => [ + 'id', + ], + 'join' => [ + [ + 'FinancialAccount AS FinancialType_EntityFinancialAccount_FinancialAccount_01', + 'LEFT', + 'EntityFinancialAccount', + [ + 'id', + '=', + 'FinancialType_EntityFinancialAccount_FinancialAccount_01.entity_id', + ], + [ + 'FinancialType_EntityFinancialAccount_FinancialAccount_01.entity_table', + '=', + "'civicrm_financial_type'", + ], + ], + ], + 'having' => [], + ], + 'expires_date' => NULL, + 'description' => NULL, + ], + ], + ], + [ + 'name' => 'SavedSearch_Financial_Types_SearchDisplay_Financial_Types_Table_1', + 'entity' => 'SearchDisplay', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Financial_Types_Table_1', + 'label' => E::ts('Financial Types Table 1'), + 'saved_search_id.name' => 'Financial_Types', + 'type' => 'table', + 'settings' => [ + 'actions' => FALSE, + 'limit' => 50, + 'classes' => [ + 'table', + 'table-striped', + ], + 'pager' => [], + 'placeholder' => 5, + 'sort' => [], + 'columns' => [ + [ + 'type' => 'field', + 'key' => 'name', + 'dataType' => 'String', + 'label' => E::ts('Name'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'description', + 'dataType' => 'String', + 'label' => E::ts('Description'), + 'sortable' => TRUE, + 'editable' => TRUE, + 'icons' => [ + [ + 'icon' => 'fa-pencil', + 'side' => 'left', + 'if' => [], + ], + ], + ], + [ + 'type' => 'field', + 'key' => 'GROUP_CONCAT_FinancialType_EntityFinancialAccount_FinancialAccount_01_name', + 'dataType' => 'String', + 'label' => E::ts('Financial Accounts'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'is_deductible', + 'dataType' => 'Boolean', + 'label' => E::ts('Tax-Deductible'), + 'sortable' => TRUE, + 'editable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'is_reserved', + 'dataType' => 'Boolean', + 'label' => E::ts('Reserved'), + 'sortable' => TRUE, + 'editable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'is_active', + 'dataType' => 'Boolean', + 'label' => E::ts('Enabled'), + 'sortable' => TRUE, + 'editable' => TRUE, + ], + [ + 'size' => 'btn-xs', + 'links' => [ + [ + 'path' => '/civicrm/admin/financial/financialType/accounts?reset=1&action=browse&aid=[id]', + 'icon' => '', + 'text' => E::ts('Accounts'), + 'style' => 'default', + 'condition' => [], + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '', + ], + ], + 'type' => 'buttons', + 'alignment' => 'text-right', + ], + [ + 'size' => 'btn-sm', + 'links' => [ + [ + 'path' => '/civicrm/admin/financial/financialType?action=update&id=[id]&reset=1', + 'icon' => 'fa-pencil', + 'text' => E::ts('Edit'), + 'style' => 'default', + 'condition' => [], + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '', + ], + ], + 'type' => 'buttons', + 'alignment' => 'text-right', + ], + [ + 'size' => 'btn-sm', + 'links' => [ + [ + 'path' => '/civicrm/admin/financial/financialType?action=delete&id=[id]', + 'icon' => 'fa-trash-o', + 'text' => E::ts('Delete'), + 'style' => 'danger', + 'condition' => [], + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '', + ], + ], + 'type' => 'buttons', + 'alignment' => 'text-right', + ], + ], + 'addButton' => [ + 'path' => 'civicrm/admin/financial/financialType/accounts?reset=1&action=add', + 'text' => E::ts('Add Financial Type'), + 'icon' => 'fa-plus', + ], + ], + 'acl_bypass' => FALSE, + ], + ], + ], +]; -- 2.25.1