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
feat: make chart of accounts realtime
Brad Barbin9a5829590a46
diff --git a/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountsTable.tsx b/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountsTable.tsxindex e59c815387..3d3d938ad5 100644--- a/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountsTable.tsx+++ b/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountsTable.tsx@@ -4,6 +4,7 @@ import type { ColumnDef } from "@tanstack/react-table";import { memo, useMemo } from "react";import { MdMoreHoriz } from "react-icons/md";import Grid from "~/components/Grid";+import { useRealtime } from "~/hooks";import type { Chart } from "~/modules/accounting";type ChartOfAccountsTableProps = {@@ -11,6 +12,8 @@ type ChartOfAccountsTableProps = {};const ChartOfAccountsTable = memo(({ data }: ChartOfAccountsTableProps) => {+ useRealtime("journal");+const navigate = useNavigate();const columns = useMemo<ColumnDef<Chart>[]>(() => {return [diff --git a/packages/database/supabase/migrations/20230705033432_ledgers.sql b/packages/database/supabase/migrations/20230705033432_ledgers.sqlindex dbb32faa7f..66ee515ee8 100644--- a/packages/database/supabase/migrations/20230705033432_ledgers.sql+++ b/packages/database/supabase/migrations/20230705033432_ledgers.sql@@ -59,6 +59,8 @@ CREATE TABLE "journal" (CONSTRAINT "journal_accountPeriodId_fkey" FOREIGN KEY ("accountingPeriodId") REFERENCES "accountingPeriod" ("id") ON DELETE RESTRICT);+ALTER publication supabase_realtime ADD TABLE "journal";+CREATE INDEX "journal_accountPeriodId_idx" ON "journal" ("accountingPeriodId");CREATE INDEX "journal_postingDate_idx" ON "journal" ("postingDate");