From e751e124b1d38e4babb86d3680946348d5cb8012 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sun, 21 Jun 2026 09:16:19 -0500 Subject: [PATCH 1/7] fix: GROUP BY includes all non-aggregated columns for ONLY_FULL_GROUP_BY compat --- .../src/Helper/DonorRetentionHelper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/packages/plg_system_mokosuitenpo/src/Helper/DonorRetentionHelper.php b/source/packages/plg_system_mokosuitenpo/src/Helper/DonorRetentionHelper.php index 6b20186..20c7cf3 100644 --- a/source/packages/plg_system_mokosuitenpo/src/Helper/DonorRetentionHelper.php +++ b/source/packages/plg_system_mokosuitenpo/src/Helper/DonorRetentionHelper.php @@ -28,7 +28,7 @@ class DonorRetentionHelper ->join('INNER', $db->quoteName('#__mokosuitenpo_donations', 'd') . ' ON d.contact_id = cd.id') ->where('YEAR(d.donation_date) = ' . $lastYear) ->where('cd.id NOT IN (SELECT d2.contact_id FROM #__mokosuitenpo_donations d2 WHERE YEAR(d2.donation_date) = ' . $currentYear . ')') - ->group('cd.id') + ->group('cd.id, cd.name, cd.email_to, cd.telephone') ->order('last_year_total DESC')); return $db->loadObjectList() ?: []; @@ -53,7 +53,7 @@ class DonorRetentionHelper ->join('INNER', $db->quoteName('#__mokosuitenpo_donations', 'd') . ' ON d.contact_id = cd.id') ->where('YEAR(d.donation_date) BETWEEN ' . $startYear . ' AND ' . $lastYear) ->where('cd.id NOT IN (SELECT d2.contact_id FROM #__mokosuitenpo_donations d2 WHERE YEAR(d2.donation_date) = ' . $currentYear . ')') - ->group('cd.id') + ->group('cd.id, cd.name, cd.email_to') ->order('lifetime_total DESC')); return $db->loadObjectList() ?: []; -- 2.52.0 From 0ecb311894b3145bf681342e1c5e620d475a320e Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Sun, 21 Jun 2026 14:17:06 +0000 Subject: [PATCH 2/7] chore(version): auto-bump patch 01.05.01-dev [skip ci] --- .mokogitea/workflows/issue-branch.yml | 2 +- source/packages/com_mokosuitenpo/mokosuitenpo.xml | 2 +- source/pkg_mokosuitenpo.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index 33cf916..3aea2aa 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokocli.Automation -# VERSION: 01.05.00 +# VERSION: 01.05.01 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/source/packages/com_mokosuitenpo/mokosuitenpo.xml b/source/packages/com_mokosuitenpo/mokosuitenpo.xml index c530e3e..d6986a3 100644 --- a/source/packages/com_mokosuitenpo/mokosuitenpo.xml +++ b/source/packages/com_mokosuitenpo/mokosuitenpo.xml @@ -7,7 +7,7 @@ GPL-3.0-or-later hello@mokoconsulting.tech https://mokoconsulting.tech - 01.05.00 + 01.05.01 8.3 MokoSuite NPO component Moko\Component\MokoSuiteNpo diff --git a/source/pkg_mokosuitenpo.xml b/source/pkg_mokosuitenpo.xml index 44fa230..dc5bf05 100644 --- a/source/pkg_mokosuitenpo.xml +++ b/source/pkg_mokosuitenpo.xml @@ -2,7 +2,7 @@ Package - MokoSuite NPO mokosuitenpo - 01.05.00 + 01.05.01 2026-06-11 Moko Consulting hello@mokoconsulting.tech -- 2.52.0 From 0a8095bf0cc04c762dbb3f942cdec19a870507b9 Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Sun, 21 Jun 2026 14:17:17 +0000 Subject: [PATCH 3/7] chore(version): pre-release bump to 01.05.02-dev [skip ci] --- .mokogitea/workflows/issue-branch.yml | 2 +- source/packages/com_mokosuitenpo/mokosuitenpo.xml | 2 +- source/pkg_mokosuitenpo.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index 3aea2aa..7d01a20 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokocli.Automation -# VERSION: 01.05.01 +# VERSION: 01.05.02 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/source/packages/com_mokosuitenpo/mokosuitenpo.xml b/source/packages/com_mokosuitenpo/mokosuitenpo.xml index d6986a3..615a9aa 100644 --- a/source/packages/com_mokosuitenpo/mokosuitenpo.xml +++ b/source/packages/com_mokosuitenpo/mokosuitenpo.xml @@ -7,7 +7,7 @@ GPL-3.0-or-later hello@mokoconsulting.tech https://mokoconsulting.tech - 01.05.01 + 01.05.02 8.3 MokoSuite NPO component Moko\Component\MokoSuiteNpo diff --git a/source/pkg_mokosuitenpo.xml b/source/pkg_mokosuitenpo.xml index dc5bf05..581d4a9 100644 --- a/source/pkg_mokosuitenpo.xml +++ b/source/pkg_mokosuitenpo.xml @@ -2,7 +2,7 @@ Package - MokoSuite NPO mokosuitenpo - 01.05.01 + 01.05.02 2026-06-11 Moko Consulting hello@mokoconsulting.tech -- 2.52.0 From 34774148f05b1edb5a15894a3f14126ee7cc1565 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sun, 21 Jun 2026 09:21:37 -0500 Subject: [PATCH 4/7] =?UTF-8?q?feat:=20InKindDonationHelper=20=E2=80=94=20?= =?UTF-8?q?non-cash=20gifts,=20FMV=20tracking,=20IRS=20appraisal=20thresho?= =?UTF-8?q?ld?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Helper/InKindDonationHelper.php | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 source/packages/plg_system_mokosuitenpo/src/Helper/InKindDonationHelper.php diff --git a/source/packages/plg_system_mokosuitenpo/src/Helper/InKindDonationHelper.php b/source/packages/plg_system_mokosuitenpo/src/Helper/InKindDonationHelper.php new file mode 100644 index 0000000..07bdc93 --- /dev/null +++ b/source/packages/plg_system_mokosuitenpo/src/Helper/InKindDonationHelper.php @@ -0,0 +1,96 @@ +get(DatabaseInterface::class); + $filter = \Joomla\Filter\InputFilter::getInstance(); + + $donation = (object) [ + 'contact_id' => $contactId, + 'description' => $filter->clean($description, 'STRING'), + 'fair_market_value'=> $fairMarketValue, + 'category' => $category, + 'status' => 'received', + 'received_at' => Factory::getDate()->toSql(), + ]; + + $db->insertObject('#__mokosuitenpo_inkind_donations', $donation, 'id'); + + return (object) ['success' => true, 'donation_id' => (int) $donation->id]; + } + + /** + * Get in-kind donation summary by category for a period. + */ + public static function getSummary(string $from = '', string $to = ''): array + { + $from = $from ?: date('Y-01-01'); + $to = $to ?: date('Y-m-d'); + + if (!\DateTime::createFromFormat('Y-m-d', $from) || !\DateTime::createFromFormat('Y-m-d', $to)) { + throw new \InvalidArgumentException('Date parameters must be Y-m-d format.'); + } + + $db = Factory::getContainer()->get(DatabaseInterface::class); + + $db->setQuery($db->getQuery(true) + ->select('ik.category') + ->select('COUNT(*) AS donation_count') + ->select('SUM(ik.fair_market_value) AS total_value') + ->select('AVG(ik.fair_market_value) AS avg_value') + ->from($db->quoteName('#__mokosuitenpo_inkind_donations', 'ik')) + ->where('DATE(ik.received_at) BETWEEN ' . $db->quote($from) . ' AND ' . $db->quote($to)) + ->group('ik.category') + ->order('total_value DESC')); + + $results = $db->loadObjectList() ?: []; + + foreach ($results as &$r) { + $r->avg_value = round((float) $r->avg_value, 2); + } + + return $results; + } + + /** + * Get donations needing appraisal (over $5,000 threshold per IRS rules). + */ + public static function getNeedingAppraisal(): array + { + $db = Factory::getContainer()->get(DatabaseInterface::class); + + $db->setQuery($db->getQuery(true) + ->select('ik.*, cd.name AS donor_name') + ->from($db->quoteName('#__mokosuitenpo_inkind_donations', 'ik')) + ->join('LEFT', $db->quoteName('#__contact_details', 'cd') . ' ON cd.id = ik.contact_id') + ->where('ik.fair_market_value > 5000') + ->where('ik.appraisal_date IS NULL') + ->where($db->quoteName('ik.category') . ' NOT IN (' . $db->quote('securities') . ')') + ->order('ik.fair_market_value DESC')); + + return $db->loadObjectList() ?: []; + } +} -- 2.52.0 From e75b2578181a1840032fea57614f6abf62c69d06 Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Sun, 21 Jun 2026 14:21:56 +0000 Subject: [PATCH 5/7] chore(version): auto-bump patch 01.05.03-dev [skip ci] --- .mokogitea/workflows/issue-branch.yml | 2 +- source/packages/com_mokosuitenpo/mokosuitenpo.xml | 2 +- source/pkg_mokosuitenpo.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index 7d01a20..add3fc8 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokocli.Automation -# VERSION: 01.05.02 +# VERSION: 01.05.03 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/source/packages/com_mokosuitenpo/mokosuitenpo.xml b/source/packages/com_mokosuitenpo/mokosuitenpo.xml index 615a9aa..aaa7f7b 100644 --- a/source/packages/com_mokosuitenpo/mokosuitenpo.xml +++ b/source/packages/com_mokosuitenpo/mokosuitenpo.xml @@ -7,7 +7,7 @@ GPL-3.0-or-later hello@mokoconsulting.tech https://mokoconsulting.tech - 01.05.02 + 01.05.03 8.3 MokoSuite NPO component Moko\Component\MokoSuiteNpo diff --git a/source/pkg_mokosuitenpo.xml b/source/pkg_mokosuitenpo.xml index 581d4a9..aef5a6a 100644 --- a/source/pkg_mokosuitenpo.xml +++ b/source/pkg_mokosuitenpo.xml @@ -2,7 +2,7 @@ Package - MokoSuite NPO mokosuitenpo - 01.05.02 + 01.05.03 2026-06-11 Moko Consulting hello@mokoconsulting.tech -- 2.52.0 From 194cb413711ec8bb0c8720ff5c55f0f4fbb4aa71 Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Sun, 21 Jun 2026 14:22:07 +0000 Subject: [PATCH 6/7] chore(version): pre-release bump to 01.05.04-dev [skip ci] --- .mokogitea/workflows/issue-branch.yml | 2 +- source/packages/com_mokosuitenpo/mokosuitenpo.xml | 2 +- source/pkg_mokosuitenpo.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index add3fc8..a09da24 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokocli.Automation -# VERSION: 01.05.03 +# VERSION: 01.05.04 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/source/packages/com_mokosuitenpo/mokosuitenpo.xml b/source/packages/com_mokosuitenpo/mokosuitenpo.xml index aaa7f7b..67abe57 100644 --- a/source/packages/com_mokosuitenpo/mokosuitenpo.xml +++ b/source/packages/com_mokosuitenpo/mokosuitenpo.xml @@ -7,7 +7,7 @@ GPL-3.0-or-later hello@mokoconsulting.tech https://mokoconsulting.tech - 01.05.03 + 01.05.04 8.3 MokoSuite NPO component Moko\Component\MokoSuiteNpo diff --git a/source/pkg_mokosuitenpo.xml b/source/pkg_mokosuitenpo.xml index aef5a6a..edc0f4d 100644 --- a/source/pkg_mokosuitenpo.xml +++ b/source/pkg_mokosuitenpo.xml @@ -2,7 +2,7 @@ Package - MokoSuite NPO mokosuitenpo - 01.05.03 + 01.05.04 2026-06-11 Moko Consulting hello@mokoconsulting.tech -- 2.52.0 From 40b85b533bfa4785cce9a5da7adab05b2aef401e Mon Sep 17 00:00:00 2001 From: Jonathan Miller <1+jmiller@noreply.git.mokoconsulting.tech> Date: Sun, 21 Jun 2026 14:06:46 +0000 Subject: [PATCH 7/7] chore: sync issue-branch.yml from Template-Generic [skip ci] --- .mokogitea/workflows/issue-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index a09da24..75a6963 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokocli.Automation -# VERSION: 01.05.04 +# VERSION: 01.00.00 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" -- 2.52.0