@@ -177,7 +193,22 @@ function PaymentReceiveFormHeader({
Intent.DANGER
}
minimal={true}
+ rightElement={
+
,
+ }}
+ tooltip={true}
+ tooltipProps={{
+ content:
+ 'Setting your auto-generated Payment Receive number',
+ position: Position.BOTTOM_LEFT,
+ }}
+ />
+ }
{...getFieldProps('payment_receive_no')}
+ onBlur={handlePaymentReceiveNumberChanged}
/>
@@ -255,4 +286,5 @@ export default compose(
withAccounts(({ accountsList }) => ({
accountsList,
})),
+ withDialogActions,
)(PaymentReceiveFormHeader);
diff --git a/client/src/containers/Sales/PaymentReceive/PaymentReceiveFormPage.js b/client/src/containers/Sales/PaymentReceive/PaymentReceiveFormPage.js
index 830013ae3..6ba860620 100644
--- a/client/src/containers/Sales/PaymentReceive/PaymentReceiveFormPage.js
+++ b/client/src/containers/Sales/PaymentReceive/PaymentReceiveFormPage.js
@@ -35,17 +35,6 @@ function PaymentReceiveFormPage({
requestFetchCustomers
}) {
const { id: paymentReceiveId } = useParams();
- const { formatMessage } = useIntl();
-
- useEffect(() => {
- console.log(paymentReceiveId, 'X');
-
- if (paymentReceiveId) {
- changePageTitle(formatMessage({ id: 'edit_payment_receive' }));
- } else {
- changePageTitle(formatMessage({ id: 'payment_receive' }));
- }
- }, [changePageTitle, paymentReceiveId, formatMessage]);
// Fetches payment recevie details.
const fetchPaymentReceive = useQuery(
@@ -72,7 +61,7 @@ function PaymentReceiveFormPage({
loading={
fetchPaymentReceive.isFetching ||
fetchAccounts.isFetching ||
- fetchSettings.isFetching ||
+ // fetchSettings.isFetching ||
fetchCustomers.isFetching
}>
{
const getPyamentReceivesItems = getPaymentReceiveCurrentPageFactory();
const getPyamentReceivesPaginationMeta = getPaymentReceivePaginationMetaFactory();
@@ -17,8 +16,14 @@ export default (mapState) => {
paymentReceivesViews: getResourceViews(state, props, 'payment_receives'),
paymentReceivesItems: state.paymentReceives.items,
paymentReceivesTableQuery: query,
- paymentReceivesPageination: getPyamentReceivesPaginationMeta(state, props, query),
+ paymentReceivesPageination: getPyamentReceivesPaginationMeta(
+ state,
+ props,
+ query,
+ ),
paymentReceivesLoading: state.paymentReceives.loading,
+
+ paymentReceiveNumberChanged: state.paymentReceives.journalNumberChanged,
};
return mapState ? mapState(mapped, state, props) : mapped;
};
diff --git a/client/src/containers/Sales/PaymentReceive/withPaymentReceivesActions.js b/client/src/containers/Sales/PaymentReceive/withPaymentReceivesActions.js
index e2b549fa8..4b526a95c 100644
--- a/client/src/containers/Sales/PaymentReceive/withPaymentReceivesActions.js
+++ b/client/src/containers/Sales/PaymentReceive/withPaymentReceivesActions.js
@@ -13,7 +13,7 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(submitPaymentReceive({ form })),
requestFetchPaymentReceive: (id) => dispatch(fetchPaymentReceive({ id })),
requestEditPaymentReceive: (id, form) =>
- dispatch(editPaymentReceive( id, form )),
+ dispatch(editPaymentReceive(id, form)),
requestDeletePaymentReceive: (id) => dispatch(deletePaymentReceive({ id })),
requestFetchPaymentReceiveTable: (query = {}) =>
dispatch(fetchPaymentReceivesTable({ query: { ...query } })),
@@ -29,6 +29,10 @@ const mapDispatchToProps = (dispatch) => ({
type: t.PAYMENT_RECEIVE_TABLE_QUERIES_ADD,
queries,
}),
+ setPaymentReceiveNumberChanged: (isChanged) =>
+ dispatch({
+ type: t.PAYMENT_RECEIVE_NUMBER_CHANGED,
+ payload: { isChanged },
+ }),
});
-
export default connect(null, mapDispatchToProps);
diff --git a/client/src/containers/Settings/withSettings.js b/client/src/containers/Settings/withSettings.js
index 7b08010e2..1713f375d 100644
--- a/client/src/containers/Settings/withSettings.js
+++ b/client/src/containers/Settings/withSettings.js
@@ -6,7 +6,7 @@ export default (mapState) => {
organizationSettings: state.settings.data.organization,
manualJournalsSettings: state.settings.data.manualJournals,
billsettings: state.settings.data.bills,
- billPaymentSettings: state.settings.data.billPayments,
+ paymentReceiveSettings: state.settings.data.paymentReceives,
estimatesSettings: state.settings.data.salesEstimates,
receiptSettings: state.settings.data.salesReceipts,
invoiceSettings: state.settings.data.salesInvoices,
diff --git a/client/src/store/PaymentReceive/paymentReceive.reducer.js b/client/src/store/PaymentReceive/paymentReceive.reducer.js
index a3c2b0d9b..699c62e49 100644
--- a/client/src/store/PaymentReceive/paymentReceive.reducer.js
+++ b/client/src/store/PaymentReceive/paymentReceive.reducer.js
@@ -1,6 +1,8 @@
import { createReducer } from '@reduxjs/toolkit';
import { createTableQueryReducers } from 'store/queryReducers';
import { omit } from 'lodash';
+import { journalNumberChangedReducer } from 'store/journalNumber.reducer';
+
import t from 'store/types';
const initialState = {
@@ -105,5 +107,7 @@ const reducer = createReducer(initialState, {
},
};
},
+
+ ...journalNumberChangedReducer(t.PAYMENT_RECEIVE_NUMBER_CHANGED),
});
export default createTableQueryReducers('payment_receives', reducer);
diff --git a/client/src/store/PaymentReceive/paymentReceive.type.js b/client/src/store/PaymentReceive/paymentReceive.type.js
index 91249d588..b872d7afd 100644
--- a/client/src/store/PaymentReceive/paymentReceive.type.js
+++ b/client/src/store/PaymentReceive/paymentReceive.type.js
@@ -8,4 +8,6 @@ export default {
PAYMENT_RECEIVES_PAGE_SET: 'PAYMENT_RECEIVES_PAGE_SET',
PAYMENT_RECEIVES_ITEMS_SET: 'PAYMENT_RECEIVES_ITEMS_SET',
PAYMENT_RECEIVES_PAGINATION_SET: 'PAYMENT_RECEIVES_PAGINATION_SET',
+
+ PAYMENT_RECEIVE_NUMBER_CHANGED: 'PAYMENT_RECEIVE_NUMBER_CHANGED',
};