-
+ }
+ className={classNames(
+ 'form-group--select-list',
+ 'form-group--currency',
+ CLASSES.FILL
+ )}
+ >
+
+
);
}
-export default compose(
- withDialogActions,
-)(MakeJournalEntriesHeader);
+export default compose(withDialogActions)(MakeJournalEntriesHeader);
diff --git a/client/src/containers/Accounting/withManualJournalsActions.js b/client/src/containers/Accounting/withManualJournalsActions.js
index 0e1600164..6c75d6a54 100644
--- a/client/src/containers/Accounting/withManualJournalsActions.js
+++ b/client/src/containers/Accounting/withManualJournalsActions.js
@@ -24,10 +24,6 @@ const mapActionsToProps = (dispatch) => ({
type: t.MANUAL_JOURNALS_TABLE_QUERIES_ADD,
queries,
}),
- setJournalNumberChanged: (isChanged) => dispatch({
- type: t.MANUAL_JOURNAL_NUMBER_CHANGED,
- payload: { isChanged },
- }),
});
export default connect(null, mapActionsToProps);
diff --git a/client/src/containers/Customers/CustomerAddressTabs.js b/client/src/containers/Customers/CustomerAddressTabs.js
index 6aeeacfb1..00bc26e09 100644
--- a/client/src/containers/Customers/CustomerAddressTabs.js
+++ b/client/src/containers/Customers/CustomerAddressTabs.js
@@ -1,245 +1,364 @@
-import React, { useState, useMemo, useCallback, useEffect } from 'react';
-import * as Yup from 'yup';
-import { useFormik } from 'formik';
-import {
- FormGroup,
- MenuItem,
- Intent,
- InputGroup,
- HTMLSelect,
- Button,
- Classes,
-} from '@blueprintjs/core';
-
-import { Row, Col } from 'react-grid-system';
-import { FormattedMessage as T, useIntl } from 'react-intl';
+import React from 'react';
+import { FormGroup, Intent, InputGroup } from '@blueprintjs/core';
+import { Row, Col } from 'components';
+import { FormattedMessage as T } from 'react-intl';
import ErrorMessage from 'components/ErrorMessage';
const CustomerBillingAddress = ({
- formik: { errors, touched, setFieldValue, getFieldProps },
+ errors,
+ touched,
+ setFieldValue,
+ getFieldProps,
}) => {
return (
-
-
-
-
-
-
+
+
+
+
+
- }
- className={'form-group--journal-number'}
+
+ }
+ label={}
+ >
+
- }
- >
-
-
+ {...getFieldProps('billing_address_country')}
+ />
+
- }
- className={'form-group--journal-number'}
+ }
+ className={'form-group--journal-number'}
+ intent={
+ errors.billing_address_1 &&
+ touched.billing_address_1 &&
+ Intent.DANGER
+ }
+ inline={true}
+ helperText={
+
+ }
+ >
+
+
+
+ }
+ className={'form-group--journal-number'}
+ intent={
+ errors.billing_address_2 &&
+ touched.billing_address_2 &&
+ Intent.DANGER
+ }
+ inline={true}
+ helperText={
+
+ }
+ >
+
+
+
+ }
+ className={'form-group--journal-number'}
+ intent={
+ errors.billing_address_city &&
+ touched.billing_address_city &&
+ Intent.DANGER
+ }
+ inline={true}
+ helperText={
+
+ }
+ >
+
- }
- >
-
-
+ {...getFieldProps('billing_address_city')}
+ />
+
- }
- className={'form-group--journal-number'}
+ }
+ className={'form-group--journal-number'}
+ intent={
+ errors.billing_address_state &&
+ touched.billing_address_state &&
+ Intent.DANGER
+ }
+ inline={true}
+ helperText={
+
+ }
+ >
+
- }
- >
-
-
+ {...getFieldProps('billing_address_state')}
+ />
+
- }
+ }
+ intent={
+ errors.billing_address_zipcode &&
+ touched.billing_address_zipcode &&
+ Intent.DANGER
+ }
+ inline={true}
+ helperText={
+
+ }
+ >
+
- }
- >
-
-
-
-
-
-
-
+ {...getFieldProps('billing_address_zipcode')}
+ />
+
- }
- className={'form-group--journal-number'}
+ }
+ intent={
+ errors.shipping_phone && touched.shipping_phone && Intent.DANGER
+ }
+ inline={true}
+ helperText={
+
+ }
+ >
+
+
+
+
+
+
+
+
+
+ }
+ className={'form-group--journal-number'}
+ intent={
+ errors.shipping_address_country &&
+ touched.shipping_address_country &&
+ Intent.DANGER
+ }
+ inline={true}
+ helperText={
+
+ }
+ >
+
- }
- >
-
-
+ {...getFieldProps('shipping_address_country')}
+ />
+
- }
- className={'form-group--journal-number'}
+ }
+ className={'form-group--journal-number'}
+ intent={
+ errors.billing_address_1 &&
+ touched.billing_address_1 &&
+ Intent.DANGER
+ }
+ inline={true}
+ helperText={
+
+ }
+ >
+
+
+
+ }
+ className={'form-group--journal-number'}
+ intent={
+ errors.billing_address_2 &&
+ touched.billing_address_2 &&
+ Intent.DANGER
+ }
+ inline={true}
+ helperText={
+
+ }
+ >
+
+
+
+ }
+ className={'form-group--journal-number'}
+ intent={
+ errors.shipping_address_city &&
+ touched.shipping_address_city &&
+ Intent.DANGER
+ }
+ inline={true}
+ helperText={
+
+ }
+ >
+
- }
- >
-
-
+ {...getFieldProps('shipping_address_city')}
+ />
+
- }
- className={'form-group--journal-number'}
+ }
+ className={'form-group--journal-number'}
+ intent={
+ errors.shipping_address_state &&
+ touched.shipping_address_state &&
+ Intent.DANGER
+ }
+ inline={true}
+ helperText={
+
+ }
+ >
+
- }
- >
-
-
+ {...getFieldProps('shipping_address_state')}
+ />
+
- }
+ }
+ intent={
+ errors.shipping_address_zipcode &&
+ touched.shipping_address_zipcode &&
+ Intent.DANGER
+ }
+ inline={true}
+ helperText={
+
+ }
+ >
+
+ {...getFieldProps('shipping_address_zipcode')}
+ />
+
+
+ }
+ intent={
+ errors.shipping_phone && touched.shipping_phone && Intent.DANGER
+ }
+ inline={true}
+ helperText={
+
+ }
+ >
+
-
-
-
-
-
+ {...getFieldProps('shipping_phone')}
+ />
+
+
+
);
};
diff --git a/client/src/containers/Customers/CustomerFinancialPanel.js b/client/src/containers/Customers/CustomerFinancialPanel.js
new file mode 100644
index 000000000..8ecae873e
--- /dev/null
+++ b/client/src/containers/Customers/CustomerFinancialPanel.js
@@ -0,0 +1,87 @@
+import React, { useCallback } from 'react';
+import moment from 'moment';
+import classNames from 'classnames';
+import { FormGroup, Intent, Position, Classes } from '@blueprintjs/core';
+import { DateInput } from '@blueprintjs/datetime';
+import {
+ ErrorMessage,
+ MoneyInputGroup,
+ CurrenciesSelectList,
+ Row,
+ Col,
+} from 'components';
+import { FormattedMessage as T } from 'react-intl';
+import { momentFormatter, tansformDateValue } from 'utils';
+
+export default function CustomerFinancialPanel({
+ setFieldValue,
+ errors,
+ touched,
+ values,
+}) {
+ const handleDateChange = useCallback(
+ (date) => {
+ const formatted = moment(date).format('YYYY-MM-DD');
+ setFieldValue('payment_date', formatted);
+ },
+ [setFieldValue],
+ );
+
+ return (
+
+
+
+ }
+ className={classNames('form-group--select-list', Classes.FILL)}
+ intent={
+ errors.opening_balance_date &&
+ touched.opening_balance_date &&
+ Intent.DANGER
+ }
+ inline={true}
+ helperText={
+
+ }
+ >
+
+
+
+ }
+ className={classNames('form-group--opening-balance', Classes.FILL)}
+ intent={
+ errors.opening_balance && touched.opening_balance && Intent.DANGER
+ }
+ inline={true}
+ >
+
+
+
+ }
+ className={classNames(
+ 'form-group--select-list',
+ 'form-group--balance-currency',
+ Classes.FILL,
+ )}
+ inline={true}
+ >
+
+
+
+
+
+ );
+}
diff --git a/client/src/containers/Customers/CustomerFooter.js b/client/src/containers/Customers/CustomerFloatingActions.js
similarity index 66%
rename from client/src/containers/Customers/CustomerFooter.js
rename to client/src/containers/Customers/CustomerFloatingActions.js
index f1c0aaf51..645bf4561 100644
--- a/client/src/containers/Customers/CustomerFooter.js
+++ b/client/src/containers/Customers/CustomerFloatingActions.js
@@ -1,16 +1,19 @@
import React from 'react';
import { Intent, Button } from '@blueprintjs/core';
import { FormattedMessage as T } from 'react-intl';
+import classNames from 'classnames';
+import { CLASSES } from 'common/classes';
-export default function CustomerFloatingFooter({
- formik: { isSubmitting, resetForm },
+export default function CustomerFloatingActions({
+ isSubmitting,
+ resetForm,
onSubmitClick,
onCancelClick,
- customer,
+ customerId,
}) {
return (
-
+
-
-