diff --git a/client/src/containers/Customers/CustomerAddressTabs.js b/client/src/containers/Customers/CustomerAddressTabs.js
index 0ce413739..bc6e067b4 100644
--- a/client/src/containers/Customers/CustomerAddressTabs.js
+++ b/client/src/containers/Customers/CustomerAddressTabs.js
@@ -222,22 +222,22 @@ const CustomerBillingAddress = ({
label={}
className={'form-group--journal-number'}
intent={
- errors.billing_address_1 &&
- touched.billing_address_1 &&
+ errors.shipping_address_1 &&
+ touched.shipping_address_1 &&
Intent.DANGER
}
inline={true}
helperText={
-
+
}
>
{/*------------ Shipping Address 2 -----------*/}
@@ -245,22 +245,22 @@ const CustomerBillingAddress = ({
label={}
className={'form-group--journal-number'}
intent={
- errors.billing_address_2 &&
- touched.billing_address_2 &&
+ errors.shipping_address_2 &&
+ touched.shipping_address_2 &&
Intent.DANGER
}
inline={true}
helperText={
-
+
}
>
{/*------------ Shipping Address city -----------*/}
diff --git a/client/src/containers/Customers/CustomerForm.js b/client/src/containers/Customers/CustomerForm.js
index 29380102e..bfa5fd523 100644
--- a/client/src/containers/Customers/CustomerForm.js
+++ b/client/src/containers/Customers/CustomerForm.js
@@ -79,10 +79,10 @@ function CustomerForm({
.required()
.label(formatMessage({ id: 'display_name_' })),
- email: Yup.string().email(),
+ email: Yup.string().email().nullable(),
work_phone: Yup.number(),
personal_phone: Yup.number(),
- website: Yup.string().url(),
+ website: Yup.string().url().nullable(),
active: Yup.boolean(),
note: Yup.string().trim(),
@@ -103,7 +103,7 @@ function CustomerForm({
shipping_address_postcode: Yup.number().nullable(),
shipping_address_phone: Yup.number(),
- opening_balance: Yup.number(),
+ opening_balance: Yup.number().nullable(),
currency_code: Yup.string(),
opening_balance_at: Yup.date(),
});
diff --git a/client/src/containers/Customers/CustomerTable.js b/client/src/containers/Customers/CustomerTable.js
index 909d682b0..0bcc12e01 100644
--- a/client/src/containers/Customers/CustomerTable.js
+++ b/client/src/containers/Customers/CustomerTable.js
@@ -122,7 +122,12 @@ const CustomerTable = ({
{
id: 'phone_number',
Header: formatMessage({ id: 'phone_number' }),
- accessor: 'work_phone',
+ accessor: (row) => (
+
+
{row.work_phone}
+
{row.personal_phone}
+
+ ),
className: 'phone_number',
width: 100,
},
diff --git a/client/src/store/customers/customers.actions.js b/client/src/store/customers/customers.actions.js
index cda05ee0f..968c1b6db 100644
--- a/client/src/store/customers/customers.actions.js
+++ b/client/src/store/customers/customers.actions.js
@@ -37,7 +37,7 @@ export const fetchCustomers = ({ query }) => {
return (dispatch, getState) =>
new Promise((resolve, reject) => {
const pageQuery = getState().customers.tableQuery;
-
+
dispatch({
type: t.CUSTOMERS_TABLE_LOADING,
payload: { loading: true },
@@ -99,14 +99,14 @@ export const fetchCustomer = ({ id }) => {
export const deleteCustomer = ({ id }) => {
return (dispatch) =>
- new Promise((resolve, reject) => {
+ new Promise((resovle, reject) => {
ApiService.delete(`customers/${id}`)
.then((response) => {
dispatch({
type: t.CUSTOMER_DELETE,
payload: { id },
});
- resolve(response);
+ resovle(response);
})
.catch((error) => {
reject(error.response.data.errors || []);
diff --git a/client/src/store/customers/customers.reducer.js b/client/src/store/customers/customers.reducer.js
index 481cd6916..fb95f60bc 100644
--- a/client/src/store/customers/customers.reducer.js
+++ b/client/src/store/customers/customers.reducer.js
@@ -55,9 +55,8 @@ const customersReducer = createReducer(initialState, {
[t.CUSTOMER_DELETE]: (state, action) => {
const { id } = action.payload;
-
if (typeof state.items[id] !== 'undefined') {
- delete state.items[action.id];
+ delete state.items[id];
}
},