mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
WIP Financial statements.
This commit is contained in:
@@ -5,12 +5,12 @@ import useAsync from 'hooks/async';
|
||||
import BalanceSheetConnect from 'connectors/BalanceSheet.connect';
|
||||
import {useIntl} from 'react-intl';
|
||||
import BalanceSheetHeader from './BalanceSheetHeader';
|
||||
import LoadingIndicator from 'components/LoadingIndicator';
|
||||
import BalanceSheetTable from './BalanceSheetTable';
|
||||
import moment from 'moment';
|
||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import BalanceSheetActionsBar from './BalanceSheetActionsBar';
|
||||
import SettingsConnect from 'connectors/Settings.connect';
|
||||
|
||||
function BalanceSheet({
|
||||
fetchBalanceSheet,
|
||||
@@ -18,6 +18,7 @@ function BalanceSheet({
|
||||
balanceSheetLoading,
|
||||
getBalanceSheetIndex,
|
||||
getBalanceSheet,
|
||||
organizationSettings
|
||||
}) {
|
||||
const intl = useIntl();
|
||||
const [filter, setFilter] = useState({
|
||||
@@ -70,6 +71,7 @@ function BalanceSheet({
|
||||
|
||||
<div class="financial-statement__body">
|
||||
<BalanceSheetTable
|
||||
companyName={organizationSettings.name}
|
||||
loading={balanceSheetLoading}
|
||||
balanceSheetIndex={balanceSheetIndex}
|
||||
onFetchData={handleFetchData} />
|
||||
@@ -83,4 +85,5 @@ function BalanceSheet({
|
||||
export default compose(
|
||||
DashboardConnect,
|
||||
BalanceSheetConnect,
|
||||
SettingsConnect,
|
||||
)(BalanceSheet);
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
} from 'utils';
|
||||
|
||||
function BalanceSheetTable({
|
||||
companyName,
|
||||
balanceSheetAccounts,
|
||||
balanceSheetColumns,
|
||||
balanceSheetQuery,
|
||||
@@ -110,9 +111,11 @@ function BalanceSheetTable({
|
||||
|
||||
return (
|
||||
<FinancialSheet
|
||||
companyTitle={'Facebook, Incopration'}
|
||||
companyName={companyName}
|
||||
sheetType={'Balance Sheet'}
|
||||
date={asDate}
|
||||
fromDate={balanceSheetQuery.from_date}
|
||||
toDate={balanceSheetQuery.to_date}
|
||||
basis={balanceSheetQuery.basis}
|
||||
loading={loading}>
|
||||
|
||||
<DataTable
|
||||
|
||||
@@ -8,9 +8,9 @@ import GeneralLedgerHeader from './GeneralLedgerHeader';
|
||||
import {compose} from 'utils';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider'
|
||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||
import DashboardActionsBar from 'components/Accounts/AccountsActionsBar'
|
||||
import GeneralLedgerActionsBar from './GeneralLedgerActionsBar';
|
||||
import AccountsConnect from 'connectors/Accounts.connector';
|
||||
import SettingsConnect from 'connectors/Settings.connect';
|
||||
|
||||
function GeneralLedger({
|
||||
changePageTitle,
|
||||
@@ -19,6 +19,7 @@ function GeneralLedger({
|
||||
fetchGeneralLedger,
|
||||
generalLedgerSheetLoading,
|
||||
fetchAccounts,
|
||||
organizationSettings,
|
||||
}) {
|
||||
const [filter, setFilter] = useState({
|
||||
from_date: moment().startOf('year').format('YYYY-MM-DD'),
|
||||
@@ -80,6 +81,7 @@ function GeneralLedger({
|
||||
|
||||
<div class="financial-statement__table">
|
||||
<GeneralLedgerTable
|
||||
companyName={organizationSettings.name}
|
||||
loading={generalLedgerSheetLoading}
|
||||
data={[
|
||||
... (generalLedgerSheet) ?
|
||||
@@ -97,4 +99,5 @@ export default compose(
|
||||
DashboardConnect,
|
||||
AccountsConnect,
|
||||
GeneralLedgerConnect,
|
||||
SettingsConnect,
|
||||
)(GeneralLedger);
|
||||
@@ -16,6 +16,7 @@ const ROW_TYPE = {
|
||||
}
|
||||
|
||||
export default function GeneralLedgerTable({
|
||||
companyName,
|
||||
onFetchData,
|
||||
loading,
|
||||
data,
|
||||
@@ -144,7 +145,7 @@ export default function GeneralLedgerTable({
|
||||
|
||||
return (
|
||||
<FinancialSheet
|
||||
companyTitle={'Facebook, Incopration'}
|
||||
companyName={companyName}
|
||||
sheetType={'General Ledger Sheet'}
|
||||
date={new Date()}
|
||||
name="general-ledger"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React, {useState, useCallback, useEffect, useMemo} from 'react';
|
||||
import {compose} from 'utils';
|
||||
import LoadingIndicator from 'components/LoadingIndicator';
|
||||
import JournalConnect from 'connectors/Journal.connect';
|
||||
import JournalHeader from 'containers/Dashboard/FinancialStatements/Journal/JournalHeader';
|
||||
import useAsync from 'hooks/async';
|
||||
@@ -11,6 +10,7 @@ import DashboardConnect from 'connectors/Dashboard.connector';
|
||||
import JournalActionsBar from './JournalActionsBar';
|
||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import SettingsConnect from 'connectors/Settings.connect';
|
||||
|
||||
function Journal({
|
||||
fetchJournalSheet,
|
||||
@@ -18,6 +18,7 @@ function Journal({
|
||||
getJournalSheetIndex,
|
||||
changePageTitle,
|
||||
journalSheetLoading,
|
||||
organizationSettings,
|
||||
}) {
|
||||
const [filter, setFilter] = useState({
|
||||
from_date: moment().startOf('year').format('YYYY-MM-DD'),
|
||||
@@ -83,6 +84,7 @@ function Journal({
|
||||
|
||||
<div class="financial-statement__table">
|
||||
<JournalTable
|
||||
companyName={organizationSettings.name}
|
||||
data={[
|
||||
...(journalSheet && journalSheet.tableRows)
|
||||
? journalSheet.tableRows : []
|
||||
@@ -99,4 +101,5 @@ function Journal({
|
||||
export default compose(
|
||||
JournalConnect,
|
||||
DashboardConnect,
|
||||
SettingsConnect,
|
||||
)(Journal);
|
||||
@@ -14,6 +14,7 @@ function JournalSheetTable({
|
||||
onFetchData,
|
||||
data,
|
||||
loading,
|
||||
companyName,
|
||||
}) {
|
||||
const rowTypeFilter = (rowType, value, types) => {
|
||||
return (types.indexOf(rowType) === -1) ? '' : value;
|
||||
@@ -76,7 +77,7 @@ function JournalSheetTable({
|
||||
|
||||
return (
|
||||
<FinancialSheet
|
||||
companyTitle={'Facebook, Incopration'}
|
||||
companyName={companyName}
|
||||
sheetType={'Journal Sheet'}
|
||||
date={new Date()}
|
||||
name="journal"
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
import React, {useState, useMemo, useCallback, useEffect} from 'react';
|
||||
import ProfitLossSheetHeader from './ProfitLossSheetHeader';
|
||||
import ProfitLossSheetTable from './ProfitLossSheetTable';
|
||||
import LoadingIndicator from 'components/LoadingIndicator';
|
||||
import moment from 'moment';
|
||||
import useAsync from 'hooks/async';
|
||||
import {compose} from 'utils';
|
||||
import ProfitLossSheetHeader from './ProfitLossSheetHeader';
|
||||
import ProfitLossSheetTable from './ProfitLossSheetTable';
|
||||
import DashboardConnect from 'connectors/Dashboard.connector';
|
||||
import ProfitLossSheetConnect from 'connectors/ProfitLossSheet.connect';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider'
|
||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent'
|
||||
import ProfitLossActionsBar from './ProfitLossActionsBar';
|
||||
import moment from 'moment';
|
||||
import SettingsConnect from 'connectors/Settings.connect';
|
||||
|
||||
|
||||
function ProfitLossSheet({
|
||||
changePageTitle,
|
||||
fetchProfitLossSheet,
|
||||
getProfitLossSheetIndex,
|
||||
profitLossSheetLoading,
|
||||
organizationSettings,
|
||||
}) {
|
||||
const [filter, setFilter] = useState({
|
||||
basis: 'cash',
|
||||
@@ -66,6 +68,7 @@ function ProfitLossSheet({
|
||||
|
||||
<div class="financial-statement__body">
|
||||
<ProfitLossSheetTable
|
||||
companyName={organizationSettings.name}
|
||||
profitLossSheetIndex={profitLossSheetIndex}
|
||||
onFetchData={handleFetchData}
|
||||
loading={profitLossSheetLoading} />
|
||||
@@ -78,5 +81,6 @@ function ProfitLossSheet({
|
||||
|
||||
export default compose(
|
||||
DashboardConnect,
|
||||
ProfitLossSheetConnect
|
||||
ProfitLossSheetConnect,
|
||||
SettingsConnect,
|
||||
)(ProfitLossSheet);
|
||||
@@ -9,11 +9,11 @@ import { compose, defaultExpanderReducer } from 'utils';
|
||||
|
||||
function ProfitLossSheetTable({
|
||||
loading,
|
||||
data,
|
||||
onFetchData,
|
||||
profitLossTableRows,
|
||||
profitLossQuery,
|
||||
profitLossColumns
|
||||
profitLossColumns,
|
||||
companyName,
|
||||
}) {
|
||||
const columns = useMemo(() => [
|
||||
{
|
||||
@@ -113,11 +113,12 @@ function ProfitLossSheetTable({
|
||||
|
||||
return (
|
||||
<FinancialSheet
|
||||
companyTitle={'Facebook, Incopration'}
|
||||
companyName={companyName}
|
||||
sheetType={'Profit/Loss Sheet'}
|
||||
date={new Date()}
|
||||
name="profit-loss-sheet"
|
||||
loading={loading}>
|
||||
loading={loading}
|
||||
basis={profitLossQuery.basis}>
|
||||
|
||||
<DataTable
|
||||
className="bigcapital-datatable--financial-report"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React, { useEffect, useCallback, useState, useMemo } from 'react';
|
||||
import TrialBalanceSheetHeader from "./TrialBalanceSheetHeader";
|
||||
import LoadingIndicator from 'components/LoadingIndicator';
|
||||
import TrialBalanceSheetTable from './TrialBalanceSheetTable';
|
||||
import useAsync from 'hooks/async';
|
||||
import moment from 'moment';
|
||||
@@ -10,7 +9,7 @@ import DashboardConnect from 'connectors/Dashboard.connector';
|
||||
import TrialBalanceActionsBar from './TrialBalanceActionsBar';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||
|
||||
import SettingsConnect from 'connectors/Settings.connect';
|
||||
|
||||
function TrialBalanceSheet({
|
||||
changePageTitle,
|
||||
@@ -18,6 +17,7 @@ function TrialBalanceSheet({
|
||||
getTrialBalanceSheetIndex,
|
||||
getTrialBalanceAccounts,
|
||||
trialBalanceSheetLoading,
|
||||
organizationSettings,
|
||||
}) {
|
||||
const [filter, setFilter] = useState({
|
||||
from_date: moment().startOf('year').format('YYYY-MM-DD'),
|
||||
@@ -72,6 +72,7 @@ function TrialBalanceSheet({
|
||||
|
||||
<div class="financial-statement__body">
|
||||
<TrialBalanceSheetTable
|
||||
companyName={organizationSettings.name}
|
||||
trialBalanceSheetAccounts={trialBalanceAccounts}
|
||||
trialBalanceSheetIndex={trialBalanceSheetIndex}
|
||||
onFetchData={handleFetchData}
|
||||
@@ -86,4 +87,5 @@ function TrialBalanceSheet({
|
||||
export default compose(
|
||||
DashboardConnect,
|
||||
TrialBalanceSheetConnect,
|
||||
SettingsConnect,
|
||||
)(TrialBalanceSheet);
|
||||
@@ -8,6 +8,7 @@ export default function TrialBalanceSheetTable({
|
||||
trialBalanceSheetIndex,
|
||||
onFetchData,
|
||||
loading,
|
||||
companyName,
|
||||
}) {
|
||||
const [data, setData] = useState([]);
|
||||
|
||||
@@ -88,7 +89,7 @@ export default function TrialBalanceSheetTable({
|
||||
|
||||
return (
|
||||
<FinancialSheet
|
||||
companyTitle={'Facebook, Incopration'}
|
||||
companyName={companyName}
|
||||
sheetType={'Trial Balance Sheet'}
|
||||
date={new Date()}
|
||||
name="trial-balance"
|
||||
|
||||
Reference in New Issue
Block a user