diff --git a/managed/SavedSearch_ContactCategories_0_2_Locus.mgd.php b/managed/SavedSearch_ContactCategories_0_2_Locus.mgd.php new file mode 100644 index 0000000..1e5eb2c --- /dev/null +++ b/managed/SavedSearch_ContactCategories_0_2_Locus.mgd.php @@ -0,0 +1,38 @@ + 'SavedSearch_ContactCategories_0_2_Locus', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_0_2_Locus', + 'label' => E::ts('ContactCategories 0.2 Locus'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'sort_name', + 'contact_type:label', + 'contact_sub_type:label', + ], + 'orderBy' => [], + 'where' => [ + ['created_date', '>=', 'now - 12 month'], + ], + 'groupBy' => [], + 'join' => [], + 'having' => [], + ], + 'description' => E::ts('0.2 Interested +entry into database < 12 months - no activity'), + ], + 'match' => ['name'], + ], + ], +]; diff --git a/managed/SavedSearch_ContactCategories_Locus_1_1.mgd.php b/managed/SavedSearch_ContactCategories_Locus_1_1.mgd.php new file mode 100644 index 0000000..a25e259 --- /dev/null +++ b/managed/SavedSearch_ContactCategories_Locus_1_1.mgd.php @@ -0,0 +1,58 @@ + 'SavedSearch_ContactCategories_Locus_1_1', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_Locus_1_1', + 'label' => E::ts('ContactCategories Locus 1.1'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'sort_name', + 'contact_type:label', + 'MAX(Contact_Contribution_contact_id_01.receive_date) AS MAX_Contact_Contribution_contact_id_01_receive_date', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => ['id'], + 'join' => [ + [ + 'Contribution AS Contact_Contribution_contact_id_01', + 'INNER', + [ + 'id', + '=', + 'Contact_Contribution_contact_id_01.contact_id', + ], + [ + 'Contact_Contribution_contact_id_01.contribution_status_id:name', + '=', + '"Completed"', + ], + ], + ], + 'having' => [ + [ + 'MAX_Contact_Contribution_contact_id_01_receive_date', + '<', + 'now - 36 month', + ], + ], + ], + 'description' => E::ts('1.1 Occasional donor: expired + +last donation 36 + months before today'), + ], + 'match' => ['name'], + ], + ], +]; diff --git a/managed/SavedSearch_ContactCategories_Locus_1_2.mgd.php b/managed/SavedSearch_ContactCategories_Locus_1_2.mgd.php new file mode 100644 index 0000000..acce807 --- /dev/null +++ b/managed/SavedSearch_ContactCategories_Locus_1_2.mgd.php @@ -0,0 +1,61 @@ + 'SavedSearch_ContactCategories_Locus_1_2', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_Locus_1_2', + 'label' => E::ts('ContactCategories Locus 1.2'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'sort_name', + 'contact_type:label', + 'contact_sub_type:label', + 'SUM(Contact_Contribution_contact_id_01.total_amount) AS SUM_Contact_Contribution_contact_id_01_total_amount', + 'COUNT(Contact_Contribution_contact_id_01.id) AS COUNT_Contact_Contribution_contact_id_01_id', + 'MAX(Contact_Contribution_contact_id_01.receive_date) AS MAX_Contact_Contribution_contact_id_01_receive_date', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => ['id'], + 'join' => [ + [ + 'Contribution AS Contact_Contribution_contact_id_01', + 'INNER', + [ + 'id', + '=', + 'Contact_Contribution_contact_id_01.contact_id', + ], + [ + 'Contact_Contribution_contact_id_01.contribution_status_id:name', + '=', + '"Completed"', + ], + ], + ], + 'having' => [ + [ + 'MAX_Contact_Contribution_contact_id_01_receive_date', + 'BETWEEN', + ['now - 26 month', 'now - 24 month'], + ], + ], + ], + 'description' => E::ts('1.2 Occasional donor: critical + +last donation 24 – 36 months before today'), + ], + 'match' => ['name'], + ], + ], +]; diff --git a/managed/SavedSearch_ContactCategories_Locus_1_3.mgd.php b/managed/SavedSearch_ContactCategories_Locus_1_3.mgd.php new file mode 100644 index 0000000..8f1805f --- /dev/null +++ b/managed/SavedSearch_ContactCategories_Locus_1_3.mgd.php @@ -0,0 +1,66 @@ + 'SavedSearch_ContactCategories_Locus_1_3', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_Locus_1_3', + 'label' => E::ts('ContactCategories Locus 1.3'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'sort_name', + 'contact_type:label', + 'contact_sub_type:label', + 'SUM(Contact_Contribution_contact_id_01.total_amount) AS SUM_Contact_Contribution_contact_id_01_total_amount', + 'COUNT(Contact_Contribution_contact_id_01.id) AS COUNT_Contact_Contribution_contact_id_01_id', + 'MIN(Contact_Contribution_contact_id_01.receive_date) AS MIN_Contact_Contribution_contact_id_01_receive_date', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => ['id'], + 'join' => [ + [ + 'Contribution AS Contact_Contribution_contact_id_01', + 'INNER', + [ + 'id', + '=', + 'Contact_Contribution_contact_id_01.contact_id', + ], + [ + 'Contact_Contribution_contact_id_01.contribution_status_id:name', + '=', + '"Completed"', + ], + ], + ], + 'having' => [ + [ + 'MIN_Contact_Contribution_contact_id_01_receive_date', + 'BETWEEN', + ['now - 24 month', 'now - 12 month'], + ], + [ + 'COUNT_Contact_Contribution_contact_id_01_id', + '=', + 1, + ], + ], + ], + 'description' => E::ts('1.3 Occasional Donor: one-time + + - first and only donation 12 – 24 months before today'), + ], + 'match' => ['name'], + ], + ], +]; diff --git a/managed/SavedSearch_ContactCategories_Locus_1_4.mgd.php b/managed/SavedSearch_ContactCategories_Locus_1_4.mgd.php new file mode 100644 index 0000000..febee82 --- /dev/null +++ b/managed/SavedSearch_ContactCategories_Locus_1_4.mgd.php @@ -0,0 +1,61 @@ + 'SavedSearch_ContactCategories_Locus_1_4', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_Locus_1_4', + 'label' => E::ts('ContactCategories Locus 1.4'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'sort_name', + 'contact_type:label', + 'contact_sub_type:label', + 'SUM(Contact_Contribution_contact_id_01.total_amount) AS SUM_Contact_Contribution_contact_id_01_total_amount', + 'COUNT(Contact_Contribution_contact_id_01.id) AS COUNT_Contact_Contribution_contact_id_01_id', + 'MIN(Contact_Contribution_contact_id_01.receive_date) AS MIN_Contact_Contribution_contact_id_01_receive_date', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => ['id'], + 'join' => [ + [ + 'Contribution AS Contact_Contribution_contact_id_01', + 'INNER', + [ + 'id', + '=', + 'Contact_Contribution_contact_id_01.contact_id', + ], + [ + 'Contact_Contribution_contact_id_01.contribution_status_id:name', + '=', + '"Completed"', + ], + ], + ], + 'having' => [ + [ + 'MIN_Contact_Contribution_contact_id_01_receive_date', + '>', + 'now - 12 month', + ], + ], + ], + 'description' => E::ts('1.4 Occasional Donor: new + + first donation within last 12 months'), + ], + 'match' => ['name'], + ], + ], +]; diff --git a/managed/SavedSearch_ContactCategories_Locus_1_5.mgd.php b/managed/SavedSearch_ContactCategories_Locus_1_5.mgd.php new file mode 100644 index 0000000..25fa87d --- /dev/null +++ b/managed/SavedSearch_ContactCategories_Locus_1_5.mgd.php @@ -0,0 +1,65 @@ + 'SavedSearch_ContactCategories_Locus_1_5', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_Locus_1_5', + 'label' => E::ts('ContactCategories Locus 1.5'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'sort_name', + 'contact_type:label', + 'contact_sub_type:label', + 'SUM(Contact_Contribution_contact_id_01.total_amount) AS SUM_Contact_Contribution_contact_id_01_total_amount', + 'COUNT(Contact_Contribution_contact_id_01.id) AS COUNT_Contact_Contribution_contact_id_01_id', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => ['id'], + 'join' => [ + [ + 'Contribution AS Contact_Contribution_contact_id_01', + 'INNER', + [ + 'id', + '=', + 'Contact_Contribution_contact_id_01.contact_id', + ], + [ + 'Contact_Contribution_contact_id_01.contribution_status_id:name', + '=', + '"Completed"', + ], + [ + 'Contact_Contribution_contact_id_01.receive_date', + '>', + '"now - 24 month"', + ], + ], + ], + 'having' => [ + [ + 'COUNT_Contact_Contribution_contact_id_01_id', + '=', + 2, + ], + ], + ], + 'description' => E::ts('1.5 Occasional Donor: two-time + +2 donations within last 24 months'), + ], + 'match' => ['name'], + ], + ], +]; diff --git a/managed/SavedSearch_ContactCategories_Locus_1_6.mgd.php b/managed/SavedSearch_ContactCategories_Locus_1_6.mgd.php new file mode 100644 index 0000000..c6b5941 --- /dev/null +++ b/managed/SavedSearch_ContactCategories_Locus_1_6.mgd.php @@ -0,0 +1,65 @@ + 'SavedSearch_ContactCategories_Locus_1_6', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_Locus_1_6', + 'label' => E::ts('ContactCategories Locus 1.6'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'sort_name', + 'contact_type:label', + 'contact_sub_type:label', + 'SUM(Contact_Contribution_contact_id_01.total_amount) AS SUM_Contact_Contribution_contact_id_01_total_amount', + 'COUNT(Contact_Contribution_contact_id_01.id) AS COUNT_Contact_Contribution_contact_id_01_id', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => ['id'], + 'join' => [ + [ + 'Contribution AS Contact_Contribution_contact_id_01', + 'INNER', + [ + 'id', + '=', + 'Contact_Contribution_contact_id_01.contact_id', + ], + [ + 'Contact_Contribution_contact_id_01.contribution_status_id:name', + '=', + '"Completed"', + ], + [ + 'Contact_Contribution_contact_id_01.receive_date', + '>', + '"now - 24 month"', + ], + ], + ], + 'having' => [ + [ + 'COUNT_Contact_Contribution_contact_id_01_id', + '>=', + 3, + ], + ], + ], + 'description' => E::ts('1.6 Occasional Donor: multiple-time + +3+ donations within last 24 months'), + ], + 'match' => ['name'], + ], + ], +]; diff --git a/managed/SavedSearch_ContactCategories_Locus_2_1.mgd.php b/managed/SavedSearch_ContactCategories_Locus_2_1.mgd.php new file mode 100644 index 0000000..83ff671 --- /dev/null +++ b/managed/SavedSearch_ContactCategories_Locus_2_1.mgd.php @@ -0,0 +1,65 @@ + 'SavedSearch_ContactCategories_Locus_2_1', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_Locus_2_1', + 'label' => E::ts('ContactCategories Locus 2.1'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'sort_name', + 'contact_type:label', + 'contact_sub_type:label', + 'Contact_ContributionRecur_contact_id_01_ContributionRecur_Contribution_contribution_recur_id_01.total_amount', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => ['id'], + 'join' => [ + [ + 'ContributionRecur AS Contact_ContributionRecur_contact_id_01', + 'INNER', + [ + 'id', + '=', + 'Contact_ContributionRecur_contact_id_01.contact_id', + ], + [ + 'Contact_ContributionRecur_contact_id_01.contribution_status_id:name', + '=', + '"Cancelled"', + ], + ], + [ + 'Contribution AS Contact_ContributionRecur_contact_id_01_ContributionRecur_Contribution_contribution_recur_id_01', + 'INNER', + [ + 'Contact_ContributionRecur_contact_id_01.id', + '=', + 'Contact_ContributionRecur_contact_id_01_ContributionRecur_Contribution_contribution_recur_id_01.contribution_recur_id', + ], + [ + 'Contact_ContributionRecur_contact_id_01_ContributionRecur_Contribution_contribution_recur_id_01.contribution_status_id:name', + '=', + '"Completed"', + ], + ], + ], + 'having' => [], + ], + 'description' => E::ts('anyone with an expired regular giving that yielded at least one completed contribution. Note: they may also have non-expired regular giving, but this is the catch all below those criteria.'), + ], + 'match' => ['name'], + ], + ], +]; diff --git a/managed/SavedSearch_ContactCategories_Locus_2_2.mgd.php b/managed/SavedSearch_ContactCategories_Locus_2_2.mgd.php new file mode 100644 index 0000000..047996a --- /dev/null +++ b/managed/SavedSearch_ContactCategories_Locus_2_2.mgd.php @@ -0,0 +1,73 @@ + 'SavedSearch_ContactCategories_Locus_2_2', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_Locus_2_2', + 'label' => E::ts('ContactCategories Locus 2.2'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'sort_name', + 'contact_type:label', + 'contact_sub_type:label', + 'Contact_ContributionRecur_contact_id_01_ContributionRecur_Contribution_contribution_recur_id_01.total_amount', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => ['id'], + 'join' => [ + [ + 'ContributionRecur AS Contact_ContributionRecur_contact_id_01', + 'INNER', + [ + 'id', + '=', + 'Contact_ContributionRecur_contact_id_01.contact_id', + ], + [ + 'Contact_ContributionRecur_contact_id_01.contribution_status_id:name', + '=', + '"In Progress"', + ], + [ + 'Contact_ContributionRecur_contact_id_01.start_date', + '>', + '"now - 12 month"', + ], + ], + [ + 'Contribution AS Contact_ContributionRecur_contact_id_01_ContributionRecur_Contribution_contribution_recur_id_01', + 'INNER', + [ + 'Contact_ContributionRecur_contact_id_01.id', + '=', + 'Contact_ContributionRecur_contact_id_01_ContributionRecur_Contribution_contribution_recur_id_01.contribution_recur_id', + ], + [ + 'Contact_ContributionRecur_contact_id_01_ContributionRecur_Contribution_contribution_recur_id_01.contribution_status_id:name', + '=', + '"Completed"', + ], + ], + ], + 'having' => [], + ], + 'description' => E::ts('new regular donor + +- started giving regular donations max. 12 months ago +- at least one completed contribution.'), + ], + 'match' => ['name'], + ], + ], +]; diff --git a/managed/SavedSearch_ContactCategories_Locus_2_3.mgd.php b/managed/SavedSearch_ContactCategories_Locus_2_3.mgd.php new file mode 100644 index 0000000..868c518 --- /dev/null +++ b/managed/SavedSearch_ContactCategories_Locus_2_3.mgd.php @@ -0,0 +1,72 @@ + 'SavedSearch_ContactCategories_Locus_2_3', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_Locus_2_3', + 'label' => E::ts('ContactCategories Locus 2.3'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'sort_name', + 'contact_type:label', + 'contact_sub_type:label', + 'Contact_ContributionRecur_contact_id_01_ContributionRecur_Contribution_contribution_recur_id_01.total_amount', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => ['id'], + 'join' => [ + [ + 'ContributionRecur AS Contact_ContributionRecur_contact_id_01', + 'INNER', + [ + 'id', + '=', + 'Contact_ContributionRecur_contact_id_01.contact_id', + ], + [ + 'Contact_ContributionRecur_contact_id_01.contribution_status_id:name', + '=', + '"In Progress"', + ], + [ + 'Contact_ContributionRecur_contact_id_01.start_date', + '<=', + '"now - 12 month"', + ], + ], + [ + 'Contribution AS Contact_ContributionRecur_contact_id_01_ContributionRecur_Contribution_contribution_recur_id_01', + 'INNER', + [ + 'Contact_ContributionRecur_contact_id_01.id', + '=', + 'Contact_ContributionRecur_contact_id_01_ContributionRecur_Contribution_contribution_recur_id_01.contribution_recur_id', + ], + [ + 'Contact_ContributionRecur_contact_id_01_ContributionRecur_Contribution_contribution_recur_id_01.contribution_status_id:name', + '=', + '"Completed"', + ], + ], + ], + 'having' => [], + ], + 'description' => E::ts('active regular donor + + - started and continued giving regular donations 12+ months ago'), + ], + 'match' => ['name'], + ], + ], +]; diff --git a/managed/SavedSearch_ContactCategories_Locus_3_0_expired_major_donor.mgd.php b/managed/SavedSearch_ContactCategories_Locus_3_0_expired_major_donor.mgd.php new file mode 100644 index 0000000..2906c23 --- /dev/null +++ b/managed/SavedSearch_ContactCategories_Locus_3_0_expired_major_donor.mgd.php @@ -0,0 +1,54 @@ + 'SavedSearch_ContactCategories_Locus_3_0_expired_major_donor', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_Locus_3_0_expired_major_donor', + 'label' => E::ts('ContactCategories Locus 3.0 expired major donor'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'sort_name', + 'contact_type:label', + 'contact_sub_type:label', + 'MAX(Contact_Contribution_contact_id_01.total_amount) AS MAX_Contact_Contribution_contact_id_01_total_amount', + 'MAX(Contact_Contribution_contact_id_01.receive_date) AS MAX_Contact_Contribution_contact_id_01_receive_date', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => ['id'], + 'join' => [ + [ + 'Contribution AS Contact_Contribution_contact_id_01', + 'INNER', + [ + 'id', + '=', + 'Contact_Contribution_contact_id_01.contact_id', + ], + ], + ], + 'having' => [ + [ + 'MAX_Contact_Contribution_contact_id_01_receive_date', + '<=', + 'now - 36 month', + ], + ], + ], + 'description' => E::ts('- last donation 36+ months before today + - 1+ donation of 500+ EUR'), + ], + 'match' => ['name'], + ], + ], +]; diff --git a/managed/SavedSearch_ContactCategories_Locus_3_1.mgd.php b/managed/SavedSearch_ContactCategories_Locus_3_1.mgd.php new file mode 100644 index 0000000..37ff800 --- /dev/null +++ b/managed/SavedSearch_ContactCategories_Locus_3_1.mgd.php @@ -0,0 +1,58 @@ + 'SavedSearch_ContactCategories_Locus_3_1', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_Locus_3_1', + 'label' => E::ts('ContactCategories Locus 3.1'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'MAX(Contact_Contribution_contact_id_01.total_amount) AS MAX_Contact_Contribution_contact_id_01_total_amount', + 'MAX(Contact_Contribution_contact_id_01.receive_date) AS MAX_Contact_Contribution_contact_id_01_receive_date', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => ['id'], + 'join' => [ + [ + 'Contribution AS Contact_Contribution_contact_id_01', + 'INNER', + [ + 'id', + '=', + 'Contact_Contribution_contact_id_01.contact_id', + ], + ], + ], + 'having' => [ + [ + 'MAX_Contact_Contribution_contact_id_01_total_amount', + '=', + '', + ], + [ + 'MAX_Contact_Contribution_contact_id_01_receive_date', + 'BETWEEN', + ['now - 36 month', 'now - 12 month'], + ], + ], + ], + 'description' => E::ts('Major donor: critical + + - last donation 24 – 36 months before today + - 1+ donation of 500+ EUR'), + ], + 'match' => ['name'], + ], + ], +]; diff --git a/managed/SavedSearch_ContactCategories_Locus_3_2.mgd.php b/managed/SavedSearch_ContactCategories_Locus_3_2.mgd.php new file mode 100644 index 0000000..db5f9e1 --- /dev/null +++ b/managed/SavedSearch_ContactCategories_Locus_3_2.mgd.php @@ -0,0 +1,69 @@ + 'SavedSearch_ContactCategories_Locus_3_2', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_Locus_3_2', + 'label' => E::ts('ContactCategories Locus 3.2'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'COUNT(Contact_Contribution_contact_id_01.id) AS COUNT_Contact_Contribution_contact_id_01_id', + 'SUM(Contact_Contribution_contact_id_01.total_amount) AS SUM_Contact_Contribution_contact_id_01_total_amount', + 'MAX(Contact_Contribution_contact_id_01.total_amount) AS MAX_Contact_Contribution_contact_id_01_total_amount', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => ['id'], + 'join' => [ + [ + 'Contribution AS Contact_Contribution_contact_id_01', + 'INNER', + [ + 'id', + '=', + 'Contact_Contribution_contact_id_01.contact_id', + ], + ], + ], + 'having' => [ + [ + 'COUNT_Contact_Contribution_contact_id_01_id', + '>=', + 2, + ], + [ + 'OR', + [ + [ + 'MAX_Contact_Contribution_contact_id_01_total_amount', + '>=', + '500', + ], + [ + 'SUM_Contact_Contribution_contact_id_01_total_amount', + '=', + '1000', + ], + ], + ], + ], + ], + 'description' => E::ts('Major donor: two-time + + - 2+ donations within last 24 months +AND 1+ donation of 500+ EUR OR sum of all donations within last 24 months 1,000+'), + ], + 'match' => ['name'], + ], + ], +]; diff --git a/managed/SavedSearch_ContactCategories_Locus_3_3.mgd.php b/managed/SavedSearch_ContactCategories_Locus_3_3.mgd.php new file mode 100644 index 0000000..db34307 --- /dev/null +++ b/managed/SavedSearch_ContactCategories_Locus_3_3.mgd.php @@ -0,0 +1,70 @@ + 'SavedSearch_ContactCategories_Locus_3_3', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_Locus_3_3', + 'label' => E::ts('ContactCategories Locus 3.3'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'MIN(Contact_Contribution_contact_id_01.receive_date) AS MIN_Contact_Contribution_contact_id_01_receive_date', + 'COUNT(Contact_Contribution_contact_id_01.id) AS COUNT_Contact_Contribution_contact_id_01_id', + 'SUM(Contact_Contribution_contact_id_01.total_amount) AS SUM_Contact_Contribution_contact_id_01_total_amount', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => ['id'], + 'join' => [ + [ + 'Contribution AS Contact_Contribution_contact_id_01', + 'INNER', + [ + 'id', + '=', + 'Contact_Contribution_contact_id_01.contact_id', + ], + [ + 'Contact_Contribution_contact_id_01.contribution_status_id:name', + '=', + '"Completed"', + ], + ], + ], + 'having' => [ + [ + 'COUNT_Contact_Contribution_contact_id_01_id', + '=', + 1, + ], + [ + 'MIN_Contact_Contribution_contact_id_01_receive_date', + 'BETWEEN', + ['now - 24 month', 'now - 12 month'], + ], + [ + 'SUM_Contact_Contribution_contact_id_01_total_amount', + '>=', + '500', + ], + ], + ], + 'description' => E::ts('Major donor: one-time + + - first and only donation +- was 12 – 24 months before today +- amount 500+'), + ], + 'match' => ['name'], + ], + ], +]; diff --git a/managed/SavedSearch_ContactCategories_Locus_3_4.mgd.php b/managed/SavedSearch_ContactCategories_Locus_3_4.mgd.php new file mode 100644 index 0000000..cb6e310 --- /dev/null +++ b/managed/SavedSearch_ContactCategories_Locus_3_4.mgd.php @@ -0,0 +1,79 @@ + 'SavedSearch_ContactCategories_Locus_3_4', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_Locus_3_4', + 'label' => E::ts('ContactCategories Locus 3.4'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'sort_name', + 'contact_type:label', + 'contact_sub_type:label', + 'SUM(Contact_Contribution_contact_id_01.total_amount) AS SUM_Contact_Contribution_contact_id_01_total_amount', + 'MIN(Contact_Contribution_contact_id_01.receive_date) AS MIN_Contact_Contribution_contact_id_01_receive_date', + 'MAX(Contact_Contribution_contact_id_01.total_amount) AS MAX_Contact_Contribution_contact_id_01_total_amount', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => ['id'], + 'join' => [ + [ + 'Contribution AS Contact_Contribution_contact_id_01', + 'INNER', + [ + 'id', + '=', + 'Contact_Contribution_contact_id_01.contact_id', + ], + [ + 'Contact_Contribution_contact_id_01.contribution_status_id:name', + '=', + '"Completed"', + ], + ], + ], + 'having' => [ + [ + 'MIN_Contact_Contribution_contact_id_01_receive_date', + '>=', + 'now - 12 month', + ], + [ + 'OR', + [ + [ + 'MAX_Contact_Contribution_contact_id_01_total_amount', + '>=', + '500', + ], + [ + 'SUM_Contact_Contribution_contact_id_01_total_amount', + '>=', + '1000', + ], + ], + ], + ], + ], + 'description' => E::ts('Major donor: new + - First donation within last 12 months +AND + - 1+ donation of 500+ EUR + OR + - sum of all donations 1,000+ EUR'), + ], + 'match' => ['name'], + ], + ], +]; diff --git a/managed/SavedSearch_ContactCategories_Locus_3_5.mgd.php b/managed/SavedSearch_ContactCategories_Locus_3_5.mgd.php new file mode 100644 index 0000000..2b65a3c --- /dev/null +++ b/managed/SavedSearch_ContactCategories_Locus_3_5.mgd.php @@ -0,0 +1,81 @@ + 'SavedSearch_ContactCategories_Locus_3_5', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'ContactCategories_Locus_3_5', + 'label' => E::ts('ContactCategories Locus 3.5'), + 'api_entity' => 'Contact', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'COUNT(Contact_Contribution_contact_id_01.id) AS COUNT_Contact_Contribution_contact_id_01_id', + 'SUM(Contact_Contribution_contact_id_01.total_amount) AS SUM_Contact_Contribution_contact_id_01_total_amount', + 'MAX(Contact_Contribution_contact_id_01.total_amount) AS MAX_Contact_Contribution_contact_id_01_total_amount', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => ['id'], + 'join' => [ + [ + 'Contribution AS Contact_Contribution_contact_id_01', + 'INNER', + [ + 'id', + '=', + 'Contact_Contribution_contact_id_01.contact_id', + ], + [ + 'Contact_Contribution_contact_id_01.receive_date', + '>=', + '"now - 24 month"', + ], + [ + 'Contact_Contribution_contact_id_01.contribution_status_id:name', + '=', + '"Completed"', + ], + [ + 'Contact_Contribution_contact_id_01.is_test', + '=', + FALSE, + ], + ], + ], + 'having' => [ + [ + 'COUNT_Contact_Contribution_contact_id_01_id', + '>=', + 3, + ], + [ + 'OR', + [ + [ + 'MAX_Contact_Contribution_contact_id_01_total_amount', + '>=', + NULL, + ], + [ + 'SUM_Contact_Contribution_contact_id_01_total_amount', + '>=', + NULL, + ], + ], + ], + ], + ], + 'description' => E::ts('Multiple time major donors.'), + ], + 'match' => ['name'], + ], + ], +];