From 275fc0aca8cd59b5aa62f48e9a232b78ba00be1f Mon Sep 17 00:00:00 2001 From: David Date: Mon, 7 Sep 2026 11:12:32 +0200 Subject: [PATCH] feat: agregar manejo de porcentaje de impuesto por defecto al duplicar y agregar elementos en el controlador de proformas --- .../use-update-proforma-items-controller.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/customer-invoices/src/web/proformas/update/controllers/use-update-proforma-items-controller.ts b/modules/customer-invoices/src/web/proformas/update/controllers/use-update-proforma-items-controller.ts index 9c6c5f5b..72558919 100644 --- a/modules/customer-invoices/src/web/proformas/update/controllers/use-update-proforma-items-controller.ts +++ b/modules/customer-invoices/src/web/proformas/update/controllers/use-update-proforma-items-controller.ts @@ -131,7 +131,9 @@ export const useUpdateProformaItemsController = ({ const duplicatedItem: ProformaItemUpdateForm = { ...item, - id: buildProformaItemUpdateDefault(index + 1).id, + id: buildProformaItemUpdateDefault(index + 1, { + defaultTaxPercentage: getValues("taxPercentage") ?? undefined, + }).id, position: index + 1, }; @@ -177,7 +179,14 @@ export const useUpdateProformaItemsController = ({ const safeIndex = Math.max(0, Math.min(index, currentItems.length)); const nextItems = [...currentItems]; - nextItems.splice(safeIndex, 0, buildProformaItemUpdateDefault(safeIndex)); + + nextItems.splice( + safeIndex, + 0, + buildProformaItemUpdateDefault(safeIndex, { + defaultTaxPercentage: getValues("taxPercentage") ?? undefined, + }) + ); replaceItems(nextItems); },