mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
fix: baseCurrency in sales.
This commit is contained in:
@@ -1,22 +1,22 @@
|
|||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import { compose } from 'utils';
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { sumBy } from 'lodash';
|
import { sumBy } from 'lodash';
|
||||||
import { useFormikContext } from 'formik';
|
import { useFormikContext } from 'formik';
|
||||||
|
|
||||||
import { CLASSES } from 'common/classes';
|
import { CLASSES } from 'common/classes';
|
||||||
|
|
||||||
import { PageFormBigNumber } from 'components';
|
|
||||||
|
|
||||||
import withCustomers from 'containers/Customers/withCustomers';
|
|
||||||
import withDialogActions from 'containers/Dialog/withDialogActions';
|
|
||||||
|
|
||||||
import EstimateFormHeaderFields from './EstimateFormHeaderFields';
|
import EstimateFormHeaderFields from './EstimateFormHeaderFields';
|
||||||
|
import { PageFormBigNumber } from 'components';
|
||||||
|
import withSettings from 'containers/Settings/withSettings';
|
||||||
|
import { compose } from 'utils';
|
||||||
|
|
||||||
// Estimate form top header.
|
// Estimate form top header.
|
||||||
function EstimateFormHeader({
|
function EstimateFormHeader({
|
||||||
// #ownProps
|
// #ownProps
|
||||||
onEstimateNumberChanged,
|
onEstimateNumberChanged,
|
||||||
|
|
||||||
|
// #withSettings
|
||||||
|
baseCurrency,
|
||||||
}) {
|
}) {
|
||||||
const { values } = useFormikContext();
|
const { values } = useFormikContext();
|
||||||
|
|
||||||
@@ -33,15 +33,14 @@ function EstimateFormHeader({
|
|||||||
<PageFormBigNumber
|
<PageFormBigNumber
|
||||||
label={'Amount'}
|
label={'Amount'}
|
||||||
amount={totalDueAmount}
|
amount={totalDueAmount}
|
||||||
currencyCode={'LYD'}
|
currencyCode={baseCurrency}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withCustomers(({ customers }) => ({
|
withSettings(({ organizationSettings }) => ({
|
||||||
customers,
|
baseCurrency: organizationSettings?.baseCurrency,
|
||||||
})),
|
})),
|
||||||
withDialogActions,
|
|
||||||
)(EstimateFormHeader);
|
)(EstimateFormHeader);
|
||||||
|
|||||||
@@ -4,16 +4,20 @@ import { sumBy } from 'lodash';
|
|||||||
import { useFormikContext } from 'formik';
|
import { useFormikContext } from 'formik';
|
||||||
|
|
||||||
import { CLASSES } from 'common/classes';
|
import { CLASSES } from 'common/classes';
|
||||||
|
|
||||||
import InvoiceFormHeaderFields from './InvoiceFormHeaderFields';
|
import InvoiceFormHeaderFields from './InvoiceFormHeaderFields';
|
||||||
|
|
||||||
import { PageFormBigNumber } from 'components';
|
import { PageFormBigNumber } from 'components';
|
||||||
|
import withSettings from 'containers/Settings/withSettings';
|
||||||
|
import { compose } from 'redux';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoice form header section.
|
* Invoice form header section.
|
||||||
*/
|
*/
|
||||||
export default function InvoiceFormHeader({
|
function InvoiceFormHeader({
|
||||||
// #ownProps
|
// #ownProps
|
||||||
onInvoiceNumberChanged,
|
onInvoiceNumberChanged,
|
||||||
|
// #withSettings
|
||||||
|
baseCurrency,
|
||||||
}) {
|
}) {
|
||||||
const { values } = useFormikContext();
|
const { values } = useFormikContext();
|
||||||
|
|
||||||
@@ -30,8 +34,13 @@ export default function InvoiceFormHeader({
|
|||||||
<PageFormBigNumber
|
<PageFormBigNumber
|
||||||
label={'Due Amount'}
|
label={'Due Amount'}
|
||||||
amount={totalDueAmount}
|
amount={totalDueAmount}
|
||||||
currencyCode={'LYD'}
|
currencyCode={baseCurrency}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
export default compose(
|
||||||
|
withSettings(({ organizationSettings }) => ({
|
||||||
|
baseCurrency: organizationSettings?.baseCurrency,
|
||||||
|
})),
|
||||||
|
)(InvoiceFormHeader);
|
||||||
|
|||||||
@@ -7,10 +7,17 @@ import { CLASSES } from 'common/classes';
|
|||||||
import ReceiptFormHeaderFields from './ReceiptFormHeaderFields';
|
import ReceiptFormHeaderFields from './ReceiptFormHeaderFields';
|
||||||
|
|
||||||
import { PageFormBigNumber } from 'components';
|
import { PageFormBigNumber } from 'components';
|
||||||
|
import withSettings from 'containers/Settings/withSettings';
|
||||||
|
import { compose } from 'redux';
|
||||||
|
|
||||||
export default function ReceiptFormHeader({
|
/**
|
||||||
|
* Receipt form header section.
|
||||||
|
*/
|
||||||
|
function ReceiptFormHeader({
|
||||||
// #ownProps
|
// #ownProps
|
||||||
onReceiptNumberChanged,
|
onReceiptNumberChanged,
|
||||||
|
// #withSettings
|
||||||
|
baseCurrency,
|
||||||
}) {
|
}) {
|
||||||
const { values } = useFormikContext();
|
const { values } = useFormikContext();
|
||||||
|
|
||||||
@@ -27,8 +34,14 @@ export default function ReceiptFormHeader({
|
|||||||
<PageFormBigNumber
|
<PageFormBigNumber
|
||||||
label={'Due Amount'}
|
label={'Due Amount'}
|
||||||
amount={totalDueAmount}
|
amount={totalDueAmount}
|
||||||
currencyCode={'LYD'}
|
currencyCode={baseCurrency}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default compose(
|
||||||
|
withSettings(({ organizationSettings }) => ({
|
||||||
|
baseCurrency: organizationSettings?.baseCurrency,
|
||||||
|
})),
|
||||||
|
)(ReceiptFormHeader);
|
||||||
|
|||||||
Reference in New Issue
Block a user