diff --git a/modules/customer-invoices/src/common/locales/en.json b/modules/customer-invoices/src/common/locales/en.json index ff685673..c7220f0f 100644 --- a/modules/customer-invoices/src/common/locales/en.json +++ b/modules/customer-invoices/src/common/locales/en.json @@ -5,7 +5,8 @@ "duplicate_row": "Duplicate", "insert_row_above": "Insert row above", "insert_row_below": "Insert row below", - "remove_row": "Remove" + "remove_row": "Remove", + "actions": "Actions" }, "catalog": { "status": { @@ -110,7 +111,7 @@ "placeholder": "Description of the invoice", "description": "General description of the invoice" }, - "subtotal_price": { + "subtotal_amount": { "label": "Subtotal", "placeholder": "", "desc": "Invoice subtotal" @@ -120,12 +121,12 @@ "placeholder": "", "desc": "Percentage discount" }, - "discount_price": { + "discount_amount": { "label": "Discount price", "placeholder": "", "desc": "Percentage discount price" }, - "total_price": { + "total_amount": { "label": "Total price", "placeholder": "", "desc": "Invoice total price" @@ -135,7 +136,7 @@ "placeholder": "Additional notes about the invoice", "description": "Additional notes that can be included in the invoice" }, - "items": { + "item": { "quantity": { "label": "Quantity", "placeholder": "", @@ -146,40 +147,40 @@ "placeholder": "", "description": "" }, - "unit_price": { + "unit_amount": { "label": "Unit price", "placeholder": "", "description": "Item unit price" }, - "subtotal_price": { + "subtotal_amount": { "label": "Subtotal", "placeholder": "", "description": "" }, - "discount": { + "discount_percentage": { "label": "Dto (%)", "placeholder": "", "description": "Percentage discount" }, - "discount_price": { + "discount_amount": { "label": "Discount price", "placeholder": "", - "desc": "Percentage discount price" + "description": "Percentage discount price" }, - "taxes": { + "tax_codes": { "label": "Taxes", "placeholder": "", - "desc": "Taxes" + "description": "Taxes" }, - "taxes_price": { + "taxes_amount": { "label": "Taxes price", "placeholder": "", - "desc": "Percentage taxes price" + "description": "Percentage taxes price" }, - "total_price": { - "label": "Total price", + "total_amount": { + "label": "Total", "placeholder": "", - "description": "Total price with percentage discount" + "description": "Invoice line total" } } }, @@ -189,6 +190,15 @@ "placeholder": "Select taxes", "description": "Select the taxes to apply to the invoice items", "invalid_tax_selection": "Invalid tax selection. Please select a valid tax." + }, + "hover_card_totals_summary": { + "label": "Breakdown of the amount", + "fields": { + "subtotal_amount": "Subtotal", + "discount_percentage": "Discount", + "taxable_amount": "Taxable base", + "total_amount": "Total" + } } } } diff --git a/modules/customer-invoices/src/common/locales/es.json b/modules/customer-invoices/src/common/locales/es.json index b5654815..a5eae403 100644 --- a/modules/customer-invoices/src/common/locales/es.json +++ b/modules/customer-invoices/src/common/locales/es.json @@ -5,7 +5,8 @@ "duplicate_row": "Duplicar", "insert_row_above": "Insertar fila arriba", "insert_row_below": "Insertar fila abajo", - "remove_row": "Eliminar" + "remove_row": "Eliminar", + "actions": "Acciones" }, "catalog": { "status": { @@ -102,7 +103,7 @@ "placeholder": "Descripción de la factura", "description": "Descripción general de la factura" }, - "subtotal_price": { + "subtotal_amount": { "label": "Subtotal", "placeholder": "", "desc": "Subtotal de la factura" @@ -112,12 +113,12 @@ "placeholder": "", "desc": "Porcentaje de descuento" }, - "discount_price": { + "discount_amount": { "label": "Importe del descuento", "placeholder": "", "desc": "Importe del descuento porcentual" }, - "total_price": { + "total_amount": { "label": "Precio total", "placeholder": "", "desc": "Precio total de la factura" @@ -127,7 +128,7 @@ "placeholder": "Notas adicionales sobre la factura", "description": "Notas adicionales que se pueden incluir en la factura" }, - "items": { + "item": { "quantity": { "label": "Cantidad", "placeholder": "", @@ -138,37 +139,37 @@ "placeholder": "", "description": "" }, - "unit_price": { + "unit_amount": { "label": "Precio unitario", "placeholder": "", "description": "Precio unitario del producto" }, - "subtotal_price": { + "subtotal_amount": { "label": "Subtotal", "placeholder": "", "description": "" }, - "discount": { + "discount_percentage": { "label": "Dto (%)", "placeholder": "", "description": "Porcentaje de descuento" }, - "discount_price": { + "discount_amount": { "label": "Importe del descuento", "placeholder": "", - "desc": "Importe del descuento porcentual" + "description": "Importe del descuento porcentual" }, - "taxes": { + "tax_codes": { "label": "Impuestos", "placeholder": "", - "desc": "Impuestos" + "description": "Impuestos" }, - "taxes_price": { + "taxes_amount": { "label": "Importe impuestos", "placeholder": "", - "desc": "Importe porcentual de los impuestos" + "description": "Importe porcentual de los impuestos" }, - "total_price": { + "total_amount": { "label": "Precio total", "placeholder": "", "description": "Precio total con descuento porcentual" @@ -181,6 +182,15 @@ "placeholder": "Selecciona impuestos", "description": "Selecciona los impuestos a aplicar a los artículos de la factura", "invalid_tax_selection": "Selección de impuestos no válida. Por favor, selecciona un impuesto válido." + }, + "hover_card_totals_summary": { + "label": "Desglose del importe", + "fields": { + "subtotal_amount": "Subtotal", + "discount_percentage": "Descuento", + "taxable_amount": "Importe base", + "total_amount": "Total" + } } } } diff --git a/modules/customer-invoices/src/web/components/editor/items/hover-card-total-summary.tsx b/modules/customer-invoices/src/web/components/editor/items/hover-card-total-summary.tsx index b74b6172..eb4e0629 100644 --- a/modules/customer-invoices/src/web/components/editor/items/hover-card-total-summary.tsx +++ b/modules/customer-invoices/src/web/components/editor/items/hover-card-total-summary.tsx @@ -5,6 +5,7 @@ import { } from "@repo/shadcn-ui/components"; import { PropsWithChildren } from 'react'; import { useInvoiceItemSummary } from '../../../hooks'; +import { useTranslation } from "../../../i18n"; import { CustomerInvoiceItemFormData } from '../../../schemas'; @@ -17,22 +18,23 @@ export const HoverCardTotalsSummary = ({ item, children, }: HoverCardTotalsSummaryProps) => { - const { format } = useMoney() - const summary = useInvoiceItemSummary(item) + const { t } = useTranslation(); + const { format } = useMoney(); + const summary = useInvoiceItemSummary(item); const SummaryBlock = () => (
-

Desglose del importe

+

{t("components.hover_card_totals_summary.label")}

- Subtotal: + {t("components.hover_card_totals_summary.fields.subtotal_amount")}: {format(summary.subtotal)}
{Number(item.discount_percentage?.value ?? 0) > 0 && (
- Descuento ({item.discount_percentage.value ?? 0}%): + {t("components.hover_card_totals_summary.fields.discount_percentage")} ({item.discount_percentage.value ?? 0}%): -{format(summary.discountAmount)} @@ -41,7 +43,7 @@ export const HoverCardTotalsSummary = ({ )}
- Base imponible: + {t("components.hover_card_totals_summary.fields.taxable_amount")}: {format(summary.baseAmount)} @@ -55,7 +57,7 @@ export const HoverCardTotalsSummary = ({ ))}
- Total: + {t("components.hover_card_totals_summary.fields.total_amount")}: {format(summary.total)}
diff --git a/modules/customer-invoices/src/web/components/editor/items/table-view.tsx b/modules/customer-invoices/src/web/components/editor/items/table-view.tsx index d9ad00d0..9da554a0 100644 --- a/modules/customer-invoices/src/web/components/editor/items/table-view.tsx +++ b/modules/customer-invoices/src/web/components/editor/items/table-view.tsx @@ -105,12 +105,13 @@ export const TableView = ({ items, actions }: TableViewProps) => { # - Descripción - Cantidad - Precio Unit. - % Desc. - Total - Acciones + {t("form_fields.item.description.label")} + {t("form_fields.item.quantity.label")} + {t("form_fields.item.unit_amount.label")} + {t("form_fields.item.discount_percentage.label")} + {t("form_fields.item.tax_codes.label")} + {t("form_fields.item.total_amount.label")} + {t("common.actions")} @@ -212,9 +213,7 @@ export const TableView = ({ items, actions }: TableViewProps) => { control={control} name={`item.${i}.tax_codes`} required - label={t("form_fields.item.tax_codes.label")} placeholder={t("form_fields.item.tax_codes.placeholder")} - description={t("form_fields.item.tax_codes.description")} />