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 upper bound for pricing approval

Gaurav Bhatt6f1ffb52fb53
diff --git a/apps/erp/app/modules/settings/ui/Approvals/ApprovalRuleCard.tsx b/apps/erp/app/modules/settings/ui/Approvals/ApprovalRuleCard.tsx
index 3cb05cd3d5..f09dad4cc6 100644
--- a/apps/erp/app/modules/settings/ui/Approvals/ApprovalRuleCard.tsx
+++ b/apps/erp/app/modules/settings/ui/Approvals/ApprovalRuleCard.tsx
@@ -33,10 +33,11 @@ import ApprovalRuleDetails from "./ApprovalRuleDetails";
type ApprovalRuleCardProps = {
rule: ApprovalRule & { approverGroupNames?: string[] };
documentType: ApprovalDocumentType;
+ upperBound?: number | null;
};
const ApprovalRuleCard = memo(
- ({ rule, documentType }: ApprovalRuleCardProps) => {
+ ({ rule, documentType, upperBound = null }: ApprovalRuleCardProps) => {
const { t } = useLingui();
const [params] = useUrlParams();
const navigate = useNavigate();
@@ -78,8 +79,8 @@ const ApprovalRuleCard = memo(
{approvalDocumentTypesWithAmounts.includes(
documentType
) &&
- (rule.upperBoundAmount != null
- ? ` ${currencyFormatter.format(rule.lowerBoundAmount ?? 0)} – ${currencyFormatter.format(rule.upperBoundAmount)}`
+ (upperBound != null
+ ? ` ${currencyFormatter.format(rule.lowerBoundAmount ?? 0)} – ${currencyFormatter.format(upperBound)}`
: ` over ${currencyFormatter.format(rule.lowerBoundAmount ?? 0)}`)}
</Heading>
<Status
diff --git a/apps/erp/app/modules/settings/ui/Approvals/ApprovalRuleDetails.tsx b/apps/erp/app/modules/settings/ui/Approvals/ApprovalRuleDetails.tsx
index c04b9fe0d5..36e6c871e8 100644
--- a/apps/erp/app/modules/settings/ui/Approvals/ApprovalRuleDetails.tsx
+++ b/apps/erp/app/modules/settings/ui/Approvals/ApprovalRuleDetails.tsx
@@ -59,15 +59,6 @@ const ApprovalRuleDetails = memo(
</FieldItem>
)}
- {documentType === "purchaseOrder" &&
- rule.upperBoundAmount != null && (
- <FieldItem icon={LuDollarSign} label={t`Maximum Amount`}>
- <p className="text-sm font-semibold text-foreground leading-relaxed">
- {currencyFormatter.format(rule.upperBoundAmount)}
- </p>
- </FieldItem>
- )}
-
{/* Approver Groups */}
<FieldItem icon={LuUsers} label={t`Who Can Approve`}>
{rule.approverGroupIds && rule.approverGroupIds.length > 0 ? (
diff --git a/apps/erp/app/modules/settings/ui/Approvals/ApprovalRuleForm.tsx b/apps/erp/app/modules/settings/ui/Approvals/ApprovalRuleForm.tsx
index 75e0d3d68c..6c2bc4c15c 100644
--- a/apps/erp/app/modules/settings/ui/Approvals/ApprovalRuleForm.tsx
+++ b/apps/erp/app/modules/settings/ui/Approvals/ApprovalRuleForm.tsx
@@ -56,7 +56,6 @@ const ApprovalRuleForm = ({
: [],
defaultApproverId: rule.defaultApproverId ?? undefined,
lowerBoundAmount: rule.lowerBoundAmount ?? 0,
- upperBoundAmount: rule.upperBoundAmount ?? undefined,
escalationDays: rule.escalationDays ?? undefined
}
: {
@@ -65,7 +64,6 @@ const ApprovalRuleForm = ({
enabled: true,
approverGroupIds: [],
lowerBoundAmount: 0,
- upperBoundAmount: undefined,
escalationDays: undefined
};
@@ -105,25 +103,15 @@ const ApprovalRuleForm = ({
approvalDocumentTypesWithAmounts.includes(
effectiveDocumentType
) && (
- <>
- <FormNumber
- name="lowerBoundAmount"
- label={t`Minimum Amount`}
- formatOptions={{
- style: "currency",
- currency: baseCurrencyCode
- }}
- />
- <FormNumber
- name="upperBoundAmount"
- label={t`Maximum Amount`}
- helperText={t`Leave empty for no upper limit`}
- formatOptions={{
- style: "currency",
- currency: baseCurrencyCode
- }}
- />
- </>
+ <FormNumber
+ name="lowerBoundAmount"
+ label={t`Minimum Amount`}
+ helperText={t`Approval is required at or above this amount, up to the next rule's minimum`}
+ formatOptions={{
+ style: "currency",
+ currency: baseCurrencyCode
+ }}
+ />
)}
<Users
diff --git a/apps/erp/app/modules/settings/ui/Approvals/ApprovalRules.tsx b/apps/erp/app/modules/settings/ui/Approvals/ApprovalRules.tsx
index 2a227d48ee..850193a369 100644
--- a/apps/erp/app/modules/settings/ui/Approvals/ApprovalRules.tsx
+++ b/apps/erp/app/modules/settings/ui/Approvals/ApprovalRules.tsx
@@ -1,7 +1,4 @@
import {
- Alert,
- AlertDescription,
- AlertTitle,
Button,
Card,
CardContent,
@@ -14,15 +11,14 @@ import {
} from "@carbon/react";
import { Trans } from "@lingui/react/macro";
import { memo, useMemo } from "react";
-import { LuPlus, LuTriangleAlert } from "react-icons/lu";
+import { LuPlus } from "react-icons/lu";
import { Link } from "react-router";
import { Empty } from "~/components";
-import { useCurrencyFormatter, usePermissions } from "~/hooks";
+import { usePermissions } from "~/hooks";
import {
type ApprovalRule,
approvalDocumentTypesWithAmounts
} from "~/modules/shared";
-import { topTierExplicitMax } from "~/modules/shared/approval-rules.coverage";
import { path } from "~/utils/path";
import ApprovalRuleCard from "./ApprovalRuleCard";
@@ -36,11 +32,15 @@ const ApprovalRules = memo(
({ poRules, qdRules, supplierRules }: ApprovalRulesProps) => {
const permissions = usePermissions();
const canCreate = permissions.can("update", "settings");
- const currencyFormatter = useCurrencyFormatter();
- const poTopTierGap = useMemo(
- () => topTierExplicitMax(poRules, "purchaseOrder"),
- [poRules]
- );
+
+ // A rule's ceiling is the next-higher tier's minimum (null for the top tier).
+ const nextTierFloor = useMemo(() => {
+ const floors = Array.from(
+ new Set(poRules.map((r) => r.lowerBoundAmount ?? 0))
+ ).sort((a, b) => a - b);
+ return (lowerBoundAmount: number): number | null =>
+ floors.find((f) => f > lowerBoundAmount) ?? null;
+ }, [poRules]);
return (
<ScrollArea className="h-full w-full">
@@ -76,22 +76,6 @@ const ApprovalRules = memo(
</div>
</CardHeader>
<CardContent>
- {poTopTierGap != null && (
- <Alert variant="warning" className="mb-4">
- <LuTriangleAlert className="h-4 w-4" />
- <AlertTitle>
- <Trans>Highest-tier rule has a maximum</Trans>
- </AlertTitle>
- <AlertDescription>
- <Trans>
- Purchase orders above{" "}
- {currencyFormatter.format(poTopTierGap)} will not
- require approval. Edit the top-tier rule and clear the
- Maximum Amount, or add a higher rule with no maximum.
- </Trans>
- </AlertDescription>
- </Alert>
- )}
{poRules.length === 0 ? (
<Empty className="my-4" />
) : (
@@ -103,6 +87,7 @@ const ApprovalRules = memo(
key={rule.id}
rule={rule}
documentType="purchaseOrder"
+ upperBound={nextTierFloor(rule.lowerBoundAmount ?? 0)}
/>
))}
</VStack>
diff --git a/apps/erp/app/modules/shared/approval-rules.coverage.ts b/apps/erp/app/modules/shared/approval-rules.coverage.ts
deleted file mode 100644
index d298548ef3..0000000000
--- a/apps/erp/app/modules/shared/approval-rules.coverage.ts
+++ /dev/null
@@ -1,96 +0,0 @@
-// Tiered-approval coverage check.
-//
-// Each approval rule represents a half-open range [lowerBoundAmount,
-// upperBoundAmount). The "top tier" — the rule(s) with the highest
-// lowerBoundAmount for a given documentType — must have at least one rule
-// with a null upperBoundAmount so amounts above the top minimum still
-// route to an approver. Without this guarantee, a $3M PO can silently
-// bypass approval when all rules have explicit ceilings.
-//
-// Used by:
-// - approval-rules.new.tsx and approval-rules.$id.tsx (save-time block)
-// - ApprovalRules.tsx (list-view warning banner)
-
-import type { ApprovalRule } from "./types";
-
-type Candidate = {
- id?: string | null;
- lowerBoundAmount: number;
- upperBoundAmount: number | null;
-};
-
-type CoverageInput = {
- existingRules: Pick<
- ApprovalRule,
- "id" | "documentType" | "lowerBoundAmount" | "upperBoundAmount"
- >[];
- documentType: ApprovalRule["documentType"];
- candidate: Candidate;
-};
-
-/**
- * Returns true if, after applying the candidate save, at least one rule
- * at the highest `lowerBoundAmount` for the document type has a null
- * `upperBoundAmount`. Returns false when the save would leave a gap
- * above the top tier.
- */
-export function topTierWouldBeUnbounded({
- existingRules,
- documentType,
- candidate
-}: CoverageInput): boolean {
- const others = existingRules.filter(
- (r) => r.documentType === documentType && r.id !== candidate.id
- );
-
- const merged: Pick<ApprovalRule, "lowerBoundAmount" | "upperBoundAmount">[] =
- [
- ...others.map((r) => ({
- lowerBoundAmount: r.lowerBoundAmount ?? 0,
- upperBoundAmount: r.upperBoundAmount ?? null
- })),
- {
- lowerBoundAmount: candidate.lowerBoundAmount,
- upperBoundAmount: candidate.upperBoundAmount
- }
- ];
-
- const highestLower = merged.reduce(
- (max, r) => Math.max(max, r.lowerBoundAmount ?? 0),
- 0
- );
- return merged
- .filter((r) => (r.lowerBoundAmount ?? 0) === highestLower)
- .some((r) => r.upperBoundAmount == null);
-}
-
-/**
- * Read-only variant used by the list-view banner. No candidate — just
- * checks the current set of rules. Returns the maximum `upperBoundAmount`
- * at the highest tier if coverage is incomplete, or null when the top is
- * unbounded.
- */
-export function topTierExplicitMax(
- rules: Pick<
- ApprovalRule,
- "documentType" | "lowerBoundAmount" | "upperBoundAmount"
- >[],
- documentType: ApprovalRule["documentType"]
-): number | null {
- const forType = rules.filter((r) => r.documentType === documentType);
- if (forType.length === 0) return null;
-
- const highestLower = forType.reduce(
- (max, r) => Math.max(max, r.lowerBoundAmount ?? 0),
- 0
- );
- const atHighest = forType.filter(
- (r) => (r.lowerBoundAmount ?? 0) === highestLower
- );
- if (atHighest.some((r) => r.upperBoundAmount == null)) return null;
-
- return atHighest.reduce(
- (max, r) => Math.max(max, r.upperBoundAmount ?? 0),
- 0
- );
-}
diff --git a/apps/erp/app/modules/shared/shared.models.ts b/apps/erp/app/modules/shared/shared.models.ts
index 7225173daf..13d43bbad3 100644
--- a/apps/erp/app/modules/shared/shared.models.ts
+++ b/apps/erp/app/modules/shared/shared.models.ts
@@ -49,29 +49,18 @@ export const approvalRequestValidator = z.object({
approverGroupIds: zfd.repeatableOfType(z.string()).optional()
});
-export const approvalRuleValidator = z
- .object({
- id: zfd.text(z.string().optional()),
- documentType: z.enum(approvalDocumentType, {
- errorMap: () => ({ message: "Document type is required" })
- }),
- approverGroupIds: z.array(
- z.string().min(1, { message: "Invalid selection" })
- ),
- defaultApproverId: zfd.text(z.string().optional()),
- lowerBoundAmount: zfd.numeric(z.number().gt(0).default(0)).optional(),
- upperBoundAmount: zfd.numeric(z.number().gt(0).optional()),
- enabled: zfd.checkbox()
- })
- .refine(
- (data) =>
- data.upperBoundAmount == null ||
- data.upperBoundAmount > (data.lowerBoundAmount ?? 0),
- {
- message: "Maximum amount must be greater than minimum amount",
- path: ["upperBoundAmount"]
- }
- );
+export const approvalRuleValidator = z.object({
+ id: zfd.text(z.string().optional()),
+ documentType: z.enum(approvalDocumentType, {
+ errorMap: () => ({ message: "Document type is required" })
+ }),
+ approverGroupIds: z.array(
+ z.string().min(1, { message: "Invalid selection" })
+ ),
+ defaultApproverId: zfd.text(z.string().optional()),
+ lowerBoundAmount: zfd.numeric(z.number().gt(0).default(0)).optional(),
+ enabled: zfd.checkbox()
+});
export const approvalStatusType = [
"Pending",
diff --git a/apps/erp/app/modules/shared/shared.service.ts b/apps/erp/app/modules/shared/shared.service.ts
index dd8fc4577b..460485878f 100644
--- a/apps/erp/app/modules/shared/shared.service.ts
+++ b/apps/erp/app/modules/shared/shared.service.ts
@@ -437,9 +437,9 @@ export async function getApprovalRuleByAmount(
.eq("enabled", true);
if (amount !== undefined && amount !== null) {
- query = query
- .lte("lowerBoundAmount", amount)
- .or(`upperBoundAmount.is.null,upperBoundAmount.gt.${amount}`);
+ // The matching tier is the highest one whose floor is at or below the
+ // amount; the next tier's floor is where its coverage ends.
+ query = query.lte("lowerBoundAmount", amount);
} else {
query = query.eq("lowerBoundAmount", 0);
}
diff --git a/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json b/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json
index 64a3769809..c6e5d073ef 100644
--- a/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json
+++ b/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json
@@ -1,5 +1,5 @@
{
- "generated": "2026-05-27T05:23:24.664Z",
+ "generated": "2026-05-27T14:05:32.644Z",
"totalTools": 1083,
"modules": 15,
"tools": [
diff --git a/apps/erp/app/routes/x+/settings+/approval-rules.$id.tsx b/apps/erp/app/routes/x+/settings+/approval-rules.$id.tsx
index 4428598d5c..8905d80d11 100644
--- a/apps/erp/app/routes/x+/settings+/approval-rules.$id.tsx
+++ b/apps/erp/app/routes/x+/settings+/approval-rules.$id.tsx
@@ -13,7 +13,6 @@ import {
getApprovalRules,
upsertApprovalRule
} from "~/modules/shared";
-import { topTierWouldBeUnbounded } from "~/modules/shared/approval-rules.coverage";
import { getParams, path } from "~/utils/path";
@@ -77,29 +76,6 @@ export async function action({ request, params }: ActionFunctionArgs) {
);
}
- // Highest-tier coverage check: enforce that the highest-lowerBoundAmount
- // tier always has at least one rule with no upper bound.
- if (validation.data.documentType === "purchaseOrder") {
- if (
- !topTierWouldBeUnbounded({
- existingRules: rules.data ?? [],
- documentType: "purchaseOrder",
- candidate: {
- id,
- lowerBoundAmount: validation.data.lowerBoundAmount ?? 0,
- upperBoundAmount: validation.data.upperBoundAmount ?? null
- }
- })
- ) {
- return validationError({
- fieldErrors: {
- upperBoundAmount:
- "The highest tier must leave the maximum empty so it covers all amounts above its minimum."
- }
- });
- }
- }
-
const result = await upsertApprovalRule(serviceRole, {
id,
updatedBy: userId,
@@ -107,8 +83,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
enabled: validation.data.enabled,
approverGroupIds: validation.data.approverGroupIds || [],
defaultApproverId: validation.data.defaultApproverId,
- lowerBoundAmount: validation.data.lowerBoundAmount ?? 0,
- upperBoundAmount: validation.data.upperBoundAmount
+ lowerBoundAmount: validation.data.lowerBoundAmount ?? 0
});
if (result.error) {
diff --git a/apps/erp/app/routes/x+/settings+/approval-rules.new.tsx b/apps/erp/app/routes/x+/settings+/approval-rules.new.tsx
index 46ccac3792..d7f5f740eb 100644
--- a/apps/erp/app/routes/x+/settings+/approval-rules.new.tsx
+++ b/apps/erp/app/routes/x+/settings+/approval-rules.new.tsx
@@ -9,10 +9,8 @@ import { ApprovalRuleForm } from "~/modules/settings";
import {
type ApprovalDocumentType,
approvalRuleValidator,
- getApprovalRules,
upsertApprovalRule
} from "~/modules/shared";
-import { topTierWouldBeUnbounded } from "~/modules/shared/approval-rules.coverage";
import { path } from "~/utils/path";
export async function loader({ request }: LoaderFunctionArgs) {
@@ -53,31 +51,6 @@ export async function action({ request }: ActionFunctionArgs) {
return validationError(validation.error);
}
- // Highest-tier coverage check: if this rule would be at (or tied for)
- // the highest lowerBoundAmount for its doc type AND it has a max set,
- // make sure at least one rule at that tier remains unbounded above —
- // otherwise amounts above the new top would silently bypass approval.
- if (validation.data.documentType === "purchaseOrder") {
- const existing = await getApprovalRules(serviceRole, companyId);
- if (
- !topTierWouldBeUnbounded({
- existingRules: existing.data ?? [],
- documentType: "purchaseOrder",
- candidate: {
- lowerBoundAmount: validation.data.lowerBoundAmount ?? 0,
- upperBoundAmount: validation.data.upperBoundAmount ?? null
- }
- })
- ) {
- return validationError({
- fieldErrors: {
- upperBoundAmount:
- "The highest tier must leave the maximum empty so it covers all amounts above its minimum."
- }
- });
- }
- }
-
const result = await upsertApprovalRule(serviceRole, {
createdBy: userId,
companyId,
@@ -85,8 +58,7 @@ export async function action({ request }: ActionFunctionArgs) {
enabled: validation.data.enabled,
approverGroupIds: validation.data.approverGroupIds || [],
defaultApproverId: validation.data.defaultApproverId,
- lowerBoundAmount: validation.data.lowerBoundAmount ?? 0,
- upperBoundAmount: validation.data.upperBoundAmount
+ lowerBoundAmount: validation.data.lowerBoundAmount ?? 0
});
if (result.error) {
diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts
index c90466e0ef..b5b4b3fd2e 100644
--- a/packages/database/src/types.ts
+++ b/packages/database/src/types.ts
@@ -1726,7 +1726,6 @@ export type Database = {
lowerBoundAmount: number
updatedAt: string | null
updatedBy: string | null
- upperBoundAmount: number | null
}
Insert: {
approverGroupIds?: string[] | null
@@ -1741,7 +1740,6 @@ export type Database = {
lowerBoundAmount?: number
updatedAt?: string | null
updatedBy?: string | null
- upperBoundAmount?: number | null
}
Update: {
approverGroupIds?: string[] | null
@@ -1756,7 +1754,6 @@ export type Database = {
lowerBoundAmount?: number
updatedAt?: string | null
updatedBy?: string | null
- upperBoundAmount?: number | null
}
Relationships: [
{
@@ -1998,6 +1995,180 @@ export type Database = {
},
]
}
+ balloon: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ inspectionDocumentId: string
+ inspectionFeatureId: string
+ pageNumber: number
+ regionHeight: number
+ regionWidth: number
+ regionX: number
+ regionY: number
+ updatedAt: string | null
+ updatedBy: string | null
+ xCoordinate: number
+ yCoordinate: number
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ inspectionDocumentId: string
+ inspectionFeatureId: string
+ pageNumber: number
+ regionHeight: number
+ regionWidth: number
+ regionX: number
+ regionY: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ xCoordinate: number
+ yCoordinate: number
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ inspectionDocumentId?: string
+ inspectionFeatureId?: string
+ pageNumber?: number
+ regionHeight?: number
+ regionWidth?: number
+ regionX?: number
+ regionY?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ xCoordinate?: number
+ yCoordinate?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "balloon_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "balloon_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "balloon_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "balloon_document_company_fkey"
+ columns: ["inspectionDocumentId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "inspectionDocument"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "balloon_document_company_fkey"
+ columns: ["inspectionDocumentId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "inspectionDocuments"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "balloon_inspectionFeatureId_fkey"
+ columns: ["inspectionFeatureId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "inspectionFeature"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "balloon_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
batchProperty: {
Row: {
companyId: string
@@ -12159,6 +12330,403 @@ export type Database = {
},
]
}
+ inspectionDocument: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ defaultPageHeight: number | null
+ defaultPageWidth: number | null
+ drawingNumber: string | null
+ fileName: string | null
+ id: string
+ pageCount: number | null
+ partId: string
+ storagePath: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ uploadedBy: string | null
+ version: number
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ defaultPageHeight?: number | null
+ defaultPageWidth?: number | null
+ drawingNumber?: string | null
+ fileName?: string | null
+ id?: string
+ pageCount?: number | null
+ partId: string
+ storagePath?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ uploadedBy?: string | null
+ version?: number
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ defaultPageHeight?: number | null
+ defaultPageWidth?: number | null
+ drawingNumber?: string | null
+ fileName?: string | null
+ id?: string
+ pageCount?: number | null
+ partId?: string
+ storagePath?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ uploadedBy?: string | null
+ version?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ inspectionFeature: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ description: string | null
+ id: string
+ inspectionDocumentId: string
+ label: string
+ nominalValue: string | null
+ pageNumber: number
+ toleranceMinus: string | null
+ tolerancePlus: string | null
+ type: Database["public"]["Enums"]["procedureStepType"]
+ unit: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ description?: string | null
+ id?: string
+ inspectionDocumentId: string
+ label: string
+ nominalValue?: string | null
+ pageNumber: number
+ toleranceMinus?: string | null
+ tolerancePlus?: string | null
+ type?: Database["public"]["Enums"]["procedureStepType"]
+ unit?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ description?: string | null
+ id?: string
+ inspectionDocumentId?: string
+ label?: string
+ nominalValue?: string | null
+ pageNumber?: number
+ toleranceMinus?: string | null
+ tolerancePlus?: string | null
+ type?: Database["public"]["Enums"]["procedureStepType"]
+ unit?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "inspectionFeature_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_document_company_fkey"
+ columns: ["inspectionDocumentId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "inspectionDocument"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_document_company_fkey"
+ columns: ["inspectionDocumentId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "inspectionDocuments"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
integration: {
Row: {
id: string
@@ -37722,7 +38290,7 @@ export type Database = {
},
]
}
- searchIndex_NNpC4dvEPuwDGzAL82Y5fS: {
+ searchIndex_LPwQiGPcoBnievXwSmP5Nz: {
Row: {
createdAt: string
description: string | null
@@ -49985,6 +50553,203 @@ export type Database = {
},
]
}
+ inspectionDocuments: {
+ Row: {
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ defaultPageHeight: number | null
+ defaultPageWidth: number | null
+ drawingNumber: string | null
+ fileName: string | null
+ id: string | null
+ pageCount: number | null
+ partId: string | null
+ partReadableId: string | null
+ storagePath: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ uploadedBy: string | null
+ version: number | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
integrations: {
Row: {
active: boolean | null
@@ -54649,14 +55414,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["supplierCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["supplierCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -63749,6 +64514,20 @@ export type Database = {
Args: { p_item_id: string; p_receipt_id: string }
Returns: string
}
+ save_inspection_document_atomic: {
+ Args: {
+ p_balloons?: Json
+ p_company_id: string
+ p_default_page_height?: number
+ p_default_page_width?: number
+ p_features?: Json
+ p_inspection_document_id: string
+ p_page_count?: number
+ p_pdf_url?: string
+ p_user_id: string
+ }
+ Returns: Json
+ }
search_company_index: {
Args: {
p_company_id: string
diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.ts
index c90466e0ef..b5b4b3fd2e 100644
--- a/packages/database/supabase/functions/lib/types.ts
+++ b/packages/database/supabase/functions/lib/types.ts
@@ -1726,7 +1726,6 @@ export type Database = {
lowerBoundAmount: number
updatedAt: string | null
updatedBy: string | null
- upperBoundAmount: number | null
}
Insert: {
approverGroupIds?: string[] | null
@@ -1741,7 +1740,6 @@ export type Database = {
lowerBoundAmount?: number
updatedAt?: string | null
updatedBy?: string | null
- upperBoundAmount?: number | null
}
Update: {
approverGroupIds?: string[] | null
@@ -1756,7 +1754,6 @@ export type Database = {
lowerBoundAmount?: number
updatedAt?: string | null
updatedBy?: string | null
- upperBoundAmount?: number | null
}
Relationships: [
{
@@ -1998,6 +1995,180 @@ export type Database = {
},
]
}
+ balloon: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ inspectionDocumentId: string
+ inspectionFeatureId: string
+ pageNumber: number
+ regionHeight: number
+ regionWidth: number
+ regionX: number
+ regionY: number
+ updatedAt: string | null
+ updatedBy: string | null
+ xCoordinate: number
+ yCoordinate: number
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ inspectionDocumentId: string
+ inspectionFeatureId: string
+ pageNumber: number
+ regionHeight: number
+ regionWidth: number
+ regionX: number
+ regionY: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ xCoordinate: number
+ yCoordinate: number
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ inspectionDocumentId?: string
+ inspectionFeatureId?: string
+ pageNumber?: number
+ regionHeight?: number
+ regionWidth?: number
+ regionX?: number
+ regionY?: number
+ updatedAt?: string | null
+ updatedBy?: string | null
+ xCoordinate?: number
+ yCoordinate?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "balloon_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "balloon_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "balloon_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "balloon_document_company_fkey"
+ columns: ["inspectionDocumentId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "inspectionDocument"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "balloon_document_company_fkey"
+ columns: ["inspectionDocumentId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "inspectionDocuments"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "balloon_inspectionFeatureId_fkey"
+ columns: ["inspectionFeatureId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "inspectionFeature"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "balloon_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "balloon_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
batchProperty: {
Row: {
companyId: string
@@ -12159,6 +12330,403 @@ export type Database = {
},
]
}
+ inspectionDocument: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ defaultPageHeight: number | null
+ defaultPageWidth: number | null
+ drawingNumber: string | null
+ fileName: string | null
+ id: string
+ pageCount: number | null
+ partId: string
+ storagePath: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ uploadedBy: string | null
+ version: number
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ defaultPageHeight?: number | null
+ defaultPageWidth?: number | null
+ drawingNumber?: string | null
+ fileName?: string | null
+ id?: string
+ pageCount?: number | null
+ partId: string
+ storagePath?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ uploadedBy?: string | null
+ version?: number
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ defaultPageHeight?: number | null
+ defaultPageWidth?: number | null
+ drawingNumber?: string | null
+ fileName?: string | null
+ id?: string
+ pageCount?: number | null
+ partId?: string
+ storagePath?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ uploadedBy?: string | null
+ version?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
+ inspectionFeature: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ description: string | null
+ id: string
+ inspectionDocumentId: string
+ label: string
+ nominalValue: string | null
+ pageNumber: number
+ toleranceMinus: string | null
+ tolerancePlus: string | null
+ type: Database["public"]["Enums"]["procedureStepType"]
+ unit: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ description?: string | null
+ id?: string
+ inspectionDocumentId: string
+ label: string
+ nominalValue?: string | null
+ pageNumber: number
+ toleranceMinus?: string | null
+ tolerancePlus?: string | null
+ type?: Database["public"]["Enums"]["procedureStepType"]
+ unit?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ description?: string | null
+ id?: string
+ inspectionDocumentId?: string
+ label?: string
+ nominalValue?: string | null
+ pageNumber?: number
+ toleranceMinus?: string | null
+ tolerancePlus?: string | null
+ type?: Database["public"]["Enums"]["procedureStepType"]
+ unit?: string | null
+ updatedAt?: string | null
+ updatedBy?: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "inspectionFeature_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_document_company_fkey"
+ columns: ["inspectionDocumentId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "inspectionDocument"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_document_company_fkey"
+ columns: ["inspectionDocumentId", "companyId"]
+ isOneToOne: false
+ referencedRelation: "inspectionDocuments"
+ referencedColumns: ["id", "companyId"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionFeature_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
integration: {
Row: {
id: string
@@ -37722,7 +38290,7 @@ export type Database = {
},
]
}
- searchIndex_NNpC4dvEPuwDGzAL82Y5fS: {
+ searchIndex_LPwQiGPcoBnievXwSmP5Nz: {
Row: {
createdAt: string
description: string | null
@@ -49985,6 +50553,203 @@ export type Database = {
},
]
}
+ inspectionDocuments: {
+ Row: {
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ defaultPageHeight: number | null
+ defaultPageWidth: number | null
+ drawingNumber: string | null
+ fileName: string | null
+ id: string | null
+ pageCount: number | null
+ partId: string | null
+ partReadableId: string | null
+ storagePath: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ uploadedBy: string | null
+ version: number | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "services"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_partId_fkey"
+ columns: ["partId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "inspectionDocument_uploadedBy_fkey"
+ columns: ["uploadedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
integrations: {
Row: {
active: boolean | null
@@ -54649,14 +55414,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["supplierCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["supplierCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -63749,6 +64514,20 @@ export type Database = {
Args: { p_item_id: string; p_receipt_id: string }
Returns: string
}
+ save_inspection_document_atomic: {
+ Args: {
+ p_balloons?: Json
+ p_company_id: string
+ p_default_page_height?: number
+ p_default_page_width?: number
+ p_features?: Json
+ p_inspection_document_id: string
+ p_page_count?: number
+ p_pdf_url?: string
+ p_user_id: string
+ }
+ Returns: Json
+ }
search_company_index: {
Args: {
p_company_id: string
diff --git a/packages/database/supabase/migrations/20260527000000_remove-approval-rule-upper-bound.sql b/packages/database/supabase/migrations/20260527000000_remove-approval-rule-upper-bound.sql
new file mode 100644
index 0000000000..09d9735649
--- /dev/null
+++ b/packages/database/supabase/migrations/20260527000000_remove-approval-rule-upper-bound.sql
@@ -0,0 +1,5 @@
+-- Drop the approval rule upper bound. A tier's ceiling is the next-higher
+-- tier's minimum, so the stored column is redundant. Dropping the column also
+-- drops its CHECK constraint.
+
+ALTER TABLE "approvalRule" DROP COLUMN "upperBoundAmount";
diff --git a/packages/locale/locales/de/erp.po b/packages/locale/locales/de/erp.po
index fc1a210ef0..8cce6c5b7b 100644
--- a/packages/locale/locales/de/erp.po
+++ b/packages/locale/locales/de/erp.po
@@ -533,6 +533,9 @@ msgstr ""
msgid "Approval Date"
msgstr "Genehmigungsdatum"
+msgid "Approval is required at or above this amount, up to the next rule's minimum"
+msgstr ""
+
msgid "Approval Requirements"
msgstr "Genehmigungsanforderungen"
@@ -3787,9 +3790,6 @@ msgstr "Spalten ausblenden, fixieren und neu anordnen"
msgid "Higher priority wins ties and applies first for markups"
msgstr "Höhere Priorität gewinnt bei Gleichständen und wird zuerst für Aufschläge angewendet"
-msgid "Highest-tier rule has a maximum"
-msgstr ""
-
msgid "History"
msgstr "Verlauf"
@@ -4282,9 +4282,6 @@ msgstr "Alle zugehörigen Belege unverändert lassen"
msgid "Leave empty for exact match"
msgstr "Leer lassen für exakte Übereinstimmung"
-msgid "Leave empty for no upper limit"
-msgstr ""
-
msgid "Leave this page"
msgstr "Diese Seite verlassen"
@@ -4626,9 +4623,6 @@ msgstr "Max. Menge"
msgid "Maximum"
msgstr "Maximum"
-msgid "Maximum Amount"
-msgstr ""
-
msgid "Maximum Inventory Quantity"
msgstr "Maximale Bestandsmenge"
@@ -6001,10 +5995,6 @@ msgstr "Bestellung erfolgreich entfernt"
msgid "Purchase Orders"
msgstr "Bestellungen"
-#. placeholder {0}: currencyFormatter.format(poTopTierGap)
-msgid "Purchase orders above {0} will not require approval. Edit the top-tier rule and clear the Maximum Amount, or add a higher rule with no maximum."
-msgstr ""
-
msgid "Purchase orders required"
msgstr "Bestellungen erforderlich"
diff --git a/packages/locale/locales/en/erp.po b/packages/locale/locales/en/erp.po
index aaf75fc723..9a91ff308f 100644
--- a/packages/locale/locales/en/erp.po
+++ b/packages/locale/locales/en/erp.po
@@ -533,6 +533,9 @@ msgstr "Approaching {PO_EMAIL_ATTACHMENT_LIMIT_MB} MB cap."
msgid "Approval Date"
msgstr "Approval Date"
+msgid "Approval is required at or above this amount, up to the next rule's minimum"
+msgstr "Approval is required at or above this amount, up to the next rule's minimum"
+
msgid "Approval Requirements"
msgstr "Approval Requirements"
@@ -3787,9 +3790,6 @@ msgstr "Hide, pin and reorder columns"
msgid "Higher priority wins ties and applies first for markups"
msgstr "Higher priority wins ties and applies first for markups"
-msgid "Highest-tier rule has a maximum"
-msgstr "Highest-tier rule has a maximum"
-
msgid "History"
msgstr "History"
@@ -4282,9 +4282,6 @@ msgstr "Leave any related receipts untouched"
msgid "Leave empty for exact match"
msgstr "Leave empty for exact match"
-msgid "Leave empty for no upper limit"
-msgstr "Leave empty for no upper limit"
-
msgid "Leave this page"
msgstr "Leave this page"
@@ -4626,9 +4623,6 @@ msgstr "Max Quantity"
msgid "Maximum"
msgstr "Maximum"
-msgid "Maximum Amount"
-msgstr "Maximum Amount"
-
msgid "Maximum Inventory Quantity"
msgstr "Maximum Inventory Quantity"
@@ -6001,10 +5995,6 @@ msgstr "Purchase order removed successfully"
msgid "Purchase Orders"
msgstr "Purchase Orders"
-#. placeholder {0}: currencyFormatter.format(poTopTierGap)
-msgid "Purchase orders above {0} will not require approval. Edit the top-tier rule and clear the Maximum Amount, or add a higher rule with no maximum."
-msgstr "Purchase orders above {0} will not require approval. Edit the top-tier rule and clear the Maximum Amount, or add a higher rule with no maximum."
-
msgid "Purchase orders required"
msgstr "Purchase orders required"
diff --git a/packages/locale/locales/es/erp.po b/packages/locale/locales/es/erp.po
index 0f12b7fbb9..f38bed68f1 100644
--- a/packages/locale/locales/es/erp.po
+++ b/packages/locale/locales/es/erp.po
@@ -533,6 +533,9 @@ msgstr ""
msgid "Approval Date"
msgstr "Fecha de Aprobación"
+msgid "Approval is required at or above this amount, up to the next rule's minimum"
+msgstr ""
+
msgid "Approval Requirements"
msgstr "Requisitos de Aprobación"
@@ -3787,9 +3790,6 @@ msgstr "Ocultar, anclar y reordenar columnas"
msgid "Higher priority wins ties and applies first for markups"
msgstr "Mayor prioridad gana empates y se aplica primero para márgenes"
-msgid "Highest-tier rule has a maximum"
-msgstr ""
-
msgid "History"
msgstr "Historial"
@@ -4282,9 +4282,6 @@ msgstr "Dejar los recibos relacionados sin tocar"
msgid "Leave empty for exact match"
msgstr "Dejar vacío para coincidencia exacta"
-msgid "Leave empty for no upper limit"
-msgstr ""
-
msgid "Leave this page"
msgstr "Salir de esta página"
@@ -4626,9 +4623,6 @@ msgstr "Cantidad Máxima"
msgid "Maximum"
msgstr "Máximo"
-msgid "Maximum Amount"
-msgstr ""
-
msgid "Maximum Inventory Quantity"
msgstr "Cantidad Máxima de Inventario"
@@ -6001,10 +5995,6 @@ msgstr "Orden de compra eliminada exitosamente"
msgid "Purchase Orders"
msgstr "Órdenes de Compra"
-#. placeholder {0}: currencyFormatter.format(poTopTierGap)
-msgid "Purchase orders above {0} will not require approval. Edit the top-tier rule and clear the Maximum Amount, or add a higher rule with no maximum."
-msgstr ""
-
msgid "Purchase orders required"
msgstr "Órdenes de compra requeridas"
diff --git a/packages/locale/locales/fr/erp.po b/packages/locale/locales/fr/erp.po
index a0cd06e849..9ad16086d8 100644
--- a/packages/locale/locales/fr/erp.po
+++ b/packages/locale/locales/fr/erp.po
@@ -533,6 +533,9 @@ msgstr ""
msgid "Approval Date"
msgstr "Date d'approbation"
+msgid "Approval is required at or above this amount, up to the next rule's minimum"
+msgstr ""
+
msgid "Approval Requirements"
msgstr "Exigences d'approbation"
@@ -3787,9 +3790,6 @@ msgstr "Masquer, épingler et réorganiser les colonnes"
msgid "Higher priority wins ties and applies first for markups"
msgstr "La priorité plus élevée gagne les égalités et s'applique en premier pour les majorations"
-msgid "Highest-tier rule has a maximum"
-msgstr ""
-
msgid "History"
msgstr "Historique"
@@ -4282,9 +4282,6 @@ msgstr "Laisser les reçus connexes intacts"
msgid "Leave empty for exact match"
msgstr "Laisser vide pour une correspondance exacte"
-msgid "Leave empty for no upper limit"
-msgstr ""
-
msgid "Leave this page"
msgstr "Quitter cette page"
@@ -4626,9 +4623,6 @@ msgstr "Quantité Max"
msgid "Maximum"
msgstr "Maximum"
-msgid "Maximum Amount"
-msgstr ""
-
msgid "Maximum Inventory Quantity"
msgstr "Quantité d'inventaire maximale"
@@ -6001,10 +5995,6 @@ msgstr "Bon de commande supprimé avec succès"
msgid "Purchase Orders"
msgstr "Bons de commande"
-#. placeholder {0}: currencyFormatter.format(poTopTierGap)
-msgid "Purchase orders above {0} will not require approval. Edit the top-tier rule and clear the Maximum Amount, or add a higher rule with no maximum."
-msgstr ""
-
msgid "Purchase orders required"
msgstr "Bons de commande requis"
diff --git a/packages/locale/locales/hi/erp.po b/packages/locale/locales/hi/erp.po
index 9ec781bb5f..7ac058d18a 100644
--- a/packages/locale/locales/hi/erp.po
+++ b/packages/locale/locales/hi/erp.po
@@ -533,6 +533,9 @@ msgstr ""
msgid "Approval Date"
msgstr "अनुमोदन तारीख"
+msgid "Approval is required at or above this amount, up to the next rule's minimum"
+msgstr ""
+
msgid "Approval Requirements"
msgstr "अनुमोदन आवश्यकताएं"
@@ -3787,9 +3790,6 @@ msgstr "कॉलम को छिपाएं, पिन करें और
msgid "Higher priority wins ties and applies first for markups"
msgstr "उच्च प्राथमिकता टाई जीतती है और मार्कअप के लिए पहले लागू होती है"
-msgid "Highest-tier rule has a maximum"
-msgstr ""
-
msgid "History"
msgstr "इतिहास"
@@ -4282,9 +4282,6 @@ msgstr "किसी भी संबंधित रसीदों को अ
msgid "Leave empty for exact match"
msgstr "सटीक मिलान के लिए खाली छोड़ें"
-msgid "Leave empty for no upper limit"
-msgstr ""
-
msgid "Leave this page"
msgstr "इस पृष्ठ को छोड़ें"
@@ -4626,9 +4623,6 @@ msgstr "अधिकतम मात्रा"
msgid "Maximum"
msgstr "अधिकतम"
-msgid "Maximum Amount"
-msgstr ""
-
msgid "Maximum Inventory Quantity"
msgstr "अधिकतम इन्वेंटरी मात्रा"
@@ -6001,10 +5995,6 @@ msgstr "क्रय आदेश सफलतापूर्वक हटा
msgid "Purchase Orders"
msgstr "क्रय आदेश"
-#. placeholder {0}: currencyFormatter.format(poTopTierGap)
-msgid "Purchase orders above {0} will not require approval. Edit the top-tier rule and clear the Maximum Amount, or add a higher rule with no maximum."
-msgstr ""
-
msgid "Purchase orders required"
msgstr "क्रय आदेश आवश्यक हैं"
diff --git a/packages/locale/locales/it/erp.po b/packages/locale/locales/it/erp.po
index c82232cbc4..727ec8f0a5 100644
--- a/packages/locale/locales/it/erp.po
+++ b/packages/locale/locales/it/erp.po
@@ -533,6 +533,9 @@ msgstr ""
msgid "Approval Date"
msgstr "Data di approvazione"
+msgid "Approval is required at or above this amount, up to the next rule's minimum"
+msgstr ""
+
msgid "Approval Requirements"
msgstr "Requisiti di Approvazione"
@@ -3787,9 +3790,6 @@ msgstr "Nascondi, fissa e riordina le colonne"
msgid "Higher priority wins ties and applies first for markups"
msgstr "La priorità più alta vince i pareggi e si applica per prima per i ricarichi"
-msgid "Highest-tier rule has a maximum"
-msgstr ""
-
msgid "History"
msgstr "Cronologia"
@@ -4282,9 +4282,6 @@ msgstr "Lasciare le ricevute correlate intatte"
msgid "Leave empty for exact match"
msgstr "Lascia vuoto per una corrispondenza esatta"
-msgid "Leave empty for no upper limit"
-msgstr ""
-
msgid "Leave this page"
msgstr "Lascia questa pagina"
@@ -4626,9 +4623,6 @@ msgstr "Quantità Massima"
msgid "Maximum"
msgstr "Massimo"
-msgid "Maximum Amount"
-msgstr ""
-
msgid "Maximum Inventory Quantity"
msgstr "Quantità Massima di Inventario"
@@ -6001,10 +5995,6 @@ msgstr "Ordine di acquisto rimosso con successo"
msgid "Purchase Orders"
msgstr "Ordini di Acquisto"
-#. placeholder {0}: currencyFormatter.format(poTopTierGap)
-msgid "Purchase orders above {0} will not require approval. Edit the top-tier rule and clear the Maximum Amount, or add a higher rule with no maximum."
-msgstr ""
-
msgid "Purchase orders required"
msgstr "Ordini di acquisto richiesti"
diff --git a/packages/locale/locales/ja/erp.po b/packages/locale/locales/ja/erp.po
index 133990fc89..19f7b0e232 100644
--- a/packages/locale/locales/ja/erp.po
+++ b/packages/locale/locales/ja/erp.po
@@ -533,6 +533,9 @@ msgstr ""
msgid "Approval Date"
msgstr "承認日"
+msgid "Approval is required at or above this amount, up to the next rule's minimum"
+msgstr ""
+
msgid "Approval Requirements"
msgstr "承認要件"
@@ -3787,9 +3790,6 @@ msgstr "列を非表示、ピン留め、並び替え"
msgid "Higher priority wins ties and applies first for markups"
msgstr "優先度が高いほど同点を制し、マークアップに最初に適用されます"
-msgid "Highest-tier rule has a maximum"
-msgstr ""
-
msgid "History"
msgstr "履歴"
@@ -4282,9 +4282,6 @@ msgstr "関連するすべての領収書はそのままにしておく"
msgid "Leave empty for exact match"
msgstr "正確な一致のために空のままにしてください"
-msgid "Leave empty for no upper limit"
-msgstr ""
-
msgid "Leave this page"
msgstr "このページを離れる"
@@ -4626,9 +4623,6 @@ msgstr "最大数量"
msgid "Maximum"
msgstr "最大"
-msgid "Maximum Amount"
-msgstr ""
-
msgid "Maximum Inventory Quantity"
msgstr "最大在庫数量"
@@ -6001,10 +5995,6 @@ msgstr "購買注文が正常に削除されました"
msgid "Purchase Orders"
msgstr "購入注文"
-#. placeholder {0}: currencyFormatter.format(poTopTierGap)
-msgid "Purchase orders above {0} will not require approval. Edit the top-tier rule and clear the Maximum Amount, or add a higher rule with no maximum."
-msgstr ""
-
msgid "Purchase orders required"
msgstr "購入注文が必要です"
diff --git a/packages/locale/locales/pl/erp.po b/packages/locale/locales/pl/erp.po
index 8f4d74053e..c9d61710ef 100644
--- a/packages/locale/locales/pl/erp.po
+++ b/packages/locale/locales/pl/erp.po
@@ -533,6 +533,9 @@ msgstr ""
msgid "Approval Date"
msgstr "Data zatwierdzenia"
+msgid "Approval is required at or above this amount, up to the next rule's minimum"
+msgstr ""
+
msgid "Approval Requirements"
msgstr "Wymagania zatwierdzenia"
@@ -3787,9 +3790,6 @@ msgstr "Ukryj, przypnij i zmień kolejność kolumn"
msgid "Higher priority wins ties and applies first for markups"
msgstr "Wyższy priorytet wygrywa remisy i jest stosowany jako pierwszy dla marż"
-msgid "Highest-tier rule has a maximum"
-msgstr ""
-
msgid "History"
msgstr "Historia"
@@ -4282,9 +4282,6 @@ msgstr "Pozostaw wszelkie powiązane paragony bez zmian"
msgid "Leave empty for exact match"
msgstr "Pozostaw puste dla dokładnego dopasowania"
-msgid "Leave empty for no upper limit"
-msgstr ""
-
msgid "Leave this page"
msgstr "Opuść tę stronę"
@@ -4626,9 +4623,6 @@ msgstr "Maks. Ilość"
msgid "Maximum"
msgstr "Maksimum"
-msgid "Maximum Amount"
-msgstr ""
-
msgid "Maximum Inventory Quantity"
msgstr "Maksymalna Ilość Zapasów"
@@ -6001,10 +5995,6 @@ msgstr "Zamówienie zakupu zostało pomyślnie usunięte"
msgid "Purchase Orders"
msgstr "Zamówienia Zakupu"
-#. placeholder {0}: currencyFormatter.format(poTopTierGap)
-msgid "Purchase orders above {0} will not require approval. Edit the top-tier rule and clear the Maximum Amount, or add a higher rule with no maximum."
-msgstr ""
-
msgid "Purchase orders required"
msgstr "Wymagane zamówienia zakupu"
diff --git a/packages/locale/locales/pt/erp.po b/packages/locale/locales/pt/erp.po
index 908b80a4e5..997b8c50e9 100644
--- a/packages/locale/locales/pt/erp.po
+++ b/packages/locale/locales/pt/erp.po
@@ -533,6 +533,9 @@ msgstr ""
msgid "Approval Date"
msgstr "Data de Aprovação"
+msgid "Approval is required at or above this amount, up to the next rule's minimum"
+msgstr ""
+
msgid "Approval Requirements"
msgstr "Requisitos de Aprovação"
@@ -3787,9 +3790,6 @@ msgstr "Ocultar, fixar e reordenar colunas"
msgid "Higher priority wins ties and applies first for markups"
msgstr "Prioridade mais alta vence empates e se aplica primeiro para margens"
-msgid "Highest-tier rule has a maximum"
-msgstr ""
-
msgid "History"
msgstr "Histórico"
@@ -4282,9 +4282,6 @@ msgstr "Deixar qualquer recebimento relacionado intocado"
msgid "Leave empty for exact match"
msgstr "Deixe vazio para correspondência exata"
-msgid "Leave empty for no upper limit"
-msgstr ""
-
msgid "Leave this page"
msgstr "Sair desta página"
@@ -4626,9 +4623,6 @@ msgstr "Quantidade Máxima"
msgid "Maximum"
msgstr "Máximo"
-msgid "Maximum Amount"
-msgstr ""
-
msgid "Maximum Inventory Quantity"
msgstr "Quantidade Máxima de Inventário"
@@ -6001,10 +5995,6 @@ msgstr "Ordem de compra removida com sucesso"
msgid "Purchase Orders"
msgstr "Pedidos de Compra"
-#. placeholder {0}: currencyFormatter.format(poTopTierGap)
-msgid "Purchase orders above {0} will not require approval. Edit the top-tier rule and clear the Maximum Amount, or add a higher rule with no maximum."
-msgstr ""
-
msgid "Purchase orders required"
msgstr "Ordens de compra necessárias"
diff --git a/packages/locale/locales/ru/erp.po b/packages/locale/locales/ru/erp.po
index 6fe233e889..35d228792a 100644
--- a/packages/locale/locales/ru/erp.po
+++ b/packages/locale/locales/ru/erp.po
@@ -533,6 +533,9 @@ msgstr ""
msgid "Approval Date"
msgstr "Дата одобрения"
+msgid "Approval is required at or above this amount, up to the next rule's minimum"
+msgstr ""
+
msgid "Approval Requirements"
msgstr "Требования к утверждению"
@@ -3787,9 +3790,6 @@ msgstr "Скрывать, закреплять и переупорядочива
msgid "Higher priority wins ties and applies first for markups"
msgstr "Более высокий приоритет выигрывает при равенстве и применяется первым для наценок"
-msgid "Highest-tier rule has a maximum"
-msgstr ""
-
msgid "History"
msgstr "История"
@@ -4282,9 +4282,6 @@ msgstr "Оставить все связанные квитанции без и
msgid "Leave empty for exact match"
msgstr "Оставьте пустым для точного совпадения"
-msgid "Leave empty for no upper limit"
-msgstr ""
-
msgid "Leave this page"
msgstr "Покинуть эту страницу"
@@ -4626,9 +4623,6 @@ msgstr "Макс. Количество"
msgid "Maximum"
msgstr "Максимум"
-msgid "Maximum Amount"
-msgstr ""
-
msgid "Maximum Inventory Quantity"
msgstr "Максимальное количество запасов"
@@ -6001,10 +5995,6 @@ msgstr "Заказ на покупку успешно удален"
msgid "Purchase Orders"
msgstr "Заказы на покупку"
-#. placeholder {0}: currencyFormatter.format(poTopTierGap)
-msgid "Purchase orders above {0} will not require approval. Edit the top-tier rule and clear the Maximum Amount, or add a higher rule with no maximum."
-msgstr ""
-
msgid "Purchase orders required"
msgstr "Требуются заказы на покупку"
diff --git a/packages/locale/locales/zh/erp.po b/packages/locale/locales/zh/erp.po
index a21923d717..85c5aac730 100644
--- a/packages/locale/locales/zh/erp.po
+++ b/packages/locale/locales/zh/erp.po
@@ -533,6 +533,9 @@ msgstr ""
msgid "Approval Date"
msgstr "批准日期"
+msgid "Approval is required at or above this amount, up to the next rule's minimum"
+msgstr ""
+
msgid "Approval Requirements"
msgstr "批准要求"
@@ -3787,9 +3790,6 @@ msgstr "隐藏、固定和重新排序列"
msgid "Higher priority wins ties and applies first for markups"
msgstr "更高的优先级在平局时获胜,并首先应用于加价"
-msgid "Highest-tier rule has a maximum"
-msgstr ""
-
msgid "History"
msgstr "历史"
@@ -4282,9 +4282,6 @@ msgstr "保留任何相关收据不变"
msgid "Leave empty for exact match"
msgstr "留空以精确匹配"
-msgid "Leave empty for no upper limit"
-msgstr ""
-
msgid "Leave this page"
msgstr "离开此页面"
@@ -4626,9 +4623,6 @@ msgstr "最大数量"
msgid "Maximum"
msgstr "最大值"
-msgid "Maximum Amount"
-msgstr ""
-
msgid "Maximum Inventory Quantity"
msgstr "最大库存数量"
@@ -6001,10 +5995,6 @@ msgstr "采购订单已成功删除"
msgid "Purchase Orders"
msgstr "采购订单"
-#. placeholder {0}: currencyFormatter.format(poTopTierGap)
-msgid "Purchase orders above {0} will not require approval. Edit the top-tier rule and clear the Maximum Amount, or add a higher rule with no maximum."
-msgstr ""
-
msgid "Purchase orders required"
msgstr "采购订单必需"