// @ts-nocheck import React from 'react'; import styled from 'styled-components'; import intl from 'react-intl-universal'; import { isEqual } from 'lodash'; import { FastField, ErrorMessage, useFormikContext } from 'formik'; import { Classes, FormGroup, InputGroup, TextArea, Position, ControlGroup, } from '@blueprintjs/core'; import classNames from 'classnames'; import { CLASSES, Features } from '@/constants'; import { DateInput } from '@blueprintjs/datetime'; import { Icon, Col, Row, If, FieldRequiredHint, FAccountsSuggestField, InputPrependText, MoneyInputGroup, FormattedMessage as T, ExchangeRateMutedField, BranchSelect, FeatureCan, FInputGroup, FMoneyInputGroup, FDateInput, FFormGroup, FTextArea, } from '@/components'; import { inputIntent, momentFormatter, tansformDateValue, handleDateChange, compose, } from '@/utils'; import { useAutofocus } from '@/hooks'; import { ACCOUNT_TYPE } from '@/constants/accountTypes'; import { useSetPrimaryBranchToForm } from './utils'; import { useRefundCreditNoteContext } from './RefundCreditNoteFormProvider'; import { withCurrentOrganization } from '@/containers/Organization/withCurrentOrganization'; /** * Refund credit note form fields. */ function RefundCreditNoteFormFields({ // #withCurrentOrganization organization: { base_currency }, }) { const { accounts, branches } = useRefundCreditNoteContext(); const { values } = useFormikContext(); const amountFieldRef = useAutofocus(); // Sets the primary branch to form. useSetPrimaryBranchToForm(); return (
}> {/* ------------- Refund date ------------- */} } labelInfo={} fill > , }} /> {/* ------------ Form account ------------ */} } labelInfo={} fill fastField > {/* ------------- Amount ------------- */} } labelInfo={} fill fastField > (amountFieldRef.current = ref)} /> {/*------------ exchange rate -----------*/} {/* ------------ Reference No. ------------ */} } fill fastField> {/* --------- Statement --------- */} } fill fastField >
); } export default compose(withCurrentOrganization())(RefundCreditNoteFormFields); export const BranchRowDivider = styled.div` --x-divider-color: #ebf1f6; .bp4-dark & { --x-divider-color: rgba(255, 255, 255, 0.1); } height: 1px; background: var(--x-divider-color); margin-bottom: 13px; `;