fix(webapp): Disable tax rates from item entries editor table on services do not support tax rates

This commit is contained in:
Ahmed Bouhuolia
2023-10-02 23:27:05 +02:00
parent b1a043f699
commit 69afa07e3b
9 changed files with 65 additions and 21 deletions

View File

@@ -31,6 +31,15 @@ export const defaultEstimateEntry = {
amount: '',
};
const defaultEstimateEntryReq = {
index: 0,
item_id: '',
rate: '',
discount: '',
quantity: '',
description: '',
};
export const defaultEstimate = {
customer_id: '',
estimate_date: moment(new Date()).format('YYYY-MM-DD'),
@@ -148,7 +157,9 @@ export const transfromsFormValuesToRequest = (values) => {
...(values.estimate_number_manually && {
estimate_number: values.estimate_number,
}),
entries: entries.map((entry) => ({ ...omit(entry, ['amount']) })),
entries: entries.map((entry) => ({
...transformToForm(entry, defaultEstimateEntryReq),
})),
};
};