Skip to content

Fix View Bill missing Item and Quantity on Direct Issue to BHT Return#22054

Merged
buddhika75 merged 14 commits into
developmentfrom
22035-view-bill-missing-items-bht-return
Jul 13, 2026
Merged

Fix View Bill missing Item and Quantity on Direct Issue to BHT Return#22054
buddhika75 merged 14 commits into
developmentfrom
22035-view-bill-missing-items-bht-return

Conversation

@buddhika75

@buddhika75 buddhika75 commented Jul 12, 2026

Copy link
Copy Markdown
Member

Summary

On the Direct Issue to BHT Return page, clicking View Bill did not display the Item and Quantity details, so users could not verify the returned items.

Root cause: When reached from the BHT Issue Return page, bill is a detached entity whose billItems were never fetched, so the reprint page's Item/QTY table rendered empty.

Changes

  • PharmacyBillSearch.java — reload the bill with its billItems (via billBean.fetchBillWithItemsAndFees) before navigating to the reprint page, so the Item/QTY table is populated.
  • pharmacy_reprint_bill_sale_bht.xhtml — relabel the page header to Manage Direct Issue to BHT.
  • inpatient_pharmacy_direct_issues_list.xhtml — add a Manage Bill action alongside View Bill, so both are available from the direct issues list. View Bill now routes through navigateToViewBillByAtomicBillTypeByBillId.

Follow-up: Service Charge / Discount on printed bills + A4/FiveFive/POS formats

Extended the inpatient direct-issue bill family so every printed/preview bill shows, per item and at bill level, Gross / Service Charge / Discount / Net (margin is labelled "Service Charge" at every location), selectable across A4 / FiveFive / POS paper via a standard print-config gear dialog.

What changed

  • New print composites (9): three DTO-based (PrintBillData) for the native direct-issue page, three entity-based (Bill) for the issue side of the return/reprint pages, and three entity-based for the return side — each in A4, FiveFive and POS layouts. All show the four money columns per item and at bill level.
  • New print-format config: PharmacyConfigController gains three application-wide keys — Pharmacy Inward Direct Issue Bill is A4 (default off) / is FiveFive (default on) / is POS (default off) — plus a saveInwardDirectIssueBillPaperConfig() action. A gear/Settings dialog (privilege ChangeReceiptPrintingPaperTypes, h:selectBooleanCheckbox per format) is wired on the direct-issue, reprint, return and reprint-return pages, following developer_docs/configuration/printer-configuration-system.md.
  • Wiring: pharmacy_bill_issue_bht.xhtml, pharmacy_reprint_bill_sale_bht.xhtml, pharmacy_bill_return_bht_issue.xhtml, pharmacy_reprint_bill_return_bht.xhtml render the new composites behind the three keys.
  • View Bill tables: relabelled the on-screen "Matrix Value" column to "Service Charge" and added a Discount column (with corrected footer colspan and a reconciling netValue) on the reprint-sale and reprint-return pages.

Safeguards

  • The DTO composites shared with the retail/wholesale native sale pages (inward_direct_issue_bill_native_five_five_custom_3, saleBill_Header_Inward_native) are not touched — sale bills are unaffected.
  • Old composites/keys are kept in place, only default-flipped off, so any deployment relying on them can re-enable them.
  • Legacy departmentPreference.pharmacyBillPaperType preview panels are guarded so they don't render alongside the new default format (no double-print).
  • Money columns keep the existing Nursing IP Billing - Show Rate and Value + NursingIPBillingViewRates gating.

Testing

Issue #22035 steps:

  1. Create a Direct Issue to BHT transaction.
  2. Process a return for the issued items.
  3. Navigate to the Direct Issue to BHT Return page.
  4. Click View Bill → Item and Quantity details now render.

Print-format follow-up: compile + XHTML well-formedness verified; end-to-end print verification (A4/FiveFive/POS across issue, reprint, return, reprint-return) pending against a redeployed local instance.

Closes #22035

🤖 Generated with Claude Code

Reload the BHT return bill with its billItems before navigating to the
reprint page. Previously the detached bill's billItems were never
fetched, so the Item/QTY table rendered empty. Also add a "Manage Bill"
action alongside "View Bill" so both are available from the direct
issues list.

Closes #22035

Signed-off-by: Dr M H B Ariyaratne <buddhika.ari@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@buddhika75, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 25 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 40a67f86-a359-4941-bee3-8e515dce0a53

📥 Commits

Reviewing files that changed from the base of the PR and between 14d6546 and 111805f.

📒 Files selected for processing (18)
  • docs/superpowers/plans/2026-07-13-inpatient-direct-issue-bill-service-charge-discount-print-formats.md
  • docs/superpowers/specs/2026-07-13-inpatient-direct-issue-bill-service-charge-discount-print-formats-design.md
  • src/main/java/com/divudi/bean/pharmacy/PharmacyBillSearch.java
  • src/main/java/com/divudi/bean/pharmacy/PharmacyConfigController.java
  • src/main/webapp/inward/pharmacy_bill_issue_bht.xhtml
  • src/main/webapp/inward/pharmacy_bill_return_bht_issue.xhtml
  • src/main/webapp/inward/pharmacy_reprint_bill_return_bht.xhtml
  • src/main/webapp/inward/pharmacy_reprint_bill_sale_bht.xhtml
  • src/main/webapp/inward/reports/inpatient_pharmacy_direct_issues_list.xhtml
  • src/main/webapp/resources/pharmacy/inward_direct_issue_bill_a4.xhtml
  • src/main/webapp/resources/pharmacy/inward_direct_issue_bill_five_five_sc.xhtml
  • src/main/webapp/resources/pharmacy/inward_direct_issue_bill_native_a4.xhtml
  • src/main/webapp/resources/pharmacy/inward_direct_issue_bill_native_five_five.xhtml
  • src/main/webapp/resources/pharmacy/inward_direct_issue_bill_native_pos.xhtml
  • src/main/webapp/resources/pharmacy/inward_direct_issue_bill_pos.xhtml
  • src/main/webapp/resources/pharmacy/inward_direct_issue_return_bill_a4.xhtml
  • src/main/webapp/resources/pharmacy/inward_direct_issue_return_bill_five_five_sc.xhtml
  • src/main/webapp/resources/pharmacy/inward_direct_issue_return_bill_pos.xhtml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 22035-view-bill-missing-items-bht-return

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

buddhika75 and others added 13 commits July 13, 2026 04:41
…and A4/FiveFive/POS print formats

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rge/Discount print formats

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-issue bill (#22035)

- Add three application-wide boolean properties: inwardDirectIssueBillA4, inwardDirectIssueBillFiveFive, inwardDirectIssueBillPos
- Load config from configOptionApplicationController in loadCurrentConfig()
- Add dedicated saveInwardDirectIssueBillPaperConfig() action method
- Add EL-bindable is*/set* accessors for JSF binding

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…fig dialog on direct-issue page (#22035)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…Bill and add A4/FiveFive/POS formats (#22035)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…n + reprint-return pages (#22035)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… avoid nested forms (#22035)

Nested h:form inside the page-level h:form is invalid and can break the
Apply postback binding. Relocate the idi* config dialogs to page-level
siblings of the outer form, matching pharmacy_reprint_bill_sale_bht.xhtml.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…per-type previews against double-print (#22035)

- pharmacy_reprint_bill_return_bht: relabel View Bill 'Matrix Value' to
  'Service Charge' and add a Discount column (colspan 4->5), matching the
  reprint-sale page.
- Guard legacy departmentPreference.pharmacyBillPaperType preview panels on
  the return + reprint-sale pages so they render only when none of the new
  A4/FiveFive/POS format keys is active, preventing two stacked previews.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… reconciles with Discount (#22035)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@buddhika75 buddhika75 merged commit cbef2db into development Jul 13, 2026
3 checks passed
@buddhika75 buddhika75 deleted the 22035-view-bill-missing-items-bht-return branch July 13, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

View Bill Missing Item and Quantity Details on Direct Issue to BHT Return Page

1 participant