Improve reporting: fix existing totals and evaluate new reports
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
Research direction
This is a planning issue, so agree on the scope before writing code. Start with the summary report actions in Purchasing.Mvc/Controllers/ReportController.cs and the search and aggregation queries in Purchasing.Core/Services/IndexSearchService.cs, which show where the 1,000-order cap applies. Done means full-dataset totals match SQL for sample data, exports cover the whole dataset, and workgroup scope is enforced server-side.
Written by the indexing model from the issue text.
Description
People report that Purchasing's reporting is limited, but we need to turn that feedback into specific improvements. Start by making existing totals trustworthy, then choose useful additional reports with clear definitions and practical permission scopes.
Keep this as one planning issue for now. New reports below are candidates to discuss, not a committed delivery list. Do not create subissues until we have agreed on the work.
The maintainer reports that the system has run in its current form for roughly a decade, serving thousands of daily users with essentially no operational issues. Preserve that stability. Query changes, small reliability improvements, and an additional reporting index are reasonable options where they solve a concrete need.
Fixing existing totals is the first implementation priority.
The workgroup, primary-organization, and vendor summary reports currently fetch at most 1,000 matching orders from Elasticsearch and count those returned rows in application code. A warning appears at the limit, but the displayed totals can still be incomplete.
- Calculate totals over the full authorized matching dataset, using SQL aggregation or Elasticsearch aggregation.
- Clearly define the date basis. Current summaries show the current status of orders created during the selected period; that is different from orders completed during the period.
- Make entered date ranges behave consistently, including the entire selected end date.
- Use consistent outcome definitions. Successful completion should distinguish
CP/CNfrom canceled and denied orders;IsCompletealone includes all of these. - Decide how historical reports include inactive workgroups and how administrative rollups are displayed without suggesting that overlapping parent/child rows can be summed.
- Make export coverage explicit and consistent with the report. A spreadsheet containing only the displayed 1,000 rows is not a complete dataset.
- Verify representative totals against SQL and check report scope enforcement, including workgroup IDs supplied through query parameters.
These fixes should not depend on redesigning the indexing pipeline.
The following new reports look useful. Select the initial set and agree on definitions here before implementation.
| Candidate | Useful result | Likely data/access approach and decisions |
|---|---|---|
| Department backlog and aging | Open orders by workgroup/status, age buckets, past-needed-date orders, and orders with no recent activity | Workgroup-scoped order data. Distinguish order age, time since last activity, and time in the current stage. The first two are simpler. |
| Monthly request volume and outcomes | Demand and completion/cancellation trends | Creation-month/current-status reporting is straightforward. Completion-month throughput needs tracking events or a completion-date projection and a definition for reopened/recompleted orders. |
| Receiving and AP follow-up | Completed orders still unreceived, partially received, or marked unpaid, grouped by workgroup or AP assignee | Existing order/line data and AP assignment. These are Purchasing's recorded receipt/payment states, not verified financial-system settlement. Discuss how canceled or otherwise resolved items leave the follow-up list. |
| Permission maintenance | Inactive members, inactive conditional approvers, missing conditional alternates, and account assignments needing review | SQL configuration data. Include conditional-only assignments in user views. A null named approver can intentionally mean a workgroup pool, so it is not automatically a configuration error. |
| My requests | Requests I created, their status, age, needed date, and receiving progress | Creator-based scope may avoid enumerating every order the user can otherwise access. |
| Account/project allocation | Requested amounts by account or chartstring | A later candidate requiring more discussion. Use structured splits and allocated amounts, avoid counting the whole order against every split, and define cross-department access. |
Permissions should follow the question the report answers. Existing management reports mostly resolve the departmental admin's organizations into authorized workgroups. This is much simpler than calculating every order a person can approve.
- Department totals and backlog can use an authorized workgroup scope without reproducing all conditional-approver, away/backup, and ad hoc routing rules.
- Creator and AP-assignee scopes can support focused personal reports.
- Consider a separate read-only reporting role if managers or purchasers need broader reporting without departmental administration or approval authority. The audience and scope still need agreement.
- “Which orders can I see?” and “Who can act next?” require the existing order-level access rules. A future “who has access, and why?” diagnostic should reuse those rules.
- Order-owning workgroup, primary organization, and account-funding organization are different dimensions. Agree on which one each report represents.
- Validate report scope on the server. Aggregate visibility, detailed order visibility, and permission to act are separate decisions.
Use Elasticsearch where it helps, with targeted improvements when justified. Most summary/timing reports already use it. SQL remains useful for current routing, permissions, and structured account splits. Simple workgroup-scoped SQL reporting does not necessarily need the expensive per-user order-access functions.
Source review raised questions about the indexer's ten-minute lookback, behavior when an update spans multiple 1,000-order batches, and unchecked bulk results. These are investigation topics, not evidence that production is routinely losing data or having outages. Evaluate actual impact before changing established behavior. Small error checks, clearer freshness information, focused update-logic fixes, or a separate reporting projection/index are options to discuss if needed. A broad migration or indexing rewrite is not required for this reporting work.
If adding Elasticsearch aggregations, apply the authorized scope to the aggregation query itself. The existing history query uses post_filter for allowed order IDs, which filters returned rows but does not restrict aggregation results.
Current reporting inventory and source findings
All eight Reports-menu entries require departmental-admin access.
| Existing report | Source | Main limitations |
|---|---|---|
| Purchaser Daily Workload | SQL OrderTracking and vOrderHistory |
Selected-day completion events plus current pending orders, not historical backlog. Text-based event matching and purchaser display-name matching complicate attribution. |
| Purchaser Processing Time by Workgroup | opp-orderhistory plus individual SQL order/tracking reads |
Creation-month cohort; defaults to rerouted orders; 1,000-order cap before further filtering; uses the last reroute and parses event descriptions. |
| Processing Time by Workgroup | opp-ordertracking |
Full-set indexed averages, but at most 1,000 detail/treemap records. Includes canceled/denied through IsComplete. Selecting an administrative workgroup does not expand its children. |
| Processing Time by Role | opp-ordertracking aggregations |
One selected actor per role, no separate conditional-approval timing, default top-ten person buckets, and 1,000 detail rows. |
| Permissions | SQL permissions, users, conditional-approval definitions | Workgroup view includes conditional primary/secondary approvers. User view omits conditional-only assignments. It does not explain effective access to an individual order. |
| Order Summary by Workgroup | opp-orderhistory plus SQL metadata |
Counts fetched rows up to 1,000. Inactive workgroups and inheritance rules affect coverage; parent/child rows overlap. |
| Order Summary by Primary Organization | Same | Same cap; attribution uses the workgroup's current primary organization rather than funding splits or historical organization. |
| Order Summary by Vendor | Same | Same cap; vendor display strings include address information and can fragment a supplier into multiple groups. Reports order counts rather than spending. |
Other reporting includes order history/admin/AP lists with exports, a Workload endpoint absent from the Reports menu, single-order PDFs, and an overall statistics endpoint. History lists return at most 1,000 displayed rows. The older Workload view has no date filter and joins historical activity to current membership.
The timing index flattens events into one order record with selected approver/account-manager/purchaser actors and elapsed calendar durations. It cannot fully explain conditional approvals, repeated approvals, handoffs, or time spent waiting. Avoid treating these durations as individual labor or performance measures without discussing their meaning.
The current Aggie Enterprise financial-officer lookup returns no officer and IsExternal = false. A new external-account report cannot rely on that flag alone. Account classification and legacy/current routing behavior need discussion.
Sources reviewed at 685bc30:
- Report controller
- Search and aggregation queries
- Workgroup reporting scope
- Workgroup authorization attribute
- Indexer and timing projection
- Permissions display
- Aggie Enterprise financial-officer lookup
- Elasticsearch aggregation filtering
These are source-level findings. Production completeness, query performance, and the frequency or impact of indexing edge cases have not been measured in this assessment.
Existing requests provide useful background and remain separate:
- #375: department reporting for unreceived and partially received orders.
- #354: receiving, payment, and days-without-activity reporting.
- #413: resolving follow-up without falsely marking canceled/unfulfilled items received.
- #301: monthly/custom-date purchaser workload.
- #453: supervisor workload delivery and a possible weekly view.
- Dominant language
- C#
- Stars
- 7
- Forks
- 5
- Avg merge
- 9h 3m
- Merged PRs (30d)
- 5
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ucdavis/Purchasing
-
remove elmahOpen
Difficulty 1/5 Under an hour Newbie friendliness 68/100
ucdavis/Purchasing#436 ·
-
Refactor configsPossibly taken @jSylvestre claimed this 10 days ago. Open
ucdavis/Purchasing#683 · 1 assignee ·
-
Add local resumable search backfill and verification runnerPossibly taken @srkirkland claimed this 24 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
ucdavis/Purchasing#678 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
ucdavis/Purchasing#677 ·
-
AE API field length issueMay be free again @jSylvestre claimed this 39 days ago, and no pull request is open. Open
ucdavis/Purchasing#665 · 1 assignee ·
All issues in ucdavis/Purchasing
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Bug IronPython Python 3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pyrevitlabs/pyRevit#4184 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
yusei36/KeePassPasskey#66 · 2 comments ·
Maintainers usually reply within 1 day
-
🐛 bug 🕒 low effort good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
guibranco/Sankhya-SDK-dotnet#654 ·
Maintainers usually reply within 1 day
-
巫女のセリフに声を付けるOpenassets claude-proposal
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Fialuxe/MouthOfGod_System#358 ·
Maintainers usually reply within 1 day