Commit 51f0458
fix(medication): don't disable non-billable stock/purchase linked Items
Medication tied an Item's `disabled` state to its linked row's `is_billable`
flag, conflating "not separately billable" with "inactive". Both the insert
and update paths set `disabled = 1` whenever `is_billable` was unchecked,
which deactivated Items that are valid and in active use elsewhere (purchasing,
stock), e.g. a vaccine modelled as a non-billable batch-tracked consumable
billed through a separate service Item. The consumable was re-disabled on every
save and could no longer be received or issued (a disabled Item is rejected by
Stock Entry / Purchase Receipt).
Only disable linked Items that aren't transactable elsewhere (skip
`is_stock_item` / `is_purchase_item`); on insert, honour just the parent
Medication's disabled state.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 96ccbf8 commit 51f0458
1 file changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
81 | 91 | | |
82 | 92 | | |
83 | 93 | | |
| |||
100 | 110 | | |
101 | 111 | | |
102 | 112 | | |
103 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
104 | 117 | | |
105 | 118 | | |
106 | 119 | | |
| |||
0 commit comments