mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +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();
|
const status = exception.getStatus();
|
||||||
|
|
||||||
response.status(status).json({
|
response.status(status).json({
|
||||||
statusCode: status,
|
errors: [
|
||||||
errorType: exception.errorType,
|
{
|
||||||
message: exception.message,
|
statusCode: status,
|
||||||
payload: exception.payload,
|
type: exception.errorType,
|
||||||
|
message: exception.message,
|
||||||
|
payload: exception.payload,
|
||||||
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ export class AuthController {
|
|||||||
return this.authApp.signUpConfirm(email, token);
|
return this.authApp.signUpConfirm(email, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Post('/send_reset_password')
|
@Post('/send_reset_password')
|
||||||
@ApiOperation({ summary: 'Send reset password email' })
|
@ApiOperation({ summary: 'Send reset password email' })
|
||||||
@ApiBody({
|
@ApiBody({
|
||||||
|
|||||||
@@ -16,10 +16,9 @@ export class AuthedController {
|
|||||||
constructor(
|
constructor(
|
||||||
private readonly getAuthedAccountService: GetAuthenticatedAccount,
|
private readonly getAuthedAccountService: GetAuthenticatedAccount,
|
||||||
private readonly authApp: AuthenticationApplication,
|
private readonly authApp: AuthenticationApplication,
|
||||||
private readonly tenancyContext: TenancyContext,
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
@Post('/signup/confirm/resend')
|
@Post('/signup/verify/resend')
|
||||||
@ApiOperation({ summary: 'Resend the signup confirmation message' })
|
@ApiOperation({ summary: 'Resend the signup confirmation message' })
|
||||||
@ApiBody({
|
@ApiBody({
|
||||||
schema: {
|
schema: {
|
||||||
|
|||||||
@@ -92,7 +92,10 @@ export class AuthSignupService {
|
|||||||
const isEmailExists = await this.systemUserModel.query().findOne({ email });
|
const isEmailExists = await this.systemUserModel.query().findOne({ email });
|
||||||
|
|
||||||
if (isEmailExists) {
|
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) {
|
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.
|
// Throw error if the signup is disabled with no exceptions.
|
||||||
} else {
|
} else {
|
||||||
throw new ServiceError(ERRORS.SIGNUP_RESTRICTED);
|
throw new ServiceError(
|
||||||
|
ERRORS.SIGNUP_RESTRICTED,
|
||||||
|
'The sign-up is disabled',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
import { defaultTo, toArray } from 'lodash';
|
import { defaultTo, toArray } from 'lodash';
|
||||||
|
import { I18nService } from 'nestjs-i18n';
|
||||||
import { FinancialSheetStructure } from '../../common/FinancialSheetStructure';
|
import { FinancialSheetStructure } from '../../common/FinancialSheetStructure';
|
||||||
import {
|
import {
|
||||||
BALANCE_SHEET_SCHEMA_NODE_TYPE,
|
BALANCE_SHEET_SCHEMA_NODE_TYPE,
|
||||||
@@ -61,7 +62,7 @@ export const BalanceSheetAccounts = <T extends GConstructor<FinancialSheet>>(
|
|||||||
/**
|
/**
|
||||||
* Localization.
|
* Localization.
|
||||||
*/
|
*/
|
||||||
readonly i18n: any;
|
readonly i18n: I18nService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Balance sheet repository.
|
* Balance sheet repository.
|
||||||
@@ -172,7 +173,7 @@ export const BalanceSheetAccounts = <T extends GConstructor<FinancialSheet>>(
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
id: node.id,
|
id: node.id,
|
||||||
name: this.i18n.__(node.name),
|
name: this.i18n.t(node.name),
|
||||||
nodeType: BALANCE_SHEET_SCHEMA_NODE_TYPE.ACCOUNTS,
|
nodeType: BALANCE_SHEET_SCHEMA_NODE_TYPE.ACCOUNTS,
|
||||||
type: BALANCE_SHEET_SCHEMA_NODE_TYPE.ACCOUNTS,
|
type: BALANCE_SHEET_SCHEMA_NODE_TYPE.ACCOUNTS,
|
||||||
children: [...accounts, ...children],
|
children: [...accounts, ...children],
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
|
import { I18nService } from 'nestjs-i18n';
|
||||||
import {
|
import {
|
||||||
BALANCE_SHEET_SCHEMA_NODE_TYPE,
|
BALANCE_SHEET_SCHEMA_NODE_TYPE,
|
||||||
IBalanceSheetAggregateNode,
|
IBalanceSheetAggregateNode,
|
||||||
@@ -31,6 +32,8 @@ export const BalanceSheetAggregators = <T extends GConstructor<FinancialSheet>>(
|
|||||||
FinancialSheetStructure,
|
FinancialSheetStructure,
|
||||||
BalanceSheetBase,
|
BalanceSheetBase,
|
||||||
)(Base) {
|
)(Base) {
|
||||||
|
public readonly i18n: I18nService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Balance sheet query.
|
* Balance sheet query.
|
||||||
* @param {BalanceSheetQuery}
|
* @param {BalanceSheetQuery}
|
||||||
@@ -89,7 +92,7 @@ export const BalanceSheetAggregators = <T extends GConstructor<FinancialSheet>>(
|
|||||||
const total = this.getTotalOfNodes(node.children);
|
const total = this.getTotalOfNodes(node.children);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: this.i18n.__(node.name),
|
name: this.i18n.t(node.name),
|
||||||
id: node.id,
|
id: node.id,
|
||||||
nodeType: BALANCE_SHEET_SCHEMA_NODE_TYPE.AGGREGATE,
|
nodeType: BALANCE_SHEET_SCHEMA_NODE_TYPE.AGGREGATE,
|
||||||
type: BALANCE_SHEET_SCHEMA_NODE_TYPE.AGGREGATE,
|
type: BALANCE_SHEET_SCHEMA_NODE_TYPE.AGGREGATE,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
|
import { I18nService } from 'nestjs-i18n';
|
||||||
import {
|
import {
|
||||||
BALANCE_SHEET_SCHEMA_NODE_TYPE,
|
BALANCE_SHEET_SCHEMA_NODE_TYPE,
|
||||||
IBalanceSheetDataNode,
|
IBalanceSheetDataNode,
|
||||||
@@ -32,6 +33,7 @@ export const BalanceSheetNetIncome = <T extends GConstructor<FinancialSheet>>(
|
|||||||
)(Base) {
|
)(Base) {
|
||||||
public repository: BalanceSheetRepository;
|
public repository: BalanceSheetRepository;
|
||||||
public query: BalanceSheetQuery;
|
public query: BalanceSheetQuery;
|
||||||
|
public i18n: I18nService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the closing balance of income accounts.
|
* Retrieves the closing balance of income accounts.
|
||||||
@@ -74,7 +76,7 @@ export const BalanceSheetNetIncome = <T extends GConstructor<FinancialSheet>>(
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
id: node.id,
|
id: node.id,
|
||||||
name: this.i18n.__(node.name),
|
name: this.i18n.t(node.name),
|
||||||
nodeType: BALANCE_SHEET_SCHEMA_NODE_TYPE.NET_INCOME,
|
nodeType: BALANCE_SHEET_SCHEMA_NODE_TYPE.NET_INCOME,
|
||||||
total: this.getTotalAmountMeta(total),
|
total: this.getTotalAmountMeta(total),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import * as R from 'ramda';
|
import * as R from 'ramda';
|
||||||
|
import { I18nService } from 'nestjs-i18n';
|
||||||
import {
|
import {
|
||||||
IBalanceSheetStatementData,
|
IBalanceSheetStatementData,
|
||||||
IBalanceSheetQuery,
|
IBalanceSheetQuery,
|
||||||
@@ -43,6 +44,8 @@ export class BalanceSheetTable extends R.pipe(
|
|||||||
BalanceSheetTablePreviousYear,
|
BalanceSheetTablePreviousYear,
|
||||||
BalanceSheetTablePreviousPeriod,
|
BalanceSheetTablePreviousPeriod,
|
||||||
)(FinancialSheet) {
|
)(FinancialSheet) {
|
||||||
|
public i18n: I18nService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Balance sheet data.
|
* Balance sheet data.
|
||||||
* @param {IBalanceSheetStatementData}
|
* @param {IBalanceSheetStatementData}
|
||||||
@@ -225,9 +228,7 @@ export class BalanceSheetTable extends R.pipe(
|
|||||||
return R.compose(
|
return R.compose(
|
||||||
R.unless(
|
R.unless(
|
||||||
R.isEmpty,
|
R.isEmpty,
|
||||||
R.concat([
|
R.concat([{ key: 'total', label: this.i18n.t('balance_sheet.total') }]),
|
||||||
{ key: 'total', label: this.i18n.__('balance_sheet.total') },
|
|
||||||
]),
|
|
||||||
),
|
),
|
||||||
R.concat(this.percentageColumns()),
|
R.concat(this.percentageColumns()),
|
||||||
R.concat(this.getPreviousYearColumns()),
|
R.concat(this.getPreviousYearColumns()),
|
||||||
@@ -243,7 +244,7 @@ export class BalanceSheetTable extends R.pipe(
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
key: 'total',
|
key: 'total',
|
||||||
label: this.i18n.__('balance_sheet.total'),
|
label: this.i18n.t('balance_sheet.total'),
|
||||||
children: this.totalColumnChildren(),
|
children: this.totalColumnChildren(),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -271,7 +272,7 @@ export class BalanceSheetTable extends R.pipe(
|
|||||||
return R.compose(
|
return R.compose(
|
||||||
this.tableColumnsCellIndexing,
|
this.tableColumnsCellIndexing,
|
||||||
R.concat([
|
R.concat([
|
||||||
{ key: 'name', label: this.i18n.__('balance_sheet.account_name') },
|
{ key: 'name', label: this.i18n.t('balance_sheet.account_name') },
|
||||||
]),
|
]),
|
||||||
R.ifElse(
|
R.ifElse(
|
||||||
this.query.isDatePeriodsColumnsType,
|
this.query.isDatePeriodsColumnsType,
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ export const BalanceSheetTableDatePeriods = <
|
|||||||
Base: T,
|
Base: T,
|
||||||
) =>
|
) =>
|
||||||
class extends R.pipe(FinancialDatePeriods)(Base) {
|
class extends R.pipe(FinancialDatePeriods)(Base) {
|
||||||
|
public i18n: I18nService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the date periods based on the report query.
|
* Retrieves the date periods based on the report query.
|
||||||
* @returns {IDateRange[]}
|
* @returns {IDateRange[]}
|
||||||
@@ -104,7 +106,7 @@ export const BalanceSheetTableDatePeriods = <
|
|||||||
R.unless(
|
R.unless(
|
||||||
R.isEmpty,
|
R.isEmpty,
|
||||||
R.concat([
|
R.concat([
|
||||||
{ key: `total`, label: this.i18n.__('balance_sheet.total') },
|
{ key: `total`, label: this.i18n.t('balance_sheet.total') },
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
R.concat(this.percentageColumns()),
|
R.concat(this.percentageColumns()),
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import * as moment from 'moment';
|
||||||
import { IBalanceSheetQuery } from "./BalanceSheet.types";
|
import { IBalanceSheetQuery } from "./BalanceSheet.types";
|
||||||
|
|
||||||
export const MAP_CONFIG = { childrenPath: 'children', pathFormat: 'array' };
|
export const MAP_CONFIG = { childrenPath: 'children', pathFormat: 'array' };
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// @ts-nocheck
|
|
||||||
|
|
||||||
|
|
||||||
export const Features = {
|
export const Features = {
|
||||||
Warehouses: 'warehouses',
|
Warehouses: 'warehouses',
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export default function RegisterUserForm() {
|
|||||||
authRegisterMutate(values)
|
authRegisterMutate(values)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
authLoginMutate({
|
authLoginMutate({
|
||||||
crediential: values.email,
|
email: values.email,
|
||||||
password: values.password,
|
password: values.password,
|
||||||
}).catch(
|
}).catch(
|
||||||
({
|
({
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export const LOGIN_ERRORS = {
|
|||||||
|
|
||||||
const REGISTER_ERRORS = {
|
const REGISTER_ERRORS = {
|
||||||
PHONE_NUMBER_EXISTS: 'PHONE_NUMBER_EXISTS',
|
PHONE_NUMBER_EXISTS: 'PHONE_NUMBER_EXISTS',
|
||||||
EMAIL_EXISTS: 'EMAIL.EXISTS',
|
EMAIL_EXISTS: 'EMAIL_EXISTS',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const LoginSchema = Yup.object().shape({
|
export const LoginSchema = Yup.object().shape({
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export function useAPAgingSummaryReport(query, props) {
|
|||||||
[t.FINANCIAL_REPORT, t.AP_AGING_SUMMARY, query],
|
[t.FINANCIAL_REPORT, t.AP_AGING_SUMMARY, query],
|
||||||
{
|
{
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/financial_statements/payable_aging_summary',
|
url: '/reports/payable-aging-summary',
|
||||||
params: query,
|
params: query,
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json+table',
|
Accept: 'application/json+table',
|
||||||
@@ -27,7 +27,7 @@ export function useAPAgingSummaryReport(query, props) {
|
|||||||
|
|
||||||
export const useAPAgingSheetXlsxExport = (query, args) => {
|
export const useAPAgingSheetXlsxExport = (query, args) => {
|
||||||
return useDownloadFile({
|
return useDownloadFile({
|
||||||
url: '/financial_statements/payable_aging_summary',
|
url: '/reports/payable-aging-summary',
|
||||||
config: {
|
config: {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/xlsx',
|
accept: 'application/xlsx',
|
||||||
@@ -41,7 +41,7 @@ export const useAPAgingSheetXlsxExport = (query, args) => {
|
|||||||
|
|
||||||
export const useAPAgingSheetCsvExport = (query, args) => {
|
export const useAPAgingSheetCsvExport = (query, args) => {
|
||||||
return useDownloadFile({
|
return useDownloadFile({
|
||||||
url: '/financial_statements/payable_aging_summary',
|
url: '/reports/payable-aging-summary',
|
||||||
config: {
|
config: {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/csv',
|
accept: 'application/csv',
|
||||||
@@ -58,7 +58,7 @@ export const useAPAgingSheetCsvExport = (query, args) => {
|
|||||||
*/
|
*/
|
||||||
export function useAPAgingSummaryPdf(query = {}) {
|
export function useAPAgingSummaryPdf(query = {}) {
|
||||||
return useRequestPdf({
|
return useRequestPdf({
|
||||||
url: `/financial_statements/payable_aging_summary`,
|
url: `/reports/payable-aging-summary`,
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export function useARAgingSummaryReport(query, props) {
|
|||||||
[t.FINANCIAL_REPORT, t.AR_AGING_SUMMARY, query],
|
[t.FINANCIAL_REPORT, t.AR_AGING_SUMMARY, query],
|
||||||
{
|
{
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/financial_statements/receivable_aging_summary',
|
url: '/reports/receivable-aging-summary',
|
||||||
params: query,
|
params: query,
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json+table',
|
Accept: 'application/json+table',
|
||||||
@@ -26,7 +26,7 @@ export function useARAgingSummaryReport(query, props) {
|
|||||||
|
|
||||||
export const useARAgingSheetXlsxExport = (query, args) => {
|
export const useARAgingSheetXlsxExport = (query, args) => {
|
||||||
return useDownloadFile({
|
return useDownloadFile({
|
||||||
url: '/financial_statements/receivable_aging_summary',
|
url: '/reports/receivable-aging-summary',
|
||||||
config: {
|
config: {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/xlsx',
|
accept: 'application/xlsx',
|
||||||
@@ -40,7 +40,7 @@ export const useARAgingSheetXlsxExport = (query, args) => {
|
|||||||
|
|
||||||
export const useARAgingSheetCsvExport = (query, args) => {
|
export const useARAgingSheetCsvExport = (query, args) => {
|
||||||
return useDownloadFile({
|
return useDownloadFile({
|
||||||
url: '/financial_statements/receivable_aging_summary',
|
url: '/reports/receivable-aging-summary',
|
||||||
config: {
|
config: {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/csv',
|
accept: 'application/csv',
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export function useBalanceSheet(query, props) {
|
|||||||
[t.FINANCIAL_REPORT, t.BALANCE_SHEET, query],
|
[t.FINANCIAL_REPORT, t.BALANCE_SHEET, query],
|
||||||
{
|
{
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/financial_statements/balance_sheet',
|
url: '/reports/balance-sheet',
|
||||||
params: query,
|
params: query,
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json+table',
|
Accept: 'application/json+table',
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export function useCashFlowStatementReport(query, props) {
|
|||||||
[t.FINANCIAL_REPORT, t.CASH_FLOW_STATEMENT, query],
|
[t.FINANCIAL_REPORT, t.CASH_FLOW_STATEMENT, query],
|
||||||
{
|
{
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/financial_statements/cash-flow',
|
url: '/reports/cashflow-statement',
|
||||||
params: query,
|
params: query,
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json+table',
|
Accept: 'application/json+table',
|
||||||
@@ -37,7 +37,7 @@ export function useCashFlowStatementReport(query, props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const useCashFlowStatementXlsxExport = (query, args) => {
|
export const useCashFlowStatementXlsxExport = (query, args) => {
|
||||||
const url = '/financial_statements/cash-flow';
|
const url = '/reports/cashflow-statement';
|
||||||
const config = {
|
const config = {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/xlsx',
|
accept: 'application/xlsx',
|
||||||
@@ -55,7 +55,7 @@ export const useCashFlowStatementXlsxExport = (query, args) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const useCashFlowStatementCsvExport = (query, args) => {
|
export const useCashFlowStatementCsvExport = (query, args) => {
|
||||||
const url = '/financial_statements/cash-flow';
|
const url = '/reports/cashflow-statement';
|
||||||
const config = {
|
const config = {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/csv',
|
accept: 'application/csv',
|
||||||
@@ -77,7 +77,7 @@ export const useCashFlowStatementCsvExport = (query, args) => {
|
|||||||
*/
|
*/
|
||||||
export function useCashflowSheetPdf(query = {}) {
|
export function useCashflowSheetPdf(query = {}) {
|
||||||
return useRequestPdf({
|
return useRequestPdf({
|
||||||
url: `/financial_statements/cash-flow`,
|
url: `/reports/cashflow-statement`,
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export function useCustomerBalanceSummaryReport(query, props) {
|
|||||||
[t.FINANCIAL_REPORT, t.CUSTOMERS_BALANCE_SUMMARY, query],
|
[t.FINANCIAL_REPORT, t.CUSTOMERS_BALANCE_SUMMARY, query],
|
||||||
{
|
{
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/financial_statements/customer-balance-summary',
|
url: '/reports/customer-balance-summary',
|
||||||
params: query,
|
params: query,
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json+table',
|
Accept: 'application/json+table',
|
||||||
@@ -34,7 +34,7 @@ export function useCustomerBalanceSummaryReport(query, props) {
|
|||||||
|
|
||||||
export const useCustomerBalanceSummaryXlsxExport = (query, args) => {
|
export const useCustomerBalanceSummaryXlsxExport = (query, args) => {
|
||||||
return useDownloadFile({
|
return useDownloadFile({
|
||||||
url: '/financial_statements/customer-balance-summary',
|
url: '/reports/customer-balance-summary',
|
||||||
config: {
|
config: {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/xlsx',
|
accept: 'application/xlsx',
|
||||||
@@ -48,7 +48,7 @@ export const useCustomerBalanceSummaryXlsxExport = (query, args) => {
|
|||||||
|
|
||||||
export const useCustomerBalanceSummaryCsvExport = (query, args) => {
|
export const useCustomerBalanceSummaryCsvExport = (query, args) => {
|
||||||
return useDownloadFile({
|
return useDownloadFile({
|
||||||
url: '/financial_statements/customer-balance-summary',
|
url: '/reports/customer-balance-summary',
|
||||||
config: {
|
config: {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/csv',
|
accept: 'application/csv',
|
||||||
@@ -65,7 +65,7 @@ export const useCustomerBalanceSummaryCsvExport = (query, args) => {
|
|||||||
*/
|
*/
|
||||||
export function useCustomerBalanceSummaryPdf(query = {}) {
|
export function useCustomerBalanceSummaryPdf(query = {}) {
|
||||||
return useRequestPdf({
|
return useRequestPdf({
|
||||||
url: `/financial_statements/customer-balance-summary`,
|
url: `/reports/customer-balance-summary`,
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export function useCustomersTransactionsReport(query, props) {
|
|||||||
[t.FINANCIAL_REPORT, t.CUSTOMERS_TRANSACTIONS, query],
|
[t.FINANCIAL_REPORT, t.CUSTOMERS_TRANSACTIONS, query],
|
||||||
{
|
{
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/financial_statements/transactions-by-customers',
|
url: '/reports/transactions-by-customers',
|
||||||
params: query,
|
params: query,
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json+table',
|
Accept: 'application/json+table',
|
||||||
@@ -33,7 +33,7 @@ export function useCustomersTransactionsReport(query, props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const useCustomersTransactionsXlsxExport = (query, args) => {
|
export const useCustomersTransactionsXlsxExport = (query, args) => {
|
||||||
const url = '/financial_statements/transactions-by-customers';
|
const url = '/reports/transactions-by-customers';
|
||||||
const config = {
|
const config = {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/xlsx',
|
accept: 'application/xlsx',
|
||||||
@@ -52,7 +52,7 @@ export const useCustomersTransactionsXlsxExport = (query, args) => {
|
|||||||
|
|
||||||
export const useCustomersTransactionsCsvExport = (query, args) => {
|
export const useCustomersTransactionsCsvExport = (query, args) => {
|
||||||
return useDownloadFile({
|
return useDownloadFile({
|
||||||
url: '/financial_statements/transactions-by-customers',
|
url: '/reports/transactions-by-customers',
|
||||||
config: {
|
config: {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/csv',
|
accept: 'application/csv',
|
||||||
@@ -69,7 +69,7 @@ export const useCustomersTransactionsCsvExport = (query, args) => {
|
|||||||
*/
|
*/
|
||||||
export const useCustomersTransactionsPdfExport = (query = {}) => {
|
export const useCustomersTransactionsPdfExport = (query = {}) => {
|
||||||
return useRequestPdf({
|
return useRequestPdf({
|
||||||
url: '/financial_statements/transactions-by-customers',
|
url: '/reports/transactions-by-customers',
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export function useGeneralLedgerSheet(query, props) {
|
|||||||
[t.FINANCIAL_REPORT, t.GENERAL_LEDGER, query],
|
[t.FINANCIAL_REPORT, t.GENERAL_LEDGER, query],
|
||||||
{
|
{
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/financial_statements/general_ledger',
|
url: '/reports/general-ledger',
|
||||||
params: query,
|
params: query,
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json+table',
|
Accept: 'application/json+table',
|
||||||
@@ -26,7 +26,7 @@ export function useGeneralLedgerSheet(query, props) {
|
|||||||
}
|
}
|
||||||
export const useGeneralLedgerSheetXlsxExport = (query, args) => {
|
export const useGeneralLedgerSheetXlsxExport = (query, args) => {
|
||||||
return useDownloadFile({
|
return useDownloadFile({
|
||||||
url: '/financial_statements/general_ledger',
|
url: '/reports/general-ledger',
|
||||||
config: {
|
config: {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/xlsx',
|
accept: 'application/xlsx',
|
||||||
@@ -40,7 +40,7 @@ export const useGeneralLedgerSheetXlsxExport = (query, args) => {
|
|||||||
|
|
||||||
export const useGeneralLedgerSheetCsvExport = (query, args) => {
|
export const useGeneralLedgerSheetCsvExport = (query, args) => {
|
||||||
return useDownloadFile({
|
return useDownloadFile({
|
||||||
url: '/financial_statements/general_ledger',
|
url: '/reports/general-ledger',
|
||||||
config: {
|
config: {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/csv',
|
accept: 'application/csv',
|
||||||
@@ -57,7 +57,7 @@ export const useGeneralLedgerSheetCsvExport = (query, args) => {
|
|||||||
*/
|
*/
|
||||||
export function useGeneralLedgerPdf(query = {}) {
|
export function useGeneralLedgerPdf(query = {}) {
|
||||||
return useRequestPdf({
|
return useRequestPdf({
|
||||||
url: `/financial_statements/general_ledger`,
|
url: `/reports/general-ledger`,
|
||||||
params: query
|
params: query,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export function useProfitLossSheet(query, props) {
|
|||||||
[t.FINANCIAL_REPORT, t.PROFIT_LOSS_SHEET, query],
|
[t.FINANCIAL_REPORT, t.PROFIT_LOSS_SHEET, query],
|
||||||
{
|
{
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/financial_statements/profit_loss_sheet',
|
url: '/reports/profit-loss-sheet',
|
||||||
params: query,
|
params: query,
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json+table',
|
Accept: 'application/json+table',
|
||||||
@@ -27,7 +27,7 @@ export function useProfitLossSheet(query, props) {
|
|||||||
|
|
||||||
export const useProfitLossSheetXlsxExport = (query, args) => {
|
export const useProfitLossSheetXlsxExport = (query, args) => {
|
||||||
return useDownloadFile({
|
return useDownloadFile({
|
||||||
url: '/financial_statements/profit_loss_sheet',
|
url: '/reports/profit-loss-sheet',
|
||||||
config: {
|
config: {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/xlsx',
|
accept: 'application/xlsx',
|
||||||
@@ -41,7 +41,7 @@ export const useProfitLossSheetXlsxExport = (query, args) => {
|
|||||||
|
|
||||||
export const useProfitLossSheetCsvExport = (query, args) => {
|
export const useProfitLossSheetCsvExport = (query, args) => {
|
||||||
return useDownloadFile({
|
return useDownloadFile({
|
||||||
url: '/financial_statements/profit_loss_sheet',
|
url: '/reports/profit-loss-sheet',
|
||||||
config: {
|
config: {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/csv',
|
accept: 'application/csv',
|
||||||
@@ -58,7 +58,7 @@ export const useProfitLossSheetCsvExport = (query, args) => {
|
|||||||
*/
|
*/
|
||||||
export function useProfitLossSheetPdf(query = {}) {
|
export function useProfitLossSheetPdf(query = {}) {
|
||||||
return useRequestPdf({
|
return useRequestPdf({
|
||||||
url: `/financial_statements/profit_loss_sheet`,
|
url: `/reports/profit-loss-sheet`,
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export function useTrialBalanceSheet(query, props) {
|
|||||||
[t.FINANCIAL_REPORT, t.TRIAL_BALANCE_SHEET, query],
|
[t.FINANCIAL_REPORT, t.TRIAL_BALANCE_SHEET, query],
|
||||||
{
|
{
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/financial_statements/trial_balance_sheet',
|
url: '/reports/trial-balance-sheet',
|
||||||
params: query,
|
params: query,
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json+table',
|
Accept: 'application/json+table',
|
||||||
@@ -27,7 +27,7 @@ export function useTrialBalanceSheet(query, props) {
|
|||||||
|
|
||||||
export const useTrialBalanceSheetXlsxExport = (query, args) => {
|
export const useTrialBalanceSheetXlsxExport = (query, args) => {
|
||||||
return useDownloadFile({
|
return useDownloadFile({
|
||||||
url: '/financial_statements/trial_balance_sheet',
|
url: '/reports/trial-balance-sheet',
|
||||||
config: {
|
config: {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/xlsx',
|
accept: 'application/xlsx',
|
||||||
@@ -41,7 +41,7 @@ export const useTrialBalanceSheetXlsxExport = (query, args) => {
|
|||||||
|
|
||||||
export const useTrialBalanceSheetCsvExport = (query, args) => {
|
export const useTrialBalanceSheetCsvExport = (query, args) => {
|
||||||
return useDownloadFile({
|
return useDownloadFile({
|
||||||
url: '/financial_statements/trial_balance_sheet',
|
url: '/reports/trial-balance-sheet',
|
||||||
config: {
|
config: {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/csv',
|
accept: 'application/csv',
|
||||||
@@ -58,7 +58,7 @@ export const useTrialBalanceSheetCsvExport = (query, args) => {
|
|||||||
*/
|
*/
|
||||||
export function useTrialBalanceSheetPdf(query = {}) {
|
export function useTrialBalanceSheetPdf(query = {}) {
|
||||||
return useRequestPdf({
|
return useRequestPdf({
|
||||||
url: `/financial_statements/trial_balance_sheet`,
|
url: `/reports/trial-balance-sheet`,
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,13 +12,12 @@ export function useVendorsBalanceSummaryReport(query, props) {
|
|||||||
[t.FINANCIAL_REPORT, t.VENDORS_BALANCE_SUMMARY, query],
|
[t.FINANCIAL_REPORT, t.VENDORS_BALANCE_SUMMARY, query],
|
||||||
{
|
{
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/financial_statements/vendor-balance-summary',
|
url: '/reports/vendor-balance-summary',
|
||||||
params: query,
|
params: query,
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json+table',
|
Accept: 'application/json+table',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
select: (res) => ({
|
select: (res) => ({
|
||||||
query: res.data.query,
|
query: res.data.query,
|
||||||
@@ -34,7 +33,7 @@ export function useVendorsBalanceSummaryReport(query, props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const useVendorBalanceSummaryXlsxExport = (args) => {
|
export const useVendorBalanceSummaryXlsxExport = (args) => {
|
||||||
const url = '/financial_statements/vendor-balance-summary';
|
const url = '/reports/vendor-balance-summary';
|
||||||
const config = {
|
const config = {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/xlsx',
|
accept: 'application/xlsx',
|
||||||
@@ -52,7 +51,7 @@ export const useVendorBalanceSummaryXlsxExport = (args) => {
|
|||||||
|
|
||||||
export const useVendorBalanceSummaryCsvExport = (args) => {
|
export const useVendorBalanceSummaryCsvExport = (args) => {
|
||||||
return useDownloadFile({
|
return useDownloadFile({
|
||||||
url: '/financial_statements/vendor-balance-summary',
|
url: '/reports/vendor-balance-summary',
|
||||||
config: {
|
config: {
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/csv',
|
accept: 'application/csv',
|
||||||
@@ -65,7 +64,7 @@ export const useVendorBalanceSummaryCsvExport = (args) => {
|
|||||||
|
|
||||||
export const useVendorBalanceSummaryPdfExport = (query = {}) => {
|
export const useVendorBalanceSummaryPdfExport = (query = {}) => {
|
||||||
return useRequestPdf({
|
return useRequestPdf({
|
||||||
url: 'financial_statements/vendor-balance-summary',
|
url: 'reports/vendor-balance-summary',
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ export function useAuthenticatedAccount(props) {
|
|||||||
url: `auth/account`,
|
url: `auth/account`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
select: (response) => response.data.data,
|
select: (response) => response.data,
|
||||||
defaultData: {},
|
defaultData: {},
|
||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
debugger;
|
debugger;
|
||||||
|
|||||||
Reference in New Issue
Block a user