Fix normalized quantity basis

This commit is contained in:
ben
2026-03-21 21:50:10 -04:00
parent db761adafc
commit d25448b690
7 changed files with 85 additions and 9 deletions

View File

@@ -344,3 +344,9 @@ Notes:
- review/link decisions should apply at the `normalized_item_id` level, then fan out to all purchase rows sharing that id.
* /
Normalized quantity is deterministic and conservative:
- if `qty * pack_qty * size_value` is available, use that total with `size_unit`
- else if count basis is explicit, use `qty * pack_qty` with unit `count`
- else if `measure_type` is `each`, use `qty each`
- else leave both fields blank
- no hidden unit conversion is applied inside normalization; values stay in their parsed units such as `oz`, `lb`, `qt`, or `count`