Skip to content

[Woo POS] Calculate and Display Order Totals on Totals Screen #11720

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

Merged
merged 23 commits into from
Jun 19, 2024

Conversation

backwardstruck
Copy link
Contributor

@backwardstruck backwardstruck commented Jun 12, 2024

Closes: #11694

Description

Implements the calculation and display of order totals on the Totals screen. After order ID is passed from the cart screen to the totals screen, the relevant order data is retrieved from the database, and then the totals (subtotal and tax) are calculated and displayed.

PR is based on PR #11717, which should be merged first.

Follow up work to clean up UI and formatting will be done in this ticket:

[Woo POS] Update Totals View UI with Subtotals from Cart Total

Steps to reproduce

  1. Go to the POS screen in settings.
  2. Add items to the cart.
  3. Tab button to checkout.
  4. Observe the displayed totals, including the subtotal and tax.

Testing information

Scenarios to test:

  • Adding items to the cart and navigating to the Totals screen.
  • Verifying that the correct totals (subtotal and tax) are calculated and displayed.

Devices tested:

  • Android Emulator (tablet, Pixel phone)

Images/gif

Screenshot_20240613_182334

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

@backwardstruck backwardstruck added type: task An internally driven task. feature: point of sale POS project labels Jun 12, 2024
@backwardstruck backwardstruck linked an issue Jun 12, 2024 that may be closed by this pull request
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jun 12, 2024

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

App Name WooCommerce Android
FlavorJalapeno
Build TypeDebug
Commit59cb5e4
Direct Downloadwoocommerce-prototype-build-pr11720-59cb5e4.apk

Base automatically changed from 11709-woo-pos-pass-order-data-to-totals-screen-after-it-being-created to trunk June 13, 2024 21:05
@backwardstruck backwardstruck marked this pull request as ready for review June 13, 2024 22:24
@backwardstruck backwardstruck modified the milestones: 19.2, 19.1 Jun 13, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 0% with 30 lines in your changes missing coverage. Please review.

Project coverage is 40.22%. Comparing base (f040b34) to head (4278021).

Current head 4278021 differs from pull request most recent head a81e7c0

Please upload reports for the commit a81e7c0 to get more accurate results.

Files Patch % Lines
...oid/ui/woopos/home/totals/WooPosTotalsViewModel.kt 0.00% 27 Missing ⚠️
...android/ui/woopos/home/totals/WooPosTotalsState.kt 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #11720      +/-   ##
============================================
- Coverage     40.24%   40.22%   -0.02%     
  Complexity     5331     5331              
============================================
  Files          1132     1132              
  Lines         65288    65317      +29     
  Branches       9056     9057       +1     
============================================
  Hits          26273    26273              
- Misses        36594    36623      +29     
  Partials       2421     2421              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@samiuelson samiuelson left a comment

Choose a reason for hiding this comment

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

Good progress @backwardstruck! I added some improvement ideas. Let me know what you think.

@backwardstruck
Copy link
Contributor Author

Thanks for the feedback @samiuelson This is now updated.

@samiuelson samiuelson self-assigned this Jun 19, 2024
Copy link
Contributor

@samiuelson samiuelson left a comment

Choose a reason for hiding this comment

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

🚀 Looks good @backwardstruck! I proposed a few more improvements that you can consider implementing though.

backwardstruck and others added 2 commits June 19, 2024 08:11
…home/totals/WooPosTotalsState.kt


Make immutable

Co-authored-by: Samuel Urbanowicz <samiuelson@gmail.com>
…home/totals/WooPosTotalsViewModel.kt


Use IllegalStateException

Co-authored-by: Samuel Urbanowicz <samiuelson@gmail.com>
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 19.2. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@backwardstruck backwardstruck enabled auto-merge June 19, 2024 12:16
@backwardstruck backwardstruck merged commit a84b138 into trunk Jun 19, 2024
14 checks passed
@backwardstruck backwardstruck deleted the 11694-woo-pos-totals-view branch June 19, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: point of sale POS project type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Woo POS] Totals view
5 participants