mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
fix(webapp): Disable tax rates from item entries editor table on services do not support tax rates
This commit is contained in:
@@ -26,14 +26,15 @@ export default function CreditNoteItemsEntriesEditorField() {
|
||||
meta: { error, touched },
|
||||
}) => (
|
||||
<ItemsEntriesTable
|
||||
entries={value}
|
||||
onUpdateData={(entries) => {
|
||||
value={value}
|
||||
onChange={(entries) => {
|
||||
setFieldValue('entries', entries);
|
||||
}}
|
||||
items={items}
|
||||
errors={error}
|
||||
linesNumber={4}
|
||||
currencyCode={values.currency_code}
|
||||
enableTaxRates={false}
|
||||
/>
|
||||
)}
|
||||
</FastField>
|
||||
|
||||
@@ -26,14 +26,15 @@ export default function EstimateFormItemsEntriesField() {
|
||||
meta: { error, touched },
|
||||
}) => (
|
||||
<ItemsEntriesTable
|
||||
entries={value}
|
||||
onUpdateData={(entries) => {
|
||||
value={value}
|
||||
onChange={(entries) => {
|
||||
setFieldValue('entries', entries);
|
||||
}}
|
||||
items={items}
|
||||
errors={error}
|
||||
linesNumber={4}
|
||||
currencyCode={values.currency_code}
|
||||
enableTaxRates={false}
|
||||
/>
|
||||
)}
|
||||
</FastField>
|
||||
|
||||
@@ -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),
|
||||
})),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -19,14 +19,15 @@ export default function ReceiptItemsEntriesEditor({ defaultReceipt }) {
|
||||
meta: { error, touched },
|
||||
}) => (
|
||||
<ItemsEntriesTable
|
||||
entries={value}
|
||||
onUpdateData={(entries) => {
|
||||
value={value}
|
||||
onChange={(entries) => {
|
||||
setFieldValue('entries', entries);
|
||||
}}
|
||||
items={items}
|
||||
errors={error}
|
||||
linesNumber={4}
|
||||
currencyCode={values.currency_code}
|
||||
enableTaxRates={false}
|
||||
/>
|
||||
)}
|
||||
</FastField>
|
||||
|
||||
@@ -32,6 +32,15 @@ export const defaultReceiptEntry = {
|
||||
amount: '',
|
||||
};
|
||||
|
||||
const defaultReceiptEntryReq = {
|
||||
index: 0,
|
||||
item_id: '',
|
||||
rate: '',
|
||||
discount: '',
|
||||
quantity: '',
|
||||
description: '',
|
||||
};
|
||||
|
||||
export const defaultReceipt = {
|
||||
customer_id: '',
|
||||
deposit_account_id: '',
|
||||
@@ -140,7 +149,9 @@ export const transformFormValuesToRequest = (values) => {
|
||||
...(values.receipt_number_manually && {
|
||||
receipt_number: values.receipt_number,
|
||||
}),
|
||||
entries: entries.map((entry) => ({ ...omit(entry, ['amount']) })),
|
||||
entries: entries.map((entry) => ({
|
||||
...transformToForm(entry, defaultReceiptEntryReq),
|
||||
})),
|
||||
closed: false,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user