diff --git a/modules/customer-invoices/src/common/locales/en.json b/modules/customer-invoices/src/common/locales/en.json index 04a667f2..e766fb1b 100644 --- a/modules/customer-invoices/src/common/locales/en.json +++ b/modules/customer-invoices/src/common/locales/en.json @@ -96,14 +96,30 @@ } }, "proformas": { + "issue_proforma_dialog": { + "title": "Issue to invoice", + "description": "Are you sure you want to issue an invoice from proforma {{reference}}?", + "warning": "This action will create a final invoice and the proforma will be marked as \"Issued\". It will no longer be editable or deletable.", + "confirm": "Issue invoice", + "submitting": "Issuing...", + "success_title": "Proforma successfully issued", + "success_description": "Proforma {{reference}} has been successfully issued to an invoice.", + "error_title": "Error issuing proforma", + "not_allowed_title": "Action not allowed", + "not_allowed_description": "Only proformas in \"Approved\" status can be issued.", + "unknown_error": "An unexpected error occurred" + }, "delete_proforma_dialog": { - "title": "Delete proforma", - "description": "Are you sure you want to delete proforma {{proformaRef}}? This action cannot be undone.", - "cancel": "Cancel", - "delete": "Delete", + "single_title": "Delete proforma {{reference}}", + "single_description": "Are you sure you want to delete this proforma? This action cannot be undone.", + "second_confirm_single_title": "Additional confirmation", + "second_confirm_single_description": "You are about to delete the proforma. This action cannot be undone. Are you sure you want to continue?", + "multiple_description": "Are you sure you want to delete the {{total}} selected proformas? This action cannot be undone.", + "confirm_delete": "Confirm deletion", "deleting": "Deleting...", - "success_title": "Proforma deleted", - "error_title": "Error deleting proforma" + "cancel": "Cancel", + "continue": "Delete", + "list_item": "Proforma {{reference}}" } }, "pages": { diff --git a/modules/customer-invoices/src/common/locales/es.json b/modules/customer-invoices/src/common/locales/es.json index 43bf102f..fbd7f691 100644 --- a/modules/customer-invoices/src/common/locales/es.json +++ b/modules/customer-invoices/src/common/locales/es.json @@ -96,20 +96,30 @@ } }, "proformas": { + "issue_proforma_dialog": { + "title": "Emitir a factura", + "description": "¿Seguro que quieres emitir la factura desde la proforma {{reference}}?", + "warning": "Esta acción creará una nueva factura definitiva y la proforma pasará al estado \"Emitida\", no pudiendo modificarse ni eliminarse posteriormente.", + "confirm": "Emitir factura", + "submitting": "Emitiendo...", + "success_title": "Proforma emitida correctamente", + "success_description": "La proforma {{reference}} se ha emitido a factura correctamente.", + "error_title": "Error al emitir la proforma", + "not_allowed_title": "Acción no permitida", + "not_allowed_description": "Solo se pueden emitir proformas en estado \"Aprobada\".", + "unknown_error": "Ha ocurrido un error inesperado", + "cancel": "Cancelar" + }, "delete_proforma_dialog": { - "title": "Eliminar proforma", - "description": "¿Seguro que deseas eliminar la proforma {{proformaRef}}? Esta acción no se puede deshacer.", - "cancel": "Cancelar", - "delete": "Eliminar", - "deleting": "Eliminando...", - "success_title": "Proforma eliminada", - "error_title": "Error al eliminar la proforma", "single_title": "Eliminar proforma {{reference}}", - "second_confirm_title": "Confirmación adicional", - "multiple_title": "Eliminar {{count}} proformas", - "second_confirm_description": "Estás a punto de borrar {{total}} proformas. Esta acción masiva no se puede deshacer. ¿Seguro que quieres continuar?", "single_description": "¿Seguro que deseas eliminar esta proforma? Esta acción no se puede deshacer.", + "second_confirm_single_title": "Confirmación adicional", + "second_confirm_single_description": "Estás a punto de borrar la proforma. Esta acción masiva no se puede deshacer. ¿Seguro que quieres continuar?", "multiple_description": "¿Seguro que deseas eliminar las {{total}} proformas seleccionadas? Esta acción no se puede deshacer.", + "confirm_delete": "Confirmar eliminación", + "deleting": "Eliminando...", + "cancel": "Cancelar", + "continue": "Eliminar", "list_item": "Proforma {{reference}}" } }, diff --git a/modules/customer-invoices/src/web/proformas/delete/controllers/use-delete-proforma-dialog-controller.ts b/modules/customer-invoices/src/web/proformas/delete/controllers/use-delete-proforma-dialog-controller.ts index 9c25c8b0..6896d135 100644 --- a/modules/customer-invoices/src/web/proformas/delete/controllers/use-delete-proforma-dialog-controller.ts +++ b/modules/customer-invoices/src/web/proformas/delete/controllers/use-delete-proforma-dialog-controller.ts @@ -59,8 +59,8 @@ export const useDeleteProformaDialogController = () => { (targets: DeleteProformaTarget[]) => { if (targets.length === 1) { showSuccessToast( - t("pages.proformas.delete.successTitle"), - t("pages.proformas.delete.successSingleMessage", { + t("proformas.delete_proforma_dialog.success_title"), + t("proformas.delete_proforma_dialog.success_single_message", { reference: getProformaLabel(targets[0]), }) ); @@ -68,8 +68,8 @@ export const useDeleteProformaDialogController = () => { } showSuccessToast( - t("pages.proformas.delete.successTitle"), - t("pages.proformas.delete.successMultipleMessage", { + t("proformas.delete_proforma_dialog.success_title"), + t("proformas.delete_proforma_dialog.success_multiple_message", { count: targets.length, }) ); @@ -81,15 +81,15 @@ export const useDeleteProformaDialogController = () => { (targets: DeleteProformaTarget[], errorCount: number) => { if (targets.length === 1) { showErrorToast( - t("pages.proformas.delete.errorTitle"), - t("pages.proformas.delete.errorSingleMessage") + t("proformas.delete_proforma_dialog.error_title"), + t("proformas.delete_proforma_dialog.error_single_message") ); return; } showErrorToast( - t("pages.proformas.delete.errorTitle"), - t("pages.proformas.delete.errorMultipleMessage", { + t("proformas.delete_proforma_dialog.error_title"), + t("proformas.delete_proforma_dialog.error_multiple_message", { count: errorCount, }) ); @@ -143,8 +143,8 @@ export const useDeleteProformaDialogController = () => { await submitDelete(); } catch { showErrorToast( - t("pages.proformas.delete.errorTitle"), - t("pages.proformas.delete.errorUnexpectedMessage") + t("proformas.delete.error_title"), + t("proformas.delete.error_unexpected_message") ); } }, [deleteMutation.isPending, moveToSecondConfirmStep, state, submitDelete, t]); diff --git a/modules/customer-invoices/src/web/proformas/delete/ui/components/delete-proforma-dialog.tsx b/modules/customer-invoices/src/web/proformas/delete/ui/components/delete-proforma-dialog.tsx index e91b9c3e..ddc0fa6e 100644 --- a/modules/customer-invoices/src/web/proformas/delete/ui/components/delete-proforma-dialog.tsx +++ b/modules/customer-invoices/src/web/proformas/delete/ui/components/delete-proforma-dialog.tsx @@ -39,29 +39,29 @@ export const DeleteProformaDialog = ({ const title = isSecondConfirmStep ? isSingle - ? t("components.delete_proforma_dialog.second_confirm_single_title", { + ? t("proformas.delete_proforma_dialog.second_confirm_single_title", { reference: getTargetLabel(firstTarget), }) - : t("components.delete_proforma_dialog.second_confirm_multiple_title", { + : t("proformas.delete_proforma_dialog.second_confirm_multiple_title", { count: total, }) : isSingle - ? t("components.delete_proforma_dialog.single_title", { + ? t("proformas.delete_proforma_dialog.single_title", { reference: getTargetLabel(firstTarget), }) - : t("components.delete_proforma_dialog.multiple_title", { + : t("proformas.delete_proforma_dialog.multiple_title", { count: total, }); const description = isSecondConfirmStep ? isSingle - ? t("components.delete_proforma_dialog.second_confirm_single_description") - : t("components.delete_proforma_dialog.second_confirm_multiple_description", { + ? t("proformas.delete_proforma_dialog.second_confirm_single_description") + : t("proformas.delete_proforma_dialog.second_confirm_multiple_description", { count: total, }) : isSingle - ? t("components.delete_proforma_dialog.single_description") - : t("components.delete_proforma_dialog.multiple_description", { + ? t("proformas.delete_proforma_dialog.single_description") + : t("proformas.delete_proforma_dialog.multiple_description", { count: total, }); @@ -84,7 +84,7 @@ export const DeleteProformaDialog = ({