Skip to content

Conversation

@kidinov
Copy link
Contributor

@kidinov kidinov commented Oct 17, 2025

WOOMOB-1533

Description

Adds refund information to the historical orders details screen in Woo POS. The order details now display individual refund line items and calculate net payment (total paid minus refunds).

Changes:

  • Added WooPosGetOrderRefundsByOrderId utility to fetch refund data for orders
  • Updated OrderDetailsViewState.TotalsBreakdown to include refunds list and net payment
  • Modified WooPosOrdersViewModel to fetch and format refund amounts
  • Updated WooPosOrderDetails UI to display refunds and net payment sections
  • Added string resources for "Refunded" and "Net Payment" labels

Note: The UI layout is not final and will be refined in subsequent iterations.

Steps to reproduce

  1. Open Woo POS
  2. Navigate to Historical Orders
  3. Select an order that has refunds
  4. Observe the order details screen showing:
    • Total paid with payment method
    • Individual refund line items (if any)
    • Net payment calculation (if refunds exist)

Testing information

  • Verified orders without refunds display correctly (no refund section shown)
  • Verified orders with single refund show refund amount and net payment
  • Verified orders with multiple refunds show all refunds separately
  • Confirmed refund amounts are formatted with negative signs
  • Confirmed net payment calculation is correct (total - sum of refunds)

Images/gif

image
  • 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.

@kidinov kidinov added this to the 23.6 milestone Oct 17, 2025
@kidinov kidinov requested a review from toupper October 17, 2025 15:09
@kidinov kidinov marked this pull request as ready for review October 17, 2025 15:09
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 17, 2025

📲 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
Commit8b8420a
Direct Downloadwoocommerce-wear-prototype-build-pr14779-8b8420a.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 17, 2025

📲 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
Commit8b8420a
Direct Downloadwoocommerce-prototype-build-pr14779-8b8420a.apk

private val refundStore: WCRefundStore,
private val selectedSite: SelectedSite
) {
suspend operator fun invoke(orderId: Long): List<Refund> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider to add tests to this one if necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

8b8420a

Copy link
Contributor

@toupper toupper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @kidinov! LGTM 🚢 :shipit:

@kidinov kidinov enabled auto-merge October 21, 2025 07:12
@kidinov kidinov merged commit 276e84c into trunk Oct 21, 2025
14 of 16 checks passed
@kidinov kidinov deleted the woomob-1533-woo-poshistorical-orders-add-refund-data-to-model-and-screen branch October 21, 2025 07:26
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 24.54545% with 83 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.03%. Comparing base (4222251) to head (8b8420a).
⚠️ Report is 98 commits behind head on trunk.

Files with missing lines Patch % Lines
...ce/android/ui/woopos/orders/WooPosOrdersDetails.kt 0.00% 81 Missing ⚠️
.../android/ui/woopos/orders/WooPosOrdersViewModel.kt 90.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #14779      +/-   ##
============================================
- Coverage     38.04%   38.03%   -0.02%     
- Complexity     9994    10000       +6     
============================================
  Files          2120     2121       +1     
  Lines        119437   119505      +68     
  Branches      16249    16259      +10     
============================================
+ Hits          45445    45451       +6     
- Misses        69406    69468      +62     
  Partials       4586     4586              

☔ 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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants