Skip to content

History / Admin Fill Bill Department Type SQL

Revisions

  • docs: correct SQL approach — derive dept type from items, not bill type prefix The simple LIKE 'PHARMACY_%' → Pharmacy shortcut is wrong: pharmacy bill types can carry store or lab items. The item-join derivation with HAVING COUNT(DISTINCT) = 1 is the safe pattern.

    @buddhika75 buddhika75 committed May 30, 2026
  • docs: add native SQL guide for filling NULL bill department types Replaces the slow Java admin function with targeted UPDATE statements that complete in seconds. Documents enum-to-column mapping and explains why the previous one-by-one JPA approach was slow.

    @buddhika75 buddhika75 committed May 30, 2026