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(sales): all-customers price overrides are visible, linkable and deliberate (#2057)

Brad Barbin81050bb9612a
diff --git a/.ai/plans/2026-10-27-price-list-all-customers.md b/.ai/plans/2026-10-27-price-list-all-customers.md
new file mode 100644
index 0000000000..e0373944cf
--- /dev/null
+++ b/.ai/plans/2026-10-27-price-list-all-customers.md
@@ -0,0 +1,103 @@
+# Price List: make all-customers overrides visible, linkable and deliberate
+
+Branch: `fix/price-list-all-customers-scope` (from `origin/main`).
+
+## Context
+
+A quote for Airlogix showed a −$3,320 "All Override" step that the user could not find or remove.
+It is a `customerItemPriceOverride` row with no `customerId` and no `customerTypeId` — an
+**all-customers** override ($6,679 on TTJ-300, copied from Q000004's manual price, note
+"Source: Q000004 … set 2026-10-23"). The schema supports this scope on purpose
+(`customerItemPriceOverride_all_item_uq`, migration `20260414120001`), and the pricing engine
+applies it (`resolvePrice`, `sales.service.ts` ~2346; `resolvePriceList` ~2650), but:
+
+1. **No screen lists it.** `resolvePriceList` (`sales.service.ts` ~2486) lists only items with an
+ override at the chosen scope; with no scope, `getBaseCatalog` ignores overrides. The
+ `ScopePicker` offers only customer types and customers.
+2. **No form can create or show it.** `PriceOverrideForm` scope is `"customer" | "customerType"`.
+3. **The write is silent.** `upsertCustomerItemPriceOverride` (MCP tool + HTTP + both form
+ routes) treats "no customerId and no customerTypeId" as all customers, so one omitted field
+ turned a one-off quote price into everyone's list price. The form route can do the same
+ (customer scope with an empty Customer field).
+4. **The trace can't link to it.** Override steps carry no id; only rule steps link.
+
+Decisions (agreed): explicit `allCustomers` flag checked in the building block; a customer or
+type scope also lists the overrides it inherits, tagged with the existing badges.
+
+## Changes
+
+### 1. Guard the write — `apps/erp/app/modules/sales/sales.service.ts`
+- `upsertCustomerItemPriceOverride(db, companyId, userId, data)`: add `allCustomers?: boolean`.
+ - neither id and `allCustomers !== true` → `{ error: { message: "Choose a customer, a customer type, or All Customers" } }`
+ - `allCustomers === true` with either id → error ("All Customers cannot also name a customer or type").
+- `sales.server.ts` `upsertCustomerItemPriceOverride` input: add
+ `allCustomers: z.boolean().describe("Set true to apply the price to every customer. Required when neither customerId nor customerTypeId is sent.").optional()`.
+- `sales.models.ts` `priceOverrideValidator`: add `allCustomers: zfd.checkbox()`; refine
+ "exactly one scope" (customer, type, or all) with the field error on `customerId`.
+- Both routes (`price-list.new.tsx`, `price-list.$overrideId.tsx`) pass `allCustomers` through.
+- Regenerate MCP metadata (`pnpm run generate:mcp`) — the tool schema gains one field.
+
+### 2. Form — `ui/Pricing/PriceOverrideForm.tsx`
+- `ScopeType` gains `"all"`; third `ChoiceCardGroup` option **All Customers** ("Override the
+ price for every customer", `LuGlobe`). Initial scope: `all` when editing a row with neither id
+ (today it falls into "customer" with an empty field). `all` renders `Hidden` empty ids +
+ `Hidden name="allCustomers" value="on"`.
+- `price-list.new.tsx` loader: `?scope=all` seeds `initialScope: "all"`.
+
+### 3. List — `resolvePriceList` + loader + picker
+- `resolvePriceList` args gain `allCustomers?: boolean`.
+ - **Item set:** union of item ids with an active override at the requested scope AND, for a
+ customer, its type's and the all-customers overrides; for a type, the all-customers ones;
+ for `allCustomers`, the all-customers ones only. (Resolve the customer's type before the
+ scope query — it is already read further down; move it up, one read.)
+ - Per-row resolution is unchanged (override ?? type ?? all), so `overrideSource` and
+ `overrideId` already point at the override that applies; the table's existing badge
+ (`PriceOverridesTable.tsx` line ~71) and Edit/Delete use them.
+- `resolvePriceList` service fn (`sales.server.ts` ~6934): add `allCustomers` to input.
+- `utils/list-registry/sales.server.ts` `priceListList`: `scope=all` param → `resolvePriceList({ allCustomers: true })`.
+- `price-list.tsx` `hasScope` includes `scope=all`.
+- `ScopePicker.tsx`: `helper` gains `"All"`; a first group with one item **All Customers**
+ (value `"all"`, icon `LuGlobe`), always present. `PriceOverridesTable.handleScopeChange`
+ maps it to `scope=all` (clearing `customerId`/`customerTypeId`); `scopeId` reads it back.
+ Options are added in the loader so the empty state (`PriceListScopeEmpty`) gets it too.
+- Duplicate modal: out of scope (it requires a target scope; all-customers as a source/target is
+ a later change).
+
+### 4. Trace link — `types.ts`, `resolvePrice`, `resolvePriceList`, `PriceTraceModal.tsx`
+- `PriceTraceStep` gains `overrideId?: string`.
+- Set it on the Override / Type Override / All Override steps in both `resolvePrice` (~2307–2368)
+ and `resolvePriceList` (~2662–2696).
+- `PriceTraceModal` (~167): link `step.overrideId` to `path.to.priceOverride(id)` the same way
+ `ruleId` links to `path.to.pricingRule`. Traces stored before this change have no id and stay
+ plain text.
+
+### 5. Docs / rules
+- `apps/erp/app/modules/sales/AGENTS.md`: the three override scopes, the `allCustomers` flag,
+ and that a scoped list shows inherited overrides.
+- Docs page for price lists if one exists under `docs/content/docs/reference/` (check; ground in code).
+- Lingui: `pnpm lingui:extract` for the new strings.
+
+## Tests (red → green)
+- `upsertCustomerItemPriceOverride` scope guard: no scope + no flag refused; flag + id refused;
+ flag alone writes a row with both ids null. Live-DB test beside the existing sales ones
+ (`apps/erp/test/database/`), or a pure helper `priceOverrideScopeError(data)` in
+ `sales.utils.ts` tested in `sales.utils.test.ts` if the DB fixtures don't cover sales.
+- `priceOverrideValidator` refines in `sales.models.test.ts`: exactly one scope.
+- Item-set union: pure helper (`priceListItemIds(rows, scope)`) tested in `sales.utils.test.ts`.
+
+## Verification
+- `pnpm exec turbo run typecheck --filter=erp`, `pnpm run lint`, `pnpm --filter erp test`
+ (scoped to the sales tests), `pnpm run generate:mcp` diff shows only the new field.
+- Browser (`/auth` + `/test`, local stack): seed an all-customers override, then
+ - Price List → scope picker shows **All Customers**; selecting it lists the row with an
+ All Override badge; Edit opens the form on **All Customers**; Delete removes it.
+ - Choose a customer → the same item appears tagged All Override.
+ - Quote line → Pricing Trace → the All Override description links to the override.
+ - Override form → All Customers → saves; Specific Customer with an empty Customer → field error.
+- MCP: `sales_upsertCustomerItemPriceOverride` with only `itemId` → refused with the message;
+ with `allCustomers: true` → succeeds.
+
+## Separate from this branch (production data)
+The Airlogix/TTJ-300 override still applies in the tenant. Once this ships it is reachable via
+All Customers; until then it can be deleted through `sales_deleteCustomerItemPriceOverride`
+once its id is known (I'll ask before any destructive call).
diff --git a/.claude/rules/quote-discount-system.md b/.claude/rules/quote-discount-system.md
index ade8c1dcc7..5fbe60251a 100644
--- a/.claude/rules/quote-discount-system.md
+++ b/.claude/rules/quote-discount-system.md
@@ -72,7 +72,7 @@ Standalone rules, `id` default `id('pr')`, scoped to a company. Columns: `name`,
`applyRulesOnTop=false` skips discounts and markups but still applies the
configuration prices (`applyPriceRules(..., { configurationOnly: true })`).
- Final price clamped to ≥ 0.
- Each step is recorded as a `PriceTraceStep` (`{ step, source, amount, adjustment?, ruleId? }`).
+ Each step is recorded as a `PriceTraceStep` (`{ step, source, amount, adjustment?, ruleId?, overrideId? }`; an override step's `overrideId` is the override it applied, linked from `PriceTraceModal`).
The trace is a **snapshot stored with the price** — pricing rules are edited
in place, so re-running today's rules cannot explain yesterday's price.
- `quoteLinePrice.priceTrace` (migration `20261001125824`), one per quantity
diff --git a/apps/erp/app/modules/sales/AGENTS.md b/apps/erp/app/modules/sales/AGENTS.md
index 13da7f5635..389030d785 100644
--- a/apps/erp/app/modules/sales/AGENTS.md
+++ b/apps/erp/app/modules/sales/AGENTS.md
@@ -11,7 +11,7 @@ Quotes (with cost rollup and pricing), sales orders, sales RFQs, customer manage
- **Price trace** — how a price was reached (base → overrides → rules → final), a snapshot stored WITH the price because rules are edited in place: `quoteLinePrice.priceTrace` per quantity break, `salesOrderLine.priceTrace` per order line (copied from the quote by `convert`). Typed (manual) prices store `null`. The calculator icon opens it in a modal; on a quote line `getQuoteLinePriceTraces` also returns today's `currentTrace`, and `repriceQuoteLineFromRules` stores it. See `.claude/rules/quote-discount-system.md`.
- **Pricing Rules** — company-scoped Discount/Markup/Configuration rules. Discounts are non-stacking (highest-priority wins); Markups stack and compound in priority order. A **Configuration** rule targets exactly ONE configurable item (`itemId` in the form → `itemIds: [id]`, amount 0, no item group — `normalizePricingRule` in `sales.service.ts`) and carries `configurationPrices` (JSONB `{ key, value, amount, label? }[]` — list option / `"true"` for a boolean / `null` = per unit of a numeric value; `label` is the parameter's label at save time, used by the price trace; validated by `pricingRuleConfigurationPriceValidator` in `sales.utils.ts`, which stays out of the `sales.models` import graph so the engine tests can load it). `toMatchedRule` parses a rule row for the engine; `applyPriceRules` (`sales.utils.ts`) adds those signed surcharges to the starting price before the discount, given the line's `configuration`. An override with `applyRulesOnTop = false` still takes them (`configurationOnly`) — they price the options, not the part. Every other rule type stores `configurationPrices` as null.
- **Line configuration** — `quoteLine.configuration` and `salesOrderLine.configuration` (keyed by `configurationParameter.key`; `convertDocument` (`shared.service.ts`, ported from the `convert` server function) copies it quote → order). Jobs made for an order line use `resolveJobConfiguration` (`sales.utils.ts`): the order line's configuration, else the quote line's; when the order line was configured differently from its quote the job is built with `itemToJob` + that configuration instead of copying the quote's method (an unset value — absent, null or blank — compares equal). A configured Make to Order quote line is priced from the part's unit sale price (not the cost rollup) when it has one, so it matches the order line — `configuredQuoteBasePrice`; a row with markups someone chose stays cost-plus. The sales order line form keeps its configurator in `useItemConfiguration` + `ItemConfigureButton` (`~/components/Configurator/ItemConfigurator`), which loads parameters through `getConfigurationParameters` and ignores a stale load for an item no longer selected.
-- **Price Overrides** — customer-specific or type-specific price overrides with quantity breaks via `customerItemPriceOverride` / `customerItemPriceOverrideBreak`. Precedence: customer > customer-type > all-customers > base price.
+- **Price Overrides** — price overrides with quantity breaks via `customerItemPriceOverride` / `customerItemPriceOverrideBreak`, scoped to one customer, one customer type, or every customer (both ids null). Precedence: customer > customer-type > all-customers > base price. An all-customers override must be asked for: `upsertCustomerItemPriceOverride` refuses a write with no scope unless `allCustomers: true` (`priceOverrideScopeError`, `sales.utils.ts`, also the form validator's refine) — an omitted field once turned one quote's price into every customer's list price. Price List (`resolvePriceList`) takes `customerId`, `customerTypeId` or `allCustomers` (`?scope=all`, the picker's **All Customers**) and lists the scope's own overrides plus the ones it inherits (`priceListOverrideScopes`): a customer also sees its type's and the all-customers rows, tagged by `overrideSource`. Override trace steps carry `overrideId`, which `PriceTraceModal` links to the override.
- **Sales Order** — confirmed order from a quote. Lines carry `methodType` (Make to Order, Make to Stock, etc.) that determines production handling.
- **Sales RFQ** — inbound request from a customer, convertible to a quote via `convertDocument` (`shared.service.ts`, ported from the `convert` server function).
- **Rental Agreement** — rents serialized fleet units (fixed assets) to a customer; billed in persisted periods, invoiced as `Rental` lines on Draft sales invoices. See "Rentals (sub-area)".
diff --git a/apps/erp/app/modules/sales/sales.models.test.ts b/apps/erp/app/modules/sales/sales.models.test.ts
index 6c898e52c3..b8ce39c3b2 100644
--- a/apps/erp/app/modules/sales/sales.models.test.ts
+++ b/apps/erp/app/modules/sales/sales.models.test.ts
@@ -20,6 +20,8 @@ vi.mock("@lingui/core/macro", () => ({
const {
contractTermFromServicePeriods,
+ priceOverrideValidator,
+ priceTraceStepValidator,
quoteLineValidator,
quoteValidator,
rentalAgreementChargeValidator,
@@ -262,3 +264,41 @@ describe("contractTermFromServicePeriods", () => {
});
});
});
+
+describe("priceOverrideValidator scope", () => {
+ const form = { itemId: "item_1", active: "on", applyRulesOnTop: "on" };
+ const scopeError = (values: Record<string, string>) =>
+ priceOverrideValidator.safeParse({ ...form, ...values }).error?.issues[0];
+
+ it("refuses an override with no scope", () => {
+ expect(scopeError({ customerId: "", customerTypeId: "" })).toMatchObject({
+ message: "Choose a customer, a customer type, or All Customers",
+ path: ["customerId"]
+ });
+ });
+
+ it("accepts All Customers, a customer, or a type", () => {
+ expect(scopeError({ allCustomers: "on" })).toBeUndefined();
+ expect(scopeError({ customerId: "cust_1" })).toBeUndefined();
+ expect(scopeError({ customerTypeId: "type_1" })).toBeUndefined();
+ });
+
+ it("refuses All Customers with a customer", () => {
+ expect(
+ scopeError({ allCustomers: "on", customerId: "cust_1" })?.message
+ ).toBe("All Customers cannot also name a customer or type");
+ });
+});
+
+describe("priceTraceStepValidator", () => {
+ it("keeps the override a step applied", () => {
+ expect(
+ priceTraceStepValidator.parse({
+ step: "All Override",
+ source: "All Customers Override",
+ amount: 6679,
+ overrideId: "ovr_1"
+ }).overrideId
+ ).toBe("ovr_1");
+ });
+});
diff --git a/apps/erp/app/modules/sales/sales.models.ts b/apps/erp/app/modules/sales/sales.models.ts
index b04c124c63..837a14636a 100644
--- a/apps/erp/app/modules/sales/sales.models.ts
+++ b/apps/erp/app/modules/sales/sales.models.ts
@@ -31,7 +31,10 @@ import {
standardFactorType,
taxExemptionReasons
} from "../shared/shared.models";
-import { pricingRuleConfigurationPriceValidator } from "./sales.utils";
+import {
+ priceOverrideScopeError,
+ pricingRuleConfigurationPriceValidator
+} from "./sales.utils";
export const KPIs = [
{
@@ -312,15 +315,17 @@ export const priceOverrideValidator = z
itemId: z.string().min(1),
customerId: z.string().optional(),
customerTypeId: z.string().optional(),
+ allCustomers: zfd.checkbox(),
active: zfd.checkbox(),
applyRulesOnTop: zfd.checkbox(),
validFrom: zfd.text(z.string().optional()),
validTo: zfd.text(z.string().optional()),
notes: zfd.text(z.string().optional())
})
- .refine((d) => !(d.customerId && d.customerTypeId), {
- message: "Cannot set both Customer and Customer Type",
- path: ["customerId"]
+ .superRefine((d, ctx) => {
+ const message = priceOverrideScopeError(d);
+ if (message)
+ ctx.addIssue({ code: "custom", message, path: ["customerId"] });
})
.refine((d) => !d.validFrom || !d.validTo || d.validFrom <= d.validTo, {
message: "Valid From must be on or before Valid To",
@@ -359,6 +364,7 @@ export const priceTraceStepValidator = z.object({
amount: z.number(),
adjustment: z.number().optional(),
ruleId: z.string().optional(),
+ overrideId: z.string().optional(),
label: z.string().optional()
});
diff --git a/apps/erp/app/modules/sales/sales.server.ts b/apps/erp/app/modules/sales/sales.server.ts
index 98200c1113..ea5254201f 100644
--- a/apps/erp/app/modules/sales/sales.server.ts
+++ b/apps/erp/app/modules/sales/sales.server.ts
@@ -6943,6 +6943,10 @@ export const resolvePriceList = defineServiceFn({
offset: z.number().int().default(0),
customerId: z.string().optional(),
customerTypeId: z.string().optional(),
+ allCustomers: z
+ .boolean()
+ .describe("Set true to list the prices set for every customer.")
+ .optional(),
search: z.string().optional(),
quantity: z.number().optional()
}),
@@ -7066,6 +7070,12 @@ export const updateCustomer = defineServiceFn({
/**
* Upsert customer item price override
*
+ * @remarks
+ * Sets an item's price for one customer (`customerId`), one customer type
+ * (`customerTypeId`), or every customer (`allCustomers: true`). Exactly one
+ * scope is required: a price for every customer replaces the item's list
+ * price on every quote, so it is never the default.
+ *
* @mcp destructive
*/
export const upsertCustomerItemPriceOverride = defineServiceFn({
@@ -7073,6 +7083,12 @@ export const upsertCustomerItemPriceOverride = defineServiceFn({
id: z.string().optional(),
customerId: z.string().optional(),
customerTypeId: z.string().optional(),
+ allCustomers: z
+ .boolean()
+ .describe(
+ "Set true to apply the price to every customer. Required when neither customerId nor customerTypeId is sent."
+ )
+ .optional(),
itemId: z.string(),
breaks: z.array(
z.looseObject({
@@ -7841,6 +7857,7 @@ export const upsertQuoteLinePrices = defineServiceFn({
amount: z.number(),
adjustment: z.number().optional(),
ruleId: z.string().optional(),
+ overrideId: z.string().optional(),
label: z.string().optional()
})
)
diff --git a/apps/erp/app/modules/sales/sales.service.ts b/apps/erp/app/modules/sales/sales.service.ts
index aea84eb3e6..ed3ba39f67 100644
--- a/apps/erp/app/modules/sales/sales.service.ts
+++ b/apps/erp/app/modules/sales/sales.service.ts
@@ -236,6 +236,8 @@ import {
decideRecalcPricing,
getDefaultRentalRates,
getEffectiveDefaultMarkups,
+ priceListOverrideScopes,
+ priceOverrideScopeError,
QUOTE_BASE_PRICE_SOURCES,
resolvePreservedQuoteLinePriceFields,
toMatchedRule,
@@ -2344,7 +2346,8 @@ export async function resolvePrice(
? `Customer Price Override: ${override.notes}`
: "Customer Price Override",
amount: override.overridePrice,
- adjustment: override.overridePrice - basePrice
+ adjustment: override.overridePrice - basePrice,
+ overrideId: override.id
});
}
}
@@ -2369,7 +2372,8 @@ export async function resolvePrice(
? `Customer Type Override: ${typeOverride.notes}`
: "Customer Type Override",
amount: typeOverride.overridePrice,
- adjustment: typeOverride.overridePrice - basePrice
+ adjustment: typeOverride.overridePrice - basePrice,
+ overrideId: typeOverride.id
});
}
}
@@ -2393,7 +2397,8 @@ export async function resolvePrice(
? `All Customers Override: ${allOverride.notes}`
: "All Customers Override",
amount: allOverride.overridePrice,
- adjustment: allOverride.overridePrice - basePrice
+ adjustment: allOverride.overridePrice - basePrice,
+ overrideId: allOverride.id
});
}
}
@@ -2516,6 +2521,7 @@ export async function resolvePriceList(
args: GenericQueryFilters & {
customerId?: string;
customerTypeId?: string;
+ allCustomers?: boolean;
search?: string;
quantity?: number;
}
@@ -2525,23 +2531,42 @@ export async function resolvePriceList(
.toString();
const previewQuantity = Math.max(args.quantity ?? 1, 0);
- let scopeQuery = client
- .from("customerItemPriceOverride")
- .select("itemId")
- .eq("companyId", companyId)
- .eq("active", true);
-
- if (args.customerId) {
- scopeQuery = scopeQuery.eq("customerId", args.customerId);
- } else if (args.customerTypeId) {
- scopeQuery = scopeQuery.eq("customerTypeId", args.customerTypeId);
- } else {
- return { data: [], count: 0, error: null };
+ let resolvedCustomerTypeId = args.customerTypeId ?? null;
+ if (args.customerId && !resolvedCustomerTypeId) {
+ const { data: cust, error: customerError } = await client
+ .from("customer")
+ .select("customerTypeId")
+ .eq("id", args.customerId)
+ .eq("companyId", companyId)
+ .maybeSingle();
+ if (customerError) return { data: [], count: 0, error: customerError };
+ resolvedCustomerTypeId = cust?.customerTypeId ?? null;
}
- const { data: scopedOverrides, error: scopeError } = await scopeQuery;
+ // A scope lists the items its own overrides price and the ones it inherits
+ // (its type's, every customer's): each of those prices is what it pays.
+ const scopes = priceListOverrideScopes(args, resolvedCustomerTypeId);
+ if (scopes.length === 0) return { data: [], count: 0, error: null };
+
+ const scopeResults = await Promise.all(
+ scopes.map((scope) => {
+ const query = client
+ .from("customerItemPriceOverride")
+ .select("itemId")
+ .eq("companyId", companyId)
+ .eq("active", true);
+ if (scope.customerId) return query.eq("customerId", scope.customerId);
+ if (scope.customerTypeId) {
+ return query.eq("customerTypeId", scope.customerTypeId);
+ }
+ return query.is("customerId", null).is("customerTypeId", null);
+ })
+ );
+ const scopeError = scopeResults.find((r) => r.error)?.error;
if (scopeError) return { data: [], count: 0, error: scopeError };
- const overriddenItemIds = (scopedOverrides ?? []).map((r) => r.itemId);
+ const overriddenItemIds = [
+ ...new Set(scopeResults.flatMap((r) => (r.data ?? []).map((o) => o.itemId)))
+ ];
if (overriddenItemIds.length === 0) {
return { data: [], count: 0, error: null };
}
@@ -2588,17 +2613,6 @@ export async function resolvePriceList(
const itemIds = items.map((i) => i.id);
- let resolvedCustomerTypeId = args.customerTypeId ?? null;
- if (args.customerId && !resolvedCustomerTypeId) {
- const { data: cust, error: customerError } = await client
- .from("customer")
- .select("customerTypeId")
- .eq("id", args.customerId)
- .maybeSingle();
- if (customerError) return { data: [], count: 0, error: customerError };
- resolvedCustomerTypeId = cust?.customerTypeId ?? null;
- }
-
const overrideSelect =
"id, itemId, notes, validFrom, validTo, applyRulesOnTop, breaks:customerItemPriceOverrideBreak(id, quantity, overridePrice, active)";
@@ -2725,7 +2739,8 @@ export async function resolvePriceList(
? `Customer Price Override: ${override.notes}`
: "Customer Price Override",
amount: override.overridePrice,
- adjustment: override.overridePrice - basePrice
+ adjustment: override.overridePrice - basePrice,
+ overrideId: override.id
});
} else if (typeOverride) {
overrideSource = "Type Override";
@@ -2735,7 +2750,8 @@ export async function resolvePriceList(
? `Customer Type Override: ${typeOverride.notes}`
: "Customer Type Override",
amount: typeOverride.overridePrice,
- adjustment: typeOverride.overridePrice - basePrice
+ adjustment: typeOverride.overridePrice - basePrice,
+ overrideId: typeOverride.id
});
} else if (allOverride) {
overrideSource = "All Override";
@@ -2745,7 +2761,8 @@ export async function resolvePriceList(
? `All Customers Override: ${allOverride.notes}`
: "All Customers Override",
amount: allOverride.overridePrice,
- adjustment: allOverride.overridePrice - basePrice
+ adjustment: allOverride.overridePrice - basePrice,
+ overrideId: allOverride.id
});
}
}
@@ -2954,6 +2971,7 @@ export async function upsertCustomerItemPriceOverride(
id?: string;
customerId?: string;
customerTypeId?: string;
+ allCustomers?: boolean;
itemId: string;
breaks: PriceOverrideBreak[];
active: boolean;
@@ -2963,11 +2981,9 @@ export async function upsertCustomerItemPriceOverride(
validTo?: string;
}
) {
- if (data.customerId && data.customerTypeId) {
- return {
- data: null,
- error: { message: "Cannot set both customerId and customerTypeId" }
- };
+ const scopeError = priceOverrideScopeError(data);
+ if (scopeError) {
+ return { data: null, error: { message: scopeError } };
}
// Kysely bypasses RLS and the dispatcher reaches this with caller-supplied
diff --git a/apps/erp/app/modules/sales/sales.utils.test.ts b/apps/erp/app/modules/sales/sales.utils.test.ts
index 86da3370ba..e875d4559b 100644
--- a/apps/erp/app/modules/sales/sales.utils.test.ts
+++ b/apps/erp/app/modules/sales/sales.utils.test.ts
@@ -12,6 +12,8 @@ import {
leaseCommencementPreview,
leaseTermMonths,
previewLeaseClassification,
+ priceListOverrideScopes,
+ priceOverrideScopeError,
readLeaseClassification,
reconcileQuantityBreaks,
rentalEquipmentStatus,
@@ -771,3 +773,67 @@ describe("rentalLineDocuments", () => {
expect(result.shipment).toBeNull();
});
});
+
+describe("priceOverrideScopeError", () => {
+ it("refuses an override with no scope", () => {
+ expect(priceOverrideScopeError({})).toBe(
+ "Choose a customer, a customer type, or All Customers"
+ );
+ });
+
+ it("refuses All Customers together with a customer or a type", () => {
+ const message = "All Customers cannot also name a customer or type";
+ expect(
+ priceOverrideScopeError({ allCustomers: true, customerId: "c" })
+ ).toBe(message);
+ expect(
+ priceOverrideScopeError({ allCustomers: true, customerTypeId: "t" })
+ ).toBe(message);
+ });
+
+ it("refuses a customer together with a type", () => {
+ expect(
+ priceOverrideScopeError({ customerId: "c", customerTypeId: "t" })
+ ).toBe("Cannot set both Customer and Customer Type");
+ });
+
+ it("accepts exactly one scope", () => {
+ expect(priceOverrideScopeError({ customerId: "c" })).toBeNull();
+ expect(priceOverrideScopeError({ customerTypeId: "t" })).toBeNull();
+ expect(priceOverrideScopeError({ allCustomers: true })).toBeNull();
+ });
+});
+
+describe("priceListOverrideScopes", () => {
+ it("lists a customer's own, its type's and the all-customers overrides", () => {
+ expect(priceListOverrideScopes({ customerId: "c" }, "t")).toEqual([
+ { customerId: "c" },
+ { customerTypeId: "t" },
+ { allCustomers: true }
+ ]);
+ });
+
+ it("skips the type of a customer that has none", () => {
+ expect(priceListOverrideScopes({ customerId: "c" }, null)).toEqual([
+ { customerId: "c" },
+ { allCustomers: true }
+ ]);
+ });
+
+ it("lists a type's own and the all-customers overrides", () => {
+ expect(priceListOverrideScopes({ customerTypeId: "t" }, null)).toEqual([
+ { customerTypeId: "t" },
+ { allCustomers: true }
+ ]);
+ });
+
+ it("lists only the all-customers overrides for All Customers", () => {
+ expect(priceListOverrideScopes({ allCustomers: true }, null)).toEqual([
+ { allCustomers: true }
+ ]);
+ });
+
+ it("lists nothing without a scope", () => {
+ expect(priceListOverrideScopes({}, null)).toEqual([]);
+ });
+});
diff --git a/apps/erp/app/modules/sales/sales.utils.ts b/apps/erp/app/modules/sales/sales.utils.ts
index c70c7058c8..bb71b4a983 100644
--- a/apps/erp/app/modules/sales/sales.utils.ts
+++ b/apps/erp/app/modules/sales/sales.utils.ts
@@ -938,3 +938,52 @@ export async function getDefaultRentalRates(
}
return { data: result, error: null };
}
+
+// Who a price override applies to: one customer, one customer type, or every
+// customer. A row with neither id applies to every customer, so writing one
+// must be asked for (`allCustomers`), never reached by leaving both ids out.
+export type PriceOverrideScope = {
+ customerId?: string;
+ customerTypeId?: string;
+ allCustomers?: boolean;
+};
+
+export function priceOverrideScopeError(
+ scope: PriceOverrideScope
+): string | null {
+ if (scope.allCustomers) {
+ return scope.customerId || scope.customerTypeId
+ ? "All Customers cannot also name a customer or type"
+ : null;
+ }
+ if (scope.customerId && scope.customerTypeId) {
+ return "Cannot set both Customer and Customer Type";
+ }
+ if (!scope.customerId && !scope.customerTypeId) {
+ return "Choose a customer, a customer type, or All Customers";
+ }
+ return null;
+}
+
+// The override scopes whose items a price list shows: the scope's own, and
+// the broader ones it inherits (a customer's type, then all customers), so
+// every item whose price differs for that scope is listed.
+export function priceListOverrideScopes(
+ scope: PriceOverrideScope,
+ customerTypeIdOfCustomer: string | null
+): PriceOverrideScope[] {
+ if (scope.customerId) {
+ return [
+ { customerId: scope.customerId },
+ ...(customerTypeIdOfCustomer
+ ? [{ customerTypeId: customerTypeIdOfCustomer }]
+ : []),
+ { allCustomers: true }
+ ];
+ }
+ if (scope.customerTypeId) {
+ return [{ customerTypeId: scope.customerTypeId }, { allCustomers: true }];
+ }
+ if (scope.allCustomers) return [{ allCustomers: true }];
+ return [];
+}
diff --git a/apps/erp/app/modules/sales/types.ts b/apps/erp/app/modules/sales/types.ts
index 5e97f6ac33..741e6a6ddc 100644
--- a/apps/erp/app/modules/sales/types.ts
+++ b/apps/erp/app/modules/sales/types.ts
@@ -125,6 +125,9 @@ export type PriceTraceStep = {
amount: number;
adjustment?: number;
ruleId?: string;
+ // The price override an Override / Type Override / All Override step
+ // applied, so the trace can open it.
+ overrideId?: string;
// A readable name for the step's badge — the parameter label on a
// Configuration step.
label?: string;
diff --git a/apps/erp/app/modules/sales/ui/Pricing/PriceListScopeEmpty.tsx b/apps/erp/app/modules/sales/ui/Pricing/PriceListScopeEmpty.tsx
index 3a3afb761f..af387af7f8 100644
--- a/apps/erp/app/modules/sales/ui/Pricing/PriceListScopeEmpty.tsx
+++ b/apps/erp/app/modules/sales/ui/Pricing/PriceListScopeEmpty.tsx
@@ -24,7 +24,7 @@ export function PriceListScopeEmpty({
<SearchLandingPage
icon={LuList}
heading={t`Price Lists`}
- description={t`Pick a customer or customer type to view their pricing.`}
+ description={t`Pick a customer, a customer type, or All Customers to view their pricing.`}
>
<div className="flex justify-center [&>[role=combobox]]:!min-w-[400px] max-md:[&>[role=combobox]]:!min-w-0 max-md:[&>[role=combobox]]:w-full max-md:[&>[role=combobox]]:h-11 max-md:[&>[role=combobox]]:rounded-md max-md:[&>[role=combobox]]:text-base">
<ScopePicker
diff --git a/apps/erp/app/modules/sales/ui/Pricing/PriceOverrideForm.tsx b/apps/erp/app/modules/sales/ui/Pricing/PriceOverrideForm.tsx
index 36b3fafee5..7b01beb6ad 100644
--- a/apps/erp/app/modules/sales/ui/Pricing/PriceOverrideForm.tsx
+++ b/apps/erp/app/modules/sales/ui/Pricing/PriceOverrideForm.tsx
@@ -48,6 +48,7 @@ import type { ColumnDef } from "@tanstack/react-table";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import {
LuEllipsisVertical,
+ LuGlobe,
LuHistory,
LuSquareUser,
LuTrash,
@@ -80,7 +81,7 @@ import {
import { priceOverrideValidator } from "../../sales.models";
import type { PriceOverrideBreak } from "../../types";
-type ScopeType = "customer" | "customerType";
+type ScopeType = "customer" | "customerType" | "all";
type PriceOverrideFormProps = {
initialValues: z.infer<typeof priceOverrideValidator>;
@@ -104,6 +105,7 @@ const PriceOverrideForm = ({
const [scope, setScope] = useState<ScopeType>(() => {
if (initialValues.customerId) return "customer";
if (initialValues.customerTypeId) return "customerType";
+ if (initialValues.allCustomers) return "all";
return initialScope ?? "customer";
});
@@ -183,6 +185,12 @@ const PriceOverrideForm = ({
title: t`Customer Type`,
description: t`Override price for all customers of a type`,
icon: <LuUsers />
+ },
+ {
+ value: "all",
+ title: t`All Customers`,
+ description: t`Override price for every customer`,
+ icon: <LuGlobe />
}
]}
/>
@@ -204,6 +212,14 @@ const PriceOverrideForm = ({
</>
)}
+ {scope === "all" && (
+ <>
+ <Hidden name="customerId" value="" />
+ <Hidden name="customerTypeId" value="" />
+ <Hidden name="allCustomers" value="on" />
+ </>
+ )}
+
<PriceBreaks
breaks={breaks}
onChange={setBreaks}
diff --git a/apps/erp/app/modules/sales/ui/Pricing/PriceOverridesTable.tsx b/apps/erp/app/modules/sales/ui/Pricing/PriceOverridesTable.tsx
index 004f4af252..ee88cbc4ba 100644
--- a/apps/erp/app/modules/sales/ui/Pricing/PriceOverridesTable.tsx
+++ b/apps/erp/app/modules/sales/ui/Pricing/PriceOverridesTable.tsx
@@ -54,7 +54,11 @@ import { path } from "~/utils/path";
import { DuplicatePriceListModal } from "./DuplicatePriceListModal";
import { PriceListScopeEmpty } from "./PriceListScopeEmpty";
import { PriceTraceModal } from "./PriceTraceModal";
-import { type ScopeOption, ScopePicker } from "./ScopePicker";
+import {
+ ALL_CUSTOMERS_SCOPE,
+ type ScopeOption,
+ ScopePicker
+} from "./ScopePicker";
type PriceListTableProps = {
data: PriceListRow[];
@@ -97,7 +101,11 @@ const PriceListTable = memo(
const currentCustomerTypeId =
searchParams.get("customerTypeId") ?? undefined;
- const scopeId = currentCustomerId ?? currentCustomerTypeId ?? "";
+ const isAllCustomers = searchParams.get("scope") === ALL_CUSTOMERS_SCOPE;
+ const scopeId =
+ currentCustomerId ??
+ currentCustomerTypeId ??
+ (isAllCustomers ? ALL_CUSTOMERS_SCOPE : "");
const sourceScope = {
customerId: currentCustomerId,
@@ -120,7 +128,10 @@ const PriceListTable = memo(
const next = new URLSearchParams(searchParams);
next.delete("customerId");
next.delete("customerTypeId");
- if (selectedId) {
+ next.delete("scope");
+ if (selectedId === ALL_CUSTOMERS_SCOPE) {
+ next.set("scope", ALL_CUSTOMERS_SCOPE);
+ } else if (selectedId) {
const picked = scopeOptions.find((o) => o.value === selectedId);
if (picked) {
next.set(
diff --git a/apps/erp/app/modules/sales/ui/Pricing/PriceTraceModal.tsx b/apps/erp/app/modules/sales/ui/Pricing/PriceTraceModal.tsx
index 211074853d..ddf03e9c26 100644
--- a/apps/erp/app/modules/sales/ui/Pricing/PriceTraceModal.tsx
+++ b/apps/erp/app/modules/sales/ui/Pricing/PriceTraceModal.tsx
@@ -164,9 +164,13 @@ export function PriceTraceTable({
className="text-sm text-muted-foreground max-w-[320px]"
title={step.source}
>
- {step.ruleId ? (
+ {step.ruleId || step.overrideId ? (
<Link
- to={path.to.pricingRule(step.ruleId)}
+ to={
+ step.ruleId
+ ? path.to.pricingRule(step.ruleId)
+ : path.to.priceOverride(step.overrideId!)
+ }
target="_blank"
rel="noreferrer"
className="hover:text-foreground hover:underline decoration-dotted underline-offset-2 inline-flex items-center gap-1 max-w-full"
diff --git a/apps/erp/app/modules/sales/ui/Pricing/ScopePicker.tsx b/apps/erp/app/modules/sales/ui/Pricing/ScopePicker.tsx
index fa91961804..3a81093dde 100644
--- a/apps/erp/app/modules/sales/ui/Pricing/ScopePicker.tsx
+++ b/apps/erp/app/modules/sales/ui/Pricing/ScopePicker.tsx
@@ -17,9 +17,13 @@ import {
Subheading
} from "@carbon/react";
import { useLingui } from "@lingui/react/macro";
-import type { ComponentType } from "react";
+import type { ComponentType, ReactNode } from "react";
import { useMemo, useState } from "react";
-import { LuCheck, LuSquareUser, LuUsers } from "react-icons/lu";
+import { LuCheck, LuGlobe, LuSquareUser, LuUsers } from "react-icons/lu";
+
+// The scope value for the prices set for every customer (no customer and no
+// customer type). The picker offers it itself; it is not a loader option.
+export const ALL_CUSTOMERS_SCOPE = "all";
export type ScopeOption = {
value: string;
@@ -85,7 +89,12 @@ export function ScopePicker({
!value && "text-muted-foreground"
)}
>
- {selected ? (
+ {value === ALL_CUSTOMERS_SCOPE ? (
+ <div className="flex items-center gap-2 truncate">
+ <LuGlobe className="size-3.5 shrink-0 text-muted-foreground" />
+ <span className="truncate">{t`All Customers`}</span>
+ </div>
+ ) : selected ? (
<div className="flex items-center gap-2 truncate">
<ScopeIcon
helper={selected.helper}
@@ -110,6 +119,21 @@ export function ScopePicker({
className="h-9"
/>
<CommandList className="max-h-[320px]">
+ <CommandGroup>
+ <ScopeItem
+ option={{
+ value: ALL_CUSTOMERS_SCOPE,
+ label: t`All Customers`,
+ helper: "Customer"
+ }}
+ icon={<LuGlobe className="size-3.5 text-muted-foreground" />}
+ selected={value === ALL_CUSTOMERS_SCOPE}
+ onSelect={select}
+ />
+ </CommandGroup>
+ {(types.length > 0 || customers.length > 0) && (
+ <CommandSeparator className="my-1" />
+ )}
{types.length > 0 && (
<CommandGroup
heading={
@@ -171,10 +195,12 @@ function GroupHeading({
function ScopeItem({
option,
+ icon,
selected,
onSelect
}: {
option: ScopeOption;
+ icon?: ReactNode;
selected: boolean;
onSelect: (value: string) => void;
}) {
@@ -183,6 +209,7 @@ function ScopeItem({
value={`${option.label} ${option.helper} ${option.value}`}
onSelect={() => onSelect(option.value)}
>
+ {icon}
<span className="flex-1 truncate">{option.label}</span>
<LuCheck
className={cn("ml-2 size-4", selected ? "opacity-100" : "opacity-0")}
diff --git a/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json b/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json
index f884e18b70..01ee048775 100644
--- a/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json
+++ b/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json
@@ -1332,7 +1332,7 @@
{"name":"sales_duplicatePricingRule","classification":"WRITE","schema":"7f8214d1083f","response":"3797626bd17e","permission":"sales:create","paginates":false},
{"name":"sales_escalateReturnOrderLine","classification":"WRITE","schema":"b207270e6864","response":"a3013ba5cdbb","permission":"none","paginates":false},
{"name":"sales_finalizeAndSendQuote","classification":"WRITE","schema":"ca18e9270f18","response":"c1e125e7d8af","permission":"sales:create","paginates":false},
- {"name":"sales_getBaseCatalog","classification":"READ","schema":"81c745eee0bd","response":"965c08b897d0","permission":"sales:view","paginates":false},
+ {"name":"sales_getBaseCatalog","classification":"READ","schema":"81c745eee0bd","response":"cb4f038f3c40","permission":"sales:view","paginates":false},
{"name":"sales_getConfigurationParametersByQuoteLineId","classification":"READ","schema":"40e11ca73a53","response":"4dc7e9b6cbc3","permission":"sales:view","paginates":false},
{"name":"sales_getContract","classification":"READ","schema":"d1a753b63ac7","response":"1375deebd9f6","permission":"sales:view","paginates":false},
{"name":"sales_getContractAmendments","classification":"READ","schema":"d1a753b63ac7","response":"70b301a95120","permission":"sales:view","paginates":false},
@@ -1381,7 +1381,7 @@
{"name":"sales_getQuoteLine","classification":"READ","schema":"40e11ca73a53","response":"a37f940eb1fa","permission":"sales:view","paginates":false},
{"name":"sales_getQuoteLinePrices","classification":"READ","schema":"40e11ca73a53","response":"b380070f2ac3","permission":"sales:view","paginates":false},
{"name":"sales_getQuoteLinePricesByQuoteId","classification":"READ","schema":"8087dc4f5248","response":"b380070f2ac3","permission":"sales:view","paginates":false},
- {"name":"sales_getQuoteLinePriceTraces","classification":"READ","schema":"ffca7e5c29c1","response":"36a0683de042","permission":"sales:view","paginates":false},
+ {"name":"sales_getQuoteLinePriceTraces","classification":"READ","schema":"ffca7e5c29c1","response":"6ada3fae7549","permission":"sales:view","paginates":false},
{"name":"sales_getQuoteLines","classification":"READ","schema":"8087dc4f5248","response":"947e5b11c1ee","permission":"sales:view","paginates":false},
{"name":"sales_getQuoteLinesList","classification":"READ","schema":"8087dc4f5248","response":"5ebff9af923d","permission":"sales:view","paginates":false},
{"name":"sales_getQuoteMakeMethod","classification":"READ","schema":"d12e0ae9a70b","response":"f6ec0930d3af","permission":"sales:view","paginates":false},
@@ -1445,8 +1445,8 @@
{"name":"sales_releaseRentalUnit","classification":"WRITE","schema":"45909d441c37","response":"9729319c460e","permission":"sales:update","paginates":false},
{"name":"sales_reopenSalesReturnOrder","classification":"WRITE","schema":"7f8214d1083f","response":"none","permission":"sales:update","paginates":false},
{"name":"sales_repriceQuoteLineFromRules","classification":"WRITE","schema":"ffca7e5c29c1","response":"bcde375ebd4c","permission":"sales:update","paginates":false},
- {"name":"sales_resolvePrice","classification":"WRITE","schema":"f5fcab444c97","response":"eb12029769da","permission":"sales:update","paginates":false},
- {"name":"sales_resolvePriceList","classification":"WRITE","schema":"bca2332502db","response":"965c08b897d0","permission":"sales:update","paginates":false},
+ {"name":"sales_resolvePrice","classification":"WRITE","schema":"f5fcab444c97","response":"9ffb18482cad","permission":"sales:update","paginates":false},
+ {"name":"sales_resolvePriceList","classification":"WRITE","schema":"22c6301fa1c8","response":"cb4f038f3c40","permission":"sales:update","paginates":false},
{"name":"sales_returnRentalUnit","classification":"WRITE","schema":"253e51a04f4e","response":"e00a9764517d","permission":"none","paginates":false},
{"name":"sales_revertContractCancellation","classification":"WRITE","schema":"a18bd6ac2fe5","response":"3797626bd17e","permission":"sales:update","paginates":false},
{"name":"sales_sellRentalUnit","classification":"WRITE","schema":"253e51a04f4e","response":"d51ae9969843","permission":"none","paginates":false},
@@ -1499,13 +1499,13 @@
{"name":"sales_updateSalesRFQ","classification":"WRITE","schema":"2cb421dde994","response":"2e56e1180d37","permission":"sales:update","paginates":false},
{"name":"sales_updateSalesRFQLine","classification":"WRITE","schema":"827ecf864e53","response":"3797626bd17e","permission":"sales:update","paginates":false},
{"name":"sales_updateSalesRFQLineOrder","classification":"WRITE","schema":"fa6fee3c7515","response":"none","permission":"sales:update","paginates":false},
- {"name":"sales_upsertCustomerItemPriceOverride","classification":"DESTRUCTIVE","schema":"c74a2a58d6cf","response":"3797626bd17e","permission":"sales:create+update","paginates":false},
+ {"name":"sales_upsertCustomerItemPriceOverride","classification":"DESTRUCTIVE","schema":"0fc21fa3cae2","response":"3797626bd17e","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertCustomerItemRentalRate","classification":"WRITE","schema":"36aacd353983","response":"3797626bd17e","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertItemRentalRate","classification":"WRITE","schema":"69671ac2dab6","response":"3797626bd17e","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertMakeMethodFromQuoteLine","classification":"WRITE","schema":"605368c2b9bd","response":"4e1a8f1febce","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertMakeMethodFromQuoteMethod","classification":"WRITE","schema":"dc9ff7a4d939","response":"bcde375ebd4c","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertQuoteLineAdditionalCharges","classification":"WRITE","schema":"18f385f95d04","response":"bcde375ebd4c","permission":"sales:create+update","paginates":false},
- {"name":"sales_upsertQuoteLinePrices","classification":"DESTRUCTIVE","schema":"01ec343190bf","response":"none","permission":"sales:create+update","paginates":false},
+ {"name":"sales_upsertQuoteLinePrices","classification":"DESTRUCTIVE","schema":"fbd05a2cdeaa","response":"none","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertQuotePayment","classification":"WRITE","schema":"41842b4f8a7e","response":"3797626bd17e","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertQuoteShipment","classification":"WRITE","schema":"9f413dd10f89","response":"3797626bd17e","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertSalesOrderPayment","classification":"WRITE","schema":"d637b4fad42f","response":"3797626bd17e","permission":"sales:create+update","paginates":false},
diff --git a/apps/erp/app/routes/x+/sales+/price-list.$overrideId.tsx b/apps/erp/app/routes/x+/sales+/price-list.$overrideId.tsx
index 2a353ff2f2..51bfe9aebc 100644
--- a/apps/erp/app/routes/x+/sales+/price-list.$overrideId.tsx
+++ b/apps/erp/app/routes/x+/sales+/price-list.$overrideId.tsx
@@ -81,6 +81,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
const {
customerId,
customerTypeId,
+ allCustomers,
itemId,
active,
applyRulesOnTop,
@@ -114,6 +115,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
id: overrideId,
customerId: customerId || undefined,
customerTypeId: customerTypeId || undefined,
+ allCustomers,
itemId,
breaks,
active,
@@ -154,6 +156,7 @@ export default function EditPriceOverrideRoute() {
itemId: override.itemId,
customerId: override.customerId ?? undefined,
customerTypeId: override.customerTypeId ?? undefined,
+ allCustomers: !override.customerId && !override.customerTypeId,
active: override.active,
applyRulesOnTop: override.applyRulesOnTop ?? true,
validFrom: override.validFrom ?? undefined,
diff --git a/apps/erp/app/routes/x+/sales+/price-list.new.tsx b/apps/erp/app/routes/x+/sales+/price-list.new.tsx
index 026cd246bf..ddc0456ef0 100644
--- a/apps/erp/app/routes/x+/sales+/price-list.new.tsx
+++ b/apps/erp/app/routes/x+/sales+/price-list.new.tsx
@@ -32,11 +32,14 @@ export async function loader({ request }: LoaderFunctionArgs) {
const url = new URL(request.url);
const customerId = url.searchParams.get("customerId") ?? undefined;
const customerTypeId = url.searchParams.get("customerTypeId") ?? undefined;
- const initialScope: "customer" | "customerType" | undefined = customerId
- ? "customer"
- : customerTypeId
- ? "customerType"
- : undefined;
+ const initialScope: "customer" | "customerType" | "all" | undefined =
+ customerId
+ ? "customer"
+ : customerTypeId
+ ? "customerType"
+ : url.searchParams.get("scope") === "all"
+ ? "all"
+ : undefined;
return {
initial: {
customerId,
@@ -85,6 +88,7 @@ export async function action({ request }: ActionFunctionArgs) {
const {
customerId,
customerTypeId,
+ allCustomers,
itemId,
active,
applyRulesOnTop,
@@ -117,6 +121,7 @@ export async function action({ request }: ActionFunctionArgs) {
{
customerId: customerId || undefined,
customerTypeId: customerTypeId || undefined,
+ allCustomers,
itemId,
breaks,
active,
@@ -153,6 +158,7 @@ export default function NewPriceOverrideRoute() {
itemId: initial.itemId,
customerId: initial.customerId,
customerTypeId: initial.customerTypeId,
+ allCustomers: initialScope === "all",
active: true,
applyRulesOnTop: true,
validFrom: initial.validFrom
diff --git a/apps/erp/app/routes/x+/sales+/price-list.tsx b/apps/erp/app/routes/x+/sales+/price-list.tsx
index a9ccedb05f..61a7f8f2fa 100644
--- a/apps/erp/app/routes/x+/sales+/price-list.tsx
+++ b/apps/erp/app/routes/x+/sales+/price-list.tsx
@@ -22,7 +22,9 @@ export async function loader({ request }: LoaderFunctionArgs) {
dataKey: "data",
firstPage: async ({ client, companyId, params }) => {
const hasScope = Boolean(
- params.get("customerId") || params.get("customerTypeId")
+ params.get("customerId") ||
+ params.get("customerTypeId") ||
+ params.get("scope") === "all"
);
const groupsResult = await client
.from("group")
diff --git a/apps/erp/app/utils/list-registry/sales.server.ts b/apps/erp/app/utils/list-registry/sales.server.ts
index a006ec7809..c12e6d4f61 100644
--- a/apps/erp/app/utils/list-registry/sales.server.ts
+++ b/apps/erp/app/utils/list-registry/sales.server.ts
@@ -89,8 +89,8 @@ export const rentalAgreementsList = searchList({
service: getRentalAgreements
});
-// With a customer or a customer type in the URL, the list resolves that
-// scope's prices; without one, it shows the base catalog.
+// With a customer, a customer type or `scope=all` (every customer) in the URL,
+// the list resolves that scope's prices; without one, it shows the base catalog.
export const priceListList = {
key: "price-list",
permission: { view: "sales", role: "employee" },
@@ -103,15 +103,17 @@ export const priceListList = {
const search = params.get("search") ?? undefined;
const customerId = params.get("customerId") ?? undefined;
const customerTypeId = params.get("customerTypeId") ?? undefined;
+ const allCustomers = params.get("scope") === "all";
const rawQuantity = Number(params.get("quantity") ?? "1");
const quantity =
Number.isFinite(rawQuantity) && rawQuantity >= 0 ? rawQuantity : 1;
const result =
- customerId || customerTypeId
+ customerId || customerTypeId || allCustomers
? await resolvePriceList(client, companyId, {
customerId,
customerTypeId,
+ allCustomers,
quantity,
search,
limit,
diff --git a/docs/content/docs/reference/pricing.mdx b/docs/content/docs/reference/pricing.mdx
index 1b375a1810..556e15cc8a 100644
--- a/docs/content/docs/reference/pricing.mdx
+++ b/docs/content/docs/reference/pricing.mdx
@@ -45,14 +45,17 @@ A **price override** pins a negotiated price for a specific item, optionally wit
- **Customer** — this item, this customer.
- **Customer type** — this item, everyone of this customer type.
-- **All customers** — this item, every customer (both customer and customer type left blank).
+- **All customers** — this item, every customer. Choose **All Customers** in the override form; through the API, send `allCustomers: true`.
-An override can't set both a customer and a customer type; the database enforces the exclusive scope. Each override carries a list of **quantity breaks** — rungs of `quantity` → `override price`. For a given line quantity Carbon picks the highest break whose quantity is at or below the ordered quantity. Order eight when the rungs are 1, 5, and 10, and you get the price on the 5-rung.
+An override names exactly one scope. Leaving the customer and the customer type blank is refused rather than read as all customers, because a price for every customer replaces the item's list price on every quote.
+
+Overrides are listed in **Sales → Price List**. Pick a customer, a customer type, or **All Customers** in the scope picker. A customer's list also shows the overrides it inherits from its customer type and from all customers, each tagged with the scope it comes from (`Override`, `Type Override`, `All Override`), so every item priced differently for that customer appears there. Each override carries a list of **quantity breaks** — rungs of `quantity` → `override price`. For a given line quantity Carbon picks the highest break whose quantity is at or below the ordered quantity. Order eight when the rungs are 1, 5, and 10, and you get the price on the 5-rung.
<FieldTable>
<Field name="Item" type="reference" required>The item this override prices.</Field>
<Field name="Customer" type="reference">Scope to one customer. Mutually exclusive with customer type.</Field>
<Field name="Customer type" type="reference">Scope to a customer type. Mutually exclusive with customer.</Field>
+ <Field name="All customers" type="boolean">Scope to every customer. Mutually exclusive with customer and customer type.</Field>
<Field name="Quantity breaks" type="list" required>One or more `quantity` → `override price` rungs. Duplicate quantities are rejected.</Field>
<Field name="Apply rules on top" type="boolean">When on (the default), pricing rules still layer onto the override price. When off, the override price is final and rules are skipped.</Field>
<Field name="Valid from / valid to" type="date">The date window the override is active in.</Field>
@@ -74,7 +77,7 @@ Resolution runs top to bottom. The result, plus every step, is stored on the lin
**Start from the base price.** The item's unit sale price, or the cost-rollup price the quote already computed. Trace source: `Base`.
</Step>
<Step>
-**Apply the best-matching override, if any.** Carbon checks the three scopes in strict precedence and commits to the first that yields a break: **customer override, then customer-type override, then all-customers override.** Once a scope matches, it never falls through to a lower one. If the ordered quantity is below the override's smallest break, that scope doesn't match and Carbon tries the next. The winning override sets the starting price. Trace source: `Override`, `Type Override`, or `All Override`.
+**Apply the best-matching override, if any.** Carbon checks the three scopes in strict precedence and commits to the first that yields a break: **customer override, then customer-type override, then all-customers override.** Once a scope matches, it never falls through to a lower one. If the ordered quantity is below the override's smallest break, that scope doesn't match and Carbon tries the next. The winning override sets the starting price. Trace source: `Override`, `Type Override`, or `All Override`. In the price trace, the step links to the override it applied (traces stored before this link existed show plain text).
</Step>
<Step>
**Layer on pricing rules**, unless the winning override set `Apply rules on top` to off. All matching active rules apply here, in the order below. Trace source: `Rule`.
@@ -127,8 +130,14 @@ On a pricing rule with `Amount type` = `Percentage`, the amount is stored as a f
### "Duplicate quantity across breaks"
A price override's quantity-break table has two rungs with the same quantity. Each break must have a unique quantity — merge or renumber the duplicate rung.
-### "Cannot set both Customer and Customer Type" / "Cannot set both customerId and customerTypeId"
-A price override targets exactly one scope. You set both a customer and a customer type on the same override. Clear one — leave both blank only for an all-customers override. (The first string is the form message; the second is the service-level guard.)
+### "Cannot set both Customer and Customer Type"
+A price override targets exactly one scope. You set both a customer and a customer type on the same override. Clear one.
+
+### "Choose a customer, a customer type, or All Customers"
+The override names no scope. Pick a customer or a customer type, or choose **All Customers** (`allCustomers: true` through the API) to price the item for everyone.
+
+### "All Customers cannot also name a customer or type"
+The override is marked for all customers and also names a customer or a customer type. Keep one scope.
### "At least one break is required"
A price override was saved with no quantity breaks. Add at least one `quantity` → `override price` rung.
diff --git a/packages/locale/locales/de/erp.po b/packages/locale/locales/de/erp.po
index c9f455cd52..267ded0c0e 100644
--- a/packages/locale/locales/de/erp.po
+++ b/packages/locale/locales/de/erp.po
@@ -16576,6 +16576,9 @@ msgstr "Preis für einen einzelnen Kunden übersteuern"
msgid "Override price for all customers of a type"
msgstr "Preis für alle Kunden eines Typs übersteuern"
+msgid "Override price for every customer"
+msgstr "Preis für jeden Kunden übersteuern"
+
#. placeholder {0}: asset.line.classificationOverrideReason
msgid "Override reason: {0}"
msgstr "Übersteuerungsgrund: {0}"
@@ -17046,8 +17049,8 @@ msgstr "Wählen Sie eine Carbon-Dimension und das Provider-Ziel aus, an das sie
msgid "Pick a column to sort by"
msgstr "Wählen Sie eine Spalte zum Sortieren"
-msgid "Pick a customer or customer type to view their pricing."
-msgstr "Wählen Sie einen Kunden oder Kundentyp aus, um deren Preisfindung anzuzeigen."
+msgid "Pick a customer, a customer type, or All Customers to view their pricing."
+msgstr "Wählen Sie einen Kunden, einen Kundentyp oder Alle Kunden aus, um deren Preise anzuzeigen."
msgid "Pick a date or leave blank to clear it."
msgstr "Wählen Sie ein Datum oder lassen Sie es leer, um es zu löschen."
diff --git a/packages/locale/locales/en/erp.po b/packages/locale/locales/en/erp.po
index 299516886c..00f36d6e13 100644
--- a/packages/locale/locales/en/erp.po
+++ b/packages/locale/locales/en/erp.po
@@ -16576,6 +16576,9 @@ msgstr "Override price for a single customer"
msgid "Override price for all customers of a type"
msgstr "Override price for all customers of a type"
+msgid "Override price for every customer"
+msgstr "Override price for every customer"
+
#. placeholder {0}: asset.line.classificationOverrideReason
msgid "Override reason: {0}"
msgstr "Override reason: {0}"
@@ -17046,8 +17049,8 @@ msgstr "Pick a Carbon dimension and the provider target it posts to. Auto-create
msgid "Pick a column to sort by"
msgstr "Pick a column to sort by"
-msgid "Pick a customer or customer type to view their pricing."
-msgstr "Pick a customer or customer type to view their pricing."
+msgid "Pick a customer, a customer type, or All Customers to view their pricing."
+msgstr "Pick a customer, a customer type, or All Customers to view their pricing."
msgid "Pick a date or leave blank to clear it."
msgstr "Pick a date or leave blank to clear it."
diff --git a/packages/locale/locales/es/erp.po b/packages/locale/locales/es/erp.po
index 49f5eec726..c5818755da 100644
--- a/packages/locale/locales/es/erp.po
+++ b/packages/locale/locales/es/erp.po
@@ -16576,6 +16576,9 @@ msgstr "Sobrescribir precio para un único cliente"
msgid "Override price for all customers of a type"
msgstr "Sobrescribir precio para todos los clientes de un tipo"
+msgid "Override price for every customer"
+msgstr "Sobrescribir precio para todos los clientes"
+
#. placeholder {0}: asset.line.classificationOverrideReason
msgid "Override reason: {0}"
msgstr "Razón de la sobrescritura: {0}"
@@ -17046,8 +17049,8 @@ msgstr "Elige una Dimensión de Carbon y el destino del proveedor al que se cont
msgid "Pick a column to sort by"
msgstr "Elige una columna para ordenar"
-msgid "Pick a customer or customer type to view their pricing."
-msgstr "Selecciona un cliente o tipo de cliente para ver su fijación de precios."
+msgid "Pick a customer, a customer type, or All Customers to view their pricing."
+msgstr "Seleccione un cliente, un tipo de cliente o Todos los clientes para ver sus precios."
msgid "Pick a date or leave blank to clear it."
msgstr "Elige una fecha o déjala en blanco para borrarla."
diff --git a/packages/locale/locales/fr/erp.po b/packages/locale/locales/fr/erp.po
index 88a8984f1d..d54601b6f3 100644
--- a/packages/locale/locales/fr/erp.po
+++ b/packages/locale/locales/fr/erp.po
@@ -16576,6 +16576,9 @@ msgstr "Modifier le prix pour un seul client"
msgid "Override price for all customers of a type"
msgstr "Modifier le prix pour tous les clients d'un type"
+msgid "Override price for every customer"
+msgstr "Définir un prix spécifique pour tous les clients"
+
#. placeholder {0}: asset.line.classificationOverrideReason
msgid "Override reason: {0}"
msgstr "Raison de la substitution : {0}"
@@ -17046,8 +17049,8 @@ msgstr "Choisissez une axe analytique Carbon et la cible du fournisseur vers leq
msgid "Pick a column to sort by"
msgstr "Choisir une colonne pour trier"
-msgid "Pick a customer or customer type to view their pricing."
-msgstr "Choisissez un client ou un type de client pour afficher sa tarification."
+msgid "Pick a customer, a customer type, or All Customers to view their pricing."
+msgstr "Choisissez un client, un type de client ou Tous les clients pour afficher leurs prix."
msgid "Pick a date or leave blank to clear it."
msgstr "Choisissez une date ou laissez vide pour l'effacer."
diff --git a/packages/locale/locales/hi/erp.po b/packages/locale/locales/hi/erp.po
index 473d8c80a6..3440663474 100644
--- a/packages/locale/locales/hi/erp.po
+++ b/packages/locale/locales/hi/erp.po
@@ -16576,6 +16576,9 @@ msgstr "एक एकल ग्राहक के लिए मूल्य ओ
msgid "Override price for all customers of a type"
msgstr "सभी प्रकार के ग्राहकों के लिए मूल्य ओवरराइड करें"
+msgid "Override price for every customer"
+msgstr "सभी ग्राहकों के लिए मूल्य ओवरराइड करें"
+
#. placeholder {0}: asset.line.classificationOverrideReason
msgid "Override reason: {0}"
msgstr "ओवरराइड कारण: {0}"
@@ -17046,8 +17049,8 @@ msgstr "एक Carbon आयाम चुनें और वह प्रदा
msgid "Pick a column to sort by"
msgstr "सॉर्ट करने के लिए एक कॉलम चुनें"
-msgid "Pick a customer or customer type to view their pricing."
-msgstr "उनकी मूल्य निर्धारण देखने के लिए एक ग्राहक या ग्राहक प्रकार चुनें।"
+msgid "Pick a customer, a customer type, or All Customers to view their pricing."
+msgstr "कोई ग्राहक, ग्राहक प्रकार, या सभी ग्राहक चुनें, उनके मूल्य देखने के लिए।"
msgid "Pick a date or leave blank to clear it."
msgstr "एक तारीख चुनें या इसे साफ करने के लिए खाली छोड़ें।"
diff --git a/packages/locale/locales/it/erp.po b/packages/locale/locales/it/erp.po
index 6b8d9cf9f9..dd0e50eec3 100644
--- a/packages/locale/locales/it/erp.po
+++ b/packages/locale/locales/it/erp.po
@@ -16576,6 +16576,9 @@ msgstr "Forzatura prezzo per un singolo cliente"
msgid "Override price for all customers of a type"
msgstr "Forzatura prezzo per tutti i clienti di un tipo"
+msgid "Override price for every customer"
+msgstr "Sovrascrivi il prezzo per tutti i clienti"
+
#. placeholder {0}: asset.line.classificationOverrideReason
msgid "Override reason: {0}"
msgstr "Motivo della forzatura: {0}"
@@ -17046,8 +17049,8 @@ msgstr "Scegli una dimensione Carbon e il target provider su cui viene contabili
msgid "Pick a column to sort by"
msgstr "Scegli una colonna per ordinare"
-msgid "Pick a customer or customer type to view their pricing."
-msgstr "Seleziona un cliente o un tipo di cliente per visualizzare i loro prezzi."
+msgid "Pick a customer, a customer type, or All Customers to view their pricing."
+msgstr "Scegli un cliente, un tipo di cliente o Tutti i clienti per visualizzare i loro prezzi."
msgid "Pick a date or leave blank to clear it."
msgstr "Scegli una data o lascia vuoto per cancellarla."
diff --git a/packages/locale/locales/ja/erp.po b/packages/locale/locales/ja/erp.po
index df7119bbc6..4431c7f584 100644
--- a/packages/locale/locales/ja/erp.po
+++ b/packages/locale/locales/ja/erp.po
@@ -16576,6 +16576,9 @@ msgstr "単一の得意先の価格を上書きする"
msgid "Override price for all customers of a type"
msgstr "得意先タイプのすべての得意先の価格を上書きする"
+msgid "Override price for every customer"
+msgstr "すべての得意先の価格を上書きする"
+
#. placeholder {0}: asset.line.classificationOverrideReason
msgid "Override reason: {0}"
msgstr "上書き理由: {0}"
@@ -17046,8 +17049,8 @@ msgstr "Carbonディメンションと、それを投稿するプロバイダー
msgid "Pick a column to sort by"
msgstr "ソート対象の列を選択"
-msgid "Pick a customer or customer type to view their pricing."
-msgstr "得意先または得意先タイプを選択して価格設定を表示。"
+msgid "Pick a customer, a customer type, or All Customers to view their pricing."
+msgstr "得意先、得意先タイプ、または「すべての得意先」を選択して、その価格を表示します。"
msgid "Pick a date or leave blank to clear it."
msgstr "日付を選択するか、空白のままにしてクリアしてください。"
diff --git a/packages/locale/locales/ko/erp.po b/packages/locale/locales/ko/erp.po
index 8d8b6fbe24..2ec6b8fabb 100644
--- a/packages/locale/locales/ko/erp.po
+++ b/packages/locale/locales/ko/erp.po
@@ -16576,6 +16576,9 @@ msgstr "단일 고객에 대한 가격 재정의"
msgid "Override price for all customers of a type"
msgstr "특정 유형의 모든 고객에 대한 가격 재정의"
+msgid "Override price for every customer"
+msgstr "모든 고객에게 가격 재정의"
+
#. placeholder {0}: asset.line.classificationOverrideReason
msgid "Override reason: {0}"
msgstr "재정의 사유: {0}"
@@ -17046,8 +17049,8 @@ msgstr "Carbon 차원과 게시할 제공자 대상을 선택하세요. 자동
msgid "Pick a column to sort by"
msgstr "정렬할 열을 선택하세요"
-msgid "Pick a customer or customer type to view their pricing."
-msgstr "고객 또는 고객 유형을 선택하여 가격 책정을 봅니다."
+msgid "Pick a customer, a customer type, or All Customers to view their pricing."
+msgstr "가격을 보려면 고객, 고객 유형 또는 모든 고객을 선택하세요."
msgid "Pick a date or leave blank to clear it."
msgstr "날짜를 선택하거나 비워두어 지우세요."
diff --git a/packages/locale/locales/pl/erp.po b/packages/locale/locales/pl/erp.po
index 34c834b2c7..4bf0520be6 100644
--- a/packages/locale/locales/pl/erp.po
+++ b/packages/locale/locales/pl/erp.po
@@ -16576,6 +16576,9 @@ msgstr "Nadpisz cenę dla jednego klienta"
msgid "Override price for all customers of a type"
msgstr "Nadpisz cenę dla wszystkich klientów danego typu"
+msgid "Override price for every customer"
+msgstr "Nadpisz cenę dla wszystkich klientów"
+
#. placeholder {0}: asset.line.classificationOverrideReason
msgid "Override reason: {0}"
msgstr "Nadpisanie powodu: {0}"
@@ -17046,8 +17049,8 @@ msgstr "Wybierz wymiar Carbon i cel dostawcy, do którego będzie wysyłany. Aut
msgid "Pick a column to sort by"
msgstr "Wybierz kolumnę do sortowania"
-msgid "Pick a customer or customer type to view their pricing."
-msgstr "Wybierz klienta lub typ klienta, aby wyświetlić ich ceny."
+msgid "Pick a customer, a customer type, or All Customers to view their pricing."
+msgstr "Wybierz klienta, typ klienta lub Wszyscy klienci, aby wyświetlić ich ceny."
msgid "Pick a date or leave blank to clear it."
msgstr "Wybierz datę lub pozostaw puste pole, aby je wyczyścić."
diff --git a/packages/locale/locales/pt/erp.po b/packages/locale/locales/pt/erp.po
index e59fadf07f..32c9063fb9 100644
--- a/packages/locale/locales/pt/erp.po
+++ b/packages/locale/locales/pt/erp.po
@@ -16576,6 +16576,9 @@ msgstr "Sobrescrita de preço para um único cliente"
msgid "Override price for all customers of a type"
msgstr "Sobrescrita de preço para todos os clientes de um tipo"
+msgid "Override price for every customer"
+msgstr "Sobrescrever preço para todos os clientes"
+
#. placeholder {0}: asset.line.classificationOverrideReason
msgid "Override reason: {0}"
msgstr "Motivo da sobrescrita: {0}"
@@ -17046,8 +17049,8 @@ msgstr "Escolha uma dimensão Carbon e o alvo do provedor ao qual ela publica. A
msgid "Pick a column to sort by"
msgstr "Escolha uma coluna para ordenar"
-msgid "Pick a customer or customer type to view their pricing."
-msgstr "Escolha um cliente ou tipo de cliente para visualizar seus preços."
+msgid "Pick a customer, a customer type, or All Customers to view their pricing."
+msgstr "Escolha um cliente, um tipo de cliente ou Todos os clientes para visualizar os preços deles."
msgid "Pick a date or leave blank to clear it."
msgstr "Escolha uma data ou deixe em branco para limpar."
diff --git a/packages/locale/locales/ru/erp.po b/packages/locale/locales/ru/erp.po
index 84b571ca7a..ce38531bc9 100644
--- a/packages/locale/locales/ru/erp.po
+++ b/packages/locale/locales/ru/erp.po
@@ -16576,6 +16576,9 @@ msgstr "Переопределить цену для одного покупат
msgid "Override price for all customers of a type"
msgstr "Переопределить цену для всех покупателей такого типа"
+msgid "Override price for every customer"
+msgstr "Переопределить цену для всех покупателей"
+
#. placeholder {0}: asset.line.classificationOverrideReason
msgid "Override reason: {0}"
msgstr "Причина переопределения: {0}"
@@ -17046,8 +17049,8 @@ msgstr "Выберите измерение Carbon и целевого пров
msgid "Pick a column to sort by"
msgstr "Выберите столбец для сортировки"
-msgid "Pick a customer or customer type to view their pricing."
-msgstr "Выберите покупателя или тип покупателя, чтобы просмотреть их ценообразование."
+msgid "Pick a customer, a customer type, or All Customers to view their pricing."
+msgstr "Выберите покупателя, тип покупателя или «Все покупатели», чтобы просмотреть их цены."
msgid "Pick a date or leave blank to clear it."
msgstr "Выберите дату или оставьте пустым, чтобы очистить."
diff --git a/packages/locale/locales/tr/erp.po b/packages/locale/locales/tr/erp.po
index 83df4a5640..de32f2525b 100644
--- a/packages/locale/locales/tr/erp.po
+++ b/packages/locale/locales/tr/erp.po
@@ -16576,6 +16576,9 @@ msgstr "Tek bir müşteri için fiyatı geçersiz kıl"
msgid "Override price for all customers of a type"
msgstr "Bir müşteri türündeki tüm müşterilerin fiyatını geçersiz kıl"
+msgid "Override price for every customer"
+msgstr "Tüm müşteriler için fiyatı geçersiz kıl"
+
#. placeholder {0}: asset.line.classificationOverrideReason
msgid "Override reason: {0}"
msgstr "Geçersiz kılma nedeni: {0}"
@@ -17046,8 +17049,8 @@ msgstr "Bir Carbon boyutu ve gönderdiği sağlayıcı hedefini seçin. Otomatik
msgid "Pick a column to sort by"
msgstr "Sıralamak için bir sütun seçin"
-msgid "Pick a customer or customer type to view their pricing."
-msgstr "Fiyatlandırmalarını görüntülemek için bir müşteri veya müşteri türü seçin."
+msgid "Pick a customer, a customer type, or All Customers to view their pricing."
+msgstr "Fiyatlarını görüntülemek için bir müşteri, bir müşteri türü veya Tüm Müşteriler seçin."
msgid "Pick a date or leave blank to clear it."
msgstr "Bir tarih seçin veya temizlemek için boş bırakın."
diff --git a/packages/locale/locales/zh/erp.po b/packages/locale/locales/zh/erp.po
index 827cc3f5f8..8ce82a5837 100644
--- a/packages/locale/locales/zh/erp.po
+++ b/packages/locale/locales/zh/erp.po
@@ -16576,6 +16576,9 @@ msgstr "为单个客户覆盖价格"
msgid "Override price for all customers of a type"
msgstr "为所有该类型的客户覆盖价格"
+msgid "Override price for every customer"
+msgstr "为所有客户覆盖价格"
+
#. placeholder {0}: asset.line.classificationOverrideReason
msgid "Override reason: {0}"
msgstr "覆盖原因:{0}"
@@ -17046,8 +17049,8 @@ msgstr "选择一个 Carbon 维度和它过账到的提供商目标。自动创
msgid "Pick a column to sort by"
msgstr "选择要排序的列"
-msgid "Pick a customer or customer type to view their pricing."
-msgstr "选择一个客户或客户类型以查看其定价。"
+msgid "Pick a customer, a customer type, or All Customers to view their pricing."
+msgstr "选择一个客户、一种客户类型或“所有客户”以查看其价格。"
msgid "Pick a date or leave blank to clear it."
msgstr "选择一个日期或留空以清除它。"