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

View File

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

View File

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

View File

@@ -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,7 +784,7 @@ 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',
@@ -795,5 +795,11 @@ export default {
opening_balance_at: 'Opening balance at',
opening_balance: 'Opening balance',
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({
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,
},
});

View File

@@ -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: {