2022-01-20 20:57:29 +00:00
|
|
|
import AccountsReceivablePayable from './AccountsReceivablePayable/AccountsReceivablePayable';
|
2021-11-04 10:31:26 +00:00
|
|
|
import BalanceSheet from './BalanceSheet/BalanceSheet';
|
|
|
|
import BankReconciliation from './BankReconciliation/BankReconciliation';
|
2022-01-20 20:57:29 +00:00
|
|
|
import GeneralLedger from './GeneralLedger/GeneralLedger';
|
2021-11-04 10:31:26 +00:00
|
|
|
import GSTR1 from './GoodsAndServiceTax/GSTR1';
|
|
|
|
import GSTR2 from './GoodsAndServiceTax/GSTR2';
|
2022-01-20 20:57:29 +00:00
|
|
|
import ProfitAndLoss from './ProfitAndLoss/ProfitAndLoss';
|
|
|
|
import PurchaseRegister from './PurchaseRegister/PurchaseRegister';
|
|
|
|
import SalesRegister from './SalesRegister/SalesRegister';
|
|
|
|
import TrialBalance from './TrialBalance/TrialBalance';
|
2018-04-26 10:23:27 +00:00
|
|
|
|
2022-03-22 08:21:00 +00:00
|
|
|
export function getReportData(method, filters) {
|
|
|
|
const reports = {
|
|
|
|
'general-ledger': GeneralLedger,
|
|
|
|
'profit-and-loss': ProfitAndLoss,
|
|
|
|
'balance-sheet': BalanceSheet,
|
|
|
|
'trial-balance': TrialBalance,
|
|
|
|
'gstr-1': GSTR1,
|
|
|
|
'gstr-2': GSTR2,
|
|
|
|
'sales-register': SalesRegister,
|
|
|
|
'purchase-register': PurchaseRegister,
|
|
|
|
'bank-reconciliation': BankReconciliation,
|
|
|
|
};
|
2018-04-27 11:33:36 +00:00
|
|
|
|
2022-03-22 08:21:00 +00:00
|
|
|
if (method === 'accounts-receivable') {
|
|
|
|
return new AccountsReceivablePayable().run('Receivable', filters);
|
|
|
|
}
|
2018-04-26 10:23:27 +00:00
|
|
|
|
2022-03-22 08:21:00 +00:00
|
|
|
if (method === 'accounts-payable') {
|
|
|
|
return new AccountsReceivablePayable().run('Payable', filters);
|
|
|
|
}
|
2019-07-30 12:02:49 +00:00
|
|
|
|
2022-03-22 08:21:00 +00:00
|
|
|
const ReportClass = reports[method];
|
|
|
|
return new ReportClass().run(filters);
|
2018-04-19 14:31:35 +00:00
|
|
|
}
|