feat: agregar manejo de porcentaje de impuesto por defecto al duplicar y agregar elementos en el controlador de proformas
This commit is contained in:
parent
394d3465e3
commit
275fc0aca8
@ -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);
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user