feat(Sales & Purchases ): add setfieldvalue exchange rate.

This commit is contained in:
elforjani13
2022-02-23 12:22:27 +02:00
parent cf7d032aae
commit e6a7c7bc58
26 changed files with 118 additions and 66 deletions

View File

@@ -60,6 +60,8 @@ function PaymentMadeFormHeaderFields({ organization: { base_currency } }) {
isNewMode,
setPaymentVendorId,
isForeignVendor,
baseCurrency,
selectVendor,
setSelectVendor,
} = usePaymentMadeFormContext();
@@ -108,6 +110,7 @@ function PaymentMadeFormHeaderFields({ organization: { base_currency } }) {
defaultSelectText={<T id={'select_vender_account'} />}
onContactSelected={(contact) => {
form.setFieldValue('vendor_id', contact.id);
form.setFieldValue('exchange_rate', '');
setPaymentVendorId(contact.id);
setSelectVendor(contact);
}}
@@ -124,8 +127,8 @@ function PaymentMadeFormHeaderFields({ organization: { base_currency } }) {
{/* ----------- Exchange rate ----------- */}
<If condition={isForeignVendor}>
<ExchangeRateInputGroup
fromCurrency={'USD'}
toCurrency={'LYD'}
fromCurrency={baseCurrency}
toCurrency={selectVendor?.currency_code}
name={'exchange_rate'}
formGroupProps={{ label: ' ', inline: true }}
/>