mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
fix: (*): fix currency code.
This commit is contained in:
@@ -17,13 +17,17 @@ import { AppToaster } from 'components';
|
||||
|
||||
import { ERROR } from 'common/errors';
|
||||
import { useBillFormContext } from './BillFormProvider';
|
||||
import { orderingLinesIndexes, safeSumBy } from 'utils';
|
||||
import { compose, orderingLinesIndexes, safeSumBy } from 'utils';
|
||||
import { defaultBill, transformToEditForm } from './utils';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
|
||||
/**
|
||||
* Bill form.
|
||||
*/
|
||||
export default function BillForm() {
|
||||
function BillForm({
|
||||
// #withSettings
|
||||
baseCurrency,
|
||||
}) {
|
||||
const { formatMessage } = useIntl();
|
||||
const history = useHistory();
|
||||
|
||||
@@ -46,6 +50,7 @@ export default function BillForm() {
|
||||
: {
|
||||
...defaultBill,
|
||||
entries: orderingLinesIndexes(defaultBill.entries),
|
||||
currency_code: baseCurrency,
|
||||
}),
|
||||
}),
|
||||
[bill],
|
||||
@@ -142,3 +147,8 @@ export default function BillForm() {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export default compose(
|
||||
withSettings(({ organizationSettings }) => ({
|
||||
baseCurrency: organizationSettings?.baseCurrency,
|
||||
})),
|
||||
)(BillForm);
|
||||
|
||||
@@ -11,15 +11,20 @@ export default function BillFormBody({ defaultBill }) {
|
||||
return (
|
||||
<div className={classNames(CLASSES.PAGE_FORM_BODY)}>
|
||||
<FastField name={'entries'}>
|
||||
{({ form, field: { value }, meta: { error, touched } }) => (
|
||||
{({
|
||||
form: { values, setFieldValue },
|
||||
field: { value },
|
||||
meta: { error, touched },
|
||||
}) => (
|
||||
<ItemsEntriesTable
|
||||
entries={value}
|
||||
onUpdateData={(entries) => {
|
||||
form.setFieldValue('entries', entries);
|
||||
setFieldValue('entries', entries);
|
||||
}}
|
||||
items={items}
|
||||
errors={error}
|
||||
linesNumber={4}
|
||||
currencyCode={values.currency_code}
|
||||
/>
|
||||
)}
|
||||
</FastField>
|
||||
|
||||
Reference in New Issue
Block a user