From e2a326d90f47c8536dc924fbc8aa69bc51d44bfa Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Nov 2025 10:12:19 +0000 Subject: [PATCH] Fix TypeError: unit_price.toFixed is not a function in SupplierProductManager - Convert unit_price to Number before calling toFixed() on line 239 - Handles cases where unit_price may be a string, null, or undefined - Uses fallback to 0 for invalid values to prevent runtime errors This fixes the error that occurred when displaying supplier product prices in the onboarding supplier step. --- .../domain/setup-wizard/steps/SupplierProductManager.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/domain/setup-wizard/steps/SupplierProductManager.tsx b/frontend/src/components/domain/setup-wizard/steps/SupplierProductManager.tsx index 3fbfb01d..7777a751 100644 --- a/frontend/src/components/domain/setup-wizard/steps/SupplierProductManager.tsx +++ b/frontend/src/components/domain/setup-wizard/steps/SupplierProductManager.tsx @@ -236,7 +236,7 @@ export const SupplierProductManager: React.FC = ({ {getProductName(priceList.inventory_product_id)} - €{priceList.unit_price.toFixed(2)}/{priceList.unit_of_measure} + €{Number(priceList.unit_price || 0).toFixed(2)}/{priceList.unit_of_measure} {priceList.minimum_order_quantity && priceList.minimum_order_quantity > 1 && (