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.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
fix: backfill invoiced status of completed shipments
Brad Barbin84f7221f966a
diff --git a/packages/database/supabase/migrations/20250507143421_sales-invoice.sql b/packages/database/supabase/migrations/20250507143421_sales-invoice.sqlindex 04a52ef2c1..2d8fc75cc9 100644--- a/packages/database/supabase/migrations/20250507143421_sales-invoice.sql+++ b/packages/database/supabase/migrations/20250507143421_sales-invoice.sql@@ -389,4 +389,13 @@ CREATE OR REPLACE VIEW "salesInvoiceLocations" WITH(SECURITY_INVOKER=true) ASLEFT OUTER JOIN "address" icaON ica.id = icl."addressId"LEFT OUTER JOIN "country" icc- ON icc.alpha2 = ica."countryCode";\ No newline at end of file+ ON icc.alpha2 = ica."countryCode";+++-- Update shipments to set invoiced = true where source document is a completed Sales Order+UPDATE "shipment"+SET "invoiced" = true+FROM "salesOrder" so+WHERE "shipment"."sourceDocument" = 'Sales Order'+ AND "shipment"."sourceDocumentId" = so.id+ AND so.status = 'Completed';