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(jobs): company purge removes files before its transaction

Sidwebworksdfcbefb9cc62
diff --git a/.claude/rules/billing-system.md b/.claude/rules/billing-system.md
index 483ca0cd61..6a11a8d00b 100644
--- a/.claude/rules/billing-system.md
+++ b/.claude/rules/billing-system.md
@@ -236,12 +236,18 @@ whom it deleted.
- Without replica permission it falls back to the plain cascade. A company with posted
documents then fails, and is logged and skipped. So does the last company in a group,
because its group's system accounts refuse deletion and the group would be stranded.
- - Inside the same transaction, after the wipe and before the commit,
- `removeCompanyLeftovers` removes the Vault `integration:<companyId>:*` secrets, the
- per-company bucket (already missing counts as done), and legacy files under
- `private/<companyId>/` (listed strictly, so a listing error is a failure). Any failure
- rolls the delete back, so the company row stays as the retry target and nothing is
- orphaned once a delete commits. A company whose cleanup failed part-way may have
+ - BEFORE the transaction, `removeCompanyFiles` drains and deletes the per-company
+ bucket (already missing counts as done) and legacy files under `private/<companyId>/`
+ (listed strictly, so a listing error is a failure). Never inside it: storage deletes
+ its object rows on its own connection, `delete_orphaned_documents` then deletes the
+ matching `document` rows, and when the open purge transaction has already deleted
+ those rows storage waits on it until it times out (HTTP 544) and the purge rolls
+ back. The bucket is drained by listing, not `emptyBucket`, which only queues the
+ deletes and so makes the `deleteBucket` after it fail as "not empty". Any failure
+ keeps the company (the row is the retry target); `stillDue` is asked before the
+ files go and again in the transaction. `removeCompanySecrets` (the Vault
+ `integration:<companyId>:*` secrets) is plain SQL and stays inside the transaction.
+ A company whose cleanup failed part-way may have
lost some files; it is still warned and due, so the next run finishes it. The search
index and audit log tables (`searchIndex_<id>`, `auditLog_<id>`: named after the
company, so outside the catalog) are dropped after the commit by `deleteCompanies`
diff --git a/packages/jobs/src/inngest/functions/scheduled/company-cleanup.ts b/packages/jobs/src/inngest/functions/scheduled/company-cleanup.ts
index 781bc6065c..a7bc117ea5 100644
--- a/packages/jobs/src/inngest/functions/scheduled/company-cleanup.ts
+++ b/packages/jobs/src/inngest/functions/scheduled/company-cleanup.ts
@@ -17,7 +17,11 @@ import {
type CompanyCandidate,
selectInactiveCompanies
} from "./inactive-companies";
-import { purgeCompany, removeCompanyLeftovers } from "./purge-company";
+import {
+ purgeCompany,
+ removeCompanyFiles,
+ removeCompanySecrets
+} from "./purge-company";
// What the weekly cleanup and the manual purge share: which companies are
// inactive, the check that one still is, and the delete itself.
@@ -207,11 +211,12 @@ export async function inactiveCompanyOwner(
type CleanupTarget = Pick<CompanyCandidate, "id" | "name" | "companyGroupId">;
/**
- * Delete each company with everything it owns: its rows, Vault secrets, storage
- * bucket and legacy files in one transaction, then its search index and audit
- * log tables. `stillDue` is asked inside that transaction, so a plan bought since
- * the list was built stops the delete. A company that cannot be deleted is
- * logged and skipped; the table catalog is read once for the whole list.
+ * Delete each company with everything it owns: its storage bucket and legacy
+ * files first, then its rows and Vault secrets in one transaction, then its
+ * search index and audit log tables. `stillDue` is asked before the files go and
+ * again inside the transaction, so a plan bought since the list was built stops
+ * the delete. A company that cannot be deleted is logged and skipped; the table
+ * catalog is read once for the whole list.
*/
export async function deleteCompanies(
companies: CleanupTarget[],
@@ -229,28 +234,30 @@ export async function deleteCompanies(
for (const company of companies) {
try {
+ // Asked before the files go (they cannot be brought back) and again in
+ // the transaction, which is what the delete itself rests on.
+ if (!(await stillDue(db, company.id))) {
+ logger.info("Company no longer due for deletion; kept", company);
+ results.push({ id: company.id, deleted: false });
+ continue;
+ }
+ // Outside the transaction: see `removeCompanyFiles`.
+ const failures = await removeCompanyFiles(serviceRole, company.id);
+ if (failures.length > 0) {
+ for (const failure of failures) {
+ logger.error("Failed to remove company {failurePart}", {
+ failurePart: failure.part,
+ ...company,
+ error: failure.error
+ });
+ }
+ results.push({ id: company.id, deleted: false });
+ continue;
+ }
const purged = await db.transaction().execute(async (trx) => {
if (!(await stillDue(trx, company.id))) return false;
await purgeCompany(trx, catalog, company.id, { replica });
- // Before the commit: when any of it fails the delete rolls back, and
- // the company, still due, is retried on the next run.
- const failures = await removeCompanyLeftovers(
- trx,
- serviceRole,
- company.id
- );
- if (failures.length > 0) {
- for (const failure of failures) {
- logger.error("Failed to remove company {failurePart}", {
- failurePart: failure.part,
- ...company,
- error: failure.error
- });
- }
- throw new Error(
- `Company cleanup incomplete: ${failures.map((f) => f.part).join(", ")}`
- );
- }
+ await removeCompanySecrets(trx, company.id);
return true;
});
if (!purged) {
diff --git a/packages/jobs/src/inngest/functions/scheduled/purge-company.test.ts b/packages/jobs/src/inngest/functions/scheduled/purge-company.test.ts
new file mode 100644
index 0000000000..d460d38e81
--- /dev/null
+++ b/packages/jobs/src/inngest/functions/scheduled/purge-company.test.ts
@@ -0,0 +1,87 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { describe, expect, it } from "vitest";
+import { removeCompanyFiles } from "./purge-company";
+
+/** A storage client over in-memory buckets of flat `folder/file` paths. */
+function fakeStorage(
+ buckets: Record<string, string[]>,
+ { failRemove = false }: { failRemove?: boolean } = {}
+) {
+ const calls: string[] = [];
+ const storage = {
+ from: (bucket: string) => ({
+ list: async (prefix: string) => {
+ const under = (buckets[bucket] ?? []).filter(
+ (path) => !prefix || path.startsWith(`${prefix}/`)
+ );
+ const names = new Map<string, boolean>();
+ for (const path of under) {
+ const [head, ...rest] = path
+ .slice(prefix ? prefix.length + 1 : 0)
+ .split("/");
+ names.set(head!, rest.length === 0);
+ }
+ return {
+ data: [...names].map(([name, isFile]) => ({
+ name,
+ id: isFile ? name : null,
+ metadata: null
+ })),
+ error: null
+ };
+ },
+ remove: async (paths: string[]) => {
+ calls.push(`remove ${bucket} ${paths.length}`);
+ if (failRemove) return { error: new Error("timeout") };
+ buckets[bucket] = buckets[bucket]!.filter((p) => !paths.includes(p));
+ return { error: null };
+ }
+ }),
+ deleteBucket: async (bucket: string) => {
+ calls.push(`deleteBucket ${bucket}`);
+ if (!(bucket in buckets)) return { error: new Error("Bucket not found") };
+ if (buckets[bucket]!.length > 0)
+ return {
+ error: new Error("The bucket you tried to delete is not empty")
+ };
+ delete buckets[bucket];
+ return { error: null };
+ },
+ emptyBucket: async () => {
+ throw new Error("emptyBucket only queues the deletes; do not use it");
+ }
+ };
+ return { serviceRole: { storage } as never, buckets, calls };
+}
+
+describe("removeCompanyFiles", () => {
+ it("drains the company bucket before deleting it, and the legacy folder", async () => {
+ const { serviceRole, buckets } = fakeStorage({
+ co1: ["parts/a.png", "job/j1/b.pdf"],
+ private: ["co1/docs/c.pdf", "co12/docs/keep.pdf"]
+ });
+ expect(await removeCompanyFiles(serviceRole, "co1")).toEqual([]);
+ expect(buckets).toEqual({ private: ["co12/docs/keep.pdf"] });
+ });
+
+ it("treats a bucket that is already gone as done", async () => {
+ const { serviceRole } = fakeStorage({ private: [] });
+ expect(await removeCompanyFiles(serviceRole, "co1")).toEqual([]);
+ });
+
+ it("reports each part that failed, and leaves the bucket", async () => {
+ const { serviceRole, calls } = fakeStorage(
+ { co1: ["a.png"], private: ["co1/b.pdf"] },
+ { failRemove: true }
+ );
+ const failures = await removeCompanyFiles(serviceRole, "co1");
+ expect(failures.map((f) => f.part)).toEqual([
+ "company bucket",
+ "legacy private files"
+ ]);
+ expect(calls).not.toContain("deleteBucket co1");
+ });
+});
diff --git a/packages/jobs/src/inngest/functions/scheduled/purge-company.ts b/packages/jobs/src/inngest/functions/scheduled/purge-company.ts
index f9d453874b..ee048c98c3 100644
--- a/packages/jobs/src/inngest/functions/scheduled/purge-company.ts
+++ b/packages/jobs/src/inngest/functions/scheduled/purge-company.ts
@@ -4,7 +4,7 @@
import type { getCarbonServiceRole } from "@carbon/auth/client.server";
import type { KyselyDatabase } from "@carbon/database/client";
-import { getCompanyPrivateBucket } from "@carbon/files";
+import { getCompanyPrivateBucket, isStorageNotFound } from "@carbon/files";
import { chunkArray } from "@carbon/utils";
import { type Kysely, sql } from "kysely";
import { listBucketFilesRecursive } from "../../../backups/storage";
@@ -89,44 +89,53 @@ export async function purgeCompany(
}
/**
- * What a company owns outside its tables: integration secrets in Vault, its own
- * storage bucket, and pre-bucket-migration files under `<companyId>/` in the
- * shared private bucket. Returns the failures; each part is attempted
- * regardless.
+ * A company's integration secrets in Vault. Run inside the purge transaction,
+ * after `purgeCompany`: it is plain SQL, so it commits or rolls back with the rows.
+ */
+export async function removeCompanySecrets(
+ trx: Kysely<KyselyDatabase>,
+ companyId: string
+): Promise<void> {
+ // starts_with, not LIKE: ids may contain `_`, a LIKE wildcard.
+ await sql`DELETE FROM vault.secrets WHERE starts_with(name, ${`integration:${companyId}:`})`.execute(
+ trx
+ );
+}
+
+/**
+ * A company's files: its own storage bucket, and pre-bucket-migration files
+ * under `<companyId>/` in the shared private bucket. Returns the failures; each
+ * part is attempted regardless.
+ *
+ * Run BEFORE the purge transaction, never inside it. Storage deletes its object
+ * rows on its own connection, and `delete_orphaned_documents` then deletes the
+ * matching `document` rows; with those rows already deleted by an open purge
+ * transaction, storage waits on that transaction, which is waiting on storage,
+ * until storage times out (HTTP 544) and the purge rolls back.
*
- * Run inside the purge transaction, after `purgeCompany`, and roll the purge back
- * when anything failed: the company row is then the retry target, so nothing is
- * left behind once the delete commits. The price is that a company whose cleanup
- * failed part-way may already have lost some files. It was warned and is still
- * due, so the next run finishes it.
+ * The company row is the retry target: when anything here fails the company is
+ * kept, and the next run carries on from what this one already removed. The
+ * price is that a kept company may already have lost some files.
*/
-export async function removeCompanyLeftovers(
- db: Kysely<KyselyDatabase>,
+export async function removeCompanyFiles(
serviceRole: ReturnType<typeof getCarbonServiceRole>,
companyId: string
): Promise<{ part: string; error: unknown }[]> {
const failures: { part: string; error: unknown }[] = [];
- try {
- // starts_with, not LIKE: ids may contain `_`, a LIKE wildcard.
- await sql`DELETE FROM vault.secrets WHERE starts_with(name, ${`integration:${companyId}:`})`.execute(
- db
- );
- } catch (error) {
- failures.push({ part: "vault secrets", error });
- }
-
- // A bucket already gone (removed by an earlier attempt that then rolled back)
- // is done, not a failure, or that company would roll back every week.
+ // Drained by listing, not `emptyBucket`: that only queues the deletes, so the
+ // `deleteBucket` after it is refused as "not empty" for any bucket with files.
+ // A bucket already gone (an earlier attempt removed it, then failed) is done.
const bucket = getCompanyPrivateBucket(companyId);
- const emptied = await serviceRole.storage.emptyBucket(bucket);
- const removed = emptied.error
- ? emptied
- : await serviceRole.storage.deleteBucket(bucket);
- if (removed.error && !/not found/i.test(removed.error.message))
- failures.push({ part: "company bucket", error: removed.error });
+ let bucketError = await drainFolder(serviceRole, bucket, "");
+ if (!bucketError) {
+ bucketError = (await serviceRole.storage.deleteBucket(bucket)).error;
+ }
+ if (bucketError && !(await isBucketGone(bucketError))) {
+ failures.push({ part: "company bucket", error: bucketError });
+ }
- const legacyError = await drainLegacyFolder(serviceRole, companyId);
+ const legacyError = await drainFolder(serviceRole, STORAGE_BUCKET, companyId);
if (legacyError) {
failures.push({ part: "legacy private files", error: legacyError });
}
@@ -134,44 +143,46 @@ export async function removeCompanyLeftovers(
return failures;
}
+const isBucketGone = async (error: unknown) =>
+ (await isStorageNotFound(error)) ||
+ /not found/i.test((error as { message?: string }).message ?? "");
+
/** Deletion passes per run; each listing returns at most 1000 entries per folder. */
-const MAX_LEGACY_PASSES = 20;
+const MAX_DRAIN_PASSES = 20;
/**
- * Empty `private/<companyId>/`. Returns the error that stopped it, including a
- * folder still not empty after `MAX_LEGACY_PASSES`: the purge then rolls back,
- * and the next run carries on from what this one already removed.
+ * Delete every file under `prefix` of `bucket`. Returns the error that stopped
+ * it, including a folder still not empty after `MAX_DRAIN_PASSES`: the company
+ * is then kept, and the next run carries on from what this one already removed.
*/
-async function drainLegacyFolder(
+async function drainFolder(
serviceRole: ReturnType<typeof getCarbonServiceRole>,
- companyId: string
+ bucket: string,
+ prefix: string
): Promise<unknown> {
for (let pass = 0; ; pass++) {
let files: { path: string }[];
try {
- files = await listBucketFilesRecursive(
- serviceRole,
- STORAGE_BUCKET,
- companyId,
- { strict: true }
- );
+ files = await listBucketFilesRecursive(serviceRole, bucket, prefix, {
+ strict: true
+ });
} catch (error) {
return error;
}
if (files.length === 0) return null;
- if (pass === MAX_LEGACY_PASSES) {
+ if (pass === MAX_DRAIN_PASSES) {
return new Error(
- `${files.length}+ legacy files remain after ${MAX_LEGACY_PASSES} passes`
+ `${files.length}+ files remain after ${MAX_DRAIN_PASSES} passes`
);
}
+ // Small requests: storage deletes the rows and the objects in one statement
+ // timeout, and each row fires `delete_orphaned_documents`.
for (const paths of chunkArray(
files.map((f) => f.path),
- 1000
+ 200
)) {
- const { error } = await serviceRole.storage
- .from(STORAGE_BUCKET)
- .remove(paths);
+ const { error } = await serviceRole.storage.from(bucket).remove(paths);
if (error) return error;
}
}
diff --git a/packages/locale/locales/de/erp.po b/packages/locale/locales/de/erp.po
index c8076ce55c..ea093e99c5 100644
--- a/packages/locale/locales/de/erp.po
+++ b/packages/locale/locales/de/erp.po
@@ -2260,7 +2260,7 @@ msgstr "Möchten Sie dieses Prüfmittel wirklich aktivieren?."
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "Möchten Sie {0} wirklich stornieren? Es wird geschlossen und schreibgeschützt, bis Sie es wieder öffnen."
-#. placeholder {0}: routeData?.rfqSummary ?.rfqId
+#. placeholder {0}: routeData?.rfqSummary ?.rfqId!
msgid "Are you sure you want to cancel {0}? This will also cancel all related supplier quotes."
msgstr "Sind Sie sicher, dass Sie {0} stornieren möchten? Dies storniert auch alle zugehörigen Lieferantenofferten."
@@ -2633,8 +2633,8 @@ msgstr "Möchten Sie diese Seite wirklich verlassen?"
msgid "Are you sure you want to pass this checkpoint? The {0} phase still has unfinished tasks."
msgstr "Sind Sie sicher, dass Sie diesen Checkpoint passieren möchten? Die Phase {0} hat noch unvollendete Aufgaben."
-#. placeholder {0}: selectedPurchaseInvoice.invoiceId
-#. placeholder {0}: selectedSalesInvoice.invoiceId
+#. placeholder {0}: selectedPurchaseInvoice.invoiceId!
+#. placeholder {0}: selectedSalesInvoice.invoiceId!
msgid "Are you sure you want to permanently delete {0}?"
msgstr "Sind Sie sicher, dass Sie {0} dauerhaft löschen möchten?"
@@ -21337,7 +21337,8 @@ msgstr "Du kannst diesen Schlüssel nur einmal sehen. Speichere ihn sicher."
#. placeholder {0}: leftoverQuantity === 1 ? "part" : "parts"
#. placeholder {1}: job.quantity
-msgid "You completed {leftoverQuantity} more \n"
+msgid ""
+"You completed {leftoverQuantity} more \n"
" {0} than the\n"
" ordered quantity of {1}. What would you like\n"
" to do with the extra parts?"
diff --git a/packages/locale/locales/en/erp.po b/packages/locale/locales/en/erp.po
index acf5bd8428..360a6b294e 100644
--- a/packages/locale/locales/en/erp.po
+++ b/packages/locale/locales/en/erp.po
@@ -2260,7 +2260,7 @@ msgstr "Are you sure you want to activate this gauge?."
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
-#. placeholder {0}: routeData?.rfqSummary ?.rfqId
+#. placeholder {0}: routeData?.rfqSummary ?.rfqId!
msgid "Are you sure you want to cancel {0}? This will also cancel all related supplier quotes."
msgstr "Are you sure you want to cancel {0}? This will also cancel all related supplier quotes."
@@ -2633,8 +2633,8 @@ msgstr "Are you sure you want to leave this page?"
msgid "Are you sure you want to pass this checkpoint? The {0} phase still has unfinished tasks."
msgstr "Are you sure you want to pass this checkpoint? The {0} phase still has unfinished tasks."
-#. placeholder {0}: selectedPurchaseInvoice.invoiceId
-#. placeholder {0}: selectedSalesInvoice.invoiceId
+#. placeholder {0}: selectedPurchaseInvoice.invoiceId!
+#. placeholder {0}: selectedSalesInvoice.invoiceId!
msgid "Are you sure you want to permanently delete {0}?"
msgstr "Are you sure you want to permanently delete {0}?"
@@ -21337,11 +21337,13 @@ msgstr "You can only see this key once. Store it safely."
#. placeholder {0}: leftoverQuantity === 1 ? "part" : "parts"
#. placeholder {1}: job.quantity
-msgid "You completed {leftoverQuantity} more \n"
+msgid ""
+"You completed {leftoverQuantity} more \n"
" {0} than the\n"
" ordered quantity of {1}. What would you like\n"
" to do with the extra parts?"
-msgstr "You completed {leftoverQuantity} more \n"
+msgstr ""
+"You completed {leftoverQuantity} more \n"
" {0} than the\n"
" ordered quantity of {1}. What would you like\n"
" to do with the extra parts?"
diff --git a/packages/locale/locales/es/erp.po b/packages/locale/locales/es/erp.po
index 0416fded5e..72166ab71f 100644
--- a/packages/locale/locales/es/erp.po
+++ b/packages/locale/locales/es/erp.po
@@ -2260,7 +2260,7 @@ msgstr "¿Está seguro de que desea activar este instrumento de medición?."
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "¿Está seguro de que desea cancelar {0}? Será cerrado y de solo lectura hasta que lo reabra."
-#. placeholder {0}: routeData?.rfqSummary ?.rfqId
+#. placeholder {0}: routeData?.rfqSummary ?.rfqId!
msgid "Are you sure you want to cancel {0}? This will also cancel all related supplier quotes."
msgstr "¿Está seguro de que desea cancelar {0}? Esto también cancelará todas las cotizaciones del proveedor relacionadas."
@@ -2633,8 +2633,8 @@ msgstr "¿Estás seguro de que quieres salir de esta página?"
msgid "Are you sure you want to pass this checkpoint? The {0} phase still has unfinished tasks."
msgstr "¿Estás seguro de que deseas pasar este checkpoint? La fase {0} aún tiene tareas sin terminar."
-#. placeholder {0}: selectedPurchaseInvoice.invoiceId
-#. placeholder {0}: selectedSalesInvoice.invoiceId
+#. placeholder {0}: selectedPurchaseInvoice.invoiceId!
+#. placeholder {0}: selectedSalesInvoice.invoiceId!
msgid "Are you sure you want to permanently delete {0}?"
msgstr "¿Estás seguro de que deseas eliminar permanentemente {0}?"
@@ -21337,7 +21337,8 @@ msgstr "Solo puedes ver esta clave una vez. Guárdala de forma segura."
#. placeholder {0}: leftoverQuantity === 1 ? "part" : "parts"
#. placeholder {1}: job.quantity
-msgid "You completed {leftoverQuantity} more \n"
+msgid ""
+"You completed {leftoverQuantity} more \n"
" {0} than the\n"
" ordered quantity of {1}. What would you like\n"
" to do with the extra parts?"
diff --git a/packages/locale/locales/fr/erp.po b/packages/locale/locales/fr/erp.po
index 9e5270eff5..0295cb8fe7 100644
--- a/packages/locale/locales/fr/erp.po
+++ b/packages/locale/locales/fr/erp.po
@@ -2260,7 +2260,7 @@ msgstr "Êtes-vous sûr de vouloir activer cet instrument de mesure ?"
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "Êtes-vous sûr de vouloir annuler {0} ? Il sera fermé et en lecture seule jusqu'à ce que vous le rouvriez."
-#. placeholder {0}: routeData?.rfqSummary ?.rfqId
+#. placeholder {0}: routeData?.rfqSummary ?.rfqId!
msgid "Are you sure you want to cancel {0}? This will also cancel all related supplier quotes."
msgstr "Êtes-vous sûr de vouloir annuler {0} ? Cela annulera également tous les devis fournisseurs associés."
@@ -2633,8 +2633,8 @@ msgstr "Êtes-vous sûr de vouloir quitter cette page ?"
msgid "Are you sure you want to pass this checkpoint? The {0} phase still has unfinished tasks."
msgstr "Êtes-vous sûr de vouloir passer ce point de contrôle ? La phase {0} a encore des tâches inachevées."
-#. placeholder {0}: selectedPurchaseInvoice.invoiceId
-#. placeholder {0}: selectedSalesInvoice.invoiceId
+#. placeholder {0}: selectedPurchaseInvoice.invoiceId!
+#. placeholder {0}: selectedSalesInvoice.invoiceId!
msgid "Are you sure you want to permanently delete {0}?"
msgstr "Êtes-vous sûr de vouloir supprimer définitivement {0} ?"
@@ -21337,7 +21337,8 @@ msgstr "Vous ne pouvez voir cette clé qu'une seule fois. Conservez-la en sécur
#. placeholder {0}: leftoverQuantity === 1 ? "part" : "parts"
#. placeholder {1}: job.quantity
-msgid "You completed {leftoverQuantity} more \n"
+msgid ""
+"You completed {leftoverQuantity} more \n"
" {0} than the\n"
" ordered quantity of {1}. What would you like\n"
" to do with the extra parts?"
diff --git a/packages/locale/locales/hi/erp.po b/packages/locale/locales/hi/erp.po
index 0fcf959098..fc7eae4d47 100644
--- a/packages/locale/locales/hi/erp.po
+++ b/packages/locale/locales/hi/erp.po
@@ -2260,7 +2260,7 @@ msgstr "क्या आप सुनिश्चित हैं कि आप
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "क्या आप {0} को रद्द करना चाहते हैं? यह बंद हो जाएगी और पढ़ने के लिए केवल तब तक होगी जब तक आप इसे फिर से खोलेंगे।"
-#. placeholder {0}: routeData?.rfqSummary ?.rfqId
+#. placeholder {0}: routeData?.rfqSummary ?.rfqId!
msgid "Are you sure you want to cancel {0}? This will also cancel all related supplier quotes."
msgstr "क्या आप {0} को रद्द करना चाहते हैं? यह सभी संबंधित आपूर्तिकर्ता कोटेशन को भी रद्द कर देगा।"
@@ -2633,8 +2633,8 @@ msgstr "क्या आप वाकई इस पृष्ठ को छोड
msgid "Are you sure you want to pass this checkpoint? The {0} phase still has unfinished tasks."
msgstr "क्या आप सुनिश्चित हैं कि आप इस चेकपॉइंट को पास करना चाहते हैं? {0} चरण में अभी भी अधूरे कार्य हैं।"
-#. placeholder {0}: selectedPurchaseInvoice.invoiceId
-#. placeholder {0}: selectedSalesInvoice.invoiceId
+#. placeholder {0}: selectedPurchaseInvoice.invoiceId!
+#. placeholder {0}: selectedSalesInvoice.invoiceId!
msgid "Are you sure you want to permanently delete {0}?"
msgstr "क्या आप {0} को स्थायी रूप से हटाना चाहते हैं?"
@@ -21337,11 +21337,13 @@ msgstr "आप इस कुंजी को केवल एक बार द
#. placeholder {0}: leftoverQuantity === 1 ? "part" : "parts"
#. placeholder {1}: job.quantity
-msgid "You completed {leftoverQuantity} more \n"
+msgid ""
+"You completed {leftoverQuantity} more \n"
" {0} than the\n"
" ordered quantity of {1}. What would you like\n"
" to do with the extra parts?"
-msgstr "आप {leftoverQuantity} अधिक \n"
+msgstr ""
+"आप {leftoverQuantity} अधिक \n"
" {0} को {1} की ऑर्डर की गई \n"
" मात्रा से पूरा कर चुके हैं। आप अतिरिक्त पार्ट्स के साथ \n"
" क्या करना चाहेंगे?"
diff --git a/packages/locale/locales/it/erp.po b/packages/locale/locales/it/erp.po
index 249b94a7b8..163a462519 100644
--- a/packages/locale/locales/it/erp.po
+++ b/packages/locale/locales/it/erp.po
@@ -2260,7 +2260,7 @@ msgstr "Sei sicuro di voler attivare questo strumento di misura?."
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "Sei sicuro di voler cancellare {0}? Sarà chiuso e in sola lettura fino a quando non lo riapri."
-#. placeholder {0}: routeData?.rfqSummary ?.rfqId
+#. placeholder {0}: routeData?.rfqSummary ?.rfqId!
msgid "Are you sure you want to cancel {0}? This will also cancel all related supplier quotes."
msgstr "Sei sicuro di voler annullare {0}? Questo annullerà anche tutte le offerte del fornitore correlate."
@@ -2633,8 +2633,8 @@ msgstr "Sei sicuro di voler lasciare questa pagina?"
msgid "Are you sure you want to pass this checkpoint? The {0} phase still has unfinished tasks."
msgstr "Sei sicuro di voler superare questo checkpoint? La fase {0} ha ancora attività non completate."
-#. placeholder {0}: selectedPurchaseInvoice.invoiceId
-#. placeholder {0}: selectedSalesInvoice.invoiceId
+#. placeholder {0}: selectedPurchaseInvoice.invoiceId!
+#. placeholder {0}: selectedSalesInvoice.invoiceId!
msgid "Are you sure you want to permanently delete {0}?"
msgstr "Sei sicuro di voler eliminare permanentemente {0}?"
@@ -21337,7 +21337,8 @@ msgstr "Puoi visualizzare questa chiave solo una volta. Conservala in modo sicur
#. placeholder {0}: leftoverQuantity === 1 ? "part" : "parts"
#. placeholder {1}: job.quantity
-msgid "You completed {leftoverQuantity} more \n"
+msgid ""
+"You completed {leftoverQuantity} more \n"
" {0} than the\n"
" ordered quantity of {1}. What would you like\n"
" to do with the extra parts?"
diff --git a/packages/locale/locales/ja/erp.po b/packages/locale/locales/ja/erp.po
index 8b2ef8952c..0e21e8cbc7 100644
--- a/packages/locale/locales/ja/erp.po
+++ b/packages/locale/locales/ja/erp.po
@@ -2260,7 +2260,7 @@ msgstr "この測定器を有効にしてもよろしいですか?."
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "{0} をキャンセルしてもよろしいですか?クローズ済になり、再オープンするまで読み取り専用になります。"
-#. placeholder {0}: routeData?.rfqSummary ?.rfqId
+#. placeholder {0}: routeData?.rfqSummary ?.rfqId!
msgid "Are you sure you want to cancel {0}? This will also cancel all related supplier quotes."
msgstr "{0} をキャンセルしてもよろしいですか?関連するすべての仕入先見積もキャンセルされます。"
@@ -2633,8 +2633,8 @@ msgstr "このページを離れてもよろしいですか?"
msgid "Are you sure you want to pass this checkpoint? The {0} phase still has unfinished tasks."
msgstr "このチェックポイントをパスしてもよろしいですか?{0}フェーズにはまだ未完了のタスクがあります。"
-#. placeholder {0}: selectedPurchaseInvoice.invoiceId
-#. placeholder {0}: selectedSalesInvoice.invoiceId
+#. placeholder {0}: selectedPurchaseInvoice.invoiceId!
+#. placeholder {0}: selectedSalesInvoice.invoiceId!
msgid "Are you sure you want to permanently delete {0}?"
msgstr "{0}を完全に削除してもよろしいですか?"
@@ -21337,7 +21337,8 @@ msgstr "このキーは一度だけ表示されます。安全に保管してく
#. placeholder {0}: leftoverQuantity === 1 ? "part" : "parts"
#. placeholder {1}: job.quantity
-msgid "You completed {leftoverQuantity} more \n"
+msgid ""
+"You completed {leftoverQuantity} more \n"
" {0} than the\n"
" ordered quantity of {1}. What would you like\n"
" to do with the extra parts?"
diff --git a/packages/locale/locales/ko/erp.po b/packages/locale/locales/ko/erp.po
index 4d077ab52b..61043e04d9 100644
--- a/packages/locale/locales/ko/erp.po
+++ b/packages/locale/locales/ko/erp.po
@@ -2260,7 +2260,7 @@ msgstr "이 계측기를 활성화하시겠습니까?."
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "{0}를 취소하시겠습니까? 다시 열기할 때까지 마감되고 읽기 전용이 됩니다."
-#. placeholder {0}: routeData?.rfqSummary ?.rfqId
+#. placeholder {0}: routeData?.rfqSummary ?.rfqId!
msgid "Are you sure you want to cancel {0}? This will also cancel all related supplier quotes."
msgstr "{0}을(를) 취소하시겠습니까? 관련된 모든 공급업체 견적도 함께 취소됩니다."
@@ -2633,8 +2633,8 @@ msgstr "이 페이지를 나가시겠습니까?"
msgid "Are you sure you want to pass this checkpoint? The {0} phase still has unfinished tasks."
msgstr "이 체크포인트를 통과하시겠습니까? {0} 단계에 아직 완료되지 않은 작업이 있습니다."
-#. placeholder {0}: selectedPurchaseInvoice.invoiceId
-#. placeholder {0}: selectedSalesInvoice.invoiceId
+#. placeholder {0}: selectedPurchaseInvoice.invoiceId!
+#. placeholder {0}: selectedSalesInvoice.invoiceId!
msgid "Are you sure you want to permanently delete {0}?"
msgstr "{0}을(를) 영구적으로 삭제하시겠습니까?"
@@ -21337,7 +21337,8 @@ msgstr "이 키는 한 번만 확인할 수 있습니다. 안전하게 보관하
#. placeholder {0}: leftoverQuantity === 1 ? "part" : "parts"
#. placeholder {1}: job.quantity
-msgid "You completed {leftoverQuantity} more \n"
+msgid ""
+"You completed {leftoverQuantity} more \n"
" {0} than the\n"
" ordered quantity of {1}. What would you like\n"
" to do with the extra parts?"
diff --git a/packages/locale/locales/pl/erp.po b/packages/locale/locales/pl/erp.po
index f8e89cf0d8..a86eab0f34 100644
--- a/packages/locale/locales/pl/erp.po
+++ b/packages/locale/locales/pl/erp.po
@@ -2260,7 +2260,7 @@ msgstr "Czy chcesz aktywować ten przyrząd pomiarowy?"
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "Czy na pewno chcesz anulować {0}? Będzie zamknięte i tylko do odczytu do momentu, gdy je ponownie otworzysz."
-#. placeholder {0}: routeData?.rfqSummary ?.rfqId
+#. placeholder {0}: routeData?.rfqSummary ?.rfqId!
msgid "Are you sure you want to cancel {0}? This will also cancel all related supplier quotes."
msgstr "Czy na pewno chcesz anulować {0}? Spowoduje to również anulowanie wszystkich powiązanych ofert dostawców."
@@ -2633,8 +2633,8 @@ msgstr "Czy na pewno chcesz opuścić tę stronę?"
msgid "Are you sure you want to pass this checkpoint? The {0} phase still has unfinished tasks."
msgstr "Czy na pewno chcesz przejść ten punkt kontrolny? Faza {0} wciąż ma niezakończone zadania."
-#. placeholder {0}: selectedPurchaseInvoice.invoiceId
-#. placeholder {0}: selectedSalesInvoice.invoiceId
+#. placeholder {0}: selectedPurchaseInvoice.invoiceId!
+#. placeholder {0}: selectedSalesInvoice.invoiceId!
msgid "Are you sure you want to permanently delete {0}?"
msgstr "Czy na pewno chcesz trwale usunąć {0}?"
@@ -21337,7 +21337,8 @@ msgstr "Możesz zobaczyć ten klucz tylko raz. Przechowuj go bezpiecznie."
#. placeholder {0}: leftoverQuantity === 1 ? "part" : "parts"
#. placeholder {1}: job.quantity
-msgid "You completed {leftoverQuantity} more \n"
+msgid ""
+"You completed {leftoverQuantity} more \n"
" {0} than the\n"
" ordered quantity of {1}. What would you like\n"
" to do with the extra parts?"
diff --git a/packages/locale/locales/pt/erp.po b/packages/locale/locales/pt/erp.po
index 5ccd4d3eca..86e8fcc85b 100644
--- a/packages/locale/locales/pt/erp.po
+++ b/packages/locale/locales/pt/erp.po
@@ -2260,7 +2260,7 @@ msgstr "Tem certeza de que deseja ativar este instrumento de medição?."
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "Tem certeza de que deseja cancelar {0}? Será fechado e somente leitura até que você o reabra."
-#. placeholder {0}: routeData?.rfqSummary ?.rfqId
+#. placeholder {0}: routeData?.rfqSummary ?.rfqId!
msgid "Are you sure you want to cancel {0}? This will also cancel all related supplier quotes."
msgstr "Tem a certeza de que deseja cancelar {0}? Isto também cancelará todas as cotações de fornecedores relacionadas."
@@ -2633,8 +2633,8 @@ msgstr "Tem certeza que deseja sair desta página?"
msgid "Are you sure you want to pass this checkpoint? The {0} phase still has unfinished tasks."
msgstr "Tem a certeza de que deseja passar neste checkpoint? A fase {0} ainda tem tarefas inacabadas."
-#. placeholder {0}: selectedPurchaseInvoice.invoiceId
-#. placeholder {0}: selectedSalesInvoice.invoiceId
+#. placeholder {0}: selectedPurchaseInvoice.invoiceId!
+#. placeholder {0}: selectedSalesInvoice.invoiceId!
msgid "Are you sure you want to permanently delete {0}?"
msgstr "Tem certeza de que deseja excluir permanentemente {0}?"
@@ -21337,7 +21337,8 @@ msgstr "Você só pode ver esta chave uma vez. Guarde-a com segurança."
#. placeholder {0}: leftoverQuantity === 1 ? "part" : "parts"
#. placeholder {1}: job.quantity
-msgid "You completed {leftoverQuantity} more \n"
+msgid ""
+"You completed {leftoverQuantity} more \n"
" {0} than the\n"
" ordered quantity of {1}. What would you like\n"
" to do with the extra parts?"
diff --git a/packages/locale/locales/ru/erp.po b/packages/locale/locales/ru/erp.po
index 582c85a965..d4d433d3dc 100644
--- a/packages/locale/locales/ru/erp.po
+++ b/packages/locale/locales/ru/erp.po
@@ -2260,7 +2260,7 @@ msgstr "Вы уверены, что хотите активировать это
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "Вы уверены, что хотите отменить {0}? Он будет закрыт и доступен только для чтения, пока вы его не откроете заново."
-#. placeholder {0}: routeData?.rfqSummary ?.rfqId
+#. placeholder {0}: routeData?.rfqSummary ?.rfqId!
msgid "Are you sure you want to cancel {0}? This will also cancel all related supplier quotes."
msgstr "Вы уверены, что хотите отменить {0}? Это также отменит все связанные предложения поставщиков."
@@ -2633,8 +2633,8 @@ msgstr "Вы уверены, что хотите покинуть эту стр
msgid "Are you sure you want to pass this checkpoint? The {0} phase still has unfinished tasks."
msgstr "Вы уверены, что хотите пройти эту контрольную точку? На этапе {0} остались незавершённые задачи."
-#. placeholder {0}: selectedPurchaseInvoice.invoiceId
-#. placeholder {0}: selectedSalesInvoice.invoiceId
+#. placeholder {0}: selectedPurchaseInvoice.invoiceId!
+#. placeholder {0}: selectedSalesInvoice.invoiceId!
msgid "Are you sure you want to permanently delete {0}?"
msgstr "Вы уверены, что хотите окончательно удалить {0}?"
@@ -21337,7 +21337,8 @@ msgstr "Вы можете увидеть этот ключ только один
#. placeholder {0}: leftoverQuantity === 1 ? "part" : "parts"
#. placeholder {1}: job.quantity
-msgid "You completed {leftoverQuantity} more \n"
+msgid ""
+"You completed {leftoverQuantity} more \n"
" {0} than the\n"
" ordered quantity of {1}. What would you like\n"
" to do with the extra parts?"
diff --git a/packages/locale/locales/tr/erp.po b/packages/locale/locales/tr/erp.po
index 357c722568..054e42bfdf 100644
--- a/packages/locale/locales/tr/erp.po
+++ b/packages/locale/locales/tr/erp.po
@@ -2260,7 +2260,7 @@ msgstr "Bu ölçüm aletini etkinleştirmek istediğinizden emin misiniz?."
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "{0} öğesini iptal etmek istediğinizden emin misiniz? Yeniden açana kadar kapalı ve salt okunur durumda olacaktır."
-#. placeholder {0}: routeData?.rfqSummary ?.rfqId
+#. placeholder {0}: routeData?.rfqSummary ?.rfqId!
msgid "Are you sure you want to cancel {0}? This will also cancel all related supplier quotes."
msgstr "{0}'yi iptal etmek istediğinizden emin misiniz? Bu aynı zamanda tüm ilgili tedarikçi tekliflerini de iptal edecektir."
@@ -2633,8 +2633,8 @@ msgstr "Bu sayfadan ayrılmak istediğinizden emin misiniz?"
msgid "Are you sure you want to pass this checkpoint? The {0} phase still has unfinished tasks."
msgstr "Bu kontrol noktasını geçmek istediğinizden emin misiniz? {0} aşaması hala tamamlanmamış görevlere sahip."
-#. placeholder {0}: selectedPurchaseInvoice.invoiceId
-#. placeholder {0}: selectedSalesInvoice.invoiceId
+#. placeholder {0}: selectedPurchaseInvoice.invoiceId!
+#. placeholder {0}: selectedSalesInvoice.invoiceId!
msgid "Are you sure you want to permanently delete {0}?"
msgstr "{0} öğesini kalıcı olarak silmek istediğinizden emin misiniz?"
@@ -21337,7 +21337,8 @@ msgstr "Bu anahtarı yalnızca bir kez görebilirsiniz. Güvenli bir yerde sakla
#. placeholder {0}: leftoverQuantity === 1 ? "part" : "parts"
#. placeholder {1}: job.quantity
-msgid "You completed {leftoverQuantity} more \n"
+msgid ""
+"You completed {leftoverQuantity} more \n"
" {0} than the\n"
" ordered quantity of {1}. What would you like\n"
" to do with the extra parts?"
diff --git a/packages/locale/locales/zh/erp.po b/packages/locale/locales/zh/erp.po
index 878da6145c..358051da43 100644
--- a/packages/locale/locales/zh/erp.po
+++ b/packages/locale/locales/zh/erp.po
@@ -2260,7 +2260,7 @@ msgstr "确定要启用此量具吗?"
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "您确定要取消{0}吗?在您重新打开之前,它将被已关闭且只读。"
-#. placeholder {0}: routeData?.rfqSummary ?.rfqId
+#. placeholder {0}: routeData?.rfqSummary ?.rfqId!
msgid "Are you sure you want to cancel {0}? This will also cancel all related supplier quotes."
msgstr "您确定要取消 {0} 吗?这也将取消所有相关的供应商报价。"
@@ -2633,8 +2633,8 @@ msgstr "您确定要离开此页面吗?"
msgid "Are you sure you want to pass this checkpoint? The {0} phase still has unfinished tasks."
msgstr "您确定要通过此检查点吗?{0}阶段仍有未完成的任务。"
-#. placeholder {0}: selectedPurchaseInvoice.invoiceId
-#. placeholder {0}: selectedSalesInvoice.invoiceId
+#. placeholder {0}: selectedPurchaseInvoice.invoiceId!
+#. placeholder {0}: selectedSalesInvoice.invoiceId!
msgid "Are you sure you want to permanently delete {0}?"
msgstr "您确定要永久删除 {0} 吗?"
@@ -21337,11 +21337,13 @@ msgstr "您只能看到此密钥一次。请妥善保管。"
#. placeholder {0}: leftoverQuantity === 1 ? "part" : "parts"
#. placeholder {1}: job.quantity
-msgid "You completed {leftoverQuantity} more \n"
+msgid ""
+"You completed {leftoverQuantity} more \n"
" {0} than the\n"
" ordered quantity of {1}. What would you like\n"
" to do with the extra parts?"
-msgstr "您完成了 {leftoverQuantity} 个以上 \n"
+msgstr ""
+"您完成了 {leftoverQuantity} 个以上 \n"
" {0},比 \n"
" 订购数量 {1} 多。您想 \n"
" 用多余的零件怎么办?"