mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
feat: export reports csv and xlsx (#286)
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
IAgingSummaryData,
|
||||
} from './AgingReport';
|
||||
import { INumberFormatQuery } from './FinancialStatements';
|
||||
import { IFinancialTable } from './Table';
|
||||
|
||||
export interface IAPAgingSummaryQuery extends IAgingSummaryQuery {
|
||||
vendorsIds: number[];
|
||||
@@ -34,3 +35,8 @@ export interface IAPAgingSummaryMeta {
|
||||
baseCurrency: string;
|
||||
organizationName: string;
|
||||
}
|
||||
|
||||
export interface IAPAgingSummaryTable extends IFinancialTable {
|
||||
query: IAPAgingSummaryQuery;
|
||||
meta: IAPAgingSummaryMeta;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
IAgingSummaryContact,
|
||||
IAgingSummaryData,
|
||||
} from './AgingReport';
|
||||
import { IFinancialTable } from './Table';
|
||||
|
||||
export interface IARAgingSummaryQuery extends IAgingSummaryQuery {
|
||||
customersIds: number[];
|
||||
@@ -26,3 +27,8 @@ export interface IARAgingSummaryMeta {
|
||||
organizationName: string;
|
||||
baseCurrency: string;
|
||||
}
|
||||
|
||||
export interface IARAgingSummaryTable extends IFinancialTable {
|
||||
meta: IARAgingSummaryMeta;
|
||||
query: IARAgingSummaryQuery;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
IFormatNumberSettings,
|
||||
IFinancialSheetBranchesQuery,
|
||||
} from './FinancialStatements';
|
||||
import { IFinancialTable } from './Table';
|
||||
|
||||
// Balance sheet schema nodes types.
|
||||
export enum BALANCE_SHEET_SCHEMA_NODE_TYPE {
|
||||
@@ -215,3 +216,8 @@ export enum IAccountTransactionsGroupBy {
|
||||
Month = 'month',
|
||||
Week = 'week',
|
||||
}
|
||||
|
||||
export interface IBalanceSheetTable extends IFinancialTable {
|
||||
meta: IBalanceSheetMeta;
|
||||
query: IBalanceSheetQuery;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { INumberFormatQuery } from './FinancialStatements';
|
||||
import { IAccount } from './Account';
|
||||
import { ILedger } from './Ledger';
|
||||
import { ITableRow } from './Table';
|
||||
import { IFinancialTable, ITableRow } from './Table';
|
||||
|
||||
export interface ICashFlowStatementQuery {
|
||||
fromDate: Date | string;
|
||||
@@ -101,6 +101,11 @@ export interface ICashFlowStatementDOO {
|
||||
query: ICashFlowStatementQuery;
|
||||
}
|
||||
|
||||
export interface ICashFlowStatementTable extends IFinancialTable {
|
||||
meta: ICashFlowStatementMeta;
|
||||
query: ICashFlowStatementQuery;
|
||||
}
|
||||
|
||||
export interface ICashFlowStatementService {
|
||||
cashFlow(
|
||||
tenantId: number,
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { INumberFormatQuery } from './FinancialStatements';
|
||||
|
||||
import {
|
||||
IContactBalanceSummaryQuery,
|
||||
IContactBalanceSummaryAmount,
|
||||
IContactBalanceSummaryPercentage,
|
||||
IContactBalanceSummaryTotal,
|
||||
} from './ContactBalanceSummary';
|
||||
import { IFinancialTable } from './Table';
|
||||
|
||||
export interface ICustomerBalanceSummaryQuery
|
||||
extends IContactBalanceSummaryQuery {
|
||||
@@ -19,7 +18,7 @@ export interface ICustomerBalanceSummaryPercentage
|
||||
extends IContactBalanceSummaryPercentage {}
|
||||
|
||||
export interface ICustomerBalanceSummaryCustomer {
|
||||
id: number,
|
||||
id: number;
|
||||
customerName: string;
|
||||
total: ICustomerBalanceSummaryAmount;
|
||||
percentageOfColumn?: ICustomerBalanceSummaryPercentage;
|
||||
@@ -47,3 +46,7 @@ export interface ICustomerBalanceSummaryService {
|
||||
query: ICustomerBalanceSummaryQuery
|
||||
): Promise<ICustomerBalanceSummaryStatement>;
|
||||
}
|
||||
|
||||
export interface ICustomerBalanceSummaryTable extends IFinancialTable {
|
||||
query: ICustomerBalanceSummaryQuery;
|
||||
}
|
||||
|
||||
7
packages/server/src/interfaces/Http.ts
Normal file
7
packages/server/src/interfaces/Http.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export const ACCEPT_TYPE = {
|
||||
APPLICATION_PDF: 'application/pdf',
|
||||
APPLICATION_JSON: 'application/json',
|
||||
APPLICATION_JSON_TABLE: 'application/json+table',
|
||||
APPLICATION_XLSX: 'application/xlsx',
|
||||
APPLICATION_CSV: 'application/csv',
|
||||
};
|
||||
@@ -1,13 +1,12 @@
|
||||
import {
|
||||
INumberFormatQuery,
|
||||
} from './FinancialStatements';
|
||||
import { INumberFormatQuery } from './FinancialStatements';
|
||||
import { IFinancialTable } from './Table';
|
||||
|
||||
export interface IInventoryDetailsQuery {
|
||||
fromDate: Date | string;
|
||||
toDate: Date | string;
|
||||
numberFormat: INumberFormatQuery;
|
||||
noneTransactions: boolean;
|
||||
itemsIds: number[]
|
||||
itemsIds: number[];
|
||||
|
||||
warehousesIds?: number[];
|
||||
branchesIds?: number[];
|
||||
@@ -66,7 +65,7 @@ export interface IInventoryDetailsItemTransaction {
|
||||
cost: IInventoryDetailsNumber;
|
||||
value: IInventoryDetailsNumber;
|
||||
profitMargin: IInventoryDetailsNumber;
|
||||
|
||||
|
||||
rate: IInventoryDetailsNumber;
|
||||
|
||||
runningQuantity: IInventoryDetailsNumber;
|
||||
@@ -80,7 +79,6 @@ export type IInventoryDetailsNode =
|
||||
| IInventoryDetailsItemTransaction;
|
||||
export type IInventoryDetailsData = IInventoryDetailsItem[];
|
||||
|
||||
|
||||
export interface IInventoryItemDetailMeta {
|
||||
isCostComputeRunning: boolean;
|
||||
organizationName: string;
|
||||
@@ -91,4 +89,9 @@ export interface IInvetoryItemDetailDOO {
|
||||
data: IInventoryDetailsData;
|
||||
query: IInventoryDetailsQuery;
|
||||
meta: IInventoryItemDetailMeta;
|
||||
}
|
||||
}
|
||||
|
||||
export interface IInvetoryItemDetailsTable extends IFinancialTable {
|
||||
query: IInventoryDetailsQuery;
|
||||
meta: IInventoryItemDetailMeta;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import {
|
||||
IFinancialSheetBranchesQuery,
|
||||
INumberFormatQuery,
|
||||
} from './FinancialStatements';
|
||||
import { IFinancialTable } from './Table';
|
||||
|
||||
export enum ProfitLossAggregateNodeId {
|
||||
INCOME = 'INCOME',
|
||||
@@ -177,3 +178,9 @@ export enum ProfitLossSheetRowType {
|
||||
ACCOUNT = 'ACCOUNT',
|
||||
TOTAL = 'TOTAL',
|
||||
}
|
||||
|
||||
|
||||
export interface IProfitLossSheetTable extends IFinancialTable{
|
||||
meta: IProfitLossSheetMeta;
|
||||
query: IProfitLossSheetQuery;
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import { IFinancialTable } from "./Table";
|
||||
|
||||
export interface SalesTaxLiabilitySummaryQuery {
|
||||
fromDate: Date;
|
||||
toDate: Date;
|
||||
@@ -49,3 +51,8 @@ export interface SalesTaxLiabilitySummaryMeta {
|
||||
organizationName: string;
|
||||
baseCurrency: string;
|
||||
}
|
||||
|
||||
export interface ISalesTaxLiabilitySummaryTable extends IFinancialTable {
|
||||
query: SalesTaxLiabilitySummaryQuery;
|
||||
meta: SalesTaxLiabilitySummaryMeta;
|
||||
}
|
||||
@@ -10,7 +10,7 @@ export interface ITableCell {
|
||||
}
|
||||
|
||||
export type ITableRow = {
|
||||
rows: ITableCell[];
|
||||
cells: ITableCell[];
|
||||
};
|
||||
|
||||
export interface ITableColumn {
|
||||
@@ -28,4 +28,13 @@ export interface ITable {
|
||||
export interface ITableColumnAccessor {
|
||||
key: string;
|
||||
accessor: string;
|
||||
}
|
||||
}
|
||||
|
||||
export interface ITableData {
|
||||
columns: ITableColumn[];
|
||||
rows: ITableRow[];
|
||||
}
|
||||
|
||||
export interface IFinancialTable {
|
||||
table: ITableData;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { IFinancialTable, ITableData } from './Table';
|
||||
import {
|
||||
ITransactionsByContactsAmount,
|
||||
ITransactionsByContactsTransaction,
|
||||
@@ -26,6 +27,11 @@ export type ITransactionsByCustomersData = ITransactionsByCustomersCustomer[];
|
||||
|
||||
export interface ITransactionsByCustomersStatement {
|
||||
data: ITransactionsByCustomersData;
|
||||
query: ITransactionsByCustomersFilter;
|
||||
}
|
||||
|
||||
export interface ITransactionsByCustomersTable extends IFinancialTable {
|
||||
query: ITransactionsByCustomersFilter;
|
||||
}
|
||||
|
||||
export interface ITransactionsByCustomersService {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { IFinancialTable } from './Table';
|
||||
import {
|
||||
ITransactionsByContactsAmount,
|
||||
ITransactionsByContactsTransaction,
|
||||
@@ -34,3 +35,7 @@ export interface ITransactionsByVendorsService {
|
||||
filter: ITransactionsByVendorsFilter
|
||||
): Promise<ITransactionsByVendorsStatement>;
|
||||
}
|
||||
|
||||
export interface ITransactionsByVendorTable extends IFinancialTable {
|
||||
query: ITransactionsByVendorsFilter;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { INumberFormatQuery } from './FinancialStatements';
|
||||
import { IFinancialTable } from './Table';
|
||||
|
||||
export interface ITrialBalanceSheetQuery {
|
||||
fromDate: Date | string;
|
||||
@@ -48,3 +49,8 @@ export interface ITrialBalanceStatement {
|
||||
query: ITrialBalanceSheetQuery;
|
||||
meta: ITrialBalanceSheetMeta;
|
||||
}
|
||||
|
||||
export interface ITrialBalanceSheetTable extends IFinancialTable {
|
||||
meta: ITrialBalanceSheetMeta;
|
||||
query: ITrialBalanceSheetQuery;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { INumberFormatQuery } from './FinancialStatements';
|
||||
import { IFinancialTable } from './Table';
|
||||
|
||||
export interface IVendorBalanceSummaryQuery {
|
||||
asDate: Date;
|
||||
vendorsIds: number[],
|
||||
vendorsIds: number[];
|
||||
numberFormat: INumberFormatQuery;
|
||||
percentageColumn: boolean;
|
||||
noneTransactions: boolean;
|
||||
@@ -45,6 +46,10 @@ export interface IVendorBalanceSummaryStatement {
|
||||
export interface IVendorBalanceSummaryService {
|
||||
vendorBalanceSummary(
|
||||
tenantId: number,
|
||||
query: IVendorBalanceSummaryQuery,
|
||||
query: IVendorBalanceSummaryQuery
|
||||
): Promise<IVendorBalanceSummaryStatement>;
|
||||
}
|
||||
|
||||
export interface IVendorBalanceSummaryTable extends IFinancialTable {
|
||||
query: IVendorBalanceSummaryQuery;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user