Skip to content

Commit

Permalink
BTHAB-184: Display linked invoices using opportunity details custom f…
Browse files Browse the repository at this point in the history
…ields
  • Loading branch information
olayiwola-compucorp committed Sep 13, 2023
1 parent 131e15b commit 7fb3d84
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 88 deletions.
2 changes: 1 addition & 1 deletion ang/afsearchQuotationInvoices.aff.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div af-fieldset="">
<crm-search-display-table search-name="Quotation_Invoices" display-name="Quotation_Invoices" filters="{'CaseSalesOrderContribution_CaseSalesOrder_case_sales_order_id_01.case_id': routeParams.caseId}"></crm-search-display-table>
<crm-search-display-table search-name="Quotation_Contributions" display-name="Contributions_Table_1" filters="{'Opportunity_Details.Case_Opportunity': routeParams.caseId, 'Opportunity_Details.Quotation': options.quotation_ids}"></crm-search-display-table>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ <h1 ng-if="view !== 'contact'" crm-page-title>{{ ts('Manage Quotations') }}</h1>
{{:: ts('Create Quotation') }}
</a>

<div class="panel panel-default">
<div class="panel panel-default quotation__list">
<div class="panel-body">
<div ng-switch="view">
<afsearch-contact-quotations options="{contact_id: contactId}" ng-switch-when="contact"> </afsearch-contact-quotations>
Expand All @@ -34,4 +34,8 @@ <h1 ng-if="view !== 'contact'" crm-page-title>{{ ts('Manage Quotations') }}</h1>
.af-field-range-sep {
margin: 0em 1em;
}
#bootstrap-theme.civicase__container .quotation__list ul.dropdown-menu {
right: 0;
left: auto;
}
</style>
125 changes: 39 additions & 86 deletions managed/SavedSearch_Civicase_Quotations.mgd.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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',
Expand All @@ -495,100 +493,55 @@
'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,
],
],
],
];


$searchKitIsInstalled = 'installed' ===
CRM_Extension_System::singleton()->getManager()->getStatus('org.civicrm.search_kit');
if ($searchKitIsInstalled) {
Expand Down

0 comments on commit 7fb3d84

Please sign in to comment.