Merge branch 'feature/associated-payment-transactions' into develop

This commit is contained in:
elforjani13
2021-12-14 13:06:05 +02:00
27 changed files with 775 additions and 63 deletions

View File

@@ -186,3 +186,18 @@ export function useRefreshBills() {
},
};
}
export function useBillPaymentTransactions(id, props) {
return useRequestQuery(
[t.BILLS_PAYMENT_TRANSACTIONS, id],
{
method: 'get',
url: `purchases/bills/${id}/payment-transactions`,
},
{
select: (res) => res.data.data,
defaultData: [],
...props,
},
);
}

View File

@@ -273,3 +273,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

@@ -30,6 +30,9 @@ const commonInvalidateQueries = (client) => {
// Invalidate the cashflow transactions.
client.invalidateQueries(t.CASH_FLOW_TRANSACTIONS);
client.invalidateQueries(t.CASHFLOW_ACCOUNT_TRANSACTIONS_INFINITY);
// Invalidate bills payment transactions.
client.invalidateQueries(t.BILLS_PAYMENT_TRANSACTIONS);
};
/**

View File

@@ -35,6 +35,9 @@ const commonInvalidateQueries = (client) => {
// Invalidate reconcile.
client.invalidateQueries(t.RECONCILE_CREDIT_NOTE);
client.invalidateQueries(t.RECONCILE_CREDIT_NOTES);
// 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 = {