summaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
Diffstat (limited to 'src/services')
-rw-r--r--src/services/accounts/index.ts1
-rw-r--r--src/services/transfers/TransferForm.tsx9
-rw-r--r--src/services/types.ts1
3 files changed, 10 insertions, 1 deletions
diff --git a/src/services/accounts/index.ts b/src/services/accounts/index.ts
index fc3a830..1936a9c 100644
--- a/src/services/accounts/index.ts
+++ b/src/services/accounts/index.ts
@@ -7,6 +7,7 @@ const service: ServiceParams<Account> = {
nameSingular: 'Счёт',
tableFields: [
{ key: 'name', label: 'Название' },
+ { key: 'currency', label: 'Валюта' },
{ key: 'balance', label: 'Баланс' },
],
searchBy: ['name'],
diff --git a/src/services/transfers/TransferForm.tsx b/src/services/transfers/TransferForm.tsx
index 92846a3..a10630a 100644
--- a/src/services/transfers/TransferForm.tsx
+++ b/src/services/transfers/TransferForm.tsx
@@ -12,20 +12,27 @@ const mapper = (item: Contractor) => ({ key: item._id, label: item.name });
const TransferForm: React.FC<FormikProps<Transfer>> = ({ setFieldValue, values }) => {
const { data: contractors } = hooks.contractors.useList();
+ const { data: accounts } = hooks.accounts.useList();
if (!values.date) setFieldValue('date', moment().format('YYYY-MM-DD'));
if (!values.contractorId && contractors?.length) setFieldValue('contractorId', contractors[0]._id);
return (
<Form id="form">
+ <Input name="date" type="date" label="Дата" required />
<div className="grid grid-cols-2">
<Select
+ name="accountId"
+ label="Счёт"
+ options={accounts?.map(mapper)}
+ required
+ />
+ <Select
name="contractorId"
label="Контрагент"
options={contractors?.map(mapper)}
required
/>
- <Input name="date" type="date" label="Дата" required />
</div>
<div className="grid grid-cols-2">
<Select
diff --git a/src/services/types.ts b/src/services/types.ts
index 6fa5f30..228bc4d 100644
--- a/src/services/types.ts
+++ b/src/services/types.ts
@@ -7,6 +7,7 @@ interface BaseModel {
export interface Account extends BaseModel {
name: string;
code: string;
+ currency: string;
balance: number;
}