This commit is contained in:
a.bouhuolia
2021-03-08 14:53:18 +02:00
17 changed files with 39 additions and 24 deletions

View File

@@ -132,8 +132,8 @@ function DateCell({ value }) {
return moment(value).format('YYYY MMM DD');
}
function AmountAccessor(row) {
return <Money amount={row.amount} currency={'USD'} />;
function AmountAccessor({ amount, currency_code }) {
return <Money amount={amount} currency={currency_code} />;
}
function ActionsCell(props) {

View File

@@ -180,7 +180,7 @@ export function useInvoicesTableColumns() {
{
id: 'balance',
Header: formatMessage({ id: 'balance' }),
accessor: (r) => <Money amount={r.balance} currency={'USD'} />,
accessor: (r) => <Money amount={r.balance} currency={r.currency_code} />,
width: 110,
className: 'balance',
},

View File

@@ -53,7 +53,7 @@ export function ActionsMenu({
* Amount accessor.
*/
export function AmountAccessor(row) {
return <Money amount={row.amount} currency={'USD'} />;
return <Money amount={row.amount} currency={row.currency_code} />;
}
/**

View File

@@ -11,6 +11,7 @@ import {
} from '@blueprintjs/core';
import { FormattedMessage as T } from 'react-intl';
import { useFormikContext } from 'formik';
import { useHistory } from 'react-router-dom';
import classNames from 'classnames';
import { CLASSES } from 'common/classes';
import { If, Icon } from 'components';
@@ -20,6 +21,9 @@ import { useReceiptFormContext } from './ReceiptFormProvider';
* Receipt floating actions bar.
*/
export default function ReceiptFormFloatingActions() {
// History context.
const history = useHistory();
// Formik context.
const { resetForm, submitForm, isSubmitting } = useFormikContext();
@@ -63,7 +67,7 @@ export default function ReceiptFormFloatingActions() {
// Handle cancel button click.
const handleCancelBtnClick = (event) => {
history.goBack();
};
const handleClearBtnClick = (event) => {

View File

@@ -128,7 +128,7 @@ export function useReceiptsTableColumns() {
{
id: 'amount',
Header: formatMessage({ id: 'amount' }),
accessor: (r) => <Money amount={r.amount} currency={'USD'} />,
accessor: (r) => <Money amount={r.amount} currency={r.currency_code} />,
width: 140,
className: 'amount',
},