mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
feat(PaymentReceivePdf): payment pdf preview.
This commit is contained in:
@@ -2,6 +2,8 @@ import { useMutation, useQueryClient } from 'react-query';
|
||||
import { useRequestQuery } from '../useQueryRequest';
|
||||
import useApiRequest from '../useRequest';
|
||||
import { transformPagination, saveInvoke } from 'utils';
|
||||
import { useRequestPdf } from '../utils';
|
||||
|
||||
import t from './types';
|
||||
|
||||
// Common invalidate queries.
|
||||
@@ -31,11 +33,11 @@ const commonInvalidateQueries = (client) => {
|
||||
|
||||
client.invalidateQueries(t.CREDIT_NOTE);
|
||||
client.invalidateQueries(t.CREDIT_NOTES);
|
||||
|
||||
|
||||
// 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);
|
||||
};
|
||||
@@ -224,3 +226,10 @@ export function usePaymentReceiveSMSDetail(
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the payment receive pdf document data.
|
||||
*/
|
||||
export function usePdfPaymentReceive(paymentReceiveId) {
|
||||
return useRequestPdf(`sales/payment_receives/${paymentReceiveId}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user