fix(Currencies): Currency code in services.

This commit is contained in:
a.bouhuolia
2021-03-30 16:18:57 +02:00
parent 78d4b56e92
commit 1ba67f183b
37 changed files with 160 additions and 73 deletions

View File

@@ -14,6 +14,7 @@ import classNames from 'classnames';
import { CLASSES } from 'common/classes';
import { DateInput } from '@blueprintjs/datetime';
import { FieldRequiredHint, Col, Row } from 'components';
import { ACCOUNT_TYPE } from 'common/accountTypes';
import {
AccountsSuggestField,
InputPrependText,
@@ -164,6 +165,11 @@ export default function QuickPaymentMadeFormFields() {
id: 'select_account',
}),
}}
filterByTypes={[
ACCOUNT_TYPE.CASH,
ACCOUNT_TYPE.BANK,
ACCOUNT_TYPE.OTHER_CURRENT_ASSET,
]}
/>
</FormGroup>
)}

View File

@@ -20,7 +20,7 @@ import {
MoneyInputGroup,
Icon,
} from 'components';
import { ACCOUNT_TYPE } from 'common/accountTypes';
import {
inputIntent,
momentFormatter,
@@ -166,6 +166,11 @@ export default function QuickPaymentReceiveFormFields({}) {
id: 'select_account',
}),
}}
filterByTypes={[
ACCOUNT_TYPE.CASH,
ACCOUNT_TYPE.BANK,
ACCOUNT_TYPE.OTHER_CURRENT_ASSET,
]}
/>
</FormGroup>
)}

View File

@@ -15,16 +15,16 @@ const ExpenseFormPageContext = createContext();
* Accounts chart data provider.
*/
function ExpenseFormPageProvider({ expenseId, ...props }) {
const { data: currencies, isFetching: isCurrenciesLoading } = useCurrencies();
const { data: currencies, isLoading: isCurrenciesLoading } = useCurrencies();
// Fetches customers list.
const {
data: { customers },
isFetching: isFieldsLoading,
isLoading: isCustomersLoading,
} = useCustomers();
// Fetch the expense details.
const { data: expense, isFetching: isExpenseLoading } = useExpense(
const { data: expense, isLoading: isExpenseLoading } = useExpense(
expenseId,
{
enabled: !!expenseId,
@@ -32,7 +32,7 @@ function ExpenseFormPageProvider({ expenseId, ...props }) {
);
// Fetch accounts list.
const { data: accounts, isFetching: isAccountsLoading } = useAccounts();
const { data: accounts, isLoading: isAccountsLoading } = useAccounts();
// Create and edit expense mutate.
const { mutateAsync: createExpenseMutate } = useCreateExpense();
@@ -57,7 +57,7 @@ function ExpenseFormPageProvider({ expenseId, ...props }) {
isCurrenciesLoading,
isExpenseLoading,
isFieldsLoading,
isCustomersLoading,
isAccountsLoading,
createExpenseMutate,
@@ -70,7 +70,7 @@ function ExpenseFormPageProvider({ expenseId, ...props }) {
loading={
isCurrenciesLoading ||
isExpenseLoading ||
isFieldsLoading ||
isCustomersLoading ||
isAccountsLoading
}
name={'expense-form'}

View File

@@ -56,6 +56,7 @@ export default function InventoryValuationTable({
expandColumnSpace={1}
sticky={true}
rowClassNames={rowClassNames}
noResults={'There were no inventory transactions during the selected date range.'}
/>
</FinancialSheet>
);

View File

@@ -29,7 +29,7 @@ export const useJournalTableColumns = () => {
},
{
Header: formatMessage({ id: 'num' }),
accessor: 'reference_id',
accessor: 'transaction_number',
className: 'reference_id',
width: 70,
},

View File

@@ -55,6 +55,7 @@ export default function PurchasesByItemsTable({ companyName }) {
expandColumnSpace={1}
sticky={true}
rowClassNames={rowClassNames}
noResults={'There were no purchases during the selected date range.'}
/>
</FinancialSheet>
);

View File

@@ -53,6 +53,7 @@ export default function SalesByItemsTable({ companyName }) {
expandColumnSpace={1}
sticky={true}
rowClassNames={rowClassNames}
noResults={'There were no sales during the selected date range.'}
/>
</FinancialSheet>
);

View File

@@ -25,6 +25,7 @@ import {
} from 'components';
import withSettings from 'containers/Settings/withSettings';
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
import { ACCOUNT_TYPE } from 'common/accountTypes';
import {
momentFormatter,
tansformDateValue,
@@ -205,6 +206,11 @@ function PaymentMadeFormHeaderFields({ baseCurrency }) {
}}
defaultSelectText={<T id={'select_payment_account'} />}
selectedAccountId={value}
filterByTypes={[
ACCOUNT_TYPE.CASH,
ACCOUNT_TYPE.BANK,
ACCOUNT_TYPE.OTHER_CURRENT_ASSET,
]}
/>
</FormGroup>
)}

View File

@@ -33,6 +33,7 @@ import {
Money,
} from 'components';
import { usePaymentReceiveFormContext } from './PaymentReceiveFormProvider';
import { ACCOUNT_TYPE } from 'common/accountTypes';
import withDialogActions from 'containers/Dialog/withDialogActions';
import withSettings from 'containers/Settings/withSettings';
@@ -263,6 +264,11 @@ function PaymentReceiveHeaderFields({
}}
defaultSelectText={<T id={'select_deposit_account'} />}
selectedAccountId={value}
filterByTypes={[
ACCOUNT_TYPE.CASH,
ACCOUNT_TYPE.BANK,
ACCOUNT_TYPE.OTHER_CURRENT_ASSET,
]}
/>
</FormGroup>
)}

View File

@@ -19,6 +19,7 @@ import {
} from 'components';
import withSettings from 'containers/Settings/withSettings';
import withDialogActions from 'containers/Dialog/withDialogActions';
import { ACCOUNT_TYPE } from 'common/accountTypes';
import {
momentFormatter,
compose,
@@ -113,8 +114,12 @@ function ReceiptFormHeader({
}}
defaultSelectText={<T id={'select_deposit_account'} />}
selectedAccountId={value}
// filterByTypes={['current_asset']}
popoverFill={true}
filterByTypes={[
ACCOUNT_TYPE.CASH,
ACCOUNT_TYPE.BANK,
ACCOUNT_TYPE.OTHER_CURRENT_ASSET,
]}
/>
</FormGroup>
)}

View File

@@ -26,7 +26,7 @@
font-weight: 500;
.td{
border-top: 1px solid #333;
border-top: 1px solid #BBB;
border-bottom: 3px double #333;
}
}

View File

@@ -26,7 +26,7 @@
font-weight: 500;
.td{
border-top: 1px solid #333;
border-top: 1px solid #BBB;
border-bottom: 3px double #333;
}
}

View File

@@ -19,7 +19,7 @@
padding-bottom: 0.4rem;
}
.tr.row_type--total .td {
border-top: 1px solid #000;
border-top: 1px solid #BBB;
font-weight: 500;
border-bottom: 3px double #000;
}

View File

@@ -22,7 +22,7 @@
border-top-color: #000;
}
.tr.row_type--total .td{
border-top: 1px solid #000;
border-top: 1px solid #bbb;
font-weight: 500;
border-bottom: 3px double #000;
}