mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 07:10:33 +00:00
fix: payment receive and made.
This commit is contained in:
@@ -1,38 +1,37 @@
|
|||||||
import React, { useMemo, useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import { CloudLoadingIndicator } from 'components';
|
import { CloudLoadingIndicator } from 'components';
|
||||||
import { Button } from '@blueprintjs/core';
|
|
||||||
import { FormattedMessage as T } from 'react-intl';
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { CLASSES } from 'common/classes';
|
import { CLASSES } from 'common/classes';
|
||||||
import { DataTableEditable } from 'components';
|
import { DataTableEditable } from 'components';
|
||||||
import { usePaymentMadeEntriesTableColumns } from './components';
|
import { usePaymentMadeEntriesTableColumns } from './components';
|
||||||
|
|
||||||
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
|
import { usePaymentMadeInnerContext } from './PaymentMadeInnerProvider';
|
||||||
import { compose, updateTableRow, safeSumBy } from 'utils';
|
import { compose, updateTableRow } from 'utils';
|
||||||
import withAlertActions from 'containers/Alert/withAlertActions';
|
import { useFormikContext } from 'formik';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Payment made items table.
|
* Payment made items table.
|
||||||
*/
|
*/
|
||||||
function PaymentMadeEntriesTable({
|
export default function PaymentMadeEntriesTable({
|
||||||
onUpdateData,
|
onUpdateData,
|
||||||
entries,
|
entries,
|
||||||
|
|
||||||
// #withAlertsActions
|
|
||||||
openAlert,
|
|
||||||
}) {
|
}) {
|
||||||
const { paymentVendorId, isDueBillsFetching } = usePaymentMadeFormContext();
|
// Payment made inner context.
|
||||||
|
const { isNewEntriesFetching } = usePaymentMadeInnerContext();
|
||||||
|
|
||||||
|
// Payment entries table columns.
|
||||||
const columns = usePaymentMadeEntriesTableColumns();
|
const columns = usePaymentMadeEntriesTableColumns();
|
||||||
|
|
||||||
|
// Formik context.
|
||||||
|
const { values: { vendor_id } } = useFormikContext();
|
||||||
|
|
||||||
// Handle update data.
|
// Handle update data.
|
||||||
const handleUpdateData = useCallback(
|
const handleUpdateData = useCallback(
|
||||||
(rowIndex, columnId, value) => {
|
(rowIndex, columnId, value) => {
|
||||||
const newRows = compose(updateTableRow(rowIndex, columnId, value))(
|
const newRows = compose(updateTableRow(rowIndex, columnId, value))(
|
||||||
entries,
|
entries,
|
||||||
);
|
);
|
||||||
|
|
||||||
onUpdateData(newRows);
|
onUpdateData(newRows);
|
||||||
},
|
},
|
||||||
[onUpdateData, entries],
|
[onUpdateData, entries],
|
||||||
@@ -40,14 +39,14 @@ function PaymentMadeEntriesTable({
|
|||||||
|
|
||||||
// Detarmines the right no results message before selecting vendor and aftering
|
// Detarmines the right no results message before selecting vendor and aftering
|
||||||
// selecting vendor id.
|
// selecting vendor id.
|
||||||
const noResultsMessage = paymentVendorId
|
const noResultsMessage = vendor_id
|
||||||
? 'There is no payable bills for this vendor that can be applied for this payment'
|
? 'There is no payable bills for this vendor that can be applied for this payment'
|
||||||
: 'Please select a vendor to display all open bills for it.';
|
: 'Please select a vendor to display all open bills for it.';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CloudLoadingIndicator isLoading={isDueBillsFetching}>
|
<CloudLoadingIndicator isLoading={isNewEntriesFetching}>
|
||||||
<DataTableEditable
|
<DataTableEditable
|
||||||
progressBarLoading={isDueBillsFetching}
|
progressBarLoading={isNewEntriesFetching}
|
||||||
className={classNames(CLASSES.DATATABLE_EDITOR_ITEMS_ENTRIES)}
|
className={classNames(CLASSES.DATATABLE_EDITOR_ITEMS_ENTRIES)}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
data={entries}
|
data={entries}
|
||||||
@@ -62,5 +61,3 @@ function PaymentMadeEntriesTable({
|
|||||||
</CloudLoadingIndicator>
|
</CloudLoadingIndicator>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default compose(withAlertActions)(PaymentMadeEntriesTable);
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ export default function PaymentMadeFormBody() {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</FastField>
|
</FastField>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { useFormikContext } from 'formik';
|
import { useFormikContext } from 'formik';
|
||||||
import { isEmpty } from 'lodash';
|
|
||||||
import React, { createContext, useContext, useEffect } from 'react';
|
import React, { createContext, useContext, useEffect } from 'react';
|
||||||
import { usePaymentMadeNewPageEntries } from 'hooks/query';
|
import { usePaymentMadeNewPageEntries } from 'hooks/query';
|
||||||
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
|
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
|
||||||
|
import { transformToNewPageEntries } from './utils';
|
||||||
|
|
||||||
const PaymentMadeInnerContext = createContext();
|
const PaymentMadeInnerContext = createContext();
|
||||||
|
|
||||||
@@ -10,6 +10,7 @@ const PaymentMadeInnerContext = createContext();
|
|||||||
* Payment made inner form provider.
|
* Payment made inner form provider.
|
||||||
*/
|
*/
|
||||||
function PaymentMadeInnerProvider({ ...props }) {
|
function PaymentMadeInnerProvider({ ...props }) {
|
||||||
|
// Payment made form context.
|
||||||
const { isNewMode } = usePaymentMadeFormContext();
|
const { isNewMode } = usePaymentMadeFormContext();
|
||||||
|
|
||||||
// Formik context.
|
// Formik context.
|
||||||
@@ -27,16 +28,16 @@ function PaymentMadeInnerProvider({ ...props }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isNewEntriesFetching && !isEmpty(newPageEntries)) {
|
if (!isNewEntriesFetching && newPageEntries && isNewMode) {
|
||||||
setFieldValue('entries', newPageEntries)
|
setFieldValue('entries', transformToNewPageEntries(newPageEntries));
|
||||||
}
|
}
|
||||||
}, [isNewEntriesFetching, newPageEntries, setFieldValue]);
|
}, [isNewEntriesFetching, newPageEntries, isNewMode, setFieldValue]);
|
||||||
|
|
||||||
// Provider payload.
|
// Provider payload.
|
||||||
const provider = {
|
const provider = {
|
||||||
newPageEntries,
|
newPageEntries,
|
||||||
isNewEntriesLoading,
|
isNewEntriesLoading,
|
||||||
isNewEntriesFetching
|
isNewEntriesFetching,
|
||||||
};
|
};
|
||||||
|
|
||||||
return <PaymentMadeInnerContext.Provider value={provider} {...props} />;
|
return <PaymentMadeInnerContext.Provider value={provider} {...props} />;
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ export function usePaymentMadeEntriesTableColumns() {
|
|||||||
Cell: BillDateCell,
|
Cell: BillDateCell,
|
||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
width: 250,
|
width: 250,
|
||||||
|
className: 'bill_date',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: formatMessage({ id: 'bill_number' }),
|
Header: formatMessage({ id: 'bill_number' }),
|
||||||
@@ -85,7 +86,7 @@ export function usePaymentMadeEntriesTableColumns() {
|
|||||||
Cell: MoneyTableCell,
|
Cell: MoneyTableCell,
|
||||||
Footer: AmountFooterCell,
|
Footer: AmountFooterCell,
|
||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
className: '',
|
className: 'amount',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: formatMessage({ id: 'amount_due' }),
|
Header: formatMessage({ id: 'amount_due' }),
|
||||||
@@ -93,7 +94,7 @@ export function usePaymentMadeEntriesTableColumns() {
|
|||||||
Cell: MoneyTableCell,
|
Cell: MoneyTableCell,
|
||||||
Footer: DueAmountFooterCell,
|
Footer: DueAmountFooterCell,
|
||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
className: '',
|
className: 'due_amount',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: formatMessage({ id: 'payment_amount' }),
|
Header: formatMessage({ id: 'payment_amount' }),
|
||||||
@@ -101,7 +102,7 @@ export function usePaymentMadeEntriesTableColumns() {
|
|||||||
Cell: MoneyFieldCell,
|
Cell: MoneyFieldCell,
|
||||||
Footer: PaymentAmountFooterCell,
|
Footer: PaymentAmountFooterCell,
|
||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
className: '',
|
className: 'payment_amount',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[formatMessage],
|
[formatMessage],
|
||||||
|
|||||||
@@ -32,7 +32,18 @@ export const transformToEditForm = (paymentMade, paymentMadeEntries) => {
|
|||||||
entries: [
|
entries: [
|
||||||
...paymentMadeEntries.map((paymentMadeEntry) => ({
|
...paymentMadeEntries.map((paymentMadeEntry) => ({
|
||||||
...transformToForm(paymentMadeEntry, defaultPaymentMadeEntry),
|
...transformToForm(paymentMadeEntry, defaultPaymentMadeEntry),
|
||||||
|
payment_amount: paymentMadeEntry.payment_amount || '',
|
||||||
})),
|
})),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transform the new page entries.
|
||||||
|
*/
|
||||||
|
export const transformToNewPageEntries = (entries) => {
|
||||||
|
return entries.map((entry) => ({
|
||||||
|
...transformToForm(entry, defaultPaymentMadeEntry),
|
||||||
|
payment_amount: '',
|
||||||
|
}));
|
||||||
|
}
|
||||||
@@ -54,8 +54,7 @@ export const statusAccessor = (row) => {
|
|||||||
<T
|
<T
|
||||||
id={'day_partially_paid'}
|
id={'day_partially_paid'}
|
||||||
values={{
|
values={{
|
||||||
due: round(row.due_amount, 2),
|
due: <Money amount={row.due_amount} currency={'USD'} />,
|
||||||
currencySign: '$',
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import { Intent } from '@blueprintjs/core';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
|
|
||||||
|
import 'style/pages/PaymentReceive/PageForm.scss';
|
||||||
|
|
||||||
import { CLASSES } from 'common/classes';
|
import { CLASSES } from 'common/classes';
|
||||||
import PaymentReceiveHeader from './PaymentReceiveFormHeader';
|
import PaymentReceiveHeader from './PaymentReceiveFormHeader';
|
||||||
import PaymentReceiveFormBody from './PaymentReceiveFormBody';
|
import PaymentReceiveFormBody from './PaymentReceiveFormBody';
|
||||||
@@ -29,8 +31,6 @@ import {
|
|||||||
transformToEditForm,
|
transformToEditForm,
|
||||||
} from './utils';
|
} from './utils';
|
||||||
|
|
||||||
import 'style/pages/PaymentReceive/PageForm.scss';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Payment Receive form.
|
* Payment Receive form.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ function PaymentReceiveFormProvider({ paymentReceiveId, ...props }) {
|
|||||||
} = usePaymentReceiveEditPage(paymentReceiveId, {
|
} = usePaymentReceiveEditPage(paymentReceiveId, {
|
||||||
enabled: !!paymentReceiveId,
|
enabled: !!paymentReceiveId,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Handle fetch accounts data.
|
// Handle fetch accounts data.
|
||||||
const { data: accounts, isFetching: isAccountsFetching } = useAccounts();
|
const { data: accounts, isFetching: isAccountsFetching } = useAccounts();
|
||||||
|
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ function PaymentReceiveInnerProvider({ ...props }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isDueInvoicesFetching && !isEmpty(dueInvoices)) {
|
if (!isDueInvoicesFetching && dueInvoices && isNewMode) {
|
||||||
setFieldValue('entries', transformInvoicesNewPageEntries(dueInvoices));
|
setFieldValue('entries', transformInvoicesNewPageEntries(dueInvoices));
|
||||||
}
|
}
|
||||||
}, [isDueInvoicesFetching, dueInvoices, setFieldValue]);
|
}, [isDueInvoicesFetching, dueInvoices, isNewMode, setFieldValue]);
|
||||||
|
|
||||||
// Provider payload.
|
// Provider payload.
|
||||||
const provider = {
|
const provider = {
|
||||||
|
|||||||
@@ -1,38 +1,34 @@
|
|||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import { Button } from '@blueprintjs/core';
|
|
||||||
import { FormattedMessage as T } from 'react-intl';
|
|
||||||
import { CloudLoadingIndicator } from 'components';
|
import { CloudLoadingIndicator } from 'components';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import { useFormikContext } from 'formik';
|
||||||
|
|
||||||
import { CLASSES } from 'common/classes';
|
import { CLASSES } from 'common/classes';
|
||||||
import { usePaymentReceiveFormContext } from './PaymentReceiveFormProvider';
|
import { usePaymentReceiveInnerContext } from './PaymentReceiveInnerProvider';
|
||||||
import { DataTableEditable } from 'components';
|
import { DataTableEditable } from 'components';
|
||||||
import { usePaymentReceiveEntriesColumns } from './components';
|
import { usePaymentReceiveEntriesColumns } from './components';
|
||||||
import { compose, updateTableRow, safeSumBy } from 'utils';
|
import { compose, updateTableRow } from 'utils';
|
||||||
import withAlertActions from 'containers/Alert/withAlertActions';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Payment receive items table.
|
* Payment receive items table.
|
||||||
*/
|
*/
|
||||||
function PaymentReceiveItemsTable({
|
export default function PaymentReceiveItemsTable({
|
||||||
entries,
|
entries,
|
||||||
onUpdateData,
|
onUpdateData,
|
||||||
|
|
||||||
// #withDialogActions
|
|
||||||
openAlert
|
|
||||||
}) {
|
}) {
|
||||||
// Payment receive form context.
|
// Payment receive form context.
|
||||||
const {
|
const {
|
||||||
isDueInvoicesFetching,
|
isDueInvoicesFetching,
|
||||||
paymentCustomerId,
|
} = usePaymentReceiveInnerContext();
|
||||||
} = usePaymentReceiveFormContext();
|
|
||||||
|
|
||||||
// Payment receive entries form context.
|
// Payment receive entries form context.
|
||||||
const columns = usePaymentReceiveEntriesColumns();
|
const columns = usePaymentReceiveEntriesColumns();
|
||||||
|
|
||||||
|
// Formik context.
|
||||||
|
const { values: { customer_id } } = useFormikContext();
|
||||||
|
|
||||||
// No results message.
|
// No results message.
|
||||||
const noResultsMessage = paymentCustomerId
|
const noResultsMessage = customer_id
|
||||||
? 'There is no receivable invoices for this customer that can be applied for this payment'
|
? 'There is no receivable invoices for this customer that can be applied for this payment'
|
||||||
: 'Please select a customer to display all open invoices for it.';
|
: 'Please select a customer to display all open invoices for it.';
|
||||||
|
|
||||||
@@ -63,5 +59,3 @@ function PaymentReceiveItemsTable({
|
|||||||
</CloudLoadingIndicator>
|
</CloudLoadingIndicator>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default compose(withAlertActions)(PaymentReceiveItemsTable);
|
|
||||||
@@ -32,6 +32,7 @@ export const transformToEditForm = (paymentReceive, paymentReceiveEntries) => ({
|
|||||||
entries: [
|
entries: [
|
||||||
...paymentReceiveEntries.map((paymentReceiveEntry) => ({
|
...paymentReceiveEntries.map((paymentReceiveEntry) => ({
|
||||||
...transformToForm(paymentReceiveEntry, defaultPaymentReceiveEntry),
|
...transformToForm(paymentReceiveEntry, defaultPaymentReceiveEntry),
|
||||||
|
payment_amount: paymentReceiveEntry.payment_amount || '',
|
||||||
})),
|
})),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
@@ -47,7 +48,7 @@ export const transformInvoicesNewPageEntries = (invoices) => [
|
|||||||
due_amount: invoice.due_amount,
|
due_amount: invoice.due_amount,
|
||||||
date: invoice.invoice_date,
|
date: invoice.invoice_date,
|
||||||
amount: invoice.balance,
|
amount: invoice.balance,
|
||||||
payment_amount: 0,
|
payment_amount: '',
|
||||||
invoice_no: invoice.invoice_no,
|
invoice_no: invoice.invoice_no,
|
||||||
total_payment_amount: invoice.payment_amount,
|
total_payment_amount: invoice.payment_amount,
|
||||||
})),
|
})),
|
||||||
|
|||||||
@@ -114,13 +114,6 @@ export function usePaymentReceivesColumns() {
|
|||||||
width: 140,
|
width: 140,
|
||||||
className: 'payment_receive_no',
|
className: 'payment_receive_no',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: 'reference_no',
|
|
||||||
Header: formatMessage({ id: 'reference_no' }),
|
|
||||||
accessor: 'reference_no',
|
|
||||||
width: 140,
|
|
||||||
className: 'reference_no',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: 'deposit_account',
|
id: 'deposit_account',
|
||||||
Header: formatMessage({ id: 'deposit_account' }),
|
Header: formatMessage({ id: 'deposit_account' }),
|
||||||
@@ -128,6 +121,13 @@ export function usePaymentReceivesColumns() {
|
|||||||
width: 140,
|
width: 140,
|
||||||
className: 'deposit_account_id',
|
className: 'deposit_account_id',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'reference_no',
|
||||||
|
Header: formatMessage({ id: 'reference_no' }),
|
||||||
|
accessor: 'reference_no',
|
||||||
|
width: 140,
|
||||||
|
className: 'reference_no',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'actions',
|
id: 'actions',
|
||||||
Header: '',
|
Header: '',
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ export function ActionsMenu({
|
|||||||
/>
|
/>
|
||||||
<If condition={!receipt.is_closed}>
|
<If condition={!receipt.is_closed}>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
|
icon={<Icon icon={'check'} iconSize={18} />}
|
||||||
text={formatMessage({ id: 'mark_as_closed' })}
|
text={formatMessage({ id: 'mark_as_closed' })}
|
||||||
onClick={safeCallback(onClose, receipt)}
|
onClick={safeCallback(onClose, receipt)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -147,6 +147,12 @@ export function useDueInvoices(customerId, props) {
|
|||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
select: (res) => res.data.sales_invoices,
|
select: (res) => res.data.sales_invoices,
|
||||||
|
initialDataUpdatedAt: 0,
|
||||||
|
initialData: {
|
||||||
|
data: {
|
||||||
|
sales_invoices: [],
|
||||||
|
},
|
||||||
|
},
|
||||||
...props,
|
...props,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -131,6 +131,12 @@ export function usePaymentMadeNewPageEntries(vendorId, props) {
|
|||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
select: (res) => res.data.entries,
|
select: (res) => res.data.entries,
|
||||||
|
initialDataUpdatedAt: 0,
|
||||||
|
initialData: {
|
||||||
|
data: {
|
||||||
|
entries: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
...props,
|
...props,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -861,7 +861,7 @@ export default {
|
|||||||
deliver_and_new: 'Deliver and new',
|
deliver_and_new: 'Deliver and new',
|
||||||
deliver_continue_editing: 'Deliver (continue editing)',
|
deliver_continue_editing: 'Deliver (continue editing)',
|
||||||
due_in: 'Due in {due} day.',
|
due_in: 'Due in {due} day.',
|
||||||
day_partially_paid: 'Partially paid, {currencySign}{due} due.',
|
day_partially_paid: 'Partially paid, {due} due.',
|
||||||
overdue_by: 'Overdue by {overdue} day.',
|
overdue_by: 'Overdue by {overdue} day.',
|
||||||
paid: 'Paid',
|
paid: 'Paid',
|
||||||
your_account_has_been_locked:
|
your_account_has_been_locked:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
const initialState = {
|
const initialState = {
|
||||||
tableState: {
|
tableState: {
|
||||||
pageSize: 12,
|
pageSize: 12,
|
||||||
pageIndex: 1,
|
pageIndex: 0,
|
||||||
sortBy: [],
|
sortBy: [],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -44,9 +44,6 @@ body.hide-scrollbar .Pane2{
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.bp3-fill{
|
.bp3-fill{
|
||||||
.bp3-popover-wrapper,
|
.bp3-popover-wrapper,
|
||||||
.bp3-popover-target {
|
.bp3-popover-target {
|
||||||
@@ -96,8 +93,10 @@ body.hide-scrollbar .Pane2{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.bp3-progress-bar.bp3-intent-primary .bp3-progress-meter{
|
.bp3-progress-bar.bp3-intent-primary .bp3-progress-meter{
|
||||||
background-color: #0066ff;
|
background-color: #0066ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bp3-overlay-backdrop{
|
||||||
|
background-color: rgba(0,10,30, .7);
|
||||||
|
}
|
||||||
@@ -67,6 +67,19 @@ body.page-payment-made-edit{
|
|||||||
}
|
}
|
||||||
|
|
||||||
.table{
|
.table{
|
||||||
|
.th,
|
||||||
|
.td {
|
||||||
|
&.amount,
|
||||||
|
&.due_amount,
|
||||||
|
&.payment_amount {
|
||||||
|
|
||||||
|
&,
|
||||||
|
input {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.tr{
|
.tr{
|
||||||
.td:first-of-type,
|
.td:first-of-type,
|
||||||
.th:first-of-type{
|
.th:first-of-type{
|
||||||
|
|||||||
@@ -70,11 +70,8 @@ body.page-payment-receive-edit{
|
|||||||
}
|
}
|
||||||
|
|
||||||
.table {
|
.table {
|
||||||
|
|
||||||
|
|
||||||
.th,
|
.th,
|
||||||
.td {
|
.td {
|
||||||
|
|
||||||
&.invoice_amount,
|
&.invoice_amount,
|
||||||
&.amount_due,
|
&.amount_due,
|
||||||
&.payment_amount {
|
&.payment_amount {
|
||||||
@@ -87,7 +84,6 @@ body.page-payment-receive-edit{
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tr {
|
.tr {
|
||||||
|
|
||||||
.td:first-of-type,
|
.td:first-of-type,
|
||||||
.th:first-of-type {
|
.th:first-of-type {
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ import { check, param, query, ValidationChain } from 'express-validator';
|
|||||||
import asyncMiddleware from 'api/middleware/asyncMiddleware';
|
import asyncMiddleware from 'api/middleware/asyncMiddleware';
|
||||||
import { ServiceError } from 'exceptions';
|
import { ServiceError } from 'exceptions';
|
||||||
import BaseController from 'api/controllers/BaseController';
|
import BaseController from 'api/controllers/BaseController';
|
||||||
import BillPaymentsService from 'services/Purchases/BillPayments';
|
import BillPaymentsService from 'services/Purchases/BillPayments/BillPayments';
|
||||||
|
import BillPaymentsPages from 'services/Purchases/BillPayments/BillPaymentsPages';
|
||||||
import DynamicListingService from 'services/DynamicListing/DynamicListService';
|
import DynamicListingService from 'services/DynamicListing/DynamicListService';
|
||||||
import AccountsService from 'services/Accounts/AccountsService';
|
import AccountsService from 'services/Accounts/AccountsService';
|
||||||
import ResourceController from '../Resources';
|
|
||||||
import { Request } from 'express-validator/src/base';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bills payments controller.
|
* Bills payments controller.
|
||||||
@@ -25,6 +25,9 @@ export default class BillsPayments extends BaseController {
|
|||||||
@Inject()
|
@Inject()
|
||||||
dynamicListService: DynamicListingService;
|
dynamicListService: DynamicListingService;
|
||||||
|
|
||||||
|
@Inject()
|
||||||
|
billPaymentsPages: BillPaymentsPages;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Router constructor.
|
* Router constructor.
|
||||||
*/
|
*/
|
||||||
@@ -144,7 +147,7 @@ export default class BillsPayments extends BaseController {
|
|||||||
const { vendorId } = this.matchedQueryData(req);
|
const { vendorId } = this.matchedQueryData(req);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const entries = await this.billPaymentService.getNewPageEntries(
|
const entries = await this.billPaymentsPages.getNewPageEntries(
|
||||||
tenantId,
|
tenantId,
|
||||||
vendorId
|
vendorId
|
||||||
);
|
);
|
||||||
@@ -171,7 +174,7 @@ export default class BillsPayments extends BaseController {
|
|||||||
const {
|
const {
|
||||||
billPayment,
|
billPayment,
|
||||||
entries,
|
entries,
|
||||||
} = await this.billPaymentService.getBillPaymentEditPage(
|
} = await this.billPaymentsPages.getBillPaymentEditPage(
|
||||||
tenantId,
|
tenantId,
|
||||||
paymentReceiveId
|
paymentReceiveId
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import { Inject, Service } from 'typedi';
|
|||||||
import { IPaymentReceiveDTO } from 'interfaces';
|
import { IPaymentReceiveDTO } from 'interfaces';
|
||||||
import BaseController from 'api/controllers/BaseController';
|
import BaseController from 'api/controllers/BaseController';
|
||||||
import asyncMiddleware from 'api/middleware/asyncMiddleware';
|
import asyncMiddleware from 'api/middleware/asyncMiddleware';
|
||||||
import PaymentReceiveService from 'services/Sales/PaymentsReceives';
|
import PaymentReceiveService from 'services/Sales/PaymentReceives/PaymentsReceives';
|
||||||
|
import PaymentReceivesPages from 'services/Sales/PaymentReceives/PaymentReceivesPages';
|
||||||
import DynamicListingService from 'services/DynamicListing/DynamicListService';
|
import DynamicListingService from 'services/DynamicListing/DynamicListService';
|
||||||
import { ServiceError } from 'exceptions';
|
import { ServiceError } from 'exceptions';
|
||||||
|
|
||||||
@@ -17,6 +18,9 @@ export default class PaymentReceivesController extends BaseController {
|
|||||||
@Inject()
|
@Inject()
|
||||||
paymentReceiveService: PaymentReceiveService;
|
paymentReceiveService: PaymentReceiveService;
|
||||||
|
|
||||||
|
@Inject()
|
||||||
|
PaymentReceivesPages: PaymentReceivesPages;
|
||||||
|
|
||||||
@Inject()
|
@Inject()
|
||||||
dynamicListService: DynamicListingService;
|
dynamicListService: DynamicListingService;
|
||||||
|
|
||||||
@@ -132,9 +136,7 @@ export default class PaymentReceivesController extends BaseController {
|
|||||||
* @return {Array}
|
* @return {Array}
|
||||||
*/
|
*/
|
||||||
get newPaymentReceiveValidation() {
|
get newPaymentReceiveValidation() {
|
||||||
return [
|
return [...this.paymentReceiveSchema];
|
||||||
...this.paymentReceiveSchema,
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -149,6 +151,9 @@ export default class PaymentReceivesController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Records payment receive to the given customer with associated invoices.
|
* Records payment receive to the given customer with associated invoices.
|
||||||
|
* @param {Request} req
|
||||||
|
* @param {Response} res
|
||||||
|
* @return {Response}
|
||||||
*/
|
*/
|
||||||
async newPaymentReceive(req: Request, res: Response, next: NextFunction) {
|
async newPaymentReceive(req: Request, res: Response, next: NextFunction) {
|
||||||
const { tenantId, user } = req;
|
const { tenantId, user } = req;
|
||||||
@@ -165,6 +170,7 @@ export default class PaymentReceivesController extends BaseController {
|
|||||||
message: 'The payment receive has been created successfully.',
|
message: 'The payment receive has been created successfully.',
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
next(error);
|
next(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -222,39 +228,6 @@ export default class PaymentReceivesController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve the given payment receive details.
|
|
||||||
* @asycn
|
|
||||||
* @param {Request} req -
|
|
||||||
* @param {Response} res -
|
|
||||||
*/
|
|
||||||
async getPaymentReceiveEditPage(
|
|
||||||
req: Request,
|
|
||||||
res: Response,
|
|
||||||
next: NextFunction
|
|
||||||
) {
|
|
||||||
const { tenantId, user } = req;
|
|
||||||
const { id: paymentReceiveId } = req.params;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const {
|
|
||||||
paymentReceive,
|
|
||||||
entries,
|
|
||||||
} = await this.paymentReceiveService.getPaymentReceiveEditPage(
|
|
||||||
tenantId,
|
|
||||||
paymentReceiveId,
|
|
||||||
user
|
|
||||||
);
|
|
||||||
|
|
||||||
return res.status(200).send({
|
|
||||||
payment_receive: this.transfromToResponse({ ...paymentReceive }),
|
|
||||||
entries: this.transfromToResponse([...entries]),
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
next(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve sale invoices that associated with the given payment receive.
|
* Retrieve sale invoices that associated with the given payment receive.
|
||||||
* @param {Request} req
|
* @param {Request} req
|
||||||
@@ -334,7 +307,7 @@ export default class PaymentReceivesController extends BaseController {
|
|||||||
const { customerId } = this.matchedQueryData(req);
|
const { customerId } = this.matchedQueryData(req);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const entries = await this.paymentReceiveService.getNewPageEntries(
|
const entries = await this.PaymentReceivesPages.getNewPageEntries(
|
||||||
tenantId,
|
tenantId,
|
||||||
customerId
|
customerId
|
||||||
);
|
);
|
||||||
@@ -346,6 +319,39 @@ export default class PaymentReceivesController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the given payment receive details.
|
||||||
|
* @asycn
|
||||||
|
* @param {Request} req -
|
||||||
|
* @param {Response} res -
|
||||||
|
*/
|
||||||
|
async getPaymentReceiveEditPage(
|
||||||
|
req: Request,
|
||||||
|
res: Response,
|
||||||
|
next: NextFunction
|
||||||
|
) {
|
||||||
|
const { tenantId, user } = req;
|
||||||
|
const { id: paymentReceiveId } = req.params;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const {
|
||||||
|
paymentReceive,
|
||||||
|
entries,
|
||||||
|
} = await this.PaymentReceivesPages.getPaymentReceiveEditPage(
|
||||||
|
tenantId,
|
||||||
|
paymentReceiveId,
|
||||||
|
user
|
||||||
|
);
|
||||||
|
|
||||||
|
return res.status(200).send({
|
||||||
|
payment_receive: this.transfromToResponse({ ...paymentReceive }),
|
||||||
|
entries: this.transfromToResponse([...entries]),
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
next(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the payment receive details.
|
* Retrieve the payment receive details.
|
||||||
* @param {Request} req
|
* @param {Request} req
|
||||||
@@ -454,6 +460,11 @@ export default class PaymentReceivesController extends BaseController {
|
|||||||
errors: [{ type: 'PAYMENT_CUSTOMER_SHOULD_NOT_UPDATE', code: 1200 }],
|
errors: [{ type: 'PAYMENT_CUSTOMER_SHOULD_NOT_UPDATE', code: 1200 }],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (error.errorType === 'PAYMENT_RECEIVE_NO_REQUIRED') {
|
||||||
|
return res.boom.badRequest(null, {
|
||||||
|
errors: [{ type: 'PAYMENT_RECEIVE_NO_REQUIRED', code: 1300 }],
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
next(error);
|
next(error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import {
|
|||||||
IPaginationMeta,
|
IPaginationMeta,
|
||||||
IFilterMeta,
|
IFilterMeta,
|
||||||
IBillPaymentEntry,
|
IBillPaymentEntry,
|
||||||
IBillReceivePageEntry,
|
|
||||||
} from 'interfaces';
|
} from 'interfaces';
|
||||||
import AccountsService from 'services/Accounts/AccountsService';
|
import AccountsService from 'services/Accounts/AccountsService';
|
||||||
import JournalPoster from 'services/Accounting/JournalPoster';
|
import JournalPoster from 'services/Accounting/JournalPoster';
|
||||||
@@ -28,19 +27,7 @@ import { entriesAmountDiff, formatDateFields } from 'utils';
|
|||||||
import { ServiceError } from 'exceptions';
|
import { ServiceError } from 'exceptions';
|
||||||
import { ACCOUNT_PARENT_TYPE } from 'data/AccountTypes';
|
import { ACCOUNT_PARENT_TYPE } from 'data/AccountTypes';
|
||||||
import VendorsService from 'services/Contacts/VendorsService';
|
import VendorsService from 'services/Contacts/VendorsService';
|
||||||
|
import { ERRORS } from './constants';
|
||||||
const ERRORS = {
|
|
||||||
BILL_VENDOR_NOT_FOUND: 'VENDOR_NOT_FOUND',
|
|
||||||
PAYMENT_MADE_NOT_FOUND: 'PAYMENT_MADE_NOT_FOUND',
|
|
||||||
BILL_PAYMENT_NUMBER_NOT_UNQIUE: 'BILL_PAYMENT_NUMBER_NOT_UNQIUE',
|
|
||||||
PAYMENT_ACCOUNT_NOT_FOUND: 'PAYMENT_ACCOUNT_NOT_FOUND',
|
|
||||||
PAYMENT_ACCOUNT_NOT_CURRENT_ASSET_TYPE:
|
|
||||||
'PAYMENT_ACCOUNT_NOT_CURRENT_ASSET_TYPE',
|
|
||||||
BILL_ENTRIES_IDS_NOT_FOUND: 'BILL_ENTRIES_IDS_NOT_FOUND',
|
|
||||||
BILL_PAYMENT_ENTRIES_NOT_FOUND: 'BILL_PAYMENT_ENTRIES_NOT_FOUND',
|
|
||||||
INVALID_BILL_PAYMENT_AMOUNT: 'INVALID_BILL_PAYMENT_AMOUNT',
|
|
||||||
PAYMENT_NUMBER_SHOULD_NOT_MODIFY: 'PAYMENT_NUMBER_SHOULD_NOT_MODIFY',
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bill payments service.
|
* Bill payments service.
|
||||||
@@ -271,7 +258,7 @@ export default class BillPaymentsService {
|
|||||||
* * Validate the payment vendor whether modified.
|
* * Validate the payment vendor whether modified.
|
||||||
* @param {string} billPaymentNo
|
* @param {string} billPaymentNo
|
||||||
*/
|
*/
|
||||||
validateVendorNotModified(
|
private validateVendorNotModified(
|
||||||
billPaymentDTO: IBillPaymentDTO,
|
billPaymentDTO: IBillPaymentDTO,
|
||||||
oldBillPayment: IBillPayment
|
oldBillPayment: IBillPayment
|
||||||
) {
|
) {
|
||||||
@@ -646,7 +633,6 @@ export default class BillPaymentsService {
|
|||||||
BillPayment,
|
BillPayment,
|
||||||
billPaymentsFilter
|
billPaymentsFilter
|
||||||
);
|
);
|
||||||
|
|
||||||
this.logger.info('[bill_payment] try to get bill payments list.', {
|
this.logger.info('[bill_payment] try to get bill payments list.', {
|
||||||
tenantId,
|
tenantId,
|
||||||
});
|
});
|
||||||
@@ -666,51 +652,6 @@ export default class BillPaymentsService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve bill payment with associated metadata.
|
|
||||||
* @param {number} billPaymentId - The bill payment id.
|
|
||||||
* @return {object}
|
|
||||||
*/
|
|
||||||
public async getBillPaymentEditPage(
|
|
||||||
tenantId: number,
|
|
||||||
billPaymentId: number
|
|
||||||
): Promise<{
|
|
||||||
billPayment: Omit<IBillPayment, 'entries'>;
|
|
||||||
entries: IBillReceivePageEntry[];
|
|
||||||
}> {
|
|
||||||
const { BillPayment, Bill } = this.tenancy.models(tenantId);
|
|
||||||
const billPayment = await BillPayment.query()
|
|
||||||
.findById(billPaymentId)
|
|
||||||
.withGraphFetched('entries.bill');
|
|
||||||
|
|
||||||
// Throw not found the bill payment.
|
|
||||||
if (!billPayment) {
|
|
||||||
throw new ServiceError(ERRORS.PAYMENT_MADE_NOT_FOUND);
|
|
||||||
}
|
|
||||||
const paymentEntries = billPayment.entries.map((entry) => ({
|
|
||||||
...this.mapBillToPageEntry(entry.bill),
|
|
||||||
paymentAmount: entry.paymentAmount,
|
|
||||||
}));
|
|
||||||
|
|
||||||
const resPayableBills = await Bill.query()
|
|
||||||
.modify('dueBills')
|
|
||||||
.where('vendor_id', billPayment.vendorId)
|
|
||||||
.whereNotIn(
|
|
||||||
'id',
|
|
||||||
billPayment.entries.map((e) => e.billId)
|
|
||||||
)
|
|
||||||
.orderBy('bill_date', 'ASC');
|
|
||||||
|
|
||||||
// Mapping the payable bills to entries.
|
|
||||||
const restPayableEntries = resPayableBills.map(this.mapBillToPageEntry);
|
|
||||||
const entries = [...paymentEntries, ...restPayableEntries];
|
|
||||||
|
|
||||||
return {
|
|
||||||
billPayment: omit(billPayment, ['entries']),
|
|
||||||
entries,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves bills payment amount changes different.
|
* Saves bills payment amount changes different.
|
||||||
* @param {number} tenantId -
|
* @param {number} tenantId -
|
||||||
@@ -746,55 +687,4 @@ export default class BillPaymentsService {
|
|||||||
);
|
);
|
||||||
await Promise.all(opers);
|
await Promise.all(opers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrive edit page invoices entries from the given sale invoices models.
|
|
||||||
* @param {ISaleInvoice[]} invoices - Invoices.
|
|
||||||
* @return {IPaymentReceiveEditPageEntry}
|
|
||||||
*/
|
|
||||||
public mapBillToPageEntry(bill: IBill): IBillReceivePageEntry {
|
|
||||||
return {
|
|
||||||
entryType: 'invoice',
|
|
||||||
billId: bill.id,
|
|
||||||
dueAmount: bill.dueAmount + bill.paymentAmount,
|
|
||||||
amount: bill.amount,
|
|
||||||
billNo: bill.billNumber,
|
|
||||||
totalPaymentAmount: bill.paymentAmount,
|
|
||||||
paymentAmount: bill.paymentAmount,
|
|
||||||
date: bill.billDate,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public mapBillToNewPageEntry(bill: IBill): IBillReceivePageEntry {
|
|
||||||
return {
|
|
||||||
entryType: 'invoice',
|
|
||||||
billId: bill.id,
|
|
||||||
dueAmount: bill.dueAmount,
|
|
||||||
amount: bill.amount,
|
|
||||||
billNo: bill.billNumber,
|
|
||||||
date: bill.billDate,
|
|
||||||
totalPaymentAmount: bill.paymentAmount,
|
|
||||||
paymentAmount: 0,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve the payable entries of the new page once vendor be selected.
|
|
||||||
* @param {number} tenantId
|
|
||||||
* @param {number} vendorId
|
|
||||||
*/
|
|
||||||
async getNewPageEntries(
|
|
||||||
tenantId: number,
|
|
||||||
vendorId: number
|
|
||||||
): Promise<IBillReceivePageEntry[]> {
|
|
||||||
const { Bill } = this.tenancy.models(tenantId);
|
|
||||||
|
|
||||||
// Retrieve all payable bills that assocaited to the payment made transaction.
|
|
||||||
const payableBills = await Bill.query()
|
|
||||||
.modify('dueBills')
|
|
||||||
.where('vendor_id', vendorId)
|
|
||||||
.orderBy('bill_date', 'ASC');
|
|
||||||
|
|
||||||
return payableBills.map(this.mapBillToNewPageEntry);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
101
server/src/services/Purchases/BillPayments/BillPaymentsPages.ts
Normal file
101
server/src/services/Purchases/BillPayments/BillPaymentsPages.ts
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
import { Inject, Service } from 'typedi';
|
||||||
|
import { omit } from 'lodash';
|
||||||
|
import TenancyService from 'services/Tenancy/TenancyService';
|
||||||
|
import { IBill, IBillPayment, IBillReceivePageEntry } from 'interfaces';
|
||||||
|
import { ERRORS } from './constants';
|
||||||
|
import { ServiceError } from 'exceptions';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bill payments edit and create pages services.
|
||||||
|
*/
|
||||||
|
@Service()
|
||||||
|
export default class BillPaymentsPages {
|
||||||
|
@Inject()
|
||||||
|
tenancy: TenancyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve bill payment with associated metadata.
|
||||||
|
* @param {number} billPaymentId - The bill payment id.
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
public async getBillPaymentEditPage(
|
||||||
|
tenantId: number,
|
||||||
|
billPaymentId: number
|
||||||
|
): Promise<{
|
||||||
|
billPayment: Omit<IBillPayment, 'entries'>;
|
||||||
|
entries: IBillReceivePageEntry[];
|
||||||
|
}> {
|
||||||
|
const { BillPayment, Bill } = this.tenancy.models(tenantId);
|
||||||
|
const billPayment = await BillPayment.query()
|
||||||
|
.findById(billPaymentId)
|
||||||
|
.withGraphFetched('entries.bill');
|
||||||
|
|
||||||
|
// Throw not found the bill payment.
|
||||||
|
if (!billPayment) {
|
||||||
|
throw new ServiceError(ERRORS.PAYMENT_MADE_NOT_FOUND);
|
||||||
|
}
|
||||||
|
const paymentEntries = billPayment.entries.map((entry) => ({
|
||||||
|
...this.mapBillToPageEntry(entry.bill),
|
||||||
|
dueAmount: entry.bill.dueAmount + entry.paymentAmount,
|
||||||
|
paymentAmount: entry.paymentAmount,
|
||||||
|
}));
|
||||||
|
|
||||||
|
const resPayableBills = await Bill.query()
|
||||||
|
.modify('opened')
|
||||||
|
.modify('dueBills')
|
||||||
|
.where('vendor_id', billPayment.vendorId)
|
||||||
|
.whereNotIn(
|
||||||
|
'id',
|
||||||
|
billPayment.entries.map((e) => e.billId)
|
||||||
|
)
|
||||||
|
.orderBy('bill_date', 'ASC');
|
||||||
|
|
||||||
|
// Mapping the payable bills to entries.
|
||||||
|
const restPayableEntries = resPayableBills.map(this.mapBillToPageEntry);
|
||||||
|
const entries = [...paymentEntries, ...restPayableEntries];
|
||||||
|
|
||||||
|
return {
|
||||||
|
billPayment: omit(billPayment, ['entries']),
|
||||||
|
entries,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the payable entries of the new page once vendor be selected.
|
||||||
|
* @param {number} tenantId
|
||||||
|
* @param {number} vendorId
|
||||||
|
*/
|
||||||
|
public async getNewPageEntries(
|
||||||
|
tenantId: number,
|
||||||
|
vendorId: number
|
||||||
|
): Promise<IBillReceivePageEntry[]> {
|
||||||
|
const { Bill } = this.tenancy.models(tenantId);
|
||||||
|
|
||||||
|
// Retrieve all payable bills that assocaited to the payment made transaction.
|
||||||
|
const payableBills = await Bill.query()
|
||||||
|
.modify('opened')
|
||||||
|
.modify('dueBills')
|
||||||
|
.where('vendor_id', vendorId)
|
||||||
|
.orderBy('bill_date', 'ASC');
|
||||||
|
|
||||||
|
return payableBills.map(this.mapBillToPageEntry);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrive edit page invoices entries from the given sale invoices models.
|
||||||
|
* @param {ISaleInvoice[]} invoices - Invoices.
|
||||||
|
* @return {IPaymentReceiveEditPageEntry}
|
||||||
|
*/
|
||||||
|
private mapBillToPageEntry(bill: IBill): IBillReceivePageEntry {
|
||||||
|
return {
|
||||||
|
entryType: 'invoice',
|
||||||
|
billId: bill.id,
|
||||||
|
dueAmount: bill.dueAmount,
|
||||||
|
amount: bill.amount,
|
||||||
|
billNo: bill.billNumber,
|
||||||
|
totalPaymentAmount: bill.paymentAmount,
|
||||||
|
paymentAmount: bill.paymentAmount,
|
||||||
|
date: bill.billDate,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
12
server/src/services/Purchases/BillPayments/constants.ts
Normal file
12
server/src/services/Purchases/BillPayments/constants.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
export const ERRORS = {
|
||||||
|
BILL_VENDOR_NOT_FOUND: 'VENDOR_NOT_FOUND',
|
||||||
|
PAYMENT_MADE_NOT_FOUND: 'PAYMENT_MADE_NOT_FOUND',
|
||||||
|
BILL_PAYMENT_NUMBER_NOT_UNQIUE: 'BILL_PAYMENT_NUMBER_NOT_UNQIUE',
|
||||||
|
PAYMENT_ACCOUNT_NOT_FOUND: 'PAYMENT_ACCOUNT_NOT_FOUND',
|
||||||
|
PAYMENT_ACCOUNT_NOT_CURRENT_ASSET_TYPE:
|
||||||
|
'PAYMENT_ACCOUNT_NOT_CURRENT_ASSET_TYPE',
|
||||||
|
BILL_ENTRIES_IDS_NOT_FOUND: 'BILL_ENTRIES_IDS_NOT_FOUND',
|
||||||
|
BILL_PAYMENT_ENTRIES_NOT_FOUND: 'BILL_PAYMENT_ENTRIES_NOT_FOUND',
|
||||||
|
INVALID_BILL_PAYMENT_AMOUNT: 'INVALID_BILL_PAYMENT_AMOUNT',
|
||||||
|
PAYMENT_NUMBER_SHOULD_NOT_MODIFY: 'PAYMENT_NUMBER_SHOULD_NOT_MODIFY',
|
||||||
|
};
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
import { Inject, Service } from 'typedi';
|
||||||
|
import { omit } from 'lodash';
|
||||||
|
import {
|
||||||
|
ISaleInvoice,
|
||||||
|
IPaymentReceivePageEntry,
|
||||||
|
IPaymentReceive,
|
||||||
|
ISystemUser,
|
||||||
|
} from 'interfaces';
|
||||||
|
import TenancyService from 'services/Tenancy/TenancyService';
|
||||||
|
import { ServiceError } from 'exceptions';
|
||||||
|
import { ERRORS } from './constants';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Payment receives edit/new pages service.
|
||||||
|
*/
|
||||||
|
@Service()
|
||||||
|
export default class PaymentReceivesPages {
|
||||||
|
@Inject()
|
||||||
|
tenancy: TenancyService;
|
||||||
|
|
||||||
|
@Inject('logger')
|
||||||
|
logger: any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrive page invoices entries from the given sale invoices models.
|
||||||
|
* @param {ISaleInvoice[]} invoices - Invoices.
|
||||||
|
* @return {IPaymentReceivePageEntry}
|
||||||
|
*/
|
||||||
|
private invoiceToPageEntry(invoice: ISaleInvoice): IPaymentReceivePageEntry {
|
||||||
|
return {
|
||||||
|
entryType: 'invoice',
|
||||||
|
invoiceId: invoice.id,
|
||||||
|
dueAmount: invoice.dueAmount,
|
||||||
|
amount: invoice.balance,
|
||||||
|
invoiceNo: invoice.invoiceNo,
|
||||||
|
totalPaymentAmount: invoice.paymentAmount,
|
||||||
|
paymentAmount: invoice.paymentAmount,
|
||||||
|
date: invoice.invoiceDate,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve payment receive new page receivable entries.
|
||||||
|
* @param {number} tenantId - Tenant id.
|
||||||
|
* @param {number} vendorId - Vendor id.
|
||||||
|
* @return {IPaymentReceivePageEntry[]}
|
||||||
|
*/
|
||||||
|
public async getNewPageEntries(tenantId: number, customerId: number) {
|
||||||
|
const { SaleInvoice } = this.tenancy.models(tenantId);
|
||||||
|
|
||||||
|
// Retrieve due invoices.
|
||||||
|
const entries = await SaleInvoice.query()
|
||||||
|
.modify('delivered')
|
||||||
|
.modify('dueInvoices')
|
||||||
|
.where('customer_id', customerId)
|
||||||
|
.orderBy('invoice_date', 'ASC');
|
||||||
|
|
||||||
|
return entries.map(this.invoiceToPageEntry);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the payment receive details of the given id.
|
||||||
|
* @param {number} tenantId - Tenant id.
|
||||||
|
* @param {Integer} paymentReceiveId - Payment receive id.
|
||||||
|
*/
|
||||||
|
public async getPaymentReceiveEditPage(
|
||||||
|
tenantId: number,
|
||||||
|
paymentReceiveId: number,
|
||||||
|
): Promise<{
|
||||||
|
paymentReceive: Omit<IPaymentReceive, 'entries'>;
|
||||||
|
entries: IPaymentReceivePageEntry[];
|
||||||
|
}> {
|
||||||
|
const { PaymentReceive, SaleInvoice } = this.tenancy.models(tenantId);
|
||||||
|
|
||||||
|
// Retrieve payment receive.
|
||||||
|
const paymentReceive = await PaymentReceive.query()
|
||||||
|
.findById(paymentReceiveId)
|
||||||
|
.withGraphFetched('entries.invoice');
|
||||||
|
|
||||||
|
// Throw not found the payment receive.
|
||||||
|
if (!paymentReceive) {
|
||||||
|
throw new ServiceError(ERRORS.PAYMENT_RECEIVE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
const paymentEntries = paymentReceive.entries.map((entry) => ({
|
||||||
|
...this.invoiceToPageEntry(entry.invoice),
|
||||||
|
dueAmount: entry.invoice.dueAmount + entry.paymentAmount,
|
||||||
|
paymentAmount: entry.paymentAmount,
|
||||||
|
}));
|
||||||
|
// Retrieves all receivable bills that associated to the payment receive transaction.
|
||||||
|
const restReceivableInvoices = await SaleInvoice.query()
|
||||||
|
.modify('delivered')
|
||||||
|
.modify('dueInvoices')
|
||||||
|
.where('customer_id', paymentReceive.customerId)
|
||||||
|
.whereNotIn(
|
||||||
|
'id',
|
||||||
|
paymentReceive.entries.map((entry) => entry.invoiceId)
|
||||||
|
)
|
||||||
|
.orderBy('invoice_date', 'ASC');
|
||||||
|
|
||||||
|
const restReceivableEntries = restReceivableInvoices.map(
|
||||||
|
this.invoiceToPageEntry
|
||||||
|
);
|
||||||
|
const entries = [...paymentEntries, ...restReceivableEntries];
|
||||||
|
|
||||||
|
return {
|
||||||
|
paymentReceive: omit(paymentReceive, ['entries']),
|
||||||
|
entries,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,6 @@ import {
|
|||||||
IPaymentReceivesFilter,
|
IPaymentReceivesFilter,
|
||||||
ISaleInvoice,
|
ISaleInvoice,
|
||||||
ISystemUser,
|
ISystemUser,
|
||||||
IPaymentReceivePageEntry,
|
|
||||||
} from 'interfaces';
|
} from 'interfaces';
|
||||||
import AccountsService from 'services/Accounts/AccountsService';
|
import AccountsService from 'services/Accounts/AccountsService';
|
||||||
import JournalPoster from 'services/Accounting/JournalPoster';
|
import JournalPoster from 'services/Accounting/JournalPoster';
|
||||||
@@ -31,21 +30,9 @@ import CustomersService from 'services/Contacts/CustomersService';
|
|||||||
import ItemsEntriesService from 'services/Items/ItemsEntriesService';
|
import ItemsEntriesService from 'services/Items/ItemsEntriesService';
|
||||||
import JournalCommands from 'services/Accounting/JournalCommands';
|
import JournalCommands from 'services/Accounting/JournalCommands';
|
||||||
import { ACCOUNT_PARENT_TYPE } from 'data/AccountTypes';
|
import { ACCOUNT_PARENT_TYPE } from 'data/AccountTypes';
|
||||||
import AutoIncrementOrdersService from './AutoIncrementOrdersService';
|
import AutoIncrementOrdersService from '../AutoIncrementOrdersService';
|
||||||
|
import { ERRORS } from './constants';
|
||||||
|
|
||||||
const ERRORS = {
|
|
||||||
PAYMENT_RECEIVE_NO_EXISTS: 'PAYMENT_RECEIVE_NO_EXISTS',
|
|
||||||
PAYMENT_RECEIVE_NOT_EXISTS: 'PAYMENT_RECEIVE_NOT_EXISTS',
|
|
||||||
DEPOSIT_ACCOUNT_NOT_FOUND: 'DEPOSIT_ACCOUNT_NOT_FOUND',
|
|
||||||
DEPOSIT_ACCOUNT_INVALID_TYPE: 'DEPOSIT_ACCOUNT_INVALID_TYPE',
|
|
||||||
INVALID_PAYMENT_AMOUNT: 'INVALID_PAYMENT_AMOUNT',
|
|
||||||
INVOICES_IDS_NOT_FOUND: 'INVOICES_IDS_NOT_FOUND',
|
|
||||||
ENTRIES_IDS_NOT_EXISTS: 'ENTRIES_IDS_NOT_EXISTS',
|
|
||||||
INVOICES_NOT_DELIVERED_YET: 'INVOICES_NOT_DELIVERED_YET',
|
|
||||||
PAYMENT_RECEIVE_NO_IS_REQUIRED: 'PAYMENT_RECEIVE_NO_IS_REQUIRED',
|
|
||||||
PAYMENT_RECEIVE_NO_REQUIRED: 'PAYMENT_RECEIVE_NO_REQUIRED',
|
|
||||||
PAYMENT_CUSTOMER_SHOULD_NOT_UPDATE: 'PAYMENT_CUSTOMER_SHOULD_NOT_UPDATE',
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* Payment receive service.
|
* Payment receive service.
|
||||||
* @service
|
* @service
|
||||||
@@ -532,7 +519,7 @@ export default class PaymentReceiveService {
|
|||||||
* @param {Integer} paymentReceiveId - Payment receive id.
|
* @param {Integer} paymentReceiveId - Payment receive id.
|
||||||
* @param {IPaymentReceive} paymentReceive - Payment receive object.
|
* @param {IPaymentReceive} paymentReceive - Payment receive object.
|
||||||
*/
|
*/
|
||||||
async deletePaymentReceive(
|
public async deletePaymentReceive(
|
||||||
tenantId: number,
|
tenantId: number,
|
||||||
paymentReceiveId: number,
|
paymentReceiveId: number,
|
||||||
authorizedUser: ISystemUser
|
authorizedUser: ISystemUser
|
||||||
@@ -572,7 +559,7 @@ export default class PaymentReceiveService {
|
|||||||
* @param {number} paymentReceiveId - Payment receive id.
|
* @param {number} paymentReceiveId - Payment receive id.
|
||||||
* @return {Promise<IPaymentReceive>}
|
* @return {Promise<IPaymentReceive>}
|
||||||
*/
|
*/
|
||||||
async getPaymentReceive(
|
public async getPaymentReceive(
|
||||||
tenantId: number,
|
tenantId: number,
|
||||||
paymentReceiveId: number
|
paymentReceiveId: number
|
||||||
): Promise<IPaymentReceive> {
|
): Promise<IPaymentReceive> {
|
||||||
@@ -591,76 +578,6 @@ export default class PaymentReceiveService {
|
|||||||
return paymentReceive;
|
return paymentReceive;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrive edit page invoices entries from the given sale invoices models.
|
|
||||||
* @param {ISaleInvoice[]} invoices - Invoices.
|
|
||||||
* @return {IPaymentReceiveEditPageEntry}
|
|
||||||
*/
|
|
||||||
public invoiceToPageEntry(
|
|
||||||
invoice: ISaleInvoice
|
|
||||||
): IPaymentReceiveEditPageEntry {
|
|
||||||
return {
|
|
||||||
entryType: 'invoice',
|
|
||||||
invoiceId: invoice.id,
|
|
||||||
dueAmount: invoice.dueAmount + invoice.paymentAmount,
|
|
||||||
amount: invoice.balance,
|
|
||||||
invoiceNo: invoice.invoiceNo,
|
|
||||||
totalPaymentAmount: invoice.paymentAmount,
|
|
||||||
paymentAmount: invoice.paymentAmount,
|
|
||||||
date: invoice.invoiceDate,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve the payment receive details of the given id.
|
|
||||||
* @param {number} tenantId - Tenant id.
|
|
||||||
* @param {Integer} paymentReceiveId - Payment receive id.
|
|
||||||
*/
|
|
||||||
public async getPaymentReceiveEditPage(
|
|
||||||
tenantId: number,
|
|
||||||
paymentReceiveId: number,
|
|
||||||
authorizedUser: ISystemUser
|
|
||||||
): Promise<{
|
|
||||||
paymentReceive: Omit<IPaymentReceive, 'entries'>;
|
|
||||||
entries: IPaymentReceivePageEntry[];
|
|
||||||
}> {
|
|
||||||
const { PaymentReceive, SaleInvoice } = this.tenancy.models(tenantId);
|
|
||||||
|
|
||||||
// Retrieve payment receive.
|
|
||||||
const paymentReceive = await PaymentReceive.query()
|
|
||||||
.findById(paymentReceiveId)
|
|
||||||
.withGraphFetched('entries.invoice');
|
|
||||||
|
|
||||||
// Throw not found the payment receive.
|
|
||||||
if (!paymentReceive) {
|
|
||||||
throw new ServiceError(ERRORS.PAYMENT_RECEIVE_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
const paymentEntries = paymentReceive.entries.map((entry) => ({
|
|
||||||
...this.invoiceToPageEntry(entry.invoice),
|
|
||||||
paymentAmount: entry.paymentAmount,
|
|
||||||
}));
|
|
||||||
|
|
||||||
// Retrieves all receivable bills that associated to the payment receive transaction.
|
|
||||||
const restReceivableInvoices = await SaleInvoice.query()
|
|
||||||
.modify('dueInvoices')
|
|
||||||
.where('customer_id', paymentReceive.customerId)
|
|
||||||
.whereNotIn(
|
|
||||||
'id',
|
|
||||||
paymentReceive.entries.map((entry) => entry.invoiceId)
|
|
||||||
)
|
|
||||||
.orderBy('invoice_date', 'ASC');
|
|
||||||
|
|
||||||
const restReceivableEntries = restReceivableInvoices.map(
|
|
||||||
this.invoiceToPageEntry
|
|
||||||
);
|
|
||||||
const entries = [...paymentEntries, ...restReceivableEntries];
|
|
||||||
|
|
||||||
return {
|
|
||||||
paymentReceive: omit(paymentReceive, ['entries']),
|
|
||||||
entries,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve sale invoices that assocaited to the given payment receive.
|
* Retrieve sale invoices that assocaited to the given payment receive.
|
||||||
* @param {number} tenantId - Tenant id.
|
* @param {number} tenantId - Tenant id.
|
||||||
@@ -680,7 +597,6 @@ export default class PaymentReceiveService {
|
|||||||
const paymentReceiveInvoicesIds = paymentReceive.entries.map(
|
const paymentReceiveInvoicesIds = paymentReceive.entries.map(
|
||||||
(entry) => entry.invoiceId
|
(entry) => entry.invoiceId
|
||||||
);
|
);
|
||||||
|
|
||||||
const saleInvoices = await SaleInvoice.query().whereIn(
|
const saleInvoices = await SaleInvoice.query().whereIn(
|
||||||
'id',
|
'id',
|
||||||
paymentReceiveInvoicesIds
|
paymentReceiveInvoicesIds
|
||||||
@@ -726,22 +642,6 @@ export default class PaymentReceiveService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve the payment receive details with associated invoices.
|
|
||||||
* @param {Integer} paymentReceiveId
|
|
||||||
*/
|
|
||||||
async getPaymentReceiveWithInvoices(
|
|
||||||
tenantId: number,
|
|
||||||
paymentReceiveId: number
|
|
||||||
) {
|
|
||||||
const { PaymentReceive } = this.tenancy.models(tenantId);
|
|
||||||
|
|
||||||
return PaymentReceive.query()
|
|
||||||
.where('id', paymentReceiveId)
|
|
||||||
.withGraphFetched('invoices')
|
|
||||||
.first();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Records payment receive journal transactions.
|
* Records payment receive journal transactions.
|
||||||
*
|
*
|
||||||
@@ -871,22 +771,4 @@ export default class PaymentReceiveService {
|
|||||||
});
|
});
|
||||||
await Promise.all([...opers]);
|
await Promise.all([...opers]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve payment receive new page receivable entries.
|
|
||||||
* @param {number} tenantId - Tenant id.
|
|
||||||
* @param {number} vendorId - Vendor id.
|
|
||||||
* @return {IPaymentReceivePageEntry[]}
|
|
||||||
*/
|
|
||||||
async getNewPageEntries(tenantId: number, customerId: number) {
|
|
||||||
const { SaleInvoice } = this.tenancy.models(tenantId);
|
|
||||||
|
|
||||||
// Retrieve due invoices.
|
|
||||||
const entries = await SaleInvoice.query()
|
|
||||||
.modify('dueInvoices')
|
|
||||||
.where('customer_id', customerId)
|
|
||||||
.orderBy('invoice_date', 'ASC');
|
|
||||||
|
|
||||||
return entries.map(this.invoiceToPageEntry);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
13
server/src/services/Sales/PaymentReceives/constants.ts
Normal file
13
server/src/services/Sales/PaymentReceives/constants.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
export const ERRORS = {
|
||||||
|
PAYMENT_RECEIVE_NO_EXISTS: 'PAYMENT_RECEIVE_NO_EXISTS',
|
||||||
|
PAYMENT_RECEIVE_NOT_EXISTS: 'PAYMENT_RECEIVE_NOT_EXISTS',
|
||||||
|
DEPOSIT_ACCOUNT_NOT_FOUND: 'DEPOSIT_ACCOUNT_NOT_FOUND',
|
||||||
|
DEPOSIT_ACCOUNT_INVALID_TYPE: 'DEPOSIT_ACCOUNT_INVALID_TYPE',
|
||||||
|
INVALID_PAYMENT_AMOUNT: 'INVALID_PAYMENT_AMOUNT',
|
||||||
|
INVOICES_IDS_NOT_FOUND: 'INVOICES_IDS_NOT_FOUND',
|
||||||
|
ENTRIES_IDS_NOT_EXISTS: 'ENTRIES_IDS_NOT_EXISTS',
|
||||||
|
INVOICES_NOT_DELIVERED_YET: 'INVOICES_NOT_DELIVERED_YET',
|
||||||
|
PAYMENT_RECEIVE_NO_IS_REQUIRED: 'PAYMENT_RECEIVE_NO_IS_REQUIRED',
|
||||||
|
PAYMENT_RECEIVE_NO_REQUIRED: 'PAYMENT_RECEIVE_NO_REQUIRED',
|
||||||
|
PAYMENT_CUSTOMER_SHOULD_NOT_UPDATE: 'PAYMENT_CUSTOMER_SHOULD_NOT_UPDATE',
|
||||||
|
};
|
||||||
@@ -656,6 +656,7 @@ export default class SaleInvoicesService {
|
|||||||
|
|
||||||
const salesInvoices = await SaleInvoice.query().onBuild((query) => {
|
const salesInvoices = await SaleInvoice.query().onBuild((query) => {
|
||||||
query.modify('dueInvoices');
|
query.modify('dueInvoices');
|
||||||
|
query.modify('delivered');
|
||||||
|
|
||||||
if (customerId) {
|
if (customerId) {
|
||||||
query.where('customer_id', customerId);
|
query.where('customer_id', customerId);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Container, Inject, Service } from 'typedi';
|
import { Container, Inject, Service } from 'typedi';
|
||||||
import { EventSubscriber, On } from 'event-dispatch';
|
import { EventSubscriber, On } from 'event-dispatch';
|
||||||
import events from 'subscribers/events';
|
import events from 'subscribers/events';
|
||||||
import BillPaymentsService from 'services/Purchases/BillPayments';
|
import BillPaymentsService from 'services/Purchases/BillPayments/BillPayments';
|
||||||
import TenancyService from 'services/Tenancy/TenancyService';
|
import TenancyService from 'services/Tenancy/TenancyService';
|
||||||
|
|
||||||
@EventSubscriber()
|
@EventSubscriber()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Container, Inject, Service } from 'typedi';
|
|||||||
import { EventSubscriber, On } from 'event-dispatch';
|
import { EventSubscriber, On } from 'event-dispatch';
|
||||||
import events from 'subscribers/events';
|
import events from 'subscribers/events';
|
||||||
import TenancyService from 'services/Tenancy/TenancyService';
|
import TenancyService from 'services/Tenancy/TenancyService';
|
||||||
import PaymentReceiveService from 'services/Sales/PaymentsReceives';
|
import PaymentReceiveService from 'services/Sales/PaymentReceives/PaymentsReceives';
|
||||||
import SettingsService from 'services/Settings/SettingsService';
|
import SettingsService from 'services/Settings/SettingsService';
|
||||||
|
|
||||||
@EventSubscriber()
|
@EventSubscriber()
|
||||||
|
|||||||
Reference in New Issue
Block a user