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

View File

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