From 9ad5f4e462574467c0f826d476301b1ec1256c52 Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Sat, 28 Nov 2020 21:23:14 +0200 Subject: [PATCH] Fix: Opening balance with Vendor & Customer. --- .../Customers/CustomerFinancialPanel.js | 8 +++++--- .../Vendors/VendorFinanicalPanelTab.js | 16 ++++++---------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/client/src/containers/Customers/CustomerFinancialPanel.js b/client/src/containers/Customers/CustomerFinancialPanel.js index 7c8da19d3..398afb136 100644 --- a/client/src/containers/Customers/CustomerFinancialPanel.js +++ b/client/src/containers/Customers/CustomerFinancialPanel.js @@ -61,7 +61,7 @@ function CustomerFinancialPanel({ {/*------------ Opening balance -----------*/} {({ - form: { values }, + form, field, field: { value }, meta: { error, touched }, @@ -76,12 +76,14 @@ function CustomerFinancialPanel({ inline={true} > - + { + form.setFieldValue('opening_balance', balance); + }} /> diff --git a/client/src/containers/Vendors/VendorFinanicalPanelTab.js b/client/src/containers/Vendors/VendorFinanicalPanelTab.js index 095ac72b6..5397f5b91 100644 --- a/client/src/containers/Vendors/VendorFinanicalPanelTab.js +++ b/client/src/containers/Vendors/VendorFinanicalPanelTab.js @@ -63,12 +63,7 @@ function VendorFinanicalPanelTab({ {/*------------ Opening balance -----------*/} - {({ - form: { values }, - field, - field: { value }, - meta: { error, touched }, - }) => ( + {({ form, field, field: { value }, meta: { error, touched } }) => ( } className={classNames( @@ -79,14 +74,15 @@ function VendorFinanicalPanelTab({ inline={true} > - + { + form.setFieldValue('opening_balance', balance); }} disabled={vendorId} />