Skip to content

Conversation

@samiuelson
Copy link
Contributor

@samiuelson samiuelson commented Jan 20, 2026

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

  • Open POS refund dialog with multiple items
  • Test individual item selection/deselection and verify amounts recalculate correctly
  • Test "Select All" toggle functionality
  • Verify the Continue button is disabled when no items are selected
  • Process a partial refund and verify only selected items are refunded

💡 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
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

Copy link
Contributor

Copilot AI left a 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.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 20, 2026

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App NameWooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit2925df4
Direct Downloadwoocommerce-wear-prototype-build-pr15221-2925df4.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 20, 2026

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit2925df4
Direct Downloadwoocommerce-prototype-build-pr15221-2925df4.apk

samiuelson and others added 2 commits January 21, 2026 12:19
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-commenter
Copy link

codecov-commenter commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 49.42529% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.75%. Comparing base (cad76f2) to head (2925df4).

Files with missing lines Patch % Lines
...ndroid/ui/woopos/orders/WooPosIssueRefundDialog.kt 0.00% 38 Missing ⚠️
.../android/ui/woopos/orders/WooPosRefundViewModel.kt 86.36% 3 Missing and 3 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samiuelson samiuelson changed the title Implement partial refund [Woo POS] Partial refunds Jan 21, 2026
@samiuelson samiuelson added this to the 24.0 milestone Jan 21, 2026
@samiuelson samiuelson added Bug type: task An internally driven task. and removed Bug labels Jan 21, 2026
@wpmobilebot wpmobilebot modified the milestones: 24.0, 24.1 Jan 23, 2026
@wpmobilebot
Copy link
Collaborator

Version 24.0 has now entered code-freeze, so the milestone of this PR has been updated to 24.1.

@samiuelson samiuelson marked this pull request as ready for review January 23, 2026 14:43
@samiuelson samiuelson requested a review from Copilot January 23, 2026 14:43
Copy link
Contributor

Copilot AI left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants