mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat(webapp): categorize the cashflow uncategorized transactions
This commit is contained in:
@@ -104,8 +104,8 @@ export function useDeleteCashflowTransaction(props) {
|
||||
export function useAccountTransactionsInfinity(
|
||||
accountId,
|
||||
query,
|
||||
axios,
|
||||
infinityProps,
|
||||
axios,
|
||||
) {
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
@@ -134,6 +134,45 @@ export function useAccountTransactionsInfinity(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve account transactions infinity scrolling.
|
||||
* @param {number} accountId
|
||||
* @param {*} axios
|
||||
* @returns
|
||||
*/
|
||||
export function useAccountUncategorizedTransactionsInfinity(
|
||||
accountId,
|
||||
query,
|
||||
infinityProps,
|
||||
axios,
|
||||
) {
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
return useInfiniteQuery(
|
||||
[t.CASHFLOW_ACCOUNT_UNCATEGORIZED_TRANSACTIONS_INFINITY, accountId],
|
||||
async ({ pageParam = 1 }) => {
|
||||
const response = await apiRequest.http({
|
||||
...axios,
|
||||
method: 'get',
|
||||
url: `/api/cashflow/transactions/${accountId}/uncategorized`,
|
||||
params: { page: pageParam, ...query },
|
||||
});
|
||||
return response.data;
|
||||
},
|
||||
{
|
||||
getPreviousPageParam: (firstPage) => firstPage.pagination.page - 1,
|
||||
getNextPageParam: (lastPage) => {
|
||||
const { pagination } = lastPage;
|
||||
|
||||
return pagination.total > pagination.page_size * pagination.page
|
||||
? lastPage.pagination.page + 1
|
||||
: undefined;
|
||||
},
|
||||
...infinityProps,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh cashflow transactions infinity.
|
||||
*/
|
||||
|
||||
@@ -77,7 +77,7 @@ const SALE_RECEIPTS = {
|
||||
SALE_RECEIPT: 'SALE_RECEIPT',
|
||||
SALE_RECEIPT_SMS_DETAIL: 'SALE_RECEIPT_SMS_DETAIL',
|
||||
NOTIFY_SALE_RECEIPT_BY_SMS: 'NOTIFY_SALE_RECEIPT_BY_SMS',
|
||||
SALE_RECEIPT_MAIL_OPTIONS: 'SALE_RECEIPT_MAIL_OPTIONS'
|
||||
SALE_RECEIPT_MAIL_OPTIONS: 'SALE_RECEIPT_MAIL_OPTIONS',
|
||||
};
|
||||
|
||||
const INVENTORY_ADJUSTMENTS = {
|
||||
@@ -115,7 +115,7 @@ const SALE_INVOICES = {
|
||||
BAD_DEBT: 'BAD_DEBT',
|
||||
CANCEL_BAD_DEBT: 'CANCEL_BAD_DEBT',
|
||||
SALE_INVOICE_PAYMENT_TRANSACTIONS: 'SALE_INVOICE_PAYMENT_TRANSACTIONS',
|
||||
SALE_INVOICE_DEFAULT_OPTIONS: 'SALE_INVOICE_DEFAULT_OPTIONS'
|
||||
SALE_INVOICE_DEFAULT_OPTIONS: 'SALE_INVOICE_DEFAULT_OPTIONS',
|
||||
};
|
||||
|
||||
const USERS = {
|
||||
@@ -200,6 +200,8 @@ const CASH_FLOW_ACCOUNTS = {
|
||||
CASH_FLOW_TRANSACTION: 'CASH_FLOW_TRANSACTION',
|
||||
CASHFLOW_ACCOUNT_TRANSACTIONS_INFINITY:
|
||||
'CASHFLOW_ACCOUNT_TRANSACTIONS_INFINITY',
|
||||
CASHFLOW_ACCOUNT_UNCATEGORIZED_TRANSACTIONS_INFINITY:
|
||||
'CASHFLOW_ACCOUNT_UNCATEGORIZED_TRANSACTIONS_INFINITY',
|
||||
};
|
||||
|
||||
const TARNSACTIONS_LOCKING = {
|
||||
|
||||
Reference in New Issue
Block a user