mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
Merge branch 'develop' into big-116-open-up-the-link-component
This commit is contained in:
18
packages/webapp/src/hooks/query/FinancialReports/index.ts
Normal file
18
packages/webapp/src/hooks/query/FinancialReports/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export * from './use-balance-sheet';
|
||||
export * from './use-trial-balance-sheet';
|
||||
export * from './use-cashflow-sheet';
|
||||
export * from './use-profit-loss-sheet';
|
||||
export * from './use-general-ledger';
|
||||
export * from './use-journal-sheet';
|
||||
export * from './use-AP-aging-summary';
|
||||
export * from './use-AR-aging-summary';
|
||||
export * from './use-inventory-valuation';
|
||||
export * from './use-inventory-item-details';
|
||||
export * from './use-purchases-by-items';
|
||||
export * from './use-sales-by-items';
|
||||
export * from './use-customer-balance-summary';
|
||||
export * from './use-vendor-balance-summary';
|
||||
export * from './use-customer-transactions';
|
||||
export * from './use-vendor-transactions';
|
||||
export * from './use-sales-tax-liabilities-summary';
|
||||
export * from './use-transactions-by-reference';
|
||||
@@ -0,0 +1,64 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Retrieve A/P aging summary report.
|
||||
*/
|
||||
export function useAPAgingSummaryReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.AP_AGING_SUMMARY, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/payable_aging_summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useAPAgingSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/payable_aging_summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'payable_aging_summary.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useAPAgingSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/payable_aging_summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'payable_aging_summary.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the A/P aging summary pdf document.
|
||||
*/
|
||||
export function useAPAgingSummaryPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/payable_aging_summary`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
/**
|
||||
* Retrieve A/R aging summary report.
|
||||
*/
|
||||
export function useARAgingSummaryReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.AR_AGING_SUMMARY, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/receivable_aging_summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useARAgingSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/receivable_aging_summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'receivable_aging_summary.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useARAgingSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/receivable_aging_summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'receivable_aging_summary.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the A/R aging summary pdf document data.
|
||||
*/
|
||||
export function useARAgingSummaryPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/receivable_aging_summary`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Fetches balance sheet data.
|
||||
* @param {Object} query - The query parameters for the request.
|
||||
* @param {Object} props - Additional options for the request.
|
||||
* @returns {Object} The response object from the useRequestQuery hook.
|
||||
*/
|
||||
export function useBalanceSheet(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.BALANCE_SHEET, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/balance_sheet',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates a download of the balance sheet in XLSX format.
|
||||
* @param {Object} query - The query parameters for the request.
|
||||
* @param {Object} args - Additional configurations for the download.
|
||||
* @returns {Function} A function to trigger the file download.
|
||||
*/
|
||||
export const useBalanceSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/balance_sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'balance_sheet.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Initiates a download of the balance sheet in CSV format.
|
||||
* @param {Object} query - The query parameters for the request.
|
||||
* @param {Object} args - Additional configurations for the download.
|
||||
* @returns {Function} A function to trigger the file download.
|
||||
*/
|
||||
export const useBalanceSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/balance_sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'balance_sheet.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Fetches balance sheet data in PDF format.
|
||||
* @param {Object} [query={}] - The query parameters for the request.
|
||||
* @returns {Object} The response object from the useRequestPdf hook.
|
||||
*/
|
||||
export function useBalanceSheetPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/balance_sheet`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Retrieve cash flow statement report.
|
||||
*/
|
||||
export function useCashFlowStatementReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.CASH_FLOW_STATEMENT, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/cash-flow',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => ({
|
||||
columns: res.data.table.columns,
|
||||
query: res.data.query,
|
||||
meta: res.data.meta,
|
||||
tableRows: res.data.table.rows,
|
||||
}),
|
||||
defaultData: {
|
||||
tableRows: [],
|
||||
columns: [],
|
||||
query: {},
|
||||
meta: {},
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useCashFlowStatementXlsxExport = (query, args) => {
|
||||
const url = '/financial_statements/cash-flow';
|
||||
const config = {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
};
|
||||
const filename = 'cashflow_statement.xlsx';
|
||||
|
||||
return useDownloadFile({
|
||||
url,
|
||||
config,
|
||||
filename,
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useCashFlowStatementCsvExport = (query, args) => {
|
||||
const url = '/financial_statements/cash-flow';
|
||||
const config = {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
};
|
||||
const filename = 'cashflow_statement.csv';
|
||||
|
||||
return useDownloadFile({
|
||||
url,
|
||||
config,
|
||||
filename,
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the cashflow sheet pdf document.
|
||||
*/
|
||||
export function useCashflowSheetPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/cash-flow`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Retrieve customers balance summary report.
|
||||
*/
|
||||
export function useCustomerBalanceSummaryReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.CUSTOMERS_BALANCE_SUMMARY, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/customer-balance-summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => ({
|
||||
query: res.data.query,
|
||||
table: res.data.table,
|
||||
}),
|
||||
defaultData: {
|
||||
table: {},
|
||||
query: {},
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useCustomerBalanceSummaryXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/customer-balance-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'customer_balance_summary.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useCustomerBalanceSummaryCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/customer-balance-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'customer_balance_summary.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the pdf content of customers balance summary.
|
||||
*/
|
||||
export function useCustomerBalanceSummaryPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/customer-balance-summary`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Retrieve customers transactions report.
|
||||
*/
|
||||
export function useCustomersTransactionsReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.CUSTOMERS_TRANSACTIONS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/transactions-by-customers',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => ({
|
||||
data: res.data.table,
|
||||
tableRows: res.data.table.rows,
|
||||
}),
|
||||
defaultData: {
|
||||
tableRows: [],
|
||||
data: [],
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useCustomersTransactionsXlsxExport = (query, args) => {
|
||||
const url = '/financial_statements/transactions-by-customers';
|
||||
const config = {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
};
|
||||
const filename = 'customers_transactions.xlsx';
|
||||
|
||||
return useDownloadFile({
|
||||
url,
|
||||
config,
|
||||
filename,
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useCustomersTransactionsCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/transactions-by-customers',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'customers_transactions.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the pdf content of customers transactions.
|
||||
*/
|
||||
export const useCustomersTransactionsPdfExport = (query = {}) => {
|
||||
return useRequestPdf({
|
||||
url: '/financial_statements/transactions-by-customers',
|
||||
params: query,
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,63 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Retrieve general ledger (GL) sheet.
|
||||
*/
|
||||
export function useGeneralLedgerSheet(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.GENERAL_LEDGER, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/general_ledger',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
export const useGeneralLedgerSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/general_ledger',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'general_ledger.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useGeneralLedgerSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/general_ledger',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'general_ledger.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the general ledger pdf document data.
|
||||
*/
|
||||
export function useGeneralLedgerPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/general_ledger`,
|
||||
params: query
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Retrieve inventory item detail report.
|
||||
*/
|
||||
export function useInventoryItemDetailsReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.INVENTORY_ITEM_DETAILS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/inventory-item-details',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => ({
|
||||
columns: res.data.table.columns,
|
||||
query: res.data.query,
|
||||
meta: res.data.meta,
|
||||
tableRows: res.data.table.rows,
|
||||
}),
|
||||
defaultData: {
|
||||
tableRows: [],
|
||||
columns: [],
|
||||
query: {},
|
||||
meta: {},
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useInventoryItemDetailsXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/inventory-item-details',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'inventory_item_details.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useInventoryItemDetailsCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/inventory-item-details',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'inventory_item_details.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the balance sheet pdf document data.
|
||||
*/
|
||||
export function useInventoryItemDetailsPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/inventory-item-details`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Retrieve inventory valuation.
|
||||
*/
|
||||
export function useInventoryValuation(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.INVENTORY_VALUATION, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/inventory-valuation',
|
||||
params: query,
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve inventory valuation.
|
||||
*/
|
||||
export function useInventoryValuationTable(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.INVENTORY_VALUATION, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/inventory-valuation',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useInventoryValuationXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/inventory-valuation',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'inventory_valuation.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useInventoryValuationCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/inventory-valuation',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'inventory_valuation.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the inventory valuation pdf document data.
|
||||
*/
|
||||
export function useInventoryValuationPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/inventory-valuation`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Retrieve journal sheet.
|
||||
*/
|
||||
export function useJournalSheet(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.JOURNAL, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/journal',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useJournalSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/journal',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'journal.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useJournalSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/journal',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'journal.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the journal sheet pdf content.
|
||||
*/
|
||||
export const useJournalSheetPdf = (query = {}) => {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/journal`,
|
||||
params: query,
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,64 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Retrieve profit/loss (P&L) sheet.
|
||||
*/
|
||||
export function useProfitLossSheet(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.PROFIT_LOSS_SHEET, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/profit_loss_sheet',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useProfitLossSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/profit_loss_sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'profit_loss_sheet.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useProfitLossSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/profit_loss_sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'profit_loss_sheet.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the profit/loss sheet pdf document data.
|
||||
*/
|
||||
export function useProfitLossSheetPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/profit_loss_sheet`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Retrieve purchases by items.
|
||||
*/
|
||||
export function usePurchasesByItems(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.PURCHASES_BY_ITEMS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/purchases-by-items',
|
||||
params: query,
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function usePurchasesByItemsTable(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.PURCHASES_BY_ITEMS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/purchases-by-items',
|
||||
params: query,
|
||||
headers: {
|
||||
accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const usePurchasesByItemsCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/purchases-by-items',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'purchases_by_items.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const usePurchasesByItemsXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/purchases-by-items',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'purchases_by_items.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the pdf document of purchases by items.
|
||||
*/
|
||||
export const usePurchasesByItemsPdfExport = (query = {}) => {
|
||||
return useRequestPdf({
|
||||
url: '/financial_statements/purchases-by-items',
|
||||
params: query,
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,78 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Retrieve sales by items.
|
||||
*/
|
||||
export function useSalesByItems(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.SALES_BY_ITEMS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/sales-by-items',
|
||||
params: query,
|
||||
},
|
||||
{
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves sales by items table format.
|
||||
*/
|
||||
export function useSalesByItemsTable(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.SALES_BY_ITEMS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/sales-by-items',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useSalesByItemsCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/sales-by-items',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'sales_by_items.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useSalesByItemsXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/sales-by-items',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'sales_by_items.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useSalesByItemsPdfExport = (query = {}) => {
|
||||
return useRequestPdf({
|
||||
url: '/financial_statements/sales-by-items',
|
||||
params: query,
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,64 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Retrieves the sales tax liability summary report.
|
||||
*/
|
||||
export function useSalesTaxLiabilitySummary(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.SALES_TAX_LIABILITY_SUMMARY, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/sales-tax-liability-summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useSalesTaxLiabilitySummaryXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/sales-tax-liability-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'sales_tax_liability_summary.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useSalesTaxLiabilitySummaryCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/sales-tax-liability-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'sales_tax_liability_summary.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves pdf document data of sales tax liability summary.
|
||||
*/
|
||||
export function useSalesTaxLiabilitySummaryPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/sales-tax-liability-summary`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import t from '../types';
|
||||
/**
|
||||
* Retrieve transactions by reference report.
|
||||
*/
|
||||
export function useTransactionsByReference(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.TRANSACTIONS_BY_REFERENCE, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: `/financial_statements/transactions-by-reference`,
|
||||
params: query,
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
defaultData: {
|
||||
transactions: [],
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Retrieve trial balance sheet.
|
||||
*/
|
||||
export function useTrialBalanceSheet(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.TRIAL_BALANCE_SHEET, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/trial_balance_sheet',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useTrialBalanceSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/trial_balance_sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'trial_balance_sheet.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useTrialBalanceSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/trial_balance_sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'trial_balance_sheet.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the trial balance sheet pdf document data.
|
||||
*/
|
||||
export function useTrialBalanceSheetPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/trial_balance_sheet`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Retrieve vendors balance summary report.
|
||||
*/
|
||||
export function useVendorsBalanceSummaryReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.VENDORS_BALANCE_SUMMARY, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/vendor-balance-summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
select: (res) => ({
|
||||
query: res.data.query,
|
||||
table: res.data.table,
|
||||
}),
|
||||
defaultData: {
|
||||
table: {},
|
||||
query: {},
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useVendorBalanceSummaryXlsxExport = (args) => {
|
||||
const url = '/financial_statements/vendor-balance-summary';
|
||||
const config = {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
};
|
||||
const filename = 'vendor_balance_summary.xlsx';
|
||||
|
||||
return useDownloadFile({
|
||||
url,
|
||||
config,
|
||||
filename,
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useVendorBalanceSummaryCsvExport = (args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/vendor-balance-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
},
|
||||
filename: 'vendor_balance_summary.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useVendorBalanceSummaryPdfExport = (query = {}) => {
|
||||
return useRequestPdf({
|
||||
url: 'financial_statements/vendor-balance-summary',
|
||||
params: query,
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,74 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../../useQueryRequest';
|
||||
import { useDownloadFile } from '../../useDownloadFile';
|
||||
import { useRequestPdf } from '../../useRequestPdf';
|
||||
import t from '../types';
|
||||
|
||||
/**
|
||||
* Retrieve vendors transactions report.
|
||||
*/
|
||||
export function useVendorsTransactionsReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.VENDORS_TRANSACTIONS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/transactions-by-vendors',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => ({
|
||||
data: res.data.table,
|
||||
tableRows: res.data.table.rows,
|
||||
}),
|
||||
defaultData: {
|
||||
tableRows: [],
|
||||
data: [],
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useVendorsTransactionsXlsxExport = (query, args) => {
|
||||
const url = '/financial_statements/transactions-by-vendors';
|
||||
const config = {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
};
|
||||
const filename = 'transactions_by_vendor.xlsx';
|
||||
|
||||
return useDownloadFile({
|
||||
url,
|
||||
config,
|
||||
filename,
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useVendorsTransactionsCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/transactions-by-vendors',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'transactions_by_vendor.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Retrieves pdf document data of the transactions by vendor sheet.
|
||||
*/
|
||||
export function useTransactionsByVendorsPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `financial_statements/transactions-by-vendors`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
@@ -354,5 +354,7 @@ export function useRefundCreditTransaction(id, props, requestProps) {
|
||||
* Retrieve the credit note pdf document data,
|
||||
*/
|
||||
export function usePdfCreditNote(creditNoteId) {
|
||||
return useRequestPdf(`sales/credit_notes/${creditNoteId}`);
|
||||
return useRequestPdf({
|
||||
url: `sales/credit_notes/${creditNoteId}`,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -181,7 +181,9 @@ export function useRejectEstimate(props) {
|
||||
*/
|
||||
|
||||
export function usePdfEstimate(estimateId) {
|
||||
return useRequestPdf(`sales/estimates/${estimateId}`);
|
||||
return useRequestPdf({
|
||||
url: `sales/estimates/${estimateId}`,
|
||||
});
|
||||
}
|
||||
|
||||
export function useRefreshEstimates() {
|
||||
|
||||
@@ -1,978 +0,0 @@
|
||||
// @ts-nocheck
|
||||
import { useRequestQuery } from '../useQueryRequest';
|
||||
import { purchasesByItemsReducer } from '@/containers/FinancialStatements/reducers';
|
||||
import { useDownloadFile } from '../useDownloadFile';
|
||||
import t from './types';
|
||||
|
||||
/**
|
||||
* Retrieve balance sheet.
|
||||
*/
|
||||
export function useBalanceSheet(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.BALANCE_SHEET, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/balance_sheet',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useBalanceSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/balance_sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'balance_sheet.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useBalanceSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/balance_sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'balance_sheet.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve trial balance sheet.
|
||||
*/
|
||||
export function useTrialBalanceSheet(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.TRIAL_BALANCE_SHEET, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/trial_balance_sheet',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useTrialBalanceSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/trial_balance_sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'trial_balance_sheet.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useTrialBalanceSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/trial_balance_sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'trial_balance_sheet.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve profit/loss (P&L) sheet.
|
||||
*/
|
||||
export function useProfitLossSheet(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.PROFIT_LOSS_SHEET, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/profit_loss_sheet',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useProfitLossSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/profit_loss_sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'profit_loss_sheet.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useProfitLossSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/profit_loss_sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'profit_loss_sheet.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve general ledger (GL) sheet.
|
||||
*/
|
||||
export function useGeneralLedgerSheet(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.GENERAL_LEDGER, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/general_ledger',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
export const useGeneralLedgerSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/general_ledger',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'general_ledger.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useGeneralLedgerSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/general_ledger',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'general_ledger.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve journal sheet.
|
||||
*/
|
||||
export function useJournalSheet(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.JOURNAL, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/journal',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useJournalSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/journal',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'journal.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useJournalSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/journal',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'journal.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve A/R aging summary report.
|
||||
*/
|
||||
export function useARAgingSummaryReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.AR_AGING_SUMMARY, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/receivable_aging_summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useARAgingSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/receivable_aging_summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'receivable_aging_summary.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useARAgingSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/receivable_aging_summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'receivable_aging_summary.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve A/P aging summary report.
|
||||
*/
|
||||
export function useAPAgingSummaryReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.AP_AGING_SUMMARY, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/payable_aging_summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useAPAgingSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/payable_aging_summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'payable_aging_summary.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useAPAgingSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/payable_aging_summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'payable_aging_summary.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve inventory valuation.
|
||||
*/
|
||||
export function useInventoryValuation(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.INVENTORY_VALUATION, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/inventory-valuation',
|
||||
params: query,
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve inventory valuation.
|
||||
*/
|
||||
export function useInventoryValuationTable(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.INVENTORY_VALUATION, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/inventory-valuation',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useInventoryValuationXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/inventory-valuation',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'inventory_valuation.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useInventoryValuationCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/inventory-valuation',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'inventory_valuation.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve purchases by items.
|
||||
*/
|
||||
export function usePurchasesByItems(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.PURCHASES_BY_ITEMS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/purchases-by-items',
|
||||
params: query,
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function usePurchasesByItemsTable(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.PURCHASES_BY_ITEMS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/purchases-by-items',
|
||||
params: query,
|
||||
headers: {
|
||||
accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const usePurchasesByItemsCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/purchases-by-items',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'purchases_by_items.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const usePurchasesByItemsXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/purchases-by-items',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'purchases_by_items.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve sales by items.
|
||||
*/
|
||||
export function useSalesByItems(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.SALES_BY_ITEMS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/sales-by-items',
|
||||
params: query,
|
||||
},
|
||||
{
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves sales by items table format.
|
||||
*/
|
||||
export function useSalesByItemsTable(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.SALES_BY_ITEMS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/sales-by-items',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useSalesByItemsCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/sales-by-items',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'sales_by_items.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useSalesByItemsXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/sales-by-items',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'sales_by_items.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve customers balance summary report.
|
||||
*/
|
||||
export function useCustomerBalanceSummaryReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.CUSTOMERS_BALANCE_SUMMARY, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/customer-balance-summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => ({
|
||||
query: res.data.query,
|
||||
table: res.data.table,
|
||||
}),
|
||||
defaultData: {
|
||||
table: {},
|
||||
query: {},
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useCustomerBalanceSummaryXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/customer-balance-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'customer_balance_summary.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useCustomerBalanceSummaryCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/customer-balance-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'customer_balance_summary.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve vendors balance summary report.
|
||||
*/
|
||||
export function useVendorsBalanceSummaryReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.VENDORS_BALANCE_SUMMARY, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/vendor-balance-summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
select: (res) => ({
|
||||
query: res.data.query,
|
||||
table: res.data.table,
|
||||
}),
|
||||
defaultData: {
|
||||
table: {},
|
||||
query: {},
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useVendorBalanceSummaryXlsxExport = (args) => {
|
||||
const url = '/financial_statements/vendor-balance-summary';
|
||||
const config = {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
};
|
||||
const filename = 'vendor_balance_summary.xlsx';
|
||||
|
||||
return useDownloadFile({
|
||||
url,
|
||||
config,
|
||||
filename,
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useVendorBalanceSummaryCsvExport = (args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/vendor-balance-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
},
|
||||
filename: 'vendor_balance_summary.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve customers transactions report.
|
||||
*/
|
||||
export function useCustomersTransactionsReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.CUSTOMERS_TRANSACTIONS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/transactions-by-customers',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => ({
|
||||
data: res.data.table,
|
||||
tableRows: res.data.table.rows,
|
||||
}),
|
||||
defaultData: {
|
||||
tableRows: [],
|
||||
data: [],
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useCustomersTransactionsXlsxExport = (query, args) => {
|
||||
const url = '/financial_statements/transactions-by-customers';
|
||||
const config = {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
};
|
||||
const filename = 'customers_transactions.xlsx';
|
||||
|
||||
return useDownloadFile({
|
||||
url,
|
||||
config,
|
||||
filename,
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useCustomersTransactionsCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/transactions-by-customers',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'customers_transactions.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve vendors transactions report.
|
||||
*/
|
||||
export function useVendorsTransactionsReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.VENDORS_TRANSACTIONS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/transactions-by-vendors',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => ({
|
||||
data: res.data.table,
|
||||
tableRows: res.data.table.rows,
|
||||
}),
|
||||
defaultData: {
|
||||
tableRows: [],
|
||||
data: [],
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useVendorsTransactionsXlsxExport = (query, args) => {
|
||||
const url = '/financial_statements/transactions-by-vendors';
|
||||
const config = {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
};
|
||||
const filename = 'transactions_by_vendor.xlsx';
|
||||
|
||||
return useDownloadFile({
|
||||
url,
|
||||
config,
|
||||
filename,
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useVendorsTransactionsCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/transactions-by-vendors',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'transactions_by_vendor.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve cash flow statement report.
|
||||
*/
|
||||
export function useCashFlowStatementReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.CASH_FLOW_STATEMENT, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/cash-flow',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => ({
|
||||
columns: res.data.table.columns,
|
||||
query: res.data.query,
|
||||
meta: res.data.meta,
|
||||
tableRows: res.data.table.rows,
|
||||
}),
|
||||
defaultData: {
|
||||
tableRows: [],
|
||||
columns: [],
|
||||
query: {},
|
||||
meta: {},
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useCashFlowStatementXlsxExport = (query, args) => {
|
||||
const url = '/financial_statements/cash-flow';
|
||||
const config = {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
};
|
||||
const filename = 'cashflow_statement.xlsx';
|
||||
|
||||
return useDownloadFile({
|
||||
url,
|
||||
config,
|
||||
filename,
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useCashFlowStatementCsvExport = (query, args) => {
|
||||
const url = '/financial_statements/cash-flow';
|
||||
const config = {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
};
|
||||
const filename = 'cashflow_statement.csv';
|
||||
|
||||
return useDownloadFile({
|
||||
url,
|
||||
config,
|
||||
filename,
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve inventory item detail report.
|
||||
*/
|
||||
export function useInventoryItemDetailsReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.INVENTORY_ITEM_DETAILS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/inventory-item-details',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => ({
|
||||
columns: res.data.table.columns,
|
||||
query: res.data.query,
|
||||
meta: res.data.meta,
|
||||
tableRows: res.data.table.rows,
|
||||
}),
|
||||
defaultData: {
|
||||
tableRows: [],
|
||||
columns: [],
|
||||
query: {},
|
||||
meta: {},
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useInventoryItemDetailsXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/inventory-item-details',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'inventory_item_details.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useInventoryItemDetailsCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/inventory-item-details',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'inventory_item_details.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve transactions by reference report.
|
||||
*/
|
||||
export function useTransactionsByReference(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.TRANSACTIONS_BY_REFERENCE, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: `/financial_statements/transactions-by-reference`,
|
||||
params: query,
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
defaultData: {
|
||||
transactions: [],
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the sales tax liability summary report.
|
||||
*/
|
||||
export function useSalesTaxLiabilitySummary(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.SALES_TAX_LIABILITY_SUMMARY, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/sales-tax-liability-summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => res.data,
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const useSalesTaxLiabilitySummaryXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/sales-tax-liability-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'sales_tax_liability_summary.xlsx',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
|
||||
export const useSalesTaxLiabilitySummaryCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/sales-tax-liability-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
},
|
||||
params: query,
|
||||
},
|
||||
filename: 'sales_tax_liability_summary.csv',
|
||||
...args,
|
||||
});
|
||||
};
|
||||
@@ -6,7 +6,6 @@ export * from './items';
|
||||
export * from './itemsCategories';
|
||||
export * from './inventoryAdjustments';
|
||||
export * from './expenses';
|
||||
export * from './financialReports';
|
||||
export * from './customers';
|
||||
export * from './vendors';
|
||||
export * from './manualJournals';
|
||||
@@ -37,4 +36,5 @@ export * from './transactionsLocking';
|
||||
export * from './warehouses';
|
||||
export * from './branches';
|
||||
export * from './warehousesTransfers';
|
||||
export * from './plaid';
|
||||
export * from './plaid';
|
||||
export * from './FinancialReports';
|
||||
|
||||
@@ -24,7 +24,7 @@ const commonInvalidateQueries = (queryClient) => {
|
||||
|
||||
// Invalidate financial reports.
|
||||
queryClient.invalidateQueries(t.FINANCIAL_REPORT);
|
||||
|
||||
|
||||
// Invalidate transactions by reference.
|
||||
queryClient.invalidateQueries(t.TRANSACTIONS_BY_REFERENCE);
|
||||
|
||||
@@ -188,7 +188,9 @@ export function useInvoice(invoiceId, props, requestProps) {
|
||||
* Retrieve the invoice pdf document data.
|
||||
*/
|
||||
export function usePdfInvoice(invoiceId) {
|
||||
return useRequestPdf(`sales/invoices/${invoiceId}`);
|
||||
return useRequestPdf({
|
||||
url: `sales/invoices/${invoiceId}`,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -339,4 +341,3 @@ export function useSaleInvoiceDefaultOptions(invoiceId, props) {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -233,9 +233,10 @@ export function usePaymentReceiveSMSDetail(
|
||||
|
||||
/**
|
||||
* Retrieve the payment receive pdf document data.
|
||||
* @param {number} paymentReceiveId - Payment receive id.
|
||||
*/
|
||||
export function usePdfPaymentReceive(paymentReceiveId) {
|
||||
return useRequestPdf(`sales/payment_receives/${paymentReceiveId}`);
|
||||
return useRequestPdf({ url: `sales/payment_receives/${paymentReceiveId}` });
|
||||
}
|
||||
|
||||
export function useSendPaymentReceiveMail(props) {
|
||||
|
||||
@@ -162,9 +162,12 @@ export function useReceipt(id, props) {
|
||||
|
||||
/**
|
||||
* Retrieve the receipt pdf document data.
|
||||
* @param {number} receiptId -
|
||||
*/
|
||||
export function usePdfReceipt(ReceiptId) {
|
||||
return useRequestPdf(`sales/receipts/${ReceiptId}`);
|
||||
export function usePdfReceipt(receiptId: number) {
|
||||
return useRequestPdf({
|
||||
url: `sales/receipts/${receiptId}`,
|
||||
});
|
||||
}
|
||||
|
||||
export function useRefreshReceipts() {
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import { useQueryClient, useMutation } from 'react-query';
|
||||
import { useRequestQuery } from '../useQueryRequest';
|
||||
import { transformPagination } from '@/utils';
|
||||
import useApiRequest from '../useRequest';
|
||||
import { useRequestPdf } from '../utils';
|
||||
import t from './types';
|
||||
|
||||
// Common invalidate queries.
|
||||
|
||||
Reference in New Issue
Block a user