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.

- some more cleanup

Gaurav Bhatt2cd67d5ba21b
diff --git a/apps/erp/app/modules/purchasing/ui/PurchasingRfq/PurchasingRFQHeader.tsx b/apps/erp/app/modules/purchasing/ui/PurchasingRfq/PurchasingRFQHeader.tsx
index 81f019a87d..894e85e555 100644
--- a/apps/erp/app/modules/purchasing/ui/PurchasingRfq/PurchasingRFQHeader.tsx
+++ b/apps/erp/app/modules/purchasing/ui/PurchasingRfq/PurchasingRFQHeader.tsx
@@ -218,9 +218,7 @@ const PurchasingRFQHeader = () => {
<input type="hidden" name="status" value="Draft" />
<Button
isDisabled={
- !["Ready for request", "Requested", "Closed"].includes(
- status
- ) ||
+ !["Closed"].includes(status) ||
statusFetcher.state !== "idle" ||
!permissions.can("update", "purchasing")
}
@@ -430,23 +428,19 @@ function ConvertToSupplierQuotesModal({
<ModalHeader>
<ModalTitle>Create Supplier Quotes</ModalTitle>
<ModalDescription>
- This will create supplier quotes for all suppliers in this RFQ.
+ Send quote requests to suppliers who can provide the parts in this
+ RFQ.
</ModalDescription>
</ModalHeader>
<ModalBody>
- <Alert variant="default">
+ <Alert variant="warning">
+ <LuTriangleAlert className="h-4 w-4" />
<AlertTitle>
- Creating {suppliers.length} Supplier Quote(s)
+ These suppliers can provide the parts in this RFQ
</AlertTitle>
<AlertDescription>
- Supplier quotes will be created for the following suppliers:
- <ul className="list-disc py-2 pl-4">
- {suppliers.map((s) => (
- <li key={s.id}>{s.supplier?.name}</li>
- ))}
- </ul>
- Each quote will include {lines.length} line item(s) from this RFQ.
+ {suppliers.map((s) => s.supplier?.name).join(", ")}
</AlertDescription>
</Alert>
</ModalBody>
diff --git a/apps/erp/app/routes/x+/purchasing-rfq+/$rfqId.convert.tsx b/apps/erp/app/routes/x+/purchasing-rfq+/$rfqId.convert.tsx
index 6eb78acebe..9bd9cea1e4 100644
--- a/apps/erp/app/routes/x+/purchasing-rfq+/$rfqId.convert.tsx
+++ b/apps/erp/app/routes/x+/purchasing-rfq+/$rfqId.convert.tsx
@@ -136,12 +136,12 @@ export async function action({ request, params }: ActionFunctionArgs) {
// Update RFQ status to Received
await updatePurchasingRFQStatus(client, {
id: rfqId,
- status: "Received",
+ status: "Requested",
updatedBy: userId
});
throw redirect(
- path.to.purchasingRfq(rfqId),
+ path.to.purchasingRfqDetails(rfqId),
await flash(
request,
success(`Created ${createdQuotes.length} supplier quote(s)`)
diff --git a/apps/erp/app/routes/x+/purchasing-rfq+/$rfqId.status.tsx b/apps/erp/app/routes/x+/purchasing-rfq+/$rfqId.status.tsx
index 5ff7e71d1c..ad660506cb 100644
--- a/apps/erp/app/routes/x+/purchasing-rfq+/$rfqId.status.tsx
+++ b/apps/erp/app/routes/x+/purchasing-rfq+/$rfqId.status.tsx
@@ -25,7 +25,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
if (!status || !purchasingRfqStatusType.includes(status)) {
throw redirect(
- path.to.purchasingRfq(id),
+ path.to.purchasingRfqDetails(id),
await flash(request, error(null, "Invalid status"))
);
}
@@ -39,13 +39,13 @@ export async function action({ request, params }: ActionFunctionArgs) {
if (update.error) {
throw redirect(
- path.to.purchasingRfq(id),
+ path.to.purchasingRfqDetails(id),
await flash(request, error(update.error, "Failed to update RFQ status"))
);
}
throw redirect(
- path.to.purchasingRfq(id),
+ path.to.purchasingRfqDetails(id),
await flash(request, success("Updated RFQ status"))
);
}
diff --git a/apps/erp/app/routes/x+/purchasing-rfq+/new.tsx b/apps/erp/app/routes/x+/purchasing-rfq+/new.tsx
index 57b78f8fc8..0e458affbf 100644
--- a/apps/erp/app/routes/x+/purchasing-rfq+/new.tsx
+++ b/apps/erp/app/routes/x+/purchasing-rfq+/new.tsx
@@ -102,7 +102,7 @@ export async function action({ request }: ActionFunctionArgs) {
}
}
- throw redirect(path.to.purchasingRfq(rfq.id));
+ throw redirect(path.to.purchasingRfqDetails(rfq.id));
}
export default function PurchasingRFQNewRoute() {
diff --git a/packages/database/supabase/functions/lib/seed.ts b/packages/database/supabase/functions/lib/seed.ts
index b8df0706b5..cbbb20e760 100644
--- a/packages/database/supabase/functions/lib/seed.ts
+++ b/packages/database/supabase/functions/lib/seed.ts
@@ -1869,6 +1869,15 @@ export const sequences = [
size: 6,
step: 1,
},
+ {
+ table: "purchasingRfq",
+ name: "Purchasing RFQ",
+ prefix: "PRFQ",
+ suffix: null,
+ next: 0,
+ size: 6,
+ step: 1,
+ },
{
table: "receipt",
name: "Receipt",
diff --git a/packages/database/supabase/migrations/20260115143000_purchasing-rfq.sql b/packages/database/supabase/migrations/20260115143000_purchasing-rfq.sql
index f47c7ecccb..2e2a9d0fec 100644
--- a/packages/database/supabase/migrations/20260115143000_purchasing-rfq.sql
+++ b/packages/database/supabase/migrations/20260115143000_purchasing-rfq.sql
@@ -15,7 +15,7 @@ INSERT INTO "customFieldTable" ("table", "name", "module")
VALUES ('purchasingRfqLine', 'Purchasing RFQ Line', 'Purchasing')
ON CONFLICT DO NOTHING;
--- Sequence for Purchasing RFQ
+-- Sequence for existing companies (new companies get this from seed-company)
INSERT INTO "sequence" ("table", "name", "prefix", "suffix", "next", "size", "step", "companyId")
SELECT
'purchasingRfq',