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

@@ -20,6 +20,7 @@ const Schema = Yup.object().shape({
reference_no: Yup.string().min(1).max(DATATYPES_LENGTH.STRING).nullable(),
// statement: Yup.string().nullable().max(DATATYPES_LENGTH.TEXT),
branch_id: Yup.string(),
exchange_rate:Yup.number(),
entries: Yup.array().of(
Yup.object().shape({
id: Yup.number().nullable(),

View File

@@ -73,6 +73,7 @@ function PaymentReceiveHeaderFields({
isNewMode,
isForeignCustomer,
baseCurrency,
selectCustomer,
setSelectCustomer,
} = usePaymentReceiveFormContext();
@@ -170,8 +171,8 @@ function PaymentReceiveHeaderFields({
{/* ----------- Exchange rate ----------- */}
<If condition={isForeignCustomer}>
<ExchangeRateInputGroup
fromCurrency={'USD'}
toCurrency={'LYD'}
fromCurrency={baseCurrency}
toCurrency={selectCustomer?.currency_code}
name={'exchange_rate'}
formGroupProps={{ label: ' ', inline: true }}
/>

View File

@@ -34,6 +34,7 @@ export const defaultPaymentReceive = {
full_amount: '',
currency_code: '',
branch_id: '',
exchange_rate:'',
entries: [],
};