mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
refactor: update CreateExpensePayload, UpdateExpensePayload, and CreateExpenseRealizationPayload types
This commit is contained in:
@@ -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: '',
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user