Bug Description
Two bugs in PharmacyGrnNativeSqlService (introduced in feat #9e55690e) prevent the GRN view from working:
Bug 1 — Wrong persistence unit name
@PersistenceContext(unitName = "ruhunuPU") references a non-existent persistence unit.
The application fails to deploy with:
Could not resolve a persistence unit corresponding to the persistence-context-ref-name
[com.divudi.service.pharmacy.PharmacyGrnNativeSqlService/em]
Fix: Change to unitName = "hmisPU".
Bug 2 — Hardcoded lowercase table names break case-sensitive MySQL
All table names in the native SQL header and items queries were hardcoded lowercase (bill, department, etc.). On deployments with lower_case_table_names=0 (e.g. local coop), MySQL stores tables as BILL, causing:
SQLSyntaxErrorException: Table 'coop.bill' doesn't exist
Fix: Extend the existing INFORMATION_SCHEMA table-name resolution (already used for PHARMACEUTICALBILLITEM) to cover all tables via a lazy per-instance cache (buildTableCache()).
Bug 3 — GRN search UI: empty Status column and oversized Actions column
- Status column (shows "Cancelled" badge) is empty for active GRN lists → remove it.
- Actions column (
white-space:nowrap) is too wide for a single View button → narrow to 6em.
Files Changed
src/main/java/com/divudi/service/pharmacy/PharmacyGrnNativeSqlService.java
src/main/webapp/resources/pharmacy/search/grn.xhtml
Bug Description
Two bugs in
PharmacyGrnNativeSqlService(introduced in feat #9e55690e) prevent the GRN view from working:Bug 1 — Wrong persistence unit name
@PersistenceContext(unitName = "ruhunuPU")references a non-existent persistence unit.The application fails to deploy with:
Fix: Change to
unitName = "hmisPU".Bug 2 — Hardcoded lowercase table names break case-sensitive MySQL
All table names in the native SQL header and items queries were hardcoded lowercase (
bill,department, etc.). On deployments withlower_case_table_names=0(e.g. local coop), MySQL stores tables asBILL, causing:Fix: Extend the existing
INFORMATION_SCHEMAtable-name resolution (already used forPHARMACEUTICALBILLITEM) to cover all tables via a lazy per-instance cache (buildTableCache()).Bug 3 — GRN search UI: empty Status column and oversized Actions column
white-space:nowrap) is too wide for a single View button → narrow to 6em.Files Changed
src/main/java/com/divudi/service/pharmacy/PharmacyGrnNativeSqlService.javasrc/main/webapp/resources/pharmacy/search/grn.xhtml