Merge remote-tracking branch 'origin/master'

This commit is contained in:
Ahmed Bouhuolia
2020-11-07 22:02:21 +02:00
6 changed files with 34 additions and 25 deletions

View File

@@ -67,7 +67,9 @@ function PaymentReceiveForm({
const { formatMessage } = useIntl(); const { formatMessage } = useIntl();
const [localPaymentEntries, setLocalPaymentEntries] = useState(paymentReceiveEntries); const [localPaymentEntries, setLocalPaymentEntries] = useState(
paymentReceiveEntries,
);
useEffect(() => { useEffect(() => {
if (localPaymentEntries !== paymentReceiveEntries) { if (localPaymentEntries !== paymentReceiveEntries) {
@@ -340,8 +342,9 @@ function PaymentReceiveForm({
onConfirm={handleConfirmAmountChangeAlert} onConfirm={handleConfirmAmountChangeAlert}
> >
<p> <p>
Changing full amount will change all credits and payment were <T
applied, Is this okay? id={'changing_full_amount_will_change_all_credits_and_payment'}
/>
</p> </p>
</Alert> </Alert>
@@ -354,8 +357,7 @@ function PaymentReceiveForm({
onConfirm={handleConfirmClearLines} onConfirm={handleConfirmClearLines}
> >
<p> <p>
Clearing the table lines will delete all credits and payment were <T id={'clearing_the_table_lines_will_delete_all_credits'} />
applied, Is this okay?
</p> </p>
</Alert> </Alert>
@@ -367,12 +369,12 @@ function PaymentReceiveForm({
onCancel={handleCancelClearFormAlert} onCancel={handleCancelClearFormAlert}
onConfirm={handleConfirmCancelClearFormAlert} onConfirm={handleConfirmCancelClearFormAlert}
> >
<p>Are you sure you want to clear this transaction?</p> <p>
<T id={'are_you_sure_you_want_to_clear_this_transaction'} />
</p>
</Alert> </Alert>
<PaymentReceiveFormFooter <PaymentReceiveFormFooter getFieldProps={getFieldProps} />
getFieldProps={getFieldProps}
/>
<PaymentReceiveFloatingActions <PaymentReceiveFloatingActions
isSubmitting={isSubmitting} isSubmitting={isSubmitting}

View File

@@ -164,7 +164,6 @@ function PaymentReceiveFormHeader({
label={<T id={'payment_receive_no'} />} label={<T id={'payment_receive_no'} />}
inline={true} inline={true}
className={('form-group--payment_receive_no', CLASSES.FILL)} className={('form-group--payment_receive_no', CLASSES.FILL)}
labelInfo={<FieldRequiredHint />}
intent={ intent={
errors.payment_receive_no && errors.payment_receive_no &&
touched.payment_receive_no && touched.payment_receive_no &&

View File

@@ -95,9 +95,13 @@ function PaymentReceivesDataTable({
const actionMenuList = useCallback( const actionMenuList = useCallback(
(paymentReceive) => ( (paymentReceive) => (
<Menu> <Menu>
<MenuItem text={formatMessage({ id: 'view_details' })} /> <MenuItem
icon={<Icon icon="reader-18" />}
text={formatMessage({ id: 'view_details' })}
/>
<MenuDivider /> <MenuDivider />
<MenuItem <MenuItem
icon={<Icon icon="pen-18" />}
text={formatMessage({ id: 'edit_payment_receive' })} text={formatMessage({ id: 'edit_payment_receive' })}
onClick={handleEditPaymentReceive(paymentReceive)} onClick={handleEditPaymentReceive(paymentReceive)}
/> />
@@ -138,7 +142,7 @@ function PaymentReceivesDataTable({
{ {
id: 'payment_receive_no', id: 'payment_receive_no',
Header: formatMessage({ 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, width: 140,
className: 'payment_receive_no', className: 'payment_receive_no',
}, },

View File

@@ -683,12 +683,12 @@ export default {
payment_receive_no_: 'Payment receive no', payment_receive_no_: 'Payment receive no',
receive_amount: 'Receive Amount', receive_amount: 'Receive Amount',
receive_amount_: 'Receive amount', receive_amount_: 'Receive amount',
the_payment_receive_has_been_successfully_created: the_payment_has_been_received_successfully_created:
'The payment receive has been 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 deleted.', 'The payment receive has been successfully deleted.',
the_payment_receive_has_been_successfully_edited: the_payment_has_been_received_successfully_edited:
'The payment receive #{number} has been 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?`, 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', select_invoice: 'Select Invoice',
payment_mades: 'Payment Mades', payment_mades: 'Payment Mades',
@@ -795,5 +795,11 @@ export default {
opening_balance_at: 'Opening balance at', opening_balance_at: 'Opening balance at',
opening_balance: 'Opening balance', opening_balance: 'Opening balance',
balance_currency: 'Balance currency', balance_currency: 'Balance currency',
financial_details: 'Financial details' financial_details: 'Financial details',
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?',
}; };

View File

@@ -111,21 +111,21 @@ export const fetchPaymentReceivesTable = ({ query = {} }) => {
dispatch({ dispatch({
type: t.PAYMENT_RECEIVES_PAGE_SET, type: t.PAYMENT_RECEIVES_PAGE_SET,
payload: { payload: {
payment_receives: response.data.payment_receives.results, payment_receives: response.data.payment_receives,
pagination: response.data.payment_receives.pagination, pagination: response.data.pagination,
customViewId: response.data.customViewId || -1, customViewId: response.data.customViewId || -1,
}, },
}); });
dispatch({ dispatch({
type: t.PAYMENT_RECEIVES_ITEMS_SET, type: t.PAYMENT_RECEIVES_ITEMS_SET,
payload: { payload: {
payment_receives: response.data.payment_receives.results, payment_receives: response.data.payment_receives,
}, },
}); });
dispatch({ dispatch({
type: t.PAYMENT_RECEIVES_PAGINATION_SET, type: t.PAYMENT_RECEIVES_PAGINATION_SET,
payload: { payload: {
pagination: response.data.payment_receives.pagination, pagination: response.data.pagination,
customViewId: response.data.customViewId || -1, customViewId: response.data.customViewId || -1,
}, },
}); });

View File

@@ -71,9 +71,8 @@ const reducer = createReducer(initialState, {
[t.PAYMENT_RECEIVES_PAGINATION_SET]: (state, action) => { [t.PAYMENT_RECEIVES_PAGINATION_SET]: (state, action) => {
const { pagination, customViewId } = action.payload; const { pagination, customViewId } = action.payload;
const mapped = { const mapped = {
pageSize: parseInt(pagination.pageSize, 10), pageSize: parseInt(pagination.page_size, 10),
page: parseInt(pagination.page, 10), page: parseInt(pagination.page, 10),
total: parseInt(pagination.total, 10), total: parseInt(pagination.total, 10),
}; };
@@ -96,7 +95,6 @@ const reducer = createReducer(initialState, {
const viewId = customViewId || -1; const viewId = customViewId || -1;
const view = state.views[viewId] || {}; const view = state.views[viewId] || {};
state.views[viewId] = { state.views[viewId] = {
...view, ...view,
pages: { pages: {