mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
refactor(nestjs): replace the reports endpoints
This commit is contained in:
@@ -15,10 +15,14 @@ export class ServiceErrorFilter implements ExceptionFilter {
|
||||
const status = exception.getStatus();
|
||||
|
||||
response.status(status).json({
|
||||
statusCode: status,
|
||||
errorType: exception.errorType,
|
||||
message: exception.message,
|
||||
payload: exception.payload,
|
||||
errors: [
|
||||
{
|
||||
statusCode: status,
|
||||
type: exception.errorType,
|
||||
message: exception.message,
|
||||
payload: exception.payload,
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ export class AuthController {
|
||||
return this.authApp.signUpConfirm(email, token);
|
||||
}
|
||||
|
||||
|
||||
@Post('/send_reset_password')
|
||||
@ApiOperation({ summary: 'Send reset password email' })
|
||||
@ApiBody({
|
||||
|
||||
@@ -16,10 +16,9 @@ export class AuthedController {
|
||||
constructor(
|
||||
private readonly getAuthedAccountService: GetAuthenticatedAccount,
|
||||
private readonly authApp: AuthenticationApplication,
|
||||
private readonly tenancyContext: TenancyContext,
|
||||
) {}
|
||||
|
||||
@Post('/signup/confirm/resend')
|
||||
@Post('/signup/verify/resend')
|
||||
@ApiOperation({ summary: 'Resend the signup confirmation message' })
|
||||
@ApiBody({
|
||||
schema: {
|
||||
|
||||
@@ -92,7 +92,10 @@ export class AuthSignupService {
|
||||
const isEmailExists = await this.systemUserModel.query().findOne({ email });
|
||||
|
||||
if (isEmailExists) {
|
||||
throw new ServiceError(ERRORS.EMAIL_EXISTS);
|
||||
throw new ServiceError(
|
||||
ERRORS.EMAIL_EXISTS,
|
||||
'The given email address is already signed-up',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,11 +123,17 @@ export class AuthSignupService {
|
||||
);
|
||||
|
||||
if (!isAllowedEmail && !isAllowedDomain) {
|
||||
throw new ServiceError(ERRORS.SIGNUP_RESTRICTED_NOT_ALLOWED);
|
||||
throw new ServiceError(
|
||||
ERRORS.SIGNUP_RESTRICTED_NOT_ALLOWED,
|
||||
'The given email address format is not allowed to signup.',
|
||||
);
|
||||
}
|
||||
// Throw error if the signup is disabled with no exceptions.
|
||||
} else {
|
||||
throw new ServiceError(ERRORS.SIGNUP_RESTRICTED);
|
||||
throw new ServiceError(
|
||||
ERRORS.SIGNUP_RESTRICTED,
|
||||
'The sign-up is disabled',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import * as R from 'ramda';
|
||||
import { defaultTo, toArray } from 'lodash';
|
||||
import { I18nService } from 'nestjs-i18n';
|
||||
import { FinancialSheetStructure } from '../../common/FinancialSheetStructure';
|
||||
import {
|
||||
BALANCE_SHEET_SCHEMA_NODE_TYPE,
|
||||
@@ -61,7 +62,7 @@ export const BalanceSheetAccounts = <T extends GConstructor<FinancialSheet>>(
|
||||
/**
|
||||
* Localization.
|
||||
*/
|
||||
readonly i18n: any;
|
||||
readonly i18n: I18nService;
|
||||
|
||||
/**
|
||||
* Balance sheet repository.
|
||||
@@ -172,7 +173,7 @@ export const BalanceSheetAccounts = <T extends GConstructor<FinancialSheet>>(
|
||||
|
||||
return {
|
||||
id: node.id,
|
||||
name: this.i18n.__(node.name),
|
||||
name: this.i18n.t(node.name),
|
||||
nodeType: BALANCE_SHEET_SCHEMA_NODE_TYPE.ACCOUNTS,
|
||||
type: BALANCE_SHEET_SCHEMA_NODE_TYPE.ACCOUNTS,
|
||||
children: [...accounts, ...children],
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// @ts-nocheck
|
||||
import * as R from 'ramda';
|
||||
import { I18nService } from 'nestjs-i18n';
|
||||
import {
|
||||
BALANCE_SHEET_SCHEMA_NODE_TYPE,
|
||||
IBalanceSheetAggregateNode,
|
||||
@@ -31,6 +32,8 @@ export const BalanceSheetAggregators = <T extends GConstructor<FinancialSheet>>(
|
||||
FinancialSheetStructure,
|
||||
BalanceSheetBase,
|
||||
)(Base) {
|
||||
public readonly i18n: I18nService;
|
||||
|
||||
/**
|
||||
* Balance sheet query.
|
||||
* @param {BalanceSheetQuery}
|
||||
@@ -89,7 +92,7 @@ export const BalanceSheetAggregators = <T extends GConstructor<FinancialSheet>>(
|
||||
const total = this.getTotalOfNodes(node.children);
|
||||
|
||||
return {
|
||||
name: this.i18n.__(node.name),
|
||||
name: this.i18n.t(node.name),
|
||||
id: node.id,
|
||||
nodeType: BALANCE_SHEET_SCHEMA_NODE_TYPE.AGGREGATE,
|
||||
type: BALANCE_SHEET_SCHEMA_NODE_TYPE.AGGREGATE,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// @ts-nocheck
|
||||
import * as R from 'ramda';
|
||||
import { I18nService } from 'nestjs-i18n';
|
||||
import {
|
||||
BALANCE_SHEET_SCHEMA_NODE_TYPE,
|
||||
IBalanceSheetDataNode,
|
||||
@@ -32,6 +33,7 @@ export const BalanceSheetNetIncome = <T extends GConstructor<FinancialSheet>>(
|
||||
)(Base) {
|
||||
public repository: BalanceSheetRepository;
|
||||
public query: BalanceSheetQuery;
|
||||
public i18n: I18nService;
|
||||
|
||||
/**
|
||||
* Retrieves the closing balance of income accounts.
|
||||
@@ -74,7 +76,7 @@ export const BalanceSheetNetIncome = <T extends GConstructor<FinancialSheet>>(
|
||||
|
||||
return {
|
||||
id: node.id,
|
||||
name: this.i18n.__(node.name),
|
||||
name: this.i18n.t(node.name),
|
||||
nodeType: BALANCE_SHEET_SCHEMA_NODE_TYPE.NET_INCOME,
|
||||
total: this.getTotalAmountMeta(total),
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// @ts-nocheck
|
||||
import * as R from 'ramda';
|
||||
import { I18nService } from 'nestjs-i18n';
|
||||
import {
|
||||
IBalanceSheetStatementData,
|
||||
IBalanceSheetQuery,
|
||||
@@ -43,6 +44,8 @@ export class BalanceSheetTable extends R.pipe(
|
||||
BalanceSheetTablePreviousYear,
|
||||
BalanceSheetTablePreviousPeriod,
|
||||
)(FinancialSheet) {
|
||||
public i18n: I18nService;
|
||||
|
||||
/**
|
||||
* Balance sheet data.
|
||||
* @param {IBalanceSheetStatementData}
|
||||
@@ -225,9 +228,7 @@ export class BalanceSheetTable extends R.pipe(
|
||||
return R.compose(
|
||||
R.unless(
|
||||
R.isEmpty,
|
||||
R.concat([
|
||||
{ key: 'total', label: this.i18n.__('balance_sheet.total') },
|
||||
]),
|
||||
R.concat([{ key: 'total', label: this.i18n.t('balance_sheet.total') }]),
|
||||
),
|
||||
R.concat(this.percentageColumns()),
|
||||
R.concat(this.getPreviousYearColumns()),
|
||||
@@ -243,7 +244,7 @@ export class BalanceSheetTable extends R.pipe(
|
||||
return [
|
||||
{
|
||||
key: 'total',
|
||||
label: this.i18n.__('balance_sheet.total'),
|
||||
label: this.i18n.t('balance_sheet.total'),
|
||||
children: this.totalColumnChildren(),
|
||||
},
|
||||
];
|
||||
@@ -271,7 +272,7 @@ export class BalanceSheetTable extends R.pipe(
|
||||
return R.compose(
|
||||
this.tableColumnsCellIndexing,
|
||||
R.concat([
|
||||
{ key: 'name', label: this.i18n.__('balance_sheet.account_name') },
|
||||
{ key: 'name', label: this.i18n.t('balance_sheet.account_name') },
|
||||
]),
|
||||
R.ifElse(
|
||||
this.query.isDatePeriodsColumnsType,
|
||||
|
||||
@@ -13,6 +13,8 @@ export const BalanceSheetTableDatePeriods = <
|
||||
Base: T,
|
||||
) =>
|
||||
class extends R.pipe(FinancialDatePeriods)(Base) {
|
||||
public i18n: I18nService;
|
||||
|
||||
/**
|
||||
* Retrieves the date periods based on the report query.
|
||||
* @returns {IDateRange[]}
|
||||
@@ -104,7 +106,7 @@ export const BalanceSheetTableDatePeriods = <
|
||||
R.unless(
|
||||
R.isEmpty,
|
||||
R.concat([
|
||||
{ key: `total`, label: this.i18n.__('balance_sheet.total') },
|
||||
{ key: `total`, label: this.i18n.t('balance_sheet.total') },
|
||||
]),
|
||||
),
|
||||
R.concat(this.percentageColumns()),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import * as moment from 'moment';
|
||||
import { IBalanceSheetQuery } from "./BalanceSheet.types";
|
||||
|
||||
export const MAP_CONFIG = { childrenPath: 'children', pathFormat: 'array' };
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// @ts-nocheck
|
||||
|
||||
|
||||
export const Features = {
|
||||
Warehouses: 'warehouses',
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function RegisterUserForm() {
|
||||
authRegisterMutate(values)
|
||||
.then(() => {
|
||||
authLoginMutate({
|
||||
crediential: values.email,
|
||||
email: values.email,
|
||||
password: values.password,
|
||||
}).catch(
|
||||
({
|
||||
|
||||
@@ -11,7 +11,7 @@ export const LOGIN_ERRORS = {
|
||||
|
||||
const REGISTER_ERRORS = {
|
||||
PHONE_NUMBER_EXISTS: 'PHONE_NUMBER_EXISTS',
|
||||
EMAIL_EXISTS: 'EMAIL.EXISTS',
|
||||
EMAIL_EXISTS: 'EMAIL_EXISTS',
|
||||
};
|
||||
|
||||
export const LoginSchema = Yup.object().shape({
|
||||
|
||||
@@ -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