From 7fb3d84b73fa57691eb3bb65c04c3348c096dc15 Mon Sep 17 00:00:00 2001 From: olayiwola-compucorp Date: Wed, 13 Sep 2023 15:56:54 +0100 Subject: [PATCH] BTHAB-184: Display linked invoices using opportunity details custom fields --- ang/afsearchQuotationInvoices.aff.html | 2 +- .../directives/quotations-list.directive.html | 6 +- .../SavedSearch_Civicase_Quotations.mgd.php | 125 ++++++------------ 3 files changed, 45 insertions(+), 88 deletions(-) diff --git a/ang/afsearchQuotationInvoices.aff.html b/ang/afsearchQuotationInvoices.aff.html index 818179830..44a6bc143 100644 --- a/ang/afsearchQuotationInvoices.aff.html +++ b/ang/afsearchQuotationInvoices.aff.html @@ -1,3 +1,3 @@
- +
diff --git a/ang/civicase-features/quotations/directives/quotations-list.directive.html b/ang/civicase-features/quotations/directives/quotations-list.directive.html index 495a03c7d..e8327d827 100644 --- a/ang/civicase-features/quotations/directives/quotations-list.directive.html +++ b/ang/civicase-features/quotations/directives/quotations-list.directive.html @@ -8,7 +8,7 @@

{{ ts('Manage Quotations') }}

{{:: ts('Create Quotation') }} -
+
@@ -34,4 +34,8 @@

{{ ts('Manage Quotations') }}

.af-field-range-sep { margin: 0em 1em; } + #bootstrap-theme.civicase__container .quotation__list ul.dropdown-menu { + right: 0; + left: auto; + } diff --git a/managed/SavedSearch_Civicase_Quotations.mgd.php b/managed/SavedSearch_Civicase_Quotations.mgd.php index f5275daee..a9cbe65ac 100644 --- a/managed/SavedSearch_Civicase_Quotations.mgd.php +++ b/managed/SavedSearch_Civicase_Quotations.mgd.php @@ -415,53 +415,51 @@ ], ], [ - 'name' => 'SavedSearch_Quotation_Invoices', + 'name' => 'SavedSearch_Quotation_Contributions', 'entity' => 'SavedSearch', 'cleanup' => 'unused', 'update' => 'unmodified', 'params' => [ 'version' => 4, 'values' => [ - 'name' => 'Quotation_Invoices', - 'label' => 'Quotation Invoices', + 'name' => 'Quotation_Contributions', + 'label' => 'Quotation Contributions', 'form_values' => NULL, 'search_custom_id' => NULL, - 'api_entity' => 'CaseSalesOrderContribution', + 'api_entity' => 'Contribution', 'api_params' => [ 'version' => 4, 'select' => [ - 'id', - 'CaseSalesOrderContribution_Contribution_contribution_id_01.id', - 'CaseSalesOrderContribution_Contribution_contribution_id_01.financial_type_id:label', - 'CaseSalesOrderContribution_Contribution_contribution_id_01.total_amount', - 'CaseSalesOrderContribution_Contribution_contribution_id_01.source', - 'CaseSalesOrderContribution_Contribution_contribution_id_01.thankyou_date', - 'CaseSalesOrderContribution_Contribution_contribution_id_01.contribution_status_id:label', - 'CaseSalesOrderContribution_Contribution_contribution_id_01.receive_date', + 'total_amount', + 'financial_type_id:label', + 'source', + 'receive_date', + 'thankyou_date', + 'contribution_status_id:label', + 'Opportunity_Details.Case_Opportunity', ], 'orderBy' => [], - 'where' => [], - 'groupBy' => [], - 'join' => [ + 'where' => [ [ - 'Contribution AS CaseSalesOrderContribution_Contribution_contribution_id_01', - 'LEFT', - [ - 'contribution_id', - '=', - 'CaseSalesOrderContribution_Contribution_contribution_id_01.id', - ], + 'id', + 'IS NOT EMPTY', ], [ - 'CaseSalesOrder AS CaseSalesOrderContribution_CaseSalesOrder_case_sales_order_id_01', - 'LEFT', + 'OR', [ - 'case_sales_order_id', - '=', - 'CaseSalesOrderContribution_CaseSalesOrder_case_sales_order_id_01.id', + [ + 'Opportunity_Details.Case_Opportunity', + 'IS NOT EMPTY', + ], + [ + 'Opportunity_Details.Quotation', + 'IS NOT EMPTY', + ], ], ], ], + 'groupBy' => [], + 'join' => [], 'having' => [], ], 'expires_date' => NULL, @@ -471,20 +469,20 @@ ], ], [ - 'name' => 'SavedSearch_Quotation_Invoices_SearchDisplay_Quotation_Invoices', + 'name' => 'SavedSearch_Quotation_Contributions_SearchDisplay_Contributions_Table_1', 'entity' => 'SearchDisplay', 'cleanup' => 'unused', 'update' => 'unmodified', 'params' => [ 'version' => 4, 'values' => [ - 'name' => 'Quotation_Invoices', - 'label' => 'Quotation Invoices', - 'saved_search_id.name' => 'Quotation_Invoices', + 'name' => 'Contributions_Table_1', + 'label' => 'Contributions Table 1', + 'saved_search_id.name' => 'Quotation_Contributions', 'type' => 'table', 'settings' => [ - 'actions' => FALSE, - 'limit' => 10, + 'actions' => TRUE, + 'limit' => 50, 'classes' => [ 'table', 'table-striped', @@ -495,92 +493,48 @@ 'columns' => [ [ 'type' => 'field', - 'key' => 'CaseSalesOrderContribution_Contribution_contribution_id_01.total_amount', + 'key' => 'total_amount', 'dataType' => 'Money', 'label' => 'Amount', 'sortable' => TRUE, ], [ 'type' => 'field', - 'key' => 'CaseSalesOrderContribution_Contribution_contribution_id_01.financial_type_id:label', + 'key' => 'financial_type_id:label', 'dataType' => 'Integer', 'label' => 'Type', 'sortable' => TRUE, ], [ 'type' => 'field', - 'key' => 'CaseSalesOrderContribution_Contribution_contribution_id_01.source', + 'key' => 'source', 'dataType' => 'String', 'label' => 'Source', 'sortable' => TRUE, ], [ 'type' => 'field', - 'key' => 'CaseSalesOrderContribution_Contribution_contribution_id_01.receive_date', + 'key' => 'receive_date', 'dataType' => 'Timestamp', 'label' => 'Date', 'sortable' => TRUE, ], [ 'type' => 'field', - 'key' => 'CaseSalesOrderContribution_Contribution_contribution_id_01.thankyou_date', + 'key' => 'thankyou_date', 'dataType' => 'Timestamp', - 'label' => 'Thank-You Sent', + 'label' => 'Thank-you Sent', 'sortable' => TRUE, - 'rewrite' => '{if "[CaseSalesOrderContribution_Contribution_contribution_id_01.thankyou_date]"} Yes {else} No {/if}', + 'rewrite' => '{if "[thankyou_date]"} Yes {else} No {/if}', ], [ 'type' => 'field', - 'key' => 'CaseSalesOrderContribution_Contribution_contribution_id_01.contribution_status_id:label', + 'key' => 'contribution_status_id:label', 'dataType' => 'Integer', 'label' => 'Status', 'sortable' => TRUE, ], - [ - 'text' => 'Actions', - 'style' => 'default', - 'size' => 'btn-sm', - 'icon' => 'fa-bars', - 'links' => [ - [ - 'entity' => 'Contribution', - 'action' => 'view', - 'join' => 'CaseSalesOrderContribution_Contribution_contribution_id_01', - 'target' => 'crm-popup', - 'icon' => 'fa-external-link', - 'text' => 'View', - 'style' => 'default', - 'path' => '', - 'condition' => [], - ], - [ - 'entity' => 'Contribution', - 'action' => 'update', - 'join' => 'CaseSalesOrderContribution_Contribution_contribution_id_01', - 'target' => 'crm-popup', - 'icon' => 'fa-pencil', - 'text' => 'Edit', - 'style' => 'default', - 'path' => '', - 'condition' => [], - ], - [ - 'path' => 'civicrm/contribute/invoice/email/?reset=1&id=[contribution_id]&select=email', - 'icon' => 'fa-paper-plane-o', - 'text' => 'Send By Email', - 'style' => 'default', - 'condition' => [], - 'entity' => '', - 'action' => '', - 'join' => '', - 'target' => 'crm-popup', - ], - ], - 'type' => 'menu', - 'alignment' => 'text-right', - ], ], - 'noResultsText' => 'No Invoices found', ], 'acl_bypass' => FALSE, ], @@ -588,7 +542,6 @@ ], ]; - $searchKitIsInstalled = 'installed' === CRM_Extension_System::singleton()->getManager()->getStatus('org.civicrm.search_kit'); if ($searchKitIsInstalled) {