Repository navigation
Fix: Add Debit Card filter to Daily Sales and Takings - #4440
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR adds support for filtering debit payment types in the Sales module. The changes introduce a new "only_debit" filter to the Sales controller and corresponding query-building logic in the Sale model, following the established patterns for cash, credit, and due payment filters. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip CodeRabbit can suggest fixes for GitHub Check annotations.Configure the |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/Controllers/Sales.php`:
- Line 95: The defaults returned by the Sales controller's getSearch() are
missing the 'only_debit' key which causes PHP warnings when
App\Models\Sale::add_filters_to_query() and ::get_payments_summary() read it;
add the 'only_debit' entry to the defaults array in getSearch() (initialize it
to a boolean, e.g. false) so the key always exists and has the correct type
before those Sale methods access it.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8abaf8b8-d0e8-4b32-81d2-15d717877990
📒 Files selected for processing (4)
app/Controllers/Sales.phpapp/Language/en-GB/Sales.phpapp/Language/en/Sales.phpapp/Models/Sale.php
Add 'only_debit' filter to Daily Sales and Takings dropdown. Reuses existing 'Sales.debit' language string for the filter label. Includes filter default initialization in getSearch() to prevent PHP warnings. Fixes #4439
ea7ec23 to
80826b4
Compare
Summary
only_debitfilter to Daily Sales and Takings dropdowndebit_filterlanguage key (was empty) inenanden-GBlocalesSalemodel for both payment summary and sales listing queriesDetails
The Daily Sales/Takings view was missing the Debit Card filter in the dropdown, even though Debit is a valid payment type. This PR adds:
Sales.php): Added'only_debit' => lang('Sales.debit_filter')to the filters arraySale.php): Added two filter conditions for debit payments (one for payment summary, one for sales listing)debit_filterfrom empty string to"Debit Card"inenanden-GBFixes #4439
Summary by CodeRabbit