mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
Fix: Connect default currency with base currency option.
This commit is contained in:
@@ -22,6 +22,7 @@ import withExpenseDetail from 'containers/Expenses/withExpenseDetail';
|
|||||||
import withAccountsActions from 'containers/Accounts/withAccountsActions';
|
import withAccountsActions from 'containers/Accounts/withAccountsActions';
|
||||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||||
import withMediaActions from 'containers/Media/withMediaActions';
|
import withMediaActions from 'containers/Media/withMediaActions';
|
||||||
|
import withSettings from 'containers/Settings/withSettings';
|
||||||
|
|
||||||
import AppToaster from 'components/AppToaster';
|
import AppToaster from 'components/AppToaster';
|
||||||
import Dragzone from 'components/Dragzone';
|
import Dragzone from 'components/Dragzone';
|
||||||
@@ -53,12 +54,14 @@ function ExpenseForm({
|
|||||||
//#withExpenseDetail
|
//#withExpenseDetail
|
||||||
expense,
|
expense,
|
||||||
|
|
||||||
|
// #withSettings
|
||||||
|
baseCurrency,
|
||||||
|
|
||||||
// #own Props
|
// #own Props
|
||||||
expenseId,
|
expenseId,
|
||||||
onFormSubmit,
|
onFormSubmit,
|
||||||
onCancelForm,
|
onCancelForm,
|
||||||
}) {
|
}) {
|
||||||
const isNewMode = !expenseId;
|
|
||||||
|
|
||||||
const [payload, setPayload] = useState({});
|
const [payload, setPayload] = useState({});
|
||||||
|
|
||||||
@@ -150,7 +153,7 @@ function ExpenseForm({
|
|||||||
payment_date: moment(new Date()).format('YYYY-MM-DD'),
|
payment_date: moment(new Date()).format('YYYY-MM-DD'),
|
||||||
description: '',
|
description: '',
|
||||||
reference_no: '',
|
reference_no: '',
|
||||||
currency_code: '',
|
currency_code: baseCurrency,
|
||||||
categories: [...repeatValue(defaultCategory, MIN_LINES_NUMBER)],
|
categories: [...repeatValue(defaultCategory, MIN_LINES_NUMBER)],
|
||||||
}),
|
}),
|
||||||
[defaultCategory],
|
[defaultCategory],
|
||||||
@@ -407,4 +410,7 @@ export default compose(
|
|||||||
withDashboardActions,
|
withDashboardActions,
|
||||||
withMediaActions,
|
withMediaActions,
|
||||||
withExpenseDetail(),
|
withExpenseDetail(),
|
||||||
|
withSettings(({ organizationSettings }) => ({
|
||||||
|
baseCurrency: organizationSettings?.baseCurrency,
|
||||||
|
})),
|
||||||
)(ExpenseForm);
|
)(ExpenseForm);
|
||||||
|
|||||||
@@ -26,14 +26,21 @@ import withAccounts from 'containers/Accounts/withAccounts';
|
|||||||
import withCustomers from 'containers/Customers/withCustomers';
|
import withCustomers from 'containers/Customers/withCustomers';
|
||||||
|
|
||||||
function ExpenseFormHeader({
|
function ExpenseFormHeader({
|
||||||
|
// #ownProps
|
||||||
errors,
|
errors,
|
||||||
touched,
|
touched,
|
||||||
setFieldValue,
|
setFieldValue,
|
||||||
getFieldProps,
|
getFieldProps,
|
||||||
values,
|
values,
|
||||||
|
|
||||||
|
//withCurrencies
|
||||||
currenciesList,
|
currenciesList,
|
||||||
|
|
||||||
|
// #withAccounts
|
||||||
accountsList,
|
accountsList,
|
||||||
accountsTypes,
|
accountsTypes,
|
||||||
|
|
||||||
|
// #withCustomers
|
||||||
customers,
|
customers,
|
||||||
}) {
|
}) {
|
||||||
const [selectedItems, setSelectedItems] = useState({});
|
const [selectedItems, setSelectedItems] = useState({});
|
||||||
@@ -175,6 +182,7 @@ function ExpenseFormHeader({
|
|||||||
currenciesList={currenciesList}
|
currenciesList={currenciesList}
|
||||||
selectedCurrencyCode={values.currency_code}
|
selectedCurrencyCode={values.currency_code}
|
||||||
onCurrencySelected={onItemsSelect('currency_code')}
|
onCurrencySelected={onItemsSelect('currency_code')}
|
||||||
|
defaultSelectText={values.currency_code}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
</Col>
|
</Col>
|
||||||
|
|||||||
Reference in New Issue
Block a user