Skip to content

Staff Welfare Report: Timeout fix (DTO) + add staff filter #19692

@buddhika75

Description

@buddhika75

Problem

The Staff Welfare Report at `/reportInstitution/report_opd_pharmacy_staff_welfare.xhtml` times out on large date ranges due to N+1 lazy-load queries (each row accesses `p.bill.toStaff.person.nameWithTitle` which triggers 3 lazy joins per row).

Additionally, there is no filter to narrow results by a specific staff member.

Fix Required

  1. DTO conversion — Replace entity-based `Payment` list with a single JOIN query returning `StaffWelfarePaymentDTO` (eliminates N+1)
  2. Staff filter — Add `p:autoComplete` staff selector; pass optional staff to DTO query
  3. Print page — Update `report_opd_pharmacy_staff_welfare_print.xhtml` to use DTO list

Files

  • `src/main/java/com/divudi/bean/report/ServiceSummery.java`
  • `src/main/java/com/divudi/core/data/dto/StaffWelfarePaymentDTO.java` (new)
  • `src/main/webapp/reportInstitution/report_opd_pharmacy_staff_welfare.xhtml`
  • `src/main/webapp/reportInstitution/report_opd_pharmacy_staff_welfare_print.xhtml`

Reported By

Galle Co-operative Hospital — session 2026-04-03

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions