From 435e4c3b994bb485cd875c2ceb6c65a96e906622 Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Sat, 7 Nov 2020 19:08:42 +0200 Subject: [PATCH] Fix : Payment Receive List --- .../PaymentReceive/PaymentReceiveForm.js | 20 ++++++++++--------- .../PaymentReceiveFormHeader.js | 1 - .../PaymentReceivesDataTable.js | 8 ++++++-- client/src/lang/en/index.js | 19 +++++++++++------- .../PaymentReceive/paymentReceive.actions.js | 8 ++++---- .../PaymentReceive/paymentReceive.reducer.js | 4 +--- 6 files changed, 34 insertions(+), 26 deletions(-) diff --git a/client/src/containers/Sales/PaymentReceive/PaymentReceiveForm.js b/client/src/containers/Sales/PaymentReceive/PaymentReceiveForm.js index 38cb287dd..e59270b82 100644 --- a/client/src/containers/Sales/PaymentReceive/PaymentReceiveForm.js +++ b/client/src/containers/Sales/PaymentReceive/PaymentReceiveForm.js @@ -67,7 +67,9 @@ function PaymentReceiveForm({ const { formatMessage } = useIntl(); - const [localPaymentEntries, setLocalPaymentEntries] = useState(paymentReceiveEntries); + const [localPaymentEntries, setLocalPaymentEntries] = useState( + paymentReceiveEntries, + ); useEffect(() => { if (localPaymentEntries !== paymentReceiveEntries) { @@ -340,8 +342,9 @@ function PaymentReceiveForm({ onConfirm={handleConfirmAmountChangeAlert} >

- Changing full amount will change all credits and payment were - applied, Is this okay? +

@@ -354,8 +357,7 @@ function PaymentReceiveForm({ onConfirm={handleConfirmClearLines} >

- Clearing the table lines will delete all credits and payment were - applied, Is this okay? +

@@ -367,12 +369,12 @@ function PaymentReceiveForm({ onCancel={handleCancelClearFormAlert} onConfirm={handleConfirmCancelClearFormAlert} > -

Are you sure you want to clear this transaction?

+

+ +

- + } inline={true} className={('form-group--payment_receive_no', CLASSES.FILL)} - labelInfo={} intent={ errors.payment_receive_no && touched.payment_receive_no && diff --git a/client/src/containers/Sales/PaymentReceive/PaymentReceivesDataTable.js b/client/src/containers/Sales/PaymentReceive/PaymentReceivesDataTable.js index 0036f32e6..acacb7e4a 100644 --- a/client/src/containers/Sales/PaymentReceive/PaymentReceivesDataTable.js +++ b/client/src/containers/Sales/PaymentReceive/PaymentReceivesDataTable.js @@ -95,9 +95,13 @@ function PaymentReceivesDataTable({ const actionMenuList = useCallback( (paymentReceive) => ( - + } + text={formatMessage({ id: 'view_details' })} + /> } text={formatMessage({ id: 'edit_payment_receive' })} onClick={handleEditPaymentReceive(paymentReceive)} /> @@ -138,7 +142,7 @@ function PaymentReceivesDataTable({ { id: 'payment_receive_no', Header: formatMessage({ id: 'payment_receive_no' }), - accessor: (row) => `#${row.payment_receive_no}`, + accessor: (row) => (row.payment_receive_no ? `#${row.payment_receive_no}` : null), width: 140, className: 'payment_receive_no', }, diff --git a/client/src/lang/en/index.js b/client/src/lang/en/index.js index d9ba48e51..cf2bea247 100644 --- a/client/src/lang/en/index.js +++ b/client/src/lang/en/index.js @@ -683,12 +683,12 @@ export default { payment_receive_no_: 'Payment receive no', receive_amount: 'Receive Amount', receive_amount_: 'Receive amount', - the_payment_receive_has_been_successfully_created: - 'The payment receive has been successfully created.', + the_payment_has_been_received_successfully_created: + 'The payment has been received successfully created.', the_payment_receive_has_been_successfully_deleted: 'The payment receive has been successfully deleted.', - the_payment_receive_has_been_successfully_edited: - 'The payment receive #{number} has been successfully edited.', + the_payment_has_been_received_successfully_edited: + 'The payment has been received successfully edited.', once_delete_this_payment_receive_you_will_able_to_restore_it: `Once you delete this payment receive, you won\'t be able to restore it later. Are you sure you want to delete this payment receive?`, select_invoice: 'Select Invoice', payment_mades: 'Payment Mades', @@ -784,11 +784,16 @@ export default { invoice_number_settings: 'Invoice Number Settings', receipt_number: 'Receipt Number', estimate_number_is_not_unqiue: 'Estimate number is not unqiue', - invoice_number_is_not_unqiue: 'Invoice number is not unqiue', + invoice_number_is_not_unqiue: 'Invoice number is not unqiue', sale_receipt_number_not_unique: 'Receipt number is not unique', sale_invoice_number_is_exists: 'Sale invoice number is exists', - bill_number_exists:'Bill number exists', + bill_number_exists: 'Bill number exists', ok: 'Ok!', quantity_cannot_be_zero_or_empty: 'Quantity cannot be zero or empty.', - + are_you_sure_you_want_to_clear_this_transaction: + 'Are you sure you want to clear this transaction?', + clearing_the_table_lines_will_delete_all_credits: + 'Clearing the table lines will delete all credits and payment were applied, Is this okay?', + changing_full_amount_will_change_all_credits_and_payment: + ' Changing full amount will change all credits and payment were applied, Is this okay?', }; diff --git a/client/src/store/PaymentReceive/paymentReceive.actions.js b/client/src/store/PaymentReceive/paymentReceive.actions.js index a9078e110..58af1ec59 100644 --- a/client/src/store/PaymentReceive/paymentReceive.actions.js +++ b/client/src/store/PaymentReceive/paymentReceive.actions.js @@ -111,21 +111,21 @@ export const fetchPaymentReceivesTable = ({ query = {} }) => { dispatch({ type: t.PAYMENT_RECEIVES_PAGE_SET, payload: { - payment_receives: response.data.payment_receives.results, - pagination: response.data.payment_receives.pagination, + payment_receives: response.data.payment_receives, + pagination: response.data.pagination, customViewId: response.data.customViewId || -1, }, }); dispatch({ type: t.PAYMENT_RECEIVES_ITEMS_SET, payload: { - payment_receives: response.data.payment_receives.results, + payment_receives: response.data.payment_receives, }, }); dispatch({ type: t.PAYMENT_RECEIVES_PAGINATION_SET, payload: { - pagination: response.data.payment_receives.pagination, + pagination: response.data.pagination, customViewId: response.data.customViewId || -1, }, }); diff --git a/client/src/store/PaymentReceive/paymentReceive.reducer.js b/client/src/store/PaymentReceive/paymentReceive.reducer.js index 83b1df220..a3c2b0d9b 100644 --- a/client/src/store/PaymentReceive/paymentReceive.reducer.js +++ b/client/src/store/PaymentReceive/paymentReceive.reducer.js @@ -71,9 +71,8 @@ const reducer = createReducer(initialState, { [t.PAYMENT_RECEIVES_PAGINATION_SET]: (state, action) => { const { pagination, customViewId } = action.payload; - const mapped = { - pageSize: parseInt(pagination.pageSize, 10), + pageSize: parseInt(pagination.page_size, 10), page: parseInt(pagination.page, 10), total: parseInt(pagination.total, 10), }; @@ -96,7 +95,6 @@ const reducer = createReducer(initialState, { const viewId = customViewId || -1; const view = state.views[viewId] || {}; - state.views[viewId] = { ...view, pages: {