mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: add warehouse transfer & expenses & journal.
This commit is contained in:
@@ -9,7 +9,10 @@ import {
|
||||
AccountsListFieldCell,
|
||||
CheckBoxFieldCell,
|
||||
} from 'components/DataTableCells';
|
||||
import { formattedAmount, safeSumBy } from 'utils';
|
||||
import { useFormikContext } from 'formik';
|
||||
import { ExchangeRateInputGroup } from 'components';
|
||||
import { useCurrentOrganization } from 'hooks/state';
|
||||
import { useExpensesIsForeign } from './utils';
|
||||
|
||||
/**
|
||||
* Expense category header cell.
|
||||
@@ -128,3 +131,27 @@ export function useExpenseFormTableColumns({ landedCost }) {
|
||||
[],
|
||||
);
|
||||
}
|
||||
;
|
||||
|
||||
/**
|
||||
* Expense exchange rate input field.
|
||||
* @returns {JSX.Element}
|
||||
*/
|
||||
export function ExpensesExchangeRateInputField({ ...props }) {
|
||||
const currentOrganization = useCurrentOrganization();
|
||||
const { values } = useFormikContext();
|
||||
|
||||
const isForeignJouranl = useExpensesIsForeign();
|
||||
|
||||
// Can't continue if the customer is not foreign.
|
||||
if (!isForeignJouranl) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<ExchangeRateInputGroup
|
||||
fromCurrency={values.currency_code}
|
||||
toCurrency={currentOrganization.base_currency}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user