fix(purchasing): allow 5-decimal unit price precision on purchase orders#1218
fix(purchasing): allow 5-decimal unit price precision on purchase orders#1218carbon-agent wants to merge 1 commit into
Conversation
Currency-styled price inputs passed only `style`/`currency` to Intl.NumberFormat, which defaults maximumFractionDigits to 2 and clamped entry/display to two decimals. The underlying columns are NUMERIC(16,5), so real per-unit prices like $0.00123 could not be recorded. Add explicit `minimumFractionDigits: 2, maximumFractionDigits: 5` to the currency price inputs so up to 5 decimals can be entered, preserved, and displayed while existing 2-decimal values render unchanged: - PurchaseOrderLineForm (item + indirect branches: unit price, shipping, tax amount) - PurchaseOrderDeliveryForm (shipping cost) - SupplierQuoteLinePricing (unit price, shipping, tax amount) - SupplierProcessForm (minimum cost) Closes #1203 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughPurchasing currency inputs now specify fractional precision up to five digits where needed. Related purchase order and supplier quote currency expressions were reformatted without changing their behavior. ChangesPurchasing currency precision
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Problem
Unit prices on purchase orders were clamped to two decimal places at input time, preventing accurate recording of real per-unit prices that carry more decimals (e.g. fasteners/raw material quoted at
$0.00123). The underlying columns already support five decimals (NUMERIC(16,5)).Root cause
The currency-styled price inputs passed only
{ style: "currency", currency }toIntl.NumberFormat, which defaultsmaximumFractionDigitsto2— clamping both entry and display to two decimals.Fix
Add explicit
minimumFractionDigits: 2, maximumFractionDigits: 5to the currency price inputs so up to 5 decimals can be entered, preserved on save, and displayed, while existing 2-decimal values render unchanged.Files touched:
PurchaseOrderLineForm.tsx— item and indirect branches (unit price, shipping, tax amount)PurchaseOrderDeliveryForm.tsx— shipping costSupplierQuoteLinePricing.tsx— supplier unit price, shipping, tax amountSupplierProcessForm.tsx— minimum costAcceptance criteria
NUMERIC(16,5))minimumFractionDigits: 2)Verification
pnpm exec turbo run typecheck --filter=erp— ✅ passesbiome checkon the 4 files — ✅ cleanNo schema changes; no new strings.
Closes #1203
🤖 Generated with Claude Code
Summary by CodeRabbit