mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
refactor(nestjs): replace the reports endpoints
This commit is contained in:
@@ -12,7 +12,7 @@ export function useAPAgingSummaryReport(query, props) {
|
||||
[t.FINANCIAL_REPORT, t.AP_AGING_SUMMARY, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/payable_aging_summary',
|
||||
url: '/reports/payable-aging-summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
@@ -27,7 +27,7 @@ export function useAPAgingSummaryReport(query, props) {
|
||||
|
||||
export const useAPAgingSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/payable_aging_summary',
|
||||
url: '/reports/payable-aging-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
@@ -41,7 +41,7 @@ export const useAPAgingSheetXlsxExport = (query, args) => {
|
||||
|
||||
export const useAPAgingSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/payable_aging_summary',
|
||||
url: '/reports/payable-aging-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
@@ -58,7 +58,7 @@ export const useAPAgingSheetCsvExport = (query, args) => {
|
||||
*/
|
||||
export function useAPAgingSummaryPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/payable_aging_summary`,
|
||||
url: `/reports/payable-aging-summary`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ export function useARAgingSummaryReport(query, props) {
|
||||
[t.FINANCIAL_REPORT, t.AR_AGING_SUMMARY, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/receivable_aging_summary',
|
||||
url: '/reports/receivable-aging-summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
@@ -26,7 +26,7 @@ export function useARAgingSummaryReport(query, props) {
|
||||
|
||||
export const useARAgingSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/receivable_aging_summary',
|
||||
url: '/reports/receivable-aging-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
@@ -40,7 +40,7 @@ export const useARAgingSheetXlsxExport = (query, args) => {
|
||||
|
||||
export const useARAgingSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/receivable_aging_summary',
|
||||
url: '/reports/receivable-aging-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
|
||||
@@ -16,7 +16,7 @@ export function useBalanceSheet(query, props) {
|
||||
[t.FINANCIAL_REPORT, t.BALANCE_SHEET, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/balance_sheet',
|
||||
url: '/reports/balance-sheet',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
|
||||
@@ -12,7 +12,7 @@ export function useCashFlowStatementReport(query, props) {
|
||||
[t.FINANCIAL_REPORT, t.CASH_FLOW_STATEMENT, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/cash-flow',
|
||||
url: '/reports/cashflow-statement',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
@@ -37,7 +37,7 @@ export function useCashFlowStatementReport(query, props) {
|
||||
}
|
||||
|
||||
export const useCashFlowStatementXlsxExport = (query, args) => {
|
||||
const url = '/financial_statements/cash-flow';
|
||||
const url = '/reports/cashflow-statement';
|
||||
const config = {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
@@ -55,7 +55,7 @@ export const useCashFlowStatementXlsxExport = (query, args) => {
|
||||
};
|
||||
|
||||
export const useCashFlowStatementCsvExport = (query, args) => {
|
||||
const url = '/financial_statements/cash-flow';
|
||||
const url = '/reports/cashflow-statement';
|
||||
const config = {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
@@ -77,7 +77,7 @@ export const useCashFlowStatementCsvExport = (query, args) => {
|
||||
*/
|
||||
export function useCashflowSheetPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/cash-flow`,
|
||||
url: `/reports/cashflow-statement`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export function useCustomerBalanceSummaryReport(query, props) {
|
||||
[t.FINANCIAL_REPORT, t.CUSTOMERS_BALANCE_SUMMARY, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/customer-balance-summary',
|
||||
url: '/reports/customer-balance-summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
@@ -34,7 +34,7 @@ export function useCustomerBalanceSummaryReport(query, props) {
|
||||
|
||||
export const useCustomerBalanceSummaryXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/customer-balance-summary',
|
||||
url: '/reports/customer-balance-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
@@ -48,7 +48,7 @@ export const useCustomerBalanceSummaryXlsxExport = (query, args) => {
|
||||
|
||||
export const useCustomerBalanceSummaryCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/customer-balance-summary',
|
||||
url: '/reports/customer-balance-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
@@ -65,7 +65,7 @@ export const useCustomerBalanceSummaryCsvExport = (query, args) => {
|
||||
*/
|
||||
export function useCustomerBalanceSummaryPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/customer-balance-summary`,
|
||||
url: `/reports/customer-balance-summary`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export function useCustomersTransactionsReport(query, props) {
|
||||
[t.FINANCIAL_REPORT, t.CUSTOMERS_TRANSACTIONS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/transactions-by-customers',
|
||||
url: '/reports/transactions-by-customers',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
@@ -33,7 +33,7 @@ export function useCustomersTransactionsReport(query, props) {
|
||||
}
|
||||
|
||||
export const useCustomersTransactionsXlsxExport = (query, args) => {
|
||||
const url = '/financial_statements/transactions-by-customers';
|
||||
const url = '/reports/transactions-by-customers';
|
||||
const config = {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
@@ -52,7 +52,7 @@ export const useCustomersTransactionsXlsxExport = (query, args) => {
|
||||
|
||||
export const useCustomersTransactionsCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/transactions-by-customers',
|
||||
url: '/reports/transactions-by-customers',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
@@ -69,7 +69,7 @@ export const useCustomersTransactionsCsvExport = (query, args) => {
|
||||
*/
|
||||
export const useCustomersTransactionsPdfExport = (query = {}) => {
|
||||
return useRequestPdf({
|
||||
url: '/financial_statements/transactions-by-customers',
|
||||
url: '/reports/transactions-by-customers',
|
||||
params: query,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -12,7 +12,7 @@ export function useGeneralLedgerSheet(query, props) {
|
||||
[t.FINANCIAL_REPORT, t.GENERAL_LEDGER, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/general_ledger',
|
||||
url: '/reports/general-ledger',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
@@ -26,7 +26,7 @@ export function useGeneralLedgerSheet(query, props) {
|
||||
}
|
||||
export const useGeneralLedgerSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/general_ledger',
|
||||
url: '/reports/general-ledger',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
@@ -40,7 +40,7 @@ export const useGeneralLedgerSheetXlsxExport = (query, args) => {
|
||||
|
||||
export const useGeneralLedgerSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/general_ledger',
|
||||
url: '/reports/general-ledger',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
@@ -57,7 +57,7 @@ export const useGeneralLedgerSheetCsvExport = (query, args) => {
|
||||
*/
|
||||
export function useGeneralLedgerPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/general_ledger`,
|
||||
params: query
|
||||
url: `/reports/general-ledger`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export function useProfitLossSheet(query, props) {
|
||||
[t.FINANCIAL_REPORT, t.PROFIT_LOSS_SHEET, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/profit_loss_sheet',
|
||||
url: '/reports/profit-loss-sheet',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
@@ -27,7 +27,7 @@ export function useProfitLossSheet(query, props) {
|
||||
|
||||
export const useProfitLossSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/profit_loss_sheet',
|
||||
url: '/reports/profit-loss-sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
@@ -41,7 +41,7 @@ export const useProfitLossSheetXlsxExport = (query, args) => {
|
||||
|
||||
export const useProfitLossSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/profit_loss_sheet',
|
||||
url: '/reports/profit-loss-sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
@@ -58,7 +58,7 @@ export const useProfitLossSheetCsvExport = (query, args) => {
|
||||
*/
|
||||
export function useProfitLossSheetPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/profit_loss_sheet`,
|
||||
url: `/reports/profit-loss-sheet`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export function useTrialBalanceSheet(query, props) {
|
||||
[t.FINANCIAL_REPORT, t.TRIAL_BALANCE_SHEET, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/trial_balance_sheet',
|
||||
url: '/reports/trial-balance-sheet',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
@@ -27,7 +27,7 @@ export function useTrialBalanceSheet(query, props) {
|
||||
|
||||
export const useTrialBalanceSheetXlsxExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/trial_balance_sheet',
|
||||
url: '/reports/trial-balance-sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
@@ -41,7 +41,7 @@ export const useTrialBalanceSheetXlsxExport = (query, args) => {
|
||||
|
||||
export const useTrialBalanceSheetCsvExport = (query, args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/trial_balance_sheet',
|
||||
url: '/reports/trial-balance-sheet',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
@@ -58,7 +58,7 @@ export const useTrialBalanceSheetCsvExport = (query, args) => {
|
||||
*/
|
||||
export function useTrialBalanceSheetPdf(query = {}) {
|
||||
return useRequestPdf({
|
||||
url: `/financial_statements/trial_balance_sheet`,
|
||||
url: `/reports/trial-balance-sheet`,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,13 +12,12 @@ export function useVendorsBalanceSummaryReport(query, props) {
|
||||
[t.FINANCIAL_REPORT, t.VENDORS_BALANCE_SUMMARY, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/vendor-balance-summary',
|
||||
url: '/reports/vendor-balance-summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
select: (res) => ({
|
||||
query: res.data.query,
|
||||
@@ -34,7 +33,7 @@ export function useVendorsBalanceSummaryReport(query, props) {
|
||||
}
|
||||
|
||||
export const useVendorBalanceSummaryXlsxExport = (args) => {
|
||||
const url = '/financial_statements/vendor-balance-summary';
|
||||
const url = '/reports/vendor-balance-summary';
|
||||
const config = {
|
||||
headers: {
|
||||
accept: 'application/xlsx',
|
||||
@@ -52,7 +51,7 @@ export const useVendorBalanceSummaryXlsxExport = (args) => {
|
||||
|
||||
export const useVendorBalanceSummaryCsvExport = (args) => {
|
||||
return useDownloadFile({
|
||||
url: '/financial_statements/vendor-balance-summary',
|
||||
url: '/reports/vendor-balance-summary',
|
||||
config: {
|
||||
headers: {
|
||||
accept: 'application/csv',
|
||||
@@ -65,7 +64,7 @@ export const useVendorBalanceSummaryCsvExport = (args) => {
|
||||
|
||||
export const useVendorBalanceSummaryPdfExport = (query = {}) => {
|
||||
return useRequestPdf({
|
||||
url: 'financial_statements/vendor-balance-summary',
|
||||
url: 'reports/vendor-balance-summary',
|
||||
params: query,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -140,7 +140,7 @@ export function useAuthenticatedAccount(props) {
|
||||
url: `auth/account`,
|
||||
},
|
||||
{
|
||||
select: (response) => response.data.data,
|
||||
select: (response) => response.data,
|
||||
defaultData: {},
|
||||
onSuccess: (data) => {
|
||||
debugger;
|
||||
|
||||
Reference in New Issue
Block a user