Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
Merge pull request #1249 from crbnos/uk-registration-number-field
Naveen Kashyapfe22789c8870
diff --git a/apps/erp/app/components/Form/AddressAutocomplete.tsx b/apps/erp/app/components/Form/AddressAutocomplete.tsxindex 19328ad07f..30cd0e37c5 100644--- a/apps/erp/app/components/Form/AddressAutocomplete.tsx+++ b/apps/erp/app/components/Form/AddressAutocomplete.tsx@@ -168,6 +168,7 @@ const AddressAutocomplete = ({onFocus={handleInputFocus}onKeyDown={handleKeyDown}autoComplete="off"+ placeholder={t`e.g. 1 Industrial Way`}className="bg-transparent"/>{open && suggestions.length > 0 && (@@ -204,21 +205,35 @@ const AddressAutocomplete = ({ref={addressLine2Ref}name="addressLine2"label={t`Address Line 2`}+ placeholder={t`e.g. Suite 200`}/>);- const cityField = <Input ref={cityRef} name="city" label={t`City`} />;+ const cityField = (+ <Input+ ref={cityRef}+ name="city"+ label={t`City`}+ placeholder={t`e.g. Detroit`}+ />+ );const stateProvinceField = (<Inputref={stateProvinceRef}name="stateProvince"label={t`State / Province`}+ placeholder={t`e.g. MI`}/>);const postalCodeField = (- <Input ref={postalCodeRef} name="postalCode" label={t`Postal Code`} />+ <Input+ ref={postalCodeRef}+ name="postalCode"+ label={t`Postal Code`}+ placeholder={t`e.g. 48201`}+ />);const countryField = <Country name="countryCode" label={t`Country`} />;diff --git a/apps/erp/app/modules/settings/settings.models.ts b/apps/erp/app/modules/settings/settings.models.tsindex af841078ac..730ede2481 100644--- a/apps/erp/app/modules/settings/settings.models.ts+++ b/apps/erp/app/modules/settings/settings.models.ts@@ -85,7 +85,8 @@ const company = {fax: zfd.text(z.string().optional()),email: zfd.text(z.string().optional()),vatNumber: zfd.text(z.string().optional()),- eori: zfd.text(z.string().optional())+ eori: zfd.text(z.string().optional()),+ registrationNumber: zfd.text(z.string().optional())};export const companyValidator = z.object(company);diff --git a/apps/erp/app/modules/settings/ui/Company/CompanyForm.tsx b/apps/erp/app/modules/settings/ui/Company/CompanyForm.tsxindex 25c7f173bd..312549328e 100644--- a/apps/erp/app/modules/settings/ui/Company/CompanyForm.tsx+++ b/apps/erp/app/modules/settings/ui/Company/CompanyForm.tsx@@ -1,6 +1,6 @@-import { ValidatedForm } from "@carbon/form";+import { useControlField, ValidatedForm } from "@carbon/form";import { VStack } from "@carbon/react";-import { isEoriCountry } from "@carbon/utils";+import { isEoriCountry, isRegistrationNumberCountry } from "@carbon/utils";import { Trans, useLingui } from "@lingui/react/macro";import type { z } from "zod";import { Currency, Hidden, Input, PhoneInput, Submit } from "~/components/Form";@@ -12,6 +12,32 @@ type CompanyFormProps = {company: z.infer<typeof companyValidator>;};+// Reads the live countryCode so picking a new country in AddressAutocomplete+// shows or hides these immediately, rather than waiting for a save + reload.+const CountrySpecificFields = () => {+ const { t } = useLingui();+ const [countryCode] = useControlField<string>("countryCode");++ return (+ <>+ {isEoriCountry(countryCode) && (+ <Input+ name="eori"+ label={t`EORI`}+ placeholder={t`e.g. GB123456789000`}+ />+ )}+ {isRegistrationNumberCountry(countryCode) && (+ <Input+ name="registrationNumber"+ label={t`Registration Number`}+ placeholder={t`e.g. 01234567`}+ />+ )}+ </>+ );+};+const CompanyForm = ({ company }: CompanyFormProps) => {const { t } = useLingui();return (@@ -26,22 +52,48 @@ const CompanyForm = ({ company }: CompanyFormProps) => {<VStack spacing={4}><div className="grid grid-cols-1 md:grid-cols-2 gap-4 w-full">- <Input name="name" label={t`Company Name`} />- <Input name="taxId" label={t`Tax ID`} />- <Input name="vatNumber" label={t`VAT Number`} />- {isEoriCountry(company.countryCode) && (- <Input name="eori" label={t`EORI`} />- )}+ <Input+ name="name"+ label={t`Company Name`}+ placeholder={t`e.g. Acme Manufacturing`}+ />+ <Input+ name="taxId"+ label={t`Tax ID`}+ placeholder={t`e.g. 12-3456789`}+ />+ <Input+ name="vatNumber"+ label={t`VAT Number`}+ placeholder={t`e.g. GB123456789`}+ />+ <CountrySpecificFields /><AddressAutocomplete variant="grid" /><Currencyname="baseCurrencyCode"label={t`Base Currency`}disabled={true}/>- <PhoneInput name="phone" label={t`Phone Number`} />- <PhoneInput name="fax" label={t`Fax Number`} />- <Input name="email" label={t`Email`} />- <Input name="website" label={t`Website`} />+ <PhoneInput+ name="phone"+ label={t`Phone Number`}+ placeholder={t`e.g. +1 555 123 4567`}+ />+ <PhoneInput+ name="fax"+ label={t`Fax Number`}+ placeholder={t`e.g. +1 555 123 4568`}+ />+ <Input+ name="email"+ label={t`Email`}+ placeholder="[email protected]"+ />+ <Input+ name="website"+ label={t`Website`}+ placeholder="https://www.example.com"+ /></div><Submit><Trans>Save</Trans>diff --git a/apps/erp/app/routes/x+/settings+/company.tsx b/apps/erp/app/routes/x+/settings+/company.tsxindex e6213b009d..85f7e73d58 100644--- a/apps/erp/app/routes/x+/settings+/company.tsx+++ b/apps/erp/app/routes/x+/settings+/company.tsx@@ -83,6 +83,7 @@ export default function Company() {taxId: company.taxId ?? undefined,vatNumber: company.vatNumber ?? undefined,eori: company.eori ?? undefined,+ registrationNumber: company.registrationNumber ?? undefined,addressLine1: company.addressLine1 ?? "",addressLine2: company.addressLine2 ?? undefined,city: company.city ?? "",diff --git a/packages/database/src/swagger-docs-schema.ts b/packages/database/src/swagger-docs-schema.tsindex 1e1c2387cf..c437f6b135 100644--- a/packages/database/src/swagger-docs-schema.ts+++ b/packages/database/src/swagger-docs-schema.ts@@ -22938,6 +22938,21 @@ export default {{$ref: "#/parameters/rowFilter.companies.logoWatermark"},+ {+ $ref: "#/parameters/rowFilter.companies.industryId"+ },+ {+ $ref: "#/parameters/rowFilter.companies.customIndustryDescription"+ },+ {+ $ref: "#/parameters/rowFilter.companies.selectedModules"+ },+ {+ $ref: "#/parameters/rowFilter.companies.featureRequests"+ },+ {+ $ref: "#/parameters/rowFilter.companies.registrationNumber"+ },{$ref: "#/parameters/rowFilter.companies.userId"},@@ -64848,6 +64863,9 @@ export default {{$ref: "#/parameters/rowFilter.company.featureRequests"},+ {+ $ref: "#/parameters/rowFilter.company.registrationNumber"+ },{$ref: "#/parameters/select"},@@ -65009,6 +65027,9 @@ export default {{$ref: "#/parameters/rowFilter.company.featureRequests"},+ {+ $ref: "#/parameters/rowFilter.company.registrationNumber"+ },{$ref: "#/parameters/preferReturn"}@@ -65124,6 +65145,9 @@ export default {{$ref: "#/parameters/rowFilter.company.featureRequests"},+ {+ $ref: "#/parameters/rowFilter.company.registrationNumber"+ },{$ref: "#/parameters/body.company"},@@ -105301,6 +105325,31 @@ export default {format: "text",type: "string"},+ industryId: {+ description:+ "Note:\nThis is a Foreign Key to `industry.id`.<fk table='industry' column='id'/>",+ format: "text",+ type: "string"+ },+ customIndustryDescription: {+ format: "text",+ type: "string"+ },+ selectedModules: {+ format: "text[]",+ items: {+ type: "string"+ },+ type: "array"+ },+ featureRequests: {+ format: "text",+ type: "string"+ },+ registrationNumber: {+ format: "text",+ type: "string"+ },userId: {description:"Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",@@ -125293,6 +125342,10 @@ export default {featureRequests: {format: "text",type: "string"+ },+ registrationNumber: {+ format: "text",+ type: "string"}},type: "object"@@ -146715,6 +146768,36 @@ export default {in: "query",type: "string"},+ "rowFilter.companies.industryId": {+ name: "industryId",+ required: false,+ in: "query",+ type: "string"+ },+ "rowFilter.companies.customIndustryDescription": {+ name: "customIndustryDescription",+ required: false,+ in: "query",+ type: "string"+ },+ "rowFilter.companies.selectedModules": {+ name: "selectedModules",+ required: false,+ in: "query",+ type: "string"+ },+ "rowFilter.companies.featureRequests": {+ name: "featureRequests",+ required: false,+ in: "query",+ type: "string"+ },+ "rowFilter.companies.registrationNumber": {+ name: "registrationNumber",+ required: false,+ in: "query",+ type: "string"+ },"rowFilter.companies.userId": {name: "userId",required: false,@@ -168919,6 +169002,12 @@ export default {in: "query",type: "string"},+ "rowFilter.company.registrationNumber": {+ name: "registrationNumber",+ required: false,+ in: "query",+ type: "string"+ },"body.documentTemplate": {name: "documentTemplate",description: "documentTemplate",diff --git a/packages/database/src/types.ts b/packages/database/src/types.tsindex 379debb82f..5ad6dbceb2 100644--- a/packages/database/src/types.ts+++ b/packages/database/src/types.ts@@ -6083,6 +6083,7 @@ export type Database = {parentCompanyId: string | nullphone: string | nullpostalCode: string | null+ registrationNumber: string | nullselectedModules: string[] | nullslackChannel: string | nullstateProvince: string | null@@ -6119,6 +6120,7 @@ export type Database = {parentCompanyId?: string | nullphone?: string | nullpostalCode?: string | null+ registrationNumber?: string | nullselectedModules?: string[] | nullslackChannel?: string | nullstateProvince?: string | null@@ -6155,6 +6157,7 @@ export type Database = {parentCompanyId?: string | nullphone?: string | nullpostalCode?: string | null+ registrationNumber?: string | nullselectedModules?: string[] | nullslackChannel?: string | nullstateProvince?: string | null@@ -58655,11 +58658,14 @@ export type Database = {companyId: string | nullcountryCode: string | nullcreatedAt: string | null+ customIndustryDescription: string | nullemail: string | nullemployeeType: string | nulleori: string | nullfax: string | null+ featureRequests: string | nullid: string | null+ industryId: string | nullisEliminationEntity: boolean | nulllogoDark: string | nulllogoDarkIcon: string | null@@ -58671,7 +58677,9 @@ export type Database = {parentCompanyId: string | nullphone: string | nullpostalCode: string | null+ registrationNumber: string | nullrole: Database["public"]["Enums"]["role"] | null+ selectedModules: string[] | nullslackChannel: string | nullstateProvince: string | nullsuggestionNotificationGroup: string[] | null@@ -58731,6 +58739,13 @@ export type Database = {referencedRelation: "companyGroup"referencedColumns: ["id"]},+ {+ foreignKeyName: "company_industryId_fkey"+ columns: ["industryId"]+ isOneToOne: false+ referencedRelation: "industry"+ referencedColumns: ["id"]+ },{foreignKeyName: "company_parentCompanyId_fkey"columns: ["parentCompanyId"]diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.tsindex 379debb82f..5ad6dbceb2 100644--- a/packages/database/supabase/functions/lib/types.ts+++ b/packages/database/supabase/functions/lib/types.ts@@ -6083,6 +6083,7 @@ export type Database = {parentCompanyId: string | nullphone: string | nullpostalCode: string | null+ registrationNumber: string | nullselectedModules: string[] | nullslackChannel: string | nullstateProvince: string | null@@ -6119,6 +6120,7 @@ export type Database = {parentCompanyId?: string | nullphone?: string | nullpostalCode?: string | null+ registrationNumber?: string | nullselectedModules?: string[] | nullslackChannel?: string | nullstateProvince?: string | null@@ -6155,6 +6157,7 @@ export type Database = {parentCompanyId?: string | nullphone?: string | nullpostalCode?: string | null+ registrationNumber?: string | nullselectedModules?: string[] | nullslackChannel?: string | nullstateProvince?: string | null@@ -58655,11 +58658,14 @@ export type Database = {companyId: string | nullcountryCode: string | nullcreatedAt: string | null+ customIndustryDescription: string | nullemail: string | nullemployeeType: string | nulleori: string | nullfax: string | null+ featureRequests: string | nullid: string | null+ industryId: string | nullisEliminationEntity: boolean | nulllogoDark: string | nulllogoDarkIcon: string | null@@ -58671,7 +58677,9 @@ export type Database = {parentCompanyId: string | nullphone: string | nullpostalCode: string | null+ registrationNumber: string | nullrole: Database["public"]["Enums"]["role"] | null+ selectedModules: string[] | nullslackChannel: string | nullstateProvince: string | nullsuggestionNotificationGroup: string[] | null@@ -58731,6 +58739,13 @@ export type Database = {referencedRelation: "companyGroup"referencedColumns: ["id"]},+ {+ foreignKeyName: "company_industryId_fkey"+ columns: ["industryId"]+ isOneToOne: false+ referencedRelation: "industry"+ referencedColumns: ["id"]+ },{foreignKeyName: "company_parentCompanyId_fkey"columns: ["parentCompanyId"]diff --git a/packages/database/supabase/migrations/20260727105000_registration-number.sql b/packages/database/supabase/migrations/20260727105000_registration-number.sqlnew file mode 100644index 0000000000..dd86356421--- /dev/null+++ b/packages/database/supabase/migrations/20260727105000_registration-number.sql@@ -0,0 +1,26 @@+-- Company registration number (e.g. UK Companies House number). Shown in+-- company settings for countries that issue one, and used as the default+-- document footer registration number.+ALTER TABLE "company"+ ADD COLUMN "registrationNumber" TEXT;++-- Postgres views freeze their column manifest at CREATE time, so adding+-- columns to "company" does not propagate to the "companies" view unless we+-- recreate it. Drop + recreate to refresh the column list.+DROP VIEW IF EXISTS "companies";+CREATE OR REPLACE VIEW "companies" WITH(SECURITY_INVOKER=true) AS+ SELECT DISTINCT+ c.*,+ uc.*,+ et.name AS "employeeType",+ cg.name AS "companyGroupName",+ cg."ownerId"+ FROM "userToCompany" uc+ INNER JOIN "company" c+ ON c.id = uc."companyId"+ LEFT JOIN "employee" e+ ON e.id = uc."userId" AND e."companyId" = uc."companyId"+ LEFT JOIN "employeeType" et+ ON et.id = e."employeeTypeId"+ LEFT JOIN "companyGroup" cg+ ON cg.id = c."companyGroupId";diff --git a/packages/documents/src/pdf/blocks/packingSlip/vars.ts b/packages/documents/src/pdf/blocks/packingSlip/vars.tsindex c8f6465af8..25f3a2e007 100644--- a/packages/documents/src/pdf/blocks/packingSlip/vars.ts+++ b/packages/documents/src/pdf/blocks/packingSlip/vars.ts@@ -23,6 +23,7 @@ export function buildPackingSlipVars("company.country": str(data.company?.countryCode),"company.taxId": str(data.company?.taxId),"company.eori": str(data.company?.eori),- "company.vatNumber": str(data.company?.vatNumber)+ "company.vatNumber": str(data.company?.vatNumber),+ "company.registrationNumber": str(data.company?.registrationNumber)};}diff --git a/packages/documents/src/pdf/blocks/purchaseOrder/vars.ts b/packages/documents/src/pdf/blocks/purchaseOrder/vars.tsindex bbdee5da97..bc0ab24c8a 100644--- a/packages/documents/src/pdf/blocks/purchaseOrder/vars.ts+++ b/packages/documents/src/pdf/blocks/purchaseOrder/vars.ts@@ -25,6 +25,7 @@ export function buildPurchaseOrderVars("company.country": str(data.company?.countryCode),"company.taxId": str(data.company?.taxId),"company.eori": str(data.company?.eori),- "company.vatNumber": str(data.company?.vatNumber)+ "company.vatNumber": str(data.company?.vatNumber),+ "company.registrationNumber": str(data.company?.registrationNumber)};}diff --git a/packages/documents/src/pdf/blocks/quote/vars.ts b/packages/documents/src/pdf/blocks/quote/vars.tsindex 29cdf54863..7a34020ec8 100644--- a/packages/documents/src/pdf/blocks/quote/vars.ts+++ b/packages/documents/src/pdf/blocks/quote/vars.ts@@ -25,6 +25,7 @@ export function buildQuoteVars("company.country": str(data.company?.countryCode),"company.taxId": str(data.company?.taxId),"company.eori": str(data.company?.eori),- "company.vatNumber": str(data.company?.vatNumber)+ "company.vatNumber": str(data.company?.vatNumber),+ "company.registrationNumber": str(data.company?.registrationNumber)};}diff --git a/packages/documents/src/pdf/blocks/salesOrder/vars.ts b/packages/documents/src/pdf/blocks/salesOrder/vars.tsindex 0fa7a417f5..8117168727 100644--- a/packages/documents/src/pdf/blocks/salesOrder/vars.ts+++ b/packages/documents/src/pdf/blocks/salesOrder/vars.ts@@ -28,6 +28,7 @@ export function buildSalesOrderVars("company.country": str(data.company?.countryCode),"company.taxId": str(data.company?.taxId),"company.eori": str(data.company?.eori),- "company.vatNumber": str(data.company?.vatNumber)+ "company.vatNumber": str(data.company?.vatNumber),+ "company.registrationNumber": str(data.company?.registrationNumber)};}diff --git a/packages/documents/src/pdf/blocks/vars.ts b/packages/documents/src/pdf/blocks/vars.tsindex ce5b2dfc09..fb57c2fe97 100644--- a/packages/documents/src/pdf/blocks/vars.ts+++ b/packages/documents/src/pdf/blocks/vars.ts@@ -34,6 +34,7 @@ export function buildSalesInvoiceVars("company.country": str(data.company?.countryCode),"company.taxId": str(data.company?.taxId),"company.eori": str(data.company?.eori),- "company.vatNumber": str(data.company?.vatNumber)+ "company.vatNumber": str(data.company?.vatNumber),+ "company.registrationNumber": str(data.company?.registrationNumber)};}diff --git a/packages/documents/src/pdf/purchaseOrder.samples.ts b/packages/documents/src/pdf/purchaseOrder.samples.tsindex eb3887681e..1d280cecd2 100644--- a/packages/documents/src/pdf/purchaseOrder.samples.ts+++ b/packages/documents/src/pdf/purchaseOrder.samples.ts@@ -13,7 +13,8 @@ export const SAMPLE_PURCHASE_ORDER = {logoLight: null,logoLightIcon: null,logoWatermark: null,- eori: null+ eori: null,+ registrationNumber: null},purchaseOrder: {purchaseOrderId: "PO-001042",diff --git a/packages/documents/src/pdf/quote.samples.ts b/packages/documents/src/pdf/quote.samples.tsindex f4c1b4a6f3..1f46b174bf 100644--- a/packages/documents/src/pdf/quote.samples.ts+++ b/packages/documents/src/pdf/quote.samples.ts@@ -12,7 +12,8 @@ export const SAMPLE_QUOTE = {logoLight: null,logoLightIcon: null,logoWatermark: null,- eori: null+ eori: null,+ registrationNumber: null},exchangeRate: 1,quote: {diff --git a/packages/documents/src/pdf/salesOrder.samples.ts b/packages/documents/src/pdf/salesOrder.samples.tsindex 963a338782..c5b6d6b74a 100644--- a/packages/documents/src/pdf/salesOrder.samples.ts+++ b/packages/documents/src/pdf/salesOrder.samples.ts@@ -16,7 +16,8 @@ export const SAMPLE_SALES_ORDER = {logoLight: null,logoLightIcon: null,logoWatermark: null,- eori: null+ eori: null,+ registrationNumber: null},salesOrder: {salesOrderId: "SO-001042",diff --git a/packages/documents/src/pdf/samples.ts b/packages/documents/src/pdf/samples.tsindex 849ed5989e..e8445dad9c 100644--- a/packages/documents/src/pdf/samples.ts+++ b/packages/documents/src/pdf/samples.ts@@ -17,7 +17,8 @@ export const SAMPLE_SALES_INVOICE = {baseCurrencyCode: "USD",logoLightIcon: null,logoWatermark: null,- eori: null+ eori: null,+ registrationNumber: null},salesInvoice: {invoiceId: "INV-001042",diff --git a/packages/documents/src/template/merge.ts b/packages/documents/src/template/merge.tsindex 5bb6411a58..73021ab6c8 100644--- a/packages/documents/src/template/merge.ts+++ b/packages/documents/src/template/merge.ts@@ -61,7 +61,12 @@ export const COMPANY_MERGE_FIELDS: MergeField[] = [{ token: "company.country", label: "Company Country", group: "Company" },{ token: "company.taxId", label: "Company Tax ID", group: "Company" },{ token: "company.eori", label: "Company EORI", group: "Company" },- { token: "company.vatNumber", label: "Company VAT Number", group: "Company" }+ { token: "company.vatNumber", label: "Company VAT Number", group: "Company" },+ {+ token: "company.registrationNumber",+ label: "Company Registration Number",+ group: "Company"+ }];const SALES_INVOICE_MERGE_FIELDS: MergeField[] = [diff --git a/packages/documents/src/template/schema.ts b/packages/documents/src/template/schema.tsindex f35172e592..446a484ecf 100644--- a/packages/documents/src/template/schema.ts+++ b/packages/documents/src/template/schema.ts@@ -268,7 +268,7 @@ export const documentSectionPlacementSchema = z.enum([]);/** Default registration number shown in the footer when none is configured. */-export const DEFAULT_REGISTRATION_NUMBER = "{company.taxId}";+export const DEFAULT_REGISTRATION_NUMBER = "{company.registrationNumber}";export const DEFAULT_FOOTER_OPTIONS = {showRegistrationLine: true,diff --git a/packages/documents/src/utils/shared.test.ts b/packages/documents/src/utils/shared.test.tsnew file mode 100644index 0000000000..18236144a8--- /dev/null+++ b/packages/documents/src/utils/shared.test.ts@@ -0,0 +1,130 @@+import { describe, expect, it } from "vitest";+import type { ResolvedSection, SectionConfig } from "../template";+import { getRegistrationFooter, resolveRegistrationLine } from "./shared";++const FOOTER_ID = "system-footer";++const footer = (config: SectionConfig): Record<string, ResolvedSection> => ({+ [FOOTER_ID]: {+ id: FOOTER_ID,+ name: "Default Footer",+ placement: "footer",+ content: { type: "doc", content: [] },+ config+ }+});++const VARS = {+ "company.taxId": "12-3456789",+ "company.registrationNumber": "09876543",+ "company.vatNumber": "GB123456789"+};++const VARS_WITHOUT_REGISTRATION = {+ ...VARS,+ "company.registrationNumber": ""+};++const company = { name: "Acme Ltd", countryCode: "GB" };++const resolve = (+ sections: Record<string, ResolvedSection>,+ vars: Record<string, string>,+ footerSectionId: string | null = FOOTER_ID,+ settings = { showRegistrationLine: true }+) =>+ resolveRegistrationLine({+ company,+ footerSectionId,+ sections,+ settings,+ vars+ });++describe("getRegistrationFooter", () => {+ it("drops the suffix when the number resolves empty", () => {+ expect(getRegistrationFooter("Acme Ltd", "GB", "")).toBe(+ "Acme Ltd is registered in United Kingdom"+ );+ });++ it("renders nothing without a company name", () => {+ expect(getRegistrationFooter(null, "GB", "09876543")).toBeUndefined();+ });+});++describe("resolveRegistrationLine", () => {+ it("defaults to the company registration number", () => {+ expect(resolve({}, VARS, null).label).toBe(+ "Acme Ltd is registered in United Kingdom, Company Registration Number 09876543"+ );+ expect(resolve(footer({ showRegistrationLine: true }), VARS).label).toBe(+ "Acme Ltd is registered in United Kingdom, Company Registration Number 09876543"+ );+ });++ it("prints no number when the company has no registration number", () => {+ expect(resolve({}, VARS_WITHOUT_REGISTRATION, null).label).toBe(+ "Acme Ltd is registered in United Kingdom"+ );+ });++ it("keeps an explicitly emptied registration number empty", () => {+ expect(+ resolve(+ footer({ showRegistrationLine: true, registrationNumber: "" }),+ VARS+ ).label+ ).toBe("Acme Ltd is registered in United Kingdom");+ });++ it("interpolates a configured value's merge fields", () => {+ expect(+ resolve(+ footer({+ showRegistrationLine: true,+ registrationNumber: "VAT {company.vatNumber}"+ }),+ VARS+ ).label+ ).toBe(+ "Acme Ltd is registered in United Kingdom, Company Registration Number VAT GB123456789"+ );+ });++ it("honors a footer configured to the tax id", () => {+ expect(+ resolve(+ footer({+ showRegistrationLine: true,+ registrationNumber: "{company.taxId}"+ }),+ VARS+ ).label+ ).toBe(+ "Acme Ltd is registered in United Kingdom, Company Registration Number 12-3456789"+ );+ });++ it("lets the footer config override the per-template visibility setting", () => {+ expect(+ resolve(footer({ showRegistrationLine: false }), VARS, FOOTER_ID, {+ showRegistrationLine: true+ }).show+ ).toBe(false);+ expect(+ resolve(footer({ showRegistrationLine: true }), VARS, FOOTER_ID, {+ showRegistrationLine: false+ }).show+ ).toBe(true);+ });++ it("falls back to the per-template setting without a footer config", () => {+ expect(resolve({}, VARS, null, { showRegistrationLine: false }).show).toBe(+ false+ );+ expect(resolve({}, VARS, null, { showRegistrationLine: true }).show).toBe(+ true+ );+ });+});diff --git a/packages/locale/locales/de/erp.po b/packages/locale/locales/de/erp.poindex dc668fdd76..2da478ddbe 100644--- a/packages/locale/locales/de/erp.po+++ b/packages/locale/locales/de/erp.po@@ -4453,18 +4453,54 @@ msgstr "Duplizieren zu..."msgid "Duration"msgstr "Dauer"+msgid "e.g. +1 555 123 4567"+msgstr "z.B. +1 555 123 4567"++msgid "e.g. +1 555 123 4568"+msgstr "z.B. +1 555 123 4568"++msgid "e.g. 01234567"+msgstr "z.B. 01234567"++msgid "e.g. 1 Industrial Way"+msgstr "z.B. 1 Industrial Way"++msgid "e.g. 12-3456789"+msgstr "z.B. 12-3456789"+msgid "e.g. 2h"msgstr "z.B. 2h"+msgid "e.g. 48201"+msgstr "z.B. 48201"++msgid "e.g. Acme Manufacturing"+msgstr "z.B. Acme Manufacturing"++msgid "e.g. Detroit"+msgstr "z.B. Detroit"+msgid "e.g. DWG-1234"msgstr "z.B. DWG-1234"+msgid "e.g. GB123456789"+msgstr "z.B. GB123456789"++msgid "e.g. GB123456789000"+msgstr "z.B. GB123456789000"+msgid "e.g. Jane Smith"msgstr "z.B. Jane Smith"msgid "e.g. Marco + the area leads"msgstr "z.B. Marco + die Bereichsleiter"+msgid "e.g. MI"+msgstr "z.B. MI"++msgid "e.g. Suite 200"+msgstr "z.B. Suite 200"+msgid "e.g. the first 3 to 4 weeks"msgstr "z.B. die ersten 3 bis 4 Wochen"@@ -10273,6 +10309,9 @@ msgstr "Registriert"msgid "Registered"msgstr "Bestellpunkt"+msgid "Registration Number"+msgstr "Registrierungsnummer"+msgid "Reject"msgstr "Ablehnen"diff --git a/packages/locale/locales/en/erp.po b/packages/locale/locales/en/erp.poindex 3039e1a4e4..f76c006f54 100644--- a/packages/locale/locales/en/erp.po+++ b/packages/locale/locales/en/erp.po@@ -4453,18 +4453,54 @@ msgstr "Duplicate to..."msgid "Duration"msgstr "Duration"+msgid "e.g. +1 555 123 4567"+msgstr "e.g. +1 555 123 4567"++msgid "e.g. +1 555 123 4568"+msgstr "e.g. +1 555 123 4568"++msgid "e.g. 01234567"+msgstr "e.g. 01234567"++msgid "e.g. 1 Industrial Way"+msgstr "e.g. 1 Industrial Way"++msgid "e.g. 12-3456789"+msgstr "e.g. 12-3456789"+msgid "e.g. 2h"msgstr "e.g. 2h"+msgid "e.g. 48201"+msgstr "e.g. 48201"++msgid "e.g. Acme Manufacturing"+msgstr "e.g. Acme Manufacturing"++msgid "e.g. Detroit"+msgstr "e.g. Detroit"+msgid "e.g. DWG-1234"msgstr "e.g. DWG-1234"+msgid "e.g. GB123456789"+msgstr "e.g. GB123456789"++msgid "e.g. GB123456789000"+msgstr "e.g. GB123456789000"+msgid "e.g. Jane Smith"msgstr "e.g. Jane Smith"msgid "e.g. Marco + the area leads"msgstr "e.g. Marco + the area leads"+msgid "e.g. MI"+msgstr "e.g. MI"++msgid "e.g. Suite 200"+msgstr "e.g. Suite 200"+msgid "e.g. the first 3 to 4 weeks"msgstr "e.g. the first 3 to 4 weeks"@@ -10273,6 +10309,9 @@ msgstr "Register Existing Asset"msgid "Registered"msgstr "Registered"+msgid "Registration Number"+msgstr "Registration Number"+msgid "Reject"msgstr "Reject"diff --git a/packages/locale/locales/es/erp.po b/packages/locale/locales/es/erp.poindex d8e71c6d24..387d41c65b 100644--- a/packages/locale/locales/es/erp.po+++ b/packages/locale/locales/es/erp.po@@ -4453,18 +4453,54 @@ msgstr "Duplicar a..."msgid "Duration"msgstr "Duración"+msgid "e.g. +1 555 123 4567"+msgstr "p. ej. +1 555 123 4567"++msgid "e.g. +1 555 123 4568"+msgstr "p. ej. +1 555 123 4568"++msgid "e.g. 01234567"+msgstr "p. ej. 01234567"++msgid "e.g. 1 Industrial Way"+msgstr "p. ej. 1 Industrial Way"++msgid "e.g. 12-3456789"+msgstr "p. ej. 12-3456789"+msgid "e.g. 2h"msgstr "p. ej. 2h"+msgid "e.g. 48201"+msgstr "p. ej. 48201"++msgid "e.g. Acme Manufacturing"+msgstr "p. ej. Acme Manufacturing"++msgid "e.g. Detroit"+msgstr "p. ej. Detroit"+msgid "e.g. DWG-1234"msgstr "p. ej. DWG-1234"+msgid "e.g. GB123456789"+msgstr "p. ej. GB123456789"++msgid "e.g. GB123456789000"+msgstr "p. ej. GB123456789000"+msgid "e.g. Jane Smith"msgstr "p. ej. Jane Smith"msgid "e.g. Marco + the area leads"msgstr "p. ej. Marco + los líderes del área"+msgid "e.g. MI"+msgstr "p. ej. MI"++msgid "e.g. Suite 200"+msgstr "p. ej. Suite 200"+msgid "e.g. the first 3 to 4 weeks"msgstr "p. ej. las primeras 3 a 4 semanas"@@ -10273,6 +10309,9 @@ msgstr "Registrado"msgid "Registered"msgstr "Punto de Reorden"+msgid "Registration Number"+msgstr "Número de registro"+msgid "Reject"msgstr "Rechazar"diff --git a/packages/locale/locales/fr/erp.po b/packages/locale/locales/fr/erp.poindex 2439a4806b..a356ea9296 100644--- a/packages/locale/locales/fr/erp.po+++ b/packages/locale/locales/fr/erp.po@@ -4453,18 +4453,54 @@ msgstr "Dupliquer vers..."msgid "Duration"msgstr "Durée"+msgid "e.g. +1 555 123 4567"+msgstr "p. ex. +1 555 123 4567"++msgid "e.g. +1 555 123 4568"+msgstr "p. ex. +1 555 123 4568"++msgid "e.g. 01234567"+msgstr "p. ex. 01234567"++msgid "e.g. 1 Industrial Way"+msgstr "p. ex. 1 Industrial Way"++msgid "e.g. 12-3456789"+msgstr "p. ex. 12-3456789"+msgid "e.g. 2h"msgstr "p. ex. 2h"+msgid "e.g. 48201"+msgstr "p. ex. 48201"++msgid "e.g. Acme Manufacturing"+msgstr "p. ex. Acme Manufacturing"++msgid "e.g. Detroit"+msgstr "p. ex. Detroit"+msgid "e.g. DWG-1234"msgstr "p. ex. DWG-1234"+msgid "e.g. GB123456789"+msgstr "p. ex. GB123456789"++msgid "e.g. GB123456789000"+msgstr "p. ex. GB123456789000"+msgid "e.g. Jane Smith"msgstr "p. ex. Jane Smith"msgid "e.g. Marco + the area leads"msgstr "p. ex. Marco + les responsables régionaux"+msgid "e.g. MI"+msgstr "p. ex. MI"++msgid "e.g. Suite 200"+msgstr "p. ex. Suite 200"+msgid "e.g. the first 3 to 4 weeks"msgstr "par exemple les 3 à 4 premières semaines"@@ -10273,6 +10309,9 @@ msgstr "Enregistré"msgid "Registered"msgstr "Point de Réapprovisionnement"+msgid "Registration Number"+msgstr "Numéro d'enregistrement"+msgid "Reject"msgstr "Rejeter"diff --git a/packages/locale/locales/hi/erp.po b/packages/locale/locales/hi/erp.poindex 154bfd5d9e..a0f6c8673f 100644--- a/packages/locale/locales/hi/erp.po+++ b/packages/locale/locales/hi/erp.po@@ -4453,18 +4453,54 @@ msgstr "...को डुप्लिकेट करें"msgid "Duration"msgstr "अवधि"+msgid "e.g. +1 555 123 4567"+msgstr "उदा. +1 555 123 4567"++msgid "e.g. +1 555 123 4568"+msgstr "उदा. +1 555 123 4568"++msgid "e.g. 01234567"+msgstr "उदा. 01234567"++msgid "e.g. 1 Industrial Way"+msgstr "उदा. 1 Industrial Way"++msgid "e.g. 12-3456789"+msgstr "उदा. 12-3456789"+msgid "e.g. 2h"msgstr "उदा. 2h"+msgid "e.g. 48201"+msgstr "उदा. 48201"++msgid "e.g. Acme Manufacturing"+msgstr "उदा. Acme Manufacturing"++msgid "e.g. Detroit"+msgstr "उदा. Detroit"+msgid "e.g. DWG-1234"msgstr "उदा. DWG-1234"+msgid "e.g. GB123456789"+msgstr "उदा. GB123456789"++msgid "e.g. GB123456789000"+msgstr "उदा. GB123456789000"+msgid "e.g. Jane Smith"msgstr "उदाहरण के लिए Jane Smith"msgid "e.g. Marco + the area leads"msgstr "उदा. मार्को + क्षेत्र के नेता"+msgid "e.g. MI"+msgstr "उदा. MI"++msgid "e.g. Suite 200"+msgstr "उदा. Suite 200"+msgid "e.g. the first 3 to 4 weeks"msgstr "उदाहरण के लिए पहले 3 से 4 सप्ताह"@@ -10273,6 +10309,9 @@ msgstr "पंजीकृत"msgid "Registered"msgstr "पुन: आदेश बिंदु"+msgid "Registration Number"+msgstr "पंजीकरण संख्या"+msgid "Reject"msgstr "अस्वीकार करें"diff --git a/packages/locale/locales/it/erp.po b/packages/locale/locales/it/erp.poindex ec97b40098..608b347aa2 100644--- a/packages/locale/locales/it/erp.po+++ b/packages/locale/locales/it/erp.po@@ -4453,18 +4453,54 @@ msgstr "Duplica in..."msgid "Duration"msgstr "Durata"+msgid "e.g. +1 555 123 4567"+msgstr "ad es. +1 555 123 4567"++msgid "e.g. +1 555 123 4568"+msgstr "ad es. +1 555 123 4568"++msgid "e.g. 01234567"+msgstr "ad es. 01234567"++msgid "e.g. 1 Industrial Way"+msgstr "ad es. 1 Industrial Way"++msgid "e.g. 12-3456789"+msgstr "ad es. 12-3456789"+msgid "e.g. 2h"msgstr "es. 2h"+msgid "e.g. 48201"+msgstr "ad es. 48201"++msgid "e.g. Acme Manufacturing"+msgstr "ad es. Acme Manufacturing"++msgid "e.g. Detroit"+msgstr "ad es. Detroit"+msgid "e.g. DWG-1234"msgstr "es. DWG-1234"+msgid "e.g. GB123456789"+msgstr "ad es. GB123456789"++msgid "e.g. GB123456789000"+msgstr "ad es. GB123456789000"+msgid "e.g. Jane Smith"msgstr "es. Jane Smith"msgid "e.g. Marco + the area leads"msgstr "es. Marco + i responsabili di area"+msgid "e.g. MI"+msgstr "ad es. MI"++msgid "e.g. Suite 200"+msgstr "ad es. Suite 200"+msgid "e.g. the first 3 to 4 weeks"msgstr "ad es. le prime 3-4 settimane"@@ -10273,6 +10309,9 @@ msgstr "Registrato"msgid "Registered"msgstr "Punto di Riordino"+msgid "Registration Number"+msgstr "Numero di Registrazione"+msgid "Reject"msgstr "Rifiuta"diff --git a/packages/locale/locales/ja/erp.po b/packages/locale/locales/ja/erp.poindex 1d653c544d..6432d5f028 100644--- a/packages/locale/locales/ja/erp.po+++ b/packages/locale/locales/ja/erp.po@@ -4453,18 +4453,54 @@ msgstr "複製先..."msgid "Duration"msgstr "期間"+msgid "e.g. +1 555 123 4567"+msgstr "例:+1 555 123 4567"++msgid "e.g. +1 555 123 4568"+msgstr "例:+1 555 123 4568"++msgid "e.g. 01234567"+msgstr "例:01234567"++msgid "e.g. 1 Industrial Way"+msgstr "例:1 Industrial Way"++msgid "e.g. 12-3456789"+msgstr "例:12-3456789"+msgid "e.g. 2h"msgstr "例:2時間"+msgid "e.g. 48201"+msgstr "例:48201"++msgid "e.g. Acme Manufacturing"+msgstr "例:Acme Manufacturing"++msgid "e.g. Detroit"+msgstr "例:Detroit"+msgid "e.g. DWG-1234"msgstr "例:DWG-1234"+msgid "e.g. GB123456789"+msgstr "例:GB123456789"++msgid "e.g. GB123456789000"+msgstr "例:GB123456789000"+msgid "e.g. Jane Smith"msgstr "例:ジェーン・スミス"msgid "e.g. Marco + the area leads"msgstr "例:Marco + エリアリーダー"+msgid "e.g. MI"+msgstr "例:MI"++msgid "e.g. Suite 200"+msgstr "例:Suite 200"+msgid "e.g. the first 3 to 4 weeks"msgstr "例:最初の3~4週間"@@ -10273,6 +10309,9 @@ msgstr "登録済み"msgid "Registered"msgstr "再注文点"+msgid "Registration Number"+msgstr "登録番号"+msgid "Reject"msgstr "却下"diff --git a/packages/locale/locales/ko/erp.po b/packages/locale/locales/ko/erp.poindex f0a0daf412..8a9c3ebd7d 100644--- a/packages/locale/locales/ko/erp.po+++ b/packages/locale/locales/ko/erp.po@@ -4453,18 +4453,54 @@ msgstr "다음으로 복제..."msgid "Duration"msgstr "기간"+msgid "e.g. +1 555 123 4567"+msgstr "예: +1 555 123 4567"++msgid "e.g. +1 555 123 4568"+msgstr "예: +1 555 123 4568"++msgid "e.g. 01234567"+msgstr "예: 01234567"++msgid "e.g. 1 Industrial Way"+msgstr "예: 1 Industrial Way"++msgid "e.g. 12-3456789"+msgstr "예: 12-3456789"+msgid "e.g. 2h"msgstr "예: 2시간"+msgid "e.g. 48201"+msgstr "예: 48201"++msgid "e.g. Acme Manufacturing"+msgstr "예: Acme Manufacturing"++msgid "e.g. Detroit"+msgstr "예: Detroit"+msgid "e.g. DWG-1234"msgstr "예: DWG-1234"+msgid "e.g. GB123456789"+msgstr "예: GB123456789"++msgid "e.g. GB123456789000"+msgstr "예: GB123456789000"+msgid "e.g. Jane Smith"msgstr "예: Jane Smith"msgid "e.g. Marco + the area leads"msgstr "예: Marco + 담당 지역 리더들"+msgid "e.g. MI"+msgstr "예: MI"++msgid "e.g. Suite 200"+msgstr "예: Suite 200"+msgid "e.g. the first 3 to 4 weeks"msgstr "예: 처음 3~4주"@@ -10273,6 +10309,9 @@ msgstr "기존 자산 등록"msgid "Registered"msgstr "등록됨"+msgid "Registration Number"+msgstr "등록 번호"+msgid "Reject"msgstr "반려"diff --git a/packages/locale/locales/pl/erp.po b/packages/locale/locales/pl/erp.poindex b3e9f27088..267dac08ba 100644--- a/packages/locale/locales/pl/erp.po+++ b/packages/locale/locales/pl/erp.po@@ -4453,18 +4453,54 @@ msgstr "Duplikuj do..."msgid "Duration"msgstr "Czas trwania"+msgid "e.g. +1 555 123 4567"+msgstr "np. +48 22 123 45 67"++msgid "e.g. +1 555 123 4568"+msgstr "np. +48 22 123 45 68"++msgid "e.g. 01234567"+msgstr "np. 01234567"++msgid "e.g. 1 Industrial Way"+msgstr "np. ul. Przemysłowa 1"++msgid "e.g. 12-3456789"+msgstr "np. 12-3456789"+msgid "e.g. 2h"msgstr "np. 2h"+msgid "e.g. 48201"+msgstr "np. 00-001"++msgid "e.g. Acme Manufacturing"+msgstr "np. Acme Manufacturing"++msgid "e.g. Detroit"+msgstr "np. Warszawa"+msgid "e.g. DWG-1234"msgstr "np. DWG-1234"+msgid "e.g. GB123456789"+msgstr "np. GB123456789"++msgid "e.g. GB123456789000"+msgstr "np. GB123456789000"+msgid "e.g. Jane Smith"msgstr "np. Jane Smith"msgid "e.g. Marco + the area leads"msgstr "np. Marco + liderzy obszarów"+msgid "e.g. MI"+msgstr "np. mazowieckie"++msgid "e.g. Suite 200"+msgstr "np. lok. 200"+msgid "e.g. the first 3 to 4 weeks"msgstr "np. pierwsze 3 do 4 tygodnie"@@ -10273,6 +10309,9 @@ msgstr "Zarejestrowany"msgid "Registered"msgstr "Punkt Ponownego Zamówienia"+msgid "Registration Number"+msgstr "Numer rejestracyjny"+msgid "Reject"msgstr "Odrzuć"diff --git a/packages/locale/locales/pt/erp.po b/packages/locale/locales/pt/erp.poindex 66a0f21601..bda9a0ded6 100644--- a/packages/locale/locales/pt/erp.po+++ b/packages/locale/locales/pt/erp.po@@ -4453,18 +4453,54 @@ msgstr "Duplicar para..."msgid "Duration"msgstr "Duração"+msgid "e.g. +1 555 123 4567"+msgstr "p. ex. +1 555 123 4567"++msgid "e.g. +1 555 123 4568"+msgstr "p. ex. +1 555 123 4568"++msgid "e.g. 01234567"+msgstr "p. ex. 01234567"++msgid "e.g. 1 Industrial Way"+msgstr "p. ex. 1 Industrial Way"++msgid "e.g. 12-3456789"+msgstr "p. ex. 12-3456789"+msgid "e.g. 2h"msgstr "p.ex. 2h"+msgid "e.g. 48201"+msgstr "p. ex. 48201"++msgid "e.g. Acme Manufacturing"+msgstr "p. ex. Acme Manufacturing"++msgid "e.g. Detroit"+msgstr "p. ex. Detroit"+msgid "e.g. DWG-1234"msgstr "p.ex. DWG-1234"+msgid "e.g. GB123456789"+msgstr "p. ex. GB123456789"++msgid "e.g. GB123456789000"+msgstr "p. ex. GB123456789000"+msgid "e.g. Jane Smith"msgstr "p. ex. Jane Smith"msgid "e.g. Marco + the area leads"msgstr "p. ex. Marco + os líderes da área"+msgid "e.g. MI"+msgstr "p. ex. MI"++msgid "e.g. Suite 200"+msgstr "p. ex. Suite 200"+msgid "e.g. the first 3 to 4 weeks"msgstr "p.ex. as primeiras 3 a 4 semanas"@@ -10273,6 +10309,9 @@ msgstr "Registrado"msgid "Registered"msgstr "Ponto de Reabastecimento"+msgid "Registration Number"+msgstr "Número de Registro"+msgid "Reject"msgstr "Rejeitar"diff --git a/packages/locale/locales/ru/erp.po b/packages/locale/locales/ru/erp.poindex daa24772e9..bfcac3b516 100644--- a/packages/locale/locales/ru/erp.po+++ b/packages/locale/locales/ru/erp.po@@ -4453,18 +4453,54 @@ msgstr "Дублировать в..."msgid "Duration"msgstr "Продолжительность"+msgid "e.g. +1 555 123 4567"+msgstr "например +1 555 123 4567"++msgid "e.g. +1 555 123 4568"+msgstr "например +1 555 123 4568"++msgid "e.g. 01234567"+msgstr "например 01234567"++msgid "e.g. 1 Industrial Way"+msgstr "например 1 Industrial Way"++msgid "e.g. 12-3456789"+msgstr "например 12-3456789"+msgid "e.g. 2h"msgstr "например, 2ч"+msgid "e.g. 48201"+msgstr "например 48201"++msgid "e.g. Acme Manufacturing"+msgstr "например Acme Manufacturing"++msgid "e.g. Detroit"+msgstr "например Detroit"+msgid "e.g. DWG-1234"msgstr "например, DWG-1234"+msgid "e.g. GB123456789"+msgstr "например GB123456789"++msgid "e.g. GB123456789000"+msgstr "например GB123456789000"+msgid "e.g. Jane Smith"msgstr "например, Джейн Смит"msgid "e.g. Marco + the area leads"msgstr "например, Марко + руководители отделов"+msgid "e.g. MI"+msgstr "например MI"++msgid "e.g. Suite 200"+msgstr "например Suite 200"+msgid "e.g. the first 3 to 4 weeks"msgstr "например, первые 3-4 недели"@@ -10273,6 +10309,9 @@ msgstr "Зарегистрирован"msgid "Registered"msgstr "Точка переза́каза"+msgid "Registration Number"+msgstr "Регистрационный номер"+msgid "Reject"msgstr "Отклонить"diff --git a/packages/locale/locales/tr/erp.po b/packages/locale/locales/tr/erp.poindex 27dc8f8d77..fb5a204674 100644--- a/packages/locale/locales/tr/erp.po+++ b/packages/locale/locales/tr/erp.po@@ -4453,18 +4453,54 @@ msgstr "…’ye kopyala"msgid "Duration"msgstr "Süre"+msgid "e.g. +1 555 123 4567"+msgstr "örn. +1 555 123 4567"++msgid "e.g. +1 555 123 4568"+msgstr "örn. +1 555 123 4568"++msgid "e.g. 01234567"+msgstr "örn. 01234567"++msgid "e.g. 1 Industrial Way"+msgstr "örn. 1 İmalat Yolu"++msgid "e.g. 12-3456789"+msgstr "örn. 12-3456789"+msgid "e.g. 2h"msgstr "örn. 2s"+msgid "e.g. 48201"+msgstr "örn. 48201"++msgid "e.g. Acme Manufacturing"+msgstr "örn. Acme İmalat"++msgid "e.g. Detroit"+msgstr "örn. Detroit"+msgid "e.g. DWG-1234"msgstr "örneğin DWG-1234"+msgid "e.g. GB123456789"+msgstr "örn. GB123456789"++msgid "e.g. GB123456789000"+msgstr "örn. GB123456789000"+msgid "e.g. Jane Smith"msgstr "örn. Jane Smith"msgid "e.g. Marco + the area leads"msgstr "örn. Marco + alan liderleri"+msgid "e.g. MI"+msgstr "örn. MI"++msgid "e.g. Suite 200"+msgstr "örn. Daire 200"+msgid "e.g. the first 3 to 4 weeks"msgstr "örn. ilk 3 ila 4 hafta"@@ -10273,6 +10309,9 @@ msgstr "Kayıtlı"msgid "Registered"msgstr "Kayıtlı"+msgid "Registration Number"+msgstr "Sicil Numarası"+msgid "Reject"msgstr "Reddet"diff --git a/packages/locale/locales/zh/erp.po b/packages/locale/locales/zh/erp.poindex 692cb089c6..359d5f1884 100644--- a/packages/locale/locales/zh/erp.po+++ b/packages/locale/locales/zh/erp.po@@ -4453,18 +4453,54 @@ msgstr "复制到..."msgid "Duration"msgstr "时长"+msgid "e.g. +1 555 123 4567"+msgstr "例:+1 555 123 4567"++msgid "e.g. +1 555 123 4568"+msgstr "例:+1 555 123 4568"++msgid "e.g. 01234567"+msgstr "例:01234567"++msgid "e.g. 1 Industrial Way"+msgstr "例:1 Industrial Way"++msgid "e.g. 12-3456789"+msgstr "例:12-3456789"+msgid "e.g. 2h"msgstr "例如 2小时"+msgid "e.g. 48201"+msgstr "例:48201"++msgid "e.g. Acme Manufacturing"+msgstr "例:Acme Manufacturing"++msgid "e.g. Detroit"+msgstr "例:Detroit"+msgid "e.g. DWG-1234"msgstr "例如 DWG-1234"+msgid "e.g. GB123456789"+msgstr "例:GB123456789"++msgid "e.g. GB123456789000"+msgstr "例:GB123456789000"+msgid "e.g. Jane Smith"msgstr "例如 Jane Smith"msgid "e.g. Marco + the area leads"msgstr "例如 Marco + 地区负责人"+msgid "e.g. MI"+msgstr "例:MI"++msgid "e.g. Suite 200"+msgstr "例:Suite 200"+msgid "e.g. the first 3 to 4 weeks"msgstr "例如前3到4周"@@ -10273,6 +10309,9 @@ msgstr "已注册"msgid "Registered"msgstr "重新订购点"+msgid "Registration Number"+msgstr "注册号"+msgid "Reject"msgstr "拒绝"diff --git a/packages/utils/src/country.ts b/packages/utils/src/country.tsindex 77ebf572fc..5a02380217 100644--- a/packages/utils/src/country.ts+++ b/packages/utils/src/country.ts@@ -1,35 +1,52 @@-const EORI_COUNTRY_CODES = new Set([- "AT",- "BE",- "BG",- "HR",- "CY",- "CZ",- "DK",- "EE",- "FI",- "FR",- "DE",- "GB",- "GR",- "HU",- "IE",- "IT",- "LV",- "LT",- "LU",- "MT",- "NL",- "PL",- "PT",- "RO",- "SK",- "SI",- "ES",- "SE"-]);+type CountryProfile = {+ eori?: boolean;+ registrationNumber?: boolean;+};++const COUNTRY_PROFILES: Record<string, CountryProfile> = {+ AT: { eori: true },+ BE: { eori: true },+ BG: { eori: true },+ HR: { eori: true },+ CY: { eori: true },+ CZ: { eori: true },+ DK: { eori: true },+ EE: { eori: true },+ FI: { eori: true },+ FR: { eori: true },+ DE: { eori: true },+ GB: { eori: true, registrationNumber: true },+ GR: { eori: true },+ HU: { eori: true },+ IE: { eori: true },+ IT: { eori: true },+ LV: { eori: true },+ LT: { eori: true },+ LU: { eori: true },+ MT: { eori: true },+ NL: { eori: true },+ PL: { eori: true },+ PT: { eori: true },+ RO: { eori: true },+ SK: { eori: true },+ SI: { eori: true },+ ES: { eori: true },+ SE: { eori: true }+};++export function getCountryProfile(+ countryCode: string | null | undefined+): CountryProfile | undefined {+ if (!countryCode) return undefined;+ return COUNTRY_PROFILES[countryCode.toUpperCase()];+}export function isEoriCountry(countryCode: string | null | undefined): boolean {- if (!countryCode) return false;- return EORI_COUNTRY_CODES.has(countryCode.toUpperCase());+ return getCountryProfile(countryCode)?.eori === true;+}++export function isRegistrationNumberCountry(+ countryCode: string | null | undefined+): boolean {+ return getCountryProfile(countryCode)?.registrationNumber === true;}