refactor: update CreateExpensePayload, UpdateExpensePayload, and CreateExpenseRealizationPayload types

This commit is contained in:
ValdiANS
2025-12-07 14:59:25 +07:00
parent 58532881f4
commit 2d1cabb86b
11 changed files with 107 additions and 117 deletions
@@ -98,15 +98,10 @@ const ExpenseRealizationForm = ({
values.realizations.forEach((realization) => {
realization.cost_items.forEach((costItem) => {
const unitPrice =
parseFloat(String(costItem.total_cost)) /
parseFloat(String(costItem.quantity));
const realizationItem = {
expense_nonstock_id: costItem.nonstock?.value as number,
qty: parseFloat(String(costItem.quantity)) as number,
unit_price: unitPrice,
total_price: parseFloat(String(costItem.total_cost)) as number,
price: parseFloat(String(costItem.price)) as number,
notes: costItem.notes ?? '',
};
@@ -177,7 +172,7 @@ const ExpenseRealizationForm = ({
{
nonstock: undefined,
quantity: undefined,
total_cost: undefined,
price: undefined,
notes: '',
},
],