Page MenuHomeIn-Portal Phabricator

MINC-214 - Unify total calculation for Sale Reports
AcceptedPublic

Authored by alex on Thu, Dec 11, 4:09 AM.

Details

Reviewers
erik
Test Plan

Preparations

  1. apply the patch from the D547 (if not already applied)
  2. login to the Admin Console
  3. go to the Website & ContentStructure & DataProducts section
  4. create a Sub Products category/section
  5. switch to a newly created category/section
  6. create a Type=Service product + Status=Active + Price=15.00 product in it
  7. if the product price wasn't saved, then try editing that product -> specifying a price -> saving it again
  8. create a Type=Service product + Status=Active + Price=5.00 product in it
  9. if the product price wasn't saved, then try editing that product -> specifying a price -> saving it again
  10. go to the User ManagementUsers section
  11. create a Status=Enabled user
  12. go to the E-commerceOrders section
  13. switch to the Incomplete tab
  14. create a new incomplete order:
    • use the above-created user and products (several with different quantities)
    • fill all required fields on all tabs
  15. on the Incomplete tab:
    • select the newly created sales order
    • press the Place Order toolbar button
  16. in IDE:
    • open the modules/in-commerce/units/reports/reports_event_handler.php file for editing
    • in the report:OnUpdateConfig event change 'totals' => 'sum' into 'totals' => 'avg' for the Amount field declaration
    • save changes

Test Plan

  1. login to the Admin Console
  2. go to the E-commerceSales Report section
  3. run the By Product report
  4. confirm that total below grid in the Amount column is an average (not sum) of the 2 shown grid rows
  5. perform the CSV export by pressing an Export button on the toolbar
  6. confirm that the same average value is shown in the export CSV file as well

Diff Detail

Repository
rINP In-Portal
Branch
branches/5.2.x
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 11167
Build 3867: arc lint + arc unit

Event Timeline

alex created this revision.Thu, Dec 11, 4:09 AM
alex requested review of this revision.Thu, Dec 11, 4:09 AM
Harbormaster completed remote builds in B11166: Diff 1416.
alex edited the test plan for this revision. (Show Details)Thu, Dec 11, 4:10 AM
alex updated this revision to Diff 1417.Thu, Dec 11, 4:42 AM

Cosmetic change.

erik accepted this revision.Thu, Dec 11, 4:56 AM
This revision is now accepted and ready to land.Thu, Dec 11, 4:56 AM
erik added a comment.Thu, Dec 11, 4:57 AM

"use the above-created user and products (several with different quantities)"

Service product quantity is always 1.

alex edited the test plan for this revision. (Show Details)Thu, Dec 11, 6:34 AM