-
Notifications
You must be signed in to change notification settings - Fork 138
[Woo POS] Partial refunds #15221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
[Woo POS] Partial refunds #15221
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements partial refund functionality, allowing users to select specific items to refund instead of refunding all items at once. The implementation adds item selection controls (individual checkboxes and a select-all toggle) and recalculates refund amounts based on the selected items.
Changes:
- Added unique ID generation for refundable items to support individual item tracking
- Implemented item selection state management with checkbox interactions
- Added recalculation logic to compute subtotal, taxes, and total based on selected items
- Modified UI to display checkboxes for individual items and a select-all toggle
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| WooPosRefundableItem.kt | Added uniqueId computed property combining orderItemId and rowIndex to uniquely identify each refundable item |
| WooPosRefundViewModel.kt | Added state caching, item selection handling, select-all toggle, and refund recalculation logic for partial refunds |
| WooPosRefundUIEvent.kt | Added ItemSelectionToggled and SelectAllToggled events for user interactions |
| WooPosRefundState.kt | Added selectedItemIds field to track which items are selected for refund |
| WooPosIssueRefundDialog.kt | Updated UI with interactive checkboxes, disabled state for Continue button when no items selected, and proper event handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/orders/WooPosRefundViewModel.kt
Show resolved
Hide resolved
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
Integrates latest trunk changes including refund reason navigation feature with the partial refund selection functionality. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #15221 +/- ##
=========================================
Coverage 38.74% 38.75%
- Complexity 10598 10608 +10
=========================================
Files 2201 2201
Lines 125126 125190 +64
Branches 17331 17340 +9
=========================================
+ Hits 48481 48515 +34
- Misses 71729 71757 +28
- Partials 4916 4918 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…d clarity and consistency
…tial-refund-for-the-order
|
Version |
…tial-refund-for-the-order
…tial-refund-for-the-order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
This PR implements partial refund functionality, allowing users to select specific items to refund instead of refunding all items at once. The implementation adds item selection controls (individual checkboxes and a select-all toggle) and recalculates refund amounts based on the selected items.
Test Steps
💡 Note: It's a known issue that the refund flow doesn't reset to the initial step when you click the Issue Refund button again after creating the first refund. You need to go back to POS Home screen and re-enter POS Orders to reset refund step. Issue: WOOMOB-1951
Images/gif
partial-demo.mp4
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.