mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
fix: add baseCurrency in sale & purchases data table.
This commit is contained in:
@@ -7,11 +7,18 @@ import { CLASSES } from 'common/classes';
|
||||
|
||||
import BillFormHeaderFields from './BillFormHeaderFields';
|
||||
import { PageFormBigNumber } from 'components';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
import { compose } from 'redux';
|
||||
|
||||
/**
|
||||
* Fill form header.
|
||||
*/
|
||||
export default function BillFormHeader({ onBillNumberChanged }) {
|
||||
function BillFormHeader({
|
||||
onBillNumberChanged,
|
||||
|
||||
// #withSettings
|
||||
baseCurrency,
|
||||
}) {
|
||||
const { values } = useFormikContext();
|
||||
|
||||
// Calculate the total due amount of bill entries.
|
||||
@@ -25,8 +32,13 @@ export default function BillFormHeader({ onBillNumberChanged }) {
|
||||
<PageFormBigNumber
|
||||
label={'Due Amount'}
|
||||
amount={totalDueAmount}
|
||||
currencyCode={'LYD'}
|
||||
currencyCode={baseCurrency}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export default compose(
|
||||
withSettings(({ organizationSettings }) => ({
|
||||
baseCurrency: organizationSettings?.baseCurrency,
|
||||
})),
|
||||
)(BillFormHeader);
|
||||
|
||||
@@ -23,6 +23,7 @@ import PaymentMadesEmptyStatus from './PaymentMadesEmptyStatus';
|
||||
import withPaymentMade from './withPaymentMade';
|
||||
import withPaymentMadeActions from './withPaymentMadeActions';
|
||||
import withCurrentView from 'containers/Views/withCurrentView';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
|
||||
/**
|
||||
* Payment made datatable transactions.
|
||||
@@ -38,6 +39,9 @@ function PaymentMadeDataTable({
|
||||
// #withPaymentMadeActions
|
||||
addPaymentMadesTableQueries,
|
||||
|
||||
// #withSettings
|
||||
baseCurrency,
|
||||
|
||||
// #ownProps
|
||||
onEditPaymentMade,
|
||||
onDeletePaymentMade,
|
||||
@@ -110,7 +114,8 @@ function PaymentMadeDataTable({
|
||||
{
|
||||
id: 'payment_number',
|
||||
Header: formatMessage({ id: 'payment_number' }),
|
||||
accessor: (row) => (row.payment_number ? `#${row.payment_number}` : null),
|
||||
accessor: (row) =>
|
||||
row.payment_number ? `#${row.payment_number}` : null,
|
||||
width: 140,
|
||||
className: 'payment_number',
|
||||
},
|
||||
@@ -124,7 +129,7 @@ function PaymentMadeDataTable({
|
||||
{
|
||||
id: 'amount',
|
||||
Header: formatMessage({ id: 'amount' }),
|
||||
accessor: (r) => <Money amount={r.amount} currency={'USD'} />,
|
||||
accessor: (r) => <Money amount={r.amount} currency={baseCurrency} />,
|
||||
width: 140,
|
||||
className: 'amount',
|
||||
},
|
||||
@@ -238,4 +243,7 @@ export default compose(
|
||||
paymentMadesCurrentViewId,
|
||||
}),
|
||||
),
|
||||
withSettings(({ organizationSettings }) => ({
|
||||
baseCurrency: organizationSettings?.baseCurrency,
|
||||
})),
|
||||
)(PaymentMadeDataTable);
|
||||
|
||||
@@ -170,7 +170,7 @@ function PaymentMadeFormHeader({
|
||||
className={'receive-full-amount'}
|
||||
>
|
||||
Receive full amount (
|
||||
<Money amount={payableFullAmount} currency={'USD'} />)
|
||||
<Money amount={payableFullAmount} currency={baseCurrency} />)
|
||||
</a>
|
||||
</FormGroup>
|
||||
|
||||
@@ -250,7 +250,7 @@ function PaymentMadeFormHeader({
|
||||
<div class="big-amount">
|
||||
<span class="big-amount__label">Amount Received</span>
|
||||
<h1 class="big-amount__number">
|
||||
<Money amount={amountPaid} currency={'USD'} />
|
||||
<Money amount={amountPaid} currency={baseCurrency} />
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user