This commit is contained in:
Ahmed Bouhuolia
2025-11-25 21:29:32 +02:00
parent ff04c4b762
commit adfa8852db
7 changed files with 57 additions and 58 deletions

View File

@@ -58,10 +58,7 @@ function QuickPaymentMadeFormFields({
<FeatureCan feature={Features.Branches}>
<Row>
<Col xs={5}>
<FFormGroup
label={<T id={'branch'} />}
className={classNames('form-group--select-list', Classes.FILL)}
>
<FFormGroup label={<T id={'branch'} />} name={'branch_id'}>
<BranchSelect
name={'branch_id'}
branches={branches}
@@ -91,15 +88,9 @@ function QuickPaymentMadeFormFields({
</Row>
{/*------------ Amount Received -----------*/}
<FFormGroup
name={'amount'}
label={<T id={'amount_received'} />}
labelInfo={<FieldRequiredHint />}
className={classNames('form-group--payment_amount', CLASSES.FILL)}
>
<FFormGroup name={'amount'} label={<T id={'amount_received'} />}>
<ControlGroup>
<InputPrependText text={values.currency_code} />
<FMoneyInputGroup
name={'amount'}
minimal={true}
@@ -130,8 +121,8 @@ function QuickPaymentMadeFormFields({
className={classNames('form-group--select-list', CLASSES.FILL)}
>
<FDateInput
{...momentFormatter('YYYY/MM/DD')}
name={'payment_date'}
{...momentFormatter('YYYY/MM/DD')}
popoverProps={{ position: Position.BOTTOM, minimal: true }}
inputProps={{
leftIcon: <Icon icon={'date-range'} />,
@@ -139,6 +130,7 @@ function QuickPaymentMadeFormFields({
/>
</FFormGroup>
</Col>
<Col xs={5}>
{/* ------------ payment account ------------ */}
<FFormGroup
@@ -146,10 +138,8 @@ function QuickPaymentMadeFormFields({
label={<T id={'payment_account'} />}
>
<AccountsSuggestField
name={'payment_account_id'}
accounts={accounts}
onAccountSelected={({ id }) =>
form.setFieldValue('payment_account_id', id)
}
inputProps={{
placeholder: intl.get('select_account'),
}}
@@ -164,21 +154,13 @@ function QuickPaymentMadeFormFields({
</Row>
{/* ------------ Reference No. ------------ */}
<FFormGroup
name={'reference'}
label={<T id={'reference'} />}
className={classNames('form-group--reference', CLASSES.FILL)}
>
<FFormGroup name={'reference'} label={<T id={'reference'} />}>
<FInputGroup name={'reference'} minimal={true} />
</FFormGroup>
{/* --------- Statement --------- */}
<FFormGroup
name={'statement'}
label={<T id={'statement'} />}
className={'form-group--statement'}
>
<FTextArea name={'statement'} growVertically={true} />
<FFormGroup name={'statement'} label={<T id={'statement'} />}>
<FTextArea name={'statement'} growVertically={true} fill={true} />
</FFormGroup>
</div>
);
@@ -190,4 +172,8 @@ export const BranchRowDivider = styled.div`
height: 1px;
background: #ebf1f6;
margin-bottom: 15px;
.bp4-dark &{
background: rgba(255, 255, 255, 0.1);
}
`;

View File

@@ -26,17 +26,11 @@ import {
FInputGroup,
FTextArea,
FDateInput,
FMoneyInputGroup,
} from '@/components';
import {
inputIntent,
momentFormatter,
tansformDateValue,
handleDateChange,
compose,
} from '@/utils';
import { momentFormatter, compose } from '@/utils';
import { useSetPrimaryBranchToForm } from './utils';
import { useQuickPaymentReceiveContext } from './QuickPaymentReceiveFormProvider';
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
import withSettings from '@/containers/Settings/withSettings';
@@ -64,10 +58,7 @@ function QuickPaymentReceiveFormFields({
<FeatureCan feature={Features.Branches}>
<Row>
<Col xs={5}>
<FFormGroup
label={<T id={'branch'} />}
className={classNames('form-group--select-list', Classes.FILL)}
>
<FFormGroup name={'branch_id'} label={<T id={'branch'} />}>
<BranchSelect
name={'branch_id'}
branches={branches}
@@ -108,20 +99,16 @@ function QuickPaymentReceiveFormFields({
</Row>
{/*------------ Amount Received -----------*/}
{/* <FFormGroup name={'amount'} label={<T id={'amount_received'} />}>
<FFormGroup name={'amount'} label={<T id={'amount_received'} />}>
<ControlGroup>
<InputPrependText text={values.currency_code} />
<MoneyInputGroup
value={value}
<FMoneyInputGroup
name={'amount'}
minimal={true}
onChange={(amount) => {
setFieldValue('amount', amount);
}}
intent={inputIntent({ error, touched })}
inputRef={(ref) => (paymentReceiveFieldRef.current = ref)}
/>
</ControlGroup>
</FFormGroup> */}
</FFormGroup>
<If condition={!isEqual(base_currency, values.currency_code)}>
{/*------------ exchange rate -----------*/}
@@ -152,7 +139,7 @@ function QuickPaymentReceiveFormFields({
<Col xs={5}>
{/* ------------ Deposit account ------------ */}
{/* <FFormGroup
<FFormGroup
name={'deposit_account_id'}
label={<T id={'deposit_to'} />}
>
@@ -168,7 +155,7 @@ function QuickPaymentReceiveFormFields({
ACCOUNT_TYPE.OTHER_CURRENT_ASSET,
]}
/>
</FFormGroup> */}
</FFormGroup>
</Col>
</Row>
@@ -200,4 +187,8 @@ export const BranchRowDivider = styled.div`
height: 1px;
background: #ebf1f6;
margin-bottom: 15px;
.bp4-dark & {
background: rgba(255, 255, 255, 0.1);
}
`;