Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix: add handling for case where only some quoteLinePrice records exist

Rob Carringtonf22894e845b1
diff --git a/apps/carbon/app/modules/sales/ui/Quotes/QuoteFinalizeModal.tsx b/apps/carbon/app/modules/sales/ui/Quotes/QuoteFinalizeModal.tsx
index 175932328f..7bc553c48d 100644
--- a/apps/carbon/app/modules/sales/ui/Quotes/QuoteFinalizeModal.tsx
+++ b/apps/carbon/app/modules/sales/ui/Quotes/QuoteFinalizeModal.tsx
@@ -72,8 +72,16 @@ const QuotationFinalizeModal = ({
canEmail ? "Email" : "Download"
);
- const linesWithNoPrices = lines
- .filter((line) => !prices.some((price) => price.quoteLineId === line.id))
+ const linesMissingQuoteLinePrices = lines
+ .filter((line) => {
+ if (!line.quantity || !Array.isArray(line.quantity)) return false;
+ return line.quantity.some(
+ (qty) =>
+ !prices.some(
+ (price) => price.quoteLineId === line.id && price.quantity === qty
+ )
+ );
+ })
.map((line) => line.itemReadableId)
.filter((id): id is string => id !== undefined);
@@ -86,7 +94,10 @@ const QuotationFinalizeModal = ({
.filter((id): id is string => id !== undefined);
const warningLineReadableIds = [
- ...new Set([...linesWithNoPrices, ...linesWithZeroPriceOrLeadTime]),
+ ...new Set([
+ ...linesMissingQuoteLinePrices,
+ ...linesWithZeroPriceOrLeadTime,
+ ]),
];
return (