Fix: Opening balance with Vendor & Customer.

This commit is contained in:
elforjani3
2020-11-28 21:23:14 +02:00
parent 29abb1ae84
commit 9ad5f4e462
2 changed files with 11 additions and 13 deletions

View File

@@ -61,7 +61,7 @@ function CustomerFinancialPanel({
{/*------------ Opening balance -----------*/}
<FastField name={'opening_balance'}>
{({
form: { values },
form,
field,
field: { value },
meta: { error, touched },
@@ -76,12 +76,14 @@ function CustomerFinancialPanel({
inline={true}
>
<ControlGroup>
<InputPrependText text={values.currency_code} />
<InputPrependText text={form.values.currency_code} />
<MoneyInputGroup
value={value}
inputGroupProps={{ fill: true }}
disabled={customerId}
{...field}
onChange={(balance) => {
form.setFieldValue('opening_balance', balance);
}}
/>
</ControlGroup>
</FormGroup>

View File

@@ -63,12 +63,7 @@ function VendorFinanicalPanelTab({
</FastField>
{/*------------ Opening balance -----------*/}
<FastField name={'opening_balance'}>
{({
form: { values },
field,
field: { value },
meta: { error, touched },
}) => (
{({ form, field, field: { value }, meta: { error, touched } }) => (
<FormGroup
label={<T id={'opening_balance'} />}
className={classNames(
@@ -79,14 +74,15 @@ function VendorFinanicalPanelTab({
inline={true}
>
<ControlGroup>
<InputPrependText text={values.currency_code} />
<InputPrependText text={form.values.currency_code} />
<MoneyInputGroup
value={value}
onChange={field.onChange}
prefix={'$'}
inputGroupProps={{
fill: true,
...field,
// ...field,
}}
onChange={(balance) => {
form.setFieldValue('opening_balance', balance);
}}
disabled={vendorId}
/>