feat: invoice payment transactions.

This commit is contained in:
elforjani13
2021-11-15 21:44:46 +02:00
parent 377fb07c70
commit bd282acae4
9 changed files with 134 additions and 9 deletions

View File

@@ -269,3 +269,18 @@ export function useInvoiceSMSDetail(invoiceId, query, props) {
},
);
}
export function useInvoicePaymentTransactions(invoiceId, props) {
return useRequestQuery(
[t.SALE_INVOICE_PAYMENT_TRANSACTIONS, invoiceId],
{
method: 'get',
url: `sales/invoices/${invoiceId}/payment-transactions`,
},
{
select: (res) => res.data.data,
defaultData: [],
...props,
},
);
}

View File

@@ -28,6 +28,9 @@ const commonInvalidateQueries = (client) => {
// Invalidate the cashflow transactions.
client.invalidateQueries(t.CASH_FLOW_TRANSACTIONS);
client.invalidateQueries(t.CASHFLOW_ACCOUNT_TRANSACTIONS_INFINITY);
// Invalidate invoices payment transactions.
client.invalidateQueries(t.SALE_INVOICE_PAYMENT_TRANSACTIONS);
};
// Transform payment receives.

View File

@@ -30,6 +30,7 @@ const BILLS = {
BILLS: 'BILLS',
BILL: 'BILL',
BILLS_DUE: 'BILLS_DUE',
BILLS_PAYMENT_TRANSACTIONS: 'BILLS_PAYMENT_TRANSACTIONS',
};
const VENDORS = {
@@ -95,6 +96,7 @@ const SALE_INVOICES = {
NOTIFY_SALE_INVOICE_BY_SMS: 'NOTIFY_SALE_INVOICE_BY_SMS',
BAD_DEBT: 'BAD_DEBT',
CANCEL_BAD_DEBT: 'CANCEL_BAD_DEBT',
SALE_INVOICE_PAYMENT_TRANSACTIONS: 'SALE_INVOICE_PAYMENT_TRANSACTIONS',
};
const USERS = {