diff --git a/modules/customers/src/api/infrastructure/sequelize/repositories/customer.repository.ts b/modules/customers/src/api/infrastructure/sequelize/repositories/customer.repository.ts index 94450561..7e9be1a3 100644 --- a/modules/customers/src/api/infrastructure/sequelize/repositories/customer.repository.ts +++ b/modules/customers/src/api/infrastructure/sequelize/repositories/customer.repository.ts @@ -58,7 +58,7 @@ export class CustomerRepository async update(customer: Customer, transaction?: Transaction): Promise> { try { const mapper: ICustomerDomainMapper = this._registry.getDomainMapper({ - resource: "customer-invoice", + resource: "customer", }); const dto = mapper.mapToPersistence(customer); diff --git a/modules/customers/src/web/components/editor/customer-basic-info-fields.tsx b/modules/customers/src/web/components/editor/customer-basic-info-fields.tsx index 612692be..95f66883 100644 --- a/modules/customers/src/web/components/editor/customer-basic-info-fields.tsx +++ b/modules/customers/src/web/components/editor/customer-basic-info-fields.tsx @@ -3,7 +3,7 @@ import { TextField } from "@repo/rdx-ui/components"; import { - Field, FieldDescription, FieldGroup, FieldLegend, FieldSet, FormControl, + Field, FieldDescription, FieldGroup, FieldLabel, FieldLegend, FieldSet, FormControl, FormField, FormItem, FormLabel, @@ -11,7 +11,7 @@ import { RadioGroup, RadioGroupItem } from '@repo/shadcn-ui/components'; -import { Controller, useFormContext, useWatch } from "react-hook-form"; +import { Controller, useFormContext } from "react-hook-form"; import { CustomerInvoiceTaxesMultiSelect } from '../../../../../customer-invoices/src/web/components'; import { useTranslation } from "../../i18n"; import { CustomerFormData } from "../../schemas"; @@ -20,12 +20,6 @@ export const CustomerBasicInfoFields = () => { const { t } = useTranslation(); const { control } = useFormContext(); - const isCompany = useWatch({ - control, - name: "is_company", - defaultValue: "true", - }); - return (
{t("form_groups.basic_info.title")} @@ -80,18 +74,15 @@ export const CustomerBasicInfoFields = () => { /> - {isCompany === "false" ? ( - - ) : ( - <> - )} + + { placeholder={t("form_fields.reference.placeholder")} description={t("form_fields.reference.description")} /> + ( - + render={({ field, fieldState }) => ( + + + {t("form_fields.default_taxes.label")} + + + )} /> diff --git a/modules/customers/src/web/pages/create/customer-create-page.tsx b/modules/customers/src/web/pages/create/customer-create-page.tsx index 6ca11588..8476cd1a 100644 --- a/modules/customers/src/web/pages/create/customer-create-page.tsx +++ b/modules/customers/src/web/pages/create/customer-create-page.tsx @@ -1,6 +1,7 @@ -import { AppBreadcrumb, AppContent } from "@repo/rdx-ui/components"; +import { AppContent, AppHeader } from "@repo/rdx-ui/components"; import { useNavigate } from "react-router-dom"; +import { PageHeader } from '@erp/core/components'; import { UnsavedChangesProvider, UpdateCommitButtonGroup, useHookForm } from "@erp/core/hooks"; import { showErrorToast, showSuccessToast } from "@repo/rdx-ui/helpers"; import { FieldErrors, FormProvider } from "react-hook-form"; @@ -61,19 +62,13 @@ export const CustomerCreatePage = () => { }; return ( - <> - - - -
-
-

- {t("pages.create.title")} -

-

- {t("pages.create.description")} -

-
+ + + { }} onBack={() => handleBack()} /> -
- {/* Alerta de error de actualización (si ha fallado el último intento) */} - {isCreateError && ( - - )} + } + /> + + + {/* Alerta de error de actualización (si ha fallado el último intento) */} + {isCreateError && ( + + )} + + + + - - - -
- + ); };