mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
WIP Financial statements.
This commit is contained in:
@@ -122,15 +122,20 @@ export default function DataTable({
|
|||||||
// Renders table row.
|
// Renders table row.
|
||||||
const RenderRow = useCallback(({ style = {}, row }) => {
|
const RenderRow = useCallback(({ style = {}, row }) => {
|
||||||
prepareRow(row);
|
prepareRow(row);
|
||||||
|
const rowClasses = rowClassNames && rowClassNames(row.original);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div {...row.getRowProps({ style })} className="tr">
|
<div {...row.getRowProps({
|
||||||
|
className: classnames('tr', rowClasses),
|
||||||
|
style
|
||||||
|
})}>
|
||||||
{row.cells.map((cell) => {
|
{row.cells.map((cell) => {
|
||||||
return <div {...cell.getCellProps({
|
return <div {...cell.getCellProps({
|
||||||
className: classnames(cell.column.className || '', 'td'),
|
className: classnames(cell.column.className || '', 'td'),
|
||||||
})}>{ cell.render('Cell') }</div>
|
})}>{ cell.render('Cell') }</div>
|
||||||
})}
|
})}
|
||||||
</div>);
|
</div>);
|
||||||
}, [prepareRow]);
|
}, [prepareRow, rowClassNames]);
|
||||||
|
|
||||||
// Renders virtualize circle table rows.
|
// Renders virtualize circle table rows.
|
||||||
const RenderVirtualizedRows = useCallback(({ index, style }) => {
|
const RenderVirtualizedRows = useCallback(({ index, style }) => {
|
||||||
|
|||||||
@@ -1,40 +1,59 @@
|
|||||||
import React, { Children } from 'react';
|
import React, { useMemo, useCallback } from 'react';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import LoadingIndicator from 'components/LoadingIndicator';
|
import LoadingIndicator from 'components/LoadingIndicator';
|
||||||
|
|
||||||
export default function FinancialSheet({
|
export default function FinancialSheet({
|
||||||
companyTitle,
|
companyName,
|
||||||
sheetType,
|
sheetType,
|
||||||
date,
|
fromDate,
|
||||||
|
toDate,
|
||||||
children,
|
children,
|
||||||
accountingBasis,
|
accountingBasis,
|
||||||
name,
|
name,
|
||||||
loading,
|
loading,
|
||||||
className,
|
className,
|
||||||
|
basis,
|
||||||
}) {
|
}) {
|
||||||
const formattedDate = moment(date).format('DD MMMM YYYY')
|
const formattedFromDate = moment(fromDate).format('DD MMMM YYYY');
|
||||||
|
const formattedToDate = moment(toDate).format('DD MMMM YYYY');
|
||||||
const nameModifer = name ? `financial-sheet--${name}` : '';
|
const nameModifer = name ? `financial-sheet--${name}` : '';
|
||||||
|
|
||||||
|
const methodsLabels = useMemo(() => ({
|
||||||
|
'cash': 'Cash',
|
||||||
|
'accural': 'Accural',
|
||||||
|
}), []);
|
||||||
|
const getBasisLabel = useCallback((b) => methodsLabels[b], [methodsLabels]);
|
||||||
|
const basisLabel = useMemo(() => getBasisLabel(basis), [getBasisLabel, basis]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classnames('financial-sheet', nameModifer, className)}>
|
<div className={classnames('financial-sheet', nameModifer, className)}>
|
||||||
<LoadingIndicator loading={loading}>
|
<LoadingIndicator loading={loading} spinnerSize={34} />
|
||||||
<h1 class="financial-sheet__title">{ companyTitle }</h1>
|
|
||||||
|
<div className={classnames('financial-sheet__inner', {
|
||||||
|
'is-loading': loading,
|
||||||
|
})}>
|
||||||
|
<h1 class="financial-sheet__title">
|
||||||
|
{ companyName }
|
||||||
|
</h1>
|
||||||
<h6 class="financial-sheet__sheet-type">{ sheetType }</h6>
|
<h6 class="financial-sheet__sheet-type">{ sheetType }</h6>
|
||||||
<div class="financial-sheet__date">From { formattedDate } | To { formattedDate }</div>
|
<div class="financial-sheet__date">
|
||||||
|
From { formattedFromDate } | To { formattedToDate }
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="financial-sheet__table">
|
<div class="financial-sheet__table">
|
||||||
{ children }
|
{ children }
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="financial-sheet__accounting-basis">
|
<div class="financial-sheet__accounting-basis">
|
||||||
{ accountingBasis }
|
{ accountingBasis }
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="financial-sheet__basis">
|
{ (basisLabel) && (
|
||||||
Accounting Basis: Accural
|
<div class="financial-sheet__basis">
|
||||||
</div>
|
Accounting Basis: { basisLabel }
|
||||||
</LoadingIndicator>
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ export default function LoadingIndicator({
|
|||||||
<div style={componentStyle}>{ children }</div>
|
<div style={componentStyle}>{ children }</div>
|
||||||
), [children, componentStyle]);
|
), [children, componentStyle]);
|
||||||
|
|
||||||
const maybeRenderComponent = rendered && renderComponent;
|
const maybeRenderComponent = (rendered && children) && renderComponent;
|
||||||
const maybeRenderLoadingSpinner = loading && loadingComponent;
|
const maybeRenderLoadingSpinner = loading && loadingComponent;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
13
client/src/connectors/Settings.connect.js
Normal file
13
client/src/connectors/Settings.connect.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import {connect} from 'react-redux';
|
||||||
|
|
||||||
|
export const mapStateToProps = (state, props) => {
|
||||||
|
return {
|
||||||
|
organizationSettings: state.settings.data.organization,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export const mapDispatchToProps = (dispatch) => ({
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps);
|
||||||
@@ -5,12 +5,12 @@ import useAsync from 'hooks/async';
|
|||||||
import BalanceSheetConnect from 'connectors/BalanceSheet.connect';
|
import BalanceSheetConnect from 'connectors/BalanceSheet.connect';
|
||||||
import {useIntl} from 'react-intl';
|
import {useIntl} from 'react-intl';
|
||||||
import BalanceSheetHeader from './BalanceSheetHeader';
|
import BalanceSheetHeader from './BalanceSheetHeader';
|
||||||
import LoadingIndicator from 'components/LoadingIndicator';
|
|
||||||
import BalanceSheetTable from './BalanceSheetTable';
|
import BalanceSheetTable from './BalanceSheetTable';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||||
import BalanceSheetActionsBar from './BalanceSheetActionsBar';
|
import BalanceSheetActionsBar from './BalanceSheetActionsBar';
|
||||||
|
import SettingsConnect from 'connectors/Settings.connect';
|
||||||
|
|
||||||
function BalanceSheet({
|
function BalanceSheet({
|
||||||
fetchBalanceSheet,
|
fetchBalanceSheet,
|
||||||
@@ -18,6 +18,7 @@ function BalanceSheet({
|
|||||||
balanceSheetLoading,
|
balanceSheetLoading,
|
||||||
getBalanceSheetIndex,
|
getBalanceSheetIndex,
|
||||||
getBalanceSheet,
|
getBalanceSheet,
|
||||||
|
organizationSettings
|
||||||
}) {
|
}) {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const [filter, setFilter] = useState({
|
const [filter, setFilter] = useState({
|
||||||
@@ -70,6 +71,7 @@ function BalanceSheet({
|
|||||||
|
|
||||||
<div class="financial-statement__body">
|
<div class="financial-statement__body">
|
||||||
<BalanceSheetTable
|
<BalanceSheetTable
|
||||||
|
companyName={organizationSettings.name}
|
||||||
loading={balanceSheetLoading}
|
loading={balanceSheetLoading}
|
||||||
balanceSheetIndex={balanceSheetIndex}
|
balanceSheetIndex={balanceSheetIndex}
|
||||||
onFetchData={handleFetchData} />
|
onFetchData={handleFetchData} />
|
||||||
@@ -83,4 +85,5 @@ function BalanceSheet({
|
|||||||
export default compose(
|
export default compose(
|
||||||
DashboardConnect,
|
DashboardConnect,
|
||||||
BalanceSheetConnect,
|
BalanceSheetConnect,
|
||||||
|
SettingsConnect,
|
||||||
)(BalanceSheet);
|
)(BalanceSheet);
|
||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
} from 'utils';
|
} from 'utils';
|
||||||
|
|
||||||
function BalanceSheetTable({
|
function BalanceSheetTable({
|
||||||
|
companyName,
|
||||||
balanceSheetAccounts,
|
balanceSheetAccounts,
|
||||||
balanceSheetColumns,
|
balanceSheetColumns,
|
||||||
balanceSheetQuery,
|
balanceSheetQuery,
|
||||||
@@ -110,9 +111,11 @@ function BalanceSheetTable({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<FinancialSheet
|
<FinancialSheet
|
||||||
companyTitle={'Facebook, Incopration'}
|
companyName={companyName}
|
||||||
sheetType={'Balance Sheet'}
|
sheetType={'Balance Sheet'}
|
||||||
date={asDate}
|
fromDate={balanceSheetQuery.from_date}
|
||||||
|
toDate={balanceSheetQuery.to_date}
|
||||||
|
basis={balanceSheetQuery.basis}
|
||||||
loading={loading}>
|
loading={loading}>
|
||||||
|
|
||||||
<DataTable
|
<DataTable
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import GeneralLedgerHeader from './GeneralLedgerHeader';
|
|||||||
import {compose} from 'utils';
|
import {compose} from 'utils';
|
||||||
import DashboardInsider from 'components/Dashboard/DashboardInsider'
|
import DashboardInsider from 'components/Dashboard/DashboardInsider'
|
||||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||||
import DashboardActionsBar from 'components/Accounts/AccountsActionsBar'
|
|
||||||
import GeneralLedgerActionsBar from './GeneralLedgerActionsBar';
|
import GeneralLedgerActionsBar from './GeneralLedgerActionsBar';
|
||||||
import AccountsConnect from 'connectors/Accounts.connector';
|
import AccountsConnect from 'connectors/Accounts.connector';
|
||||||
|
import SettingsConnect from 'connectors/Settings.connect';
|
||||||
|
|
||||||
function GeneralLedger({
|
function GeneralLedger({
|
||||||
changePageTitle,
|
changePageTitle,
|
||||||
@@ -19,6 +19,7 @@ function GeneralLedger({
|
|||||||
fetchGeneralLedger,
|
fetchGeneralLedger,
|
||||||
generalLedgerSheetLoading,
|
generalLedgerSheetLoading,
|
||||||
fetchAccounts,
|
fetchAccounts,
|
||||||
|
organizationSettings,
|
||||||
}) {
|
}) {
|
||||||
const [filter, setFilter] = useState({
|
const [filter, setFilter] = useState({
|
||||||
from_date: moment().startOf('year').format('YYYY-MM-DD'),
|
from_date: moment().startOf('year').format('YYYY-MM-DD'),
|
||||||
@@ -80,6 +81,7 @@ function GeneralLedger({
|
|||||||
|
|
||||||
<div class="financial-statement__table">
|
<div class="financial-statement__table">
|
||||||
<GeneralLedgerTable
|
<GeneralLedgerTable
|
||||||
|
companyName={organizationSettings.name}
|
||||||
loading={generalLedgerSheetLoading}
|
loading={generalLedgerSheetLoading}
|
||||||
data={[
|
data={[
|
||||||
... (generalLedgerSheet) ?
|
... (generalLedgerSheet) ?
|
||||||
@@ -97,4 +99,5 @@ export default compose(
|
|||||||
DashboardConnect,
|
DashboardConnect,
|
||||||
AccountsConnect,
|
AccountsConnect,
|
||||||
GeneralLedgerConnect,
|
GeneralLedgerConnect,
|
||||||
|
SettingsConnect,
|
||||||
)(GeneralLedger);
|
)(GeneralLedger);
|
||||||
@@ -16,6 +16,7 @@ const ROW_TYPE = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function GeneralLedgerTable({
|
export default function GeneralLedgerTable({
|
||||||
|
companyName,
|
||||||
onFetchData,
|
onFetchData,
|
||||||
loading,
|
loading,
|
||||||
data,
|
data,
|
||||||
@@ -144,7 +145,7 @@ export default function GeneralLedgerTable({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<FinancialSheet
|
<FinancialSheet
|
||||||
companyTitle={'Facebook, Incopration'}
|
companyName={companyName}
|
||||||
sheetType={'General Ledger Sheet'}
|
sheetType={'General Ledger Sheet'}
|
||||||
date={new Date()}
|
date={new Date()}
|
||||||
name="general-ledger"
|
name="general-ledger"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import React, {useState, useCallback, useEffect, useMemo} from 'react';
|
import React, {useState, useCallback, useEffect, useMemo} from 'react';
|
||||||
import {compose} from 'utils';
|
import {compose} from 'utils';
|
||||||
import LoadingIndicator from 'components/LoadingIndicator';
|
|
||||||
import JournalConnect from 'connectors/Journal.connect';
|
import JournalConnect from 'connectors/Journal.connect';
|
||||||
import JournalHeader from 'containers/Dashboard/FinancialStatements/Journal/JournalHeader';
|
import JournalHeader from 'containers/Dashboard/FinancialStatements/Journal/JournalHeader';
|
||||||
import useAsync from 'hooks/async';
|
import useAsync from 'hooks/async';
|
||||||
@@ -11,6 +10,7 @@ import DashboardConnect from 'connectors/Dashboard.connector';
|
|||||||
import JournalActionsBar from './JournalActionsBar';
|
import JournalActionsBar from './JournalActionsBar';
|
||||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||||
|
import SettingsConnect from 'connectors/Settings.connect';
|
||||||
|
|
||||||
function Journal({
|
function Journal({
|
||||||
fetchJournalSheet,
|
fetchJournalSheet,
|
||||||
@@ -18,6 +18,7 @@ function Journal({
|
|||||||
getJournalSheetIndex,
|
getJournalSheetIndex,
|
||||||
changePageTitle,
|
changePageTitle,
|
||||||
journalSheetLoading,
|
journalSheetLoading,
|
||||||
|
organizationSettings,
|
||||||
}) {
|
}) {
|
||||||
const [filter, setFilter] = useState({
|
const [filter, setFilter] = useState({
|
||||||
from_date: moment().startOf('year').format('YYYY-MM-DD'),
|
from_date: moment().startOf('year').format('YYYY-MM-DD'),
|
||||||
@@ -83,6 +84,7 @@ function Journal({
|
|||||||
|
|
||||||
<div class="financial-statement__table">
|
<div class="financial-statement__table">
|
||||||
<JournalTable
|
<JournalTable
|
||||||
|
companyName={organizationSettings.name}
|
||||||
data={[
|
data={[
|
||||||
...(journalSheet && journalSheet.tableRows)
|
...(journalSheet && journalSheet.tableRows)
|
||||||
? journalSheet.tableRows : []
|
? journalSheet.tableRows : []
|
||||||
@@ -99,4 +101,5 @@ function Journal({
|
|||||||
export default compose(
|
export default compose(
|
||||||
JournalConnect,
|
JournalConnect,
|
||||||
DashboardConnect,
|
DashboardConnect,
|
||||||
|
SettingsConnect,
|
||||||
)(Journal);
|
)(Journal);
|
||||||
@@ -14,6 +14,7 @@ function JournalSheetTable({
|
|||||||
onFetchData,
|
onFetchData,
|
||||||
data,
|
data,
|
||||||
loading,
|
loading,
|
||||||
|
companyName,
|
||||||
}) {
|
}) {
|
||||||
const rowTypeFilter = (rowType, value, types) => {
|
const rowTypeFilter = (rowType, value, types) => {
|
||||||
return (types.indexOf(rowType) === -1) ? '' : value;
|
return (types.indexOf(rowType) === -1) ? '' : value;
|
||||||
@@ -76,7 +77,7 @@ function JournalSheetTable({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<FinancialSheet
|
<FinancialSheet
|
||||||
companyTitle={'Facebook, Incopration'}
|
companyName={companyName}
|
||||||
sheetType={'Journal Sheet'}
|
sheetType={'Journal Sheet'}
|
||||||
date={new Date()}
|
date={new Date()}
|
||||||
name="journal"
|
name="journal"
|
||||||
|
|||||||
@@ -1,21 +1,23 @@
|
|||||||
import React, {useState, useMemo, useCallback, useEffect} from 'react';
|
import React, {useState, useMemo, useCallback, useEffect} from 'react';
|
||||||
import ProfitLossSheetHeader from './ProfitLossSheetHeader';
|
import moment from 'moment';
|
||||||
import ProfitLossSheetTable from './ProfitLossSheetTable';
|
|
||||||
import LoadingIndicator from 'components/LoadingIndicator';
|
|
||||||
import useAsync from 'hooks/async';
|
import useAsync from 'hooks/async';
|
||||||
import {compose} from 'utils';
|
import {compose} from 'utils';
|
||||||
|
import ProfitLossSheetHeader from './ProfitLossSheetHeader';
|
||||||
|
import ProfitLossSheetTable from './ProfitLossSheetTable';
|
||||||
import DashboardConnect from 'connectors/Dashboard.connector';
|
import DashboardConnect from 'connectors/Dashboard.connector';
|
||||||
import ProfitLossSheetConnect from 'connectors/ProfitLossSheet.connect';
|
import ProfitLossSheetConnect from 'connectors/ProfitLossSheet.connect';
|
||||||
import DashboardInsider from 'components/Dashboard/DashboardInsider'
|
import DashboardInsider from 'components/Dashboard/DashboardInsider'
|
||||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent'
|
import DashboardPageContent from 'components/Dashboard/DashboardPageContent'
|
||||||
import ProfitLossActionsBar from './ProfitLossActionsBar';
|
import ProfitLossActionsBar from './ProfitLossActionsBar';
|
||||||
import moment from 'moment';
|
import SettingsConnect from 'connectors/Settings.connect';
|
||||||
|
|
||||||
|
|
||||||
function ProfitLossSheet({
|
function ProfitLossSheet({
|
||||||
changePageTitle,
|
changePageTitle,
|
||||||
fetchProfitLossSheet,
|
fetchProfitLossSheet,
|
||||||
getProfitLossSheetIndex,
|
getProfitLossSheetIndex,
|
||||||
profitLossSheetLoading,
|
profitLossSheetLoading,
|
||||||
|
organizationSettings,
|
||||||
}) {
|
}) {
|
||||||
const [filter, setFilter] = useState({
|
const [filter, setFilter] = useState({
|
||||||
basis: 'cash',
|
basis: 'cash',
|
||||||
@@ -66,6 +68,7 @@ function ProfitLossSheet({
|
|||||||
|
|
||||||
<div class="financial-statement__body">
|
<div class="financial-statement__body">
|
||||||
<ProfitLossSheetTable
|
<ProfitLossSheetTable
|
||||||
|
companyName={organizationSettings.name}
|
||||||
profitLossSheetIndex={profitLossSheetIndex}
|
profitLossSheetIndex={profitLossSheetIndex}
|
||||||
onFetchData={handleFetchData}
|
onFetchData={handleFetchData}
|
||||||
loading={profitLossSheetLoading} />
|
loading={profitLossSheetLoading} />
|
||||||
@@ -78,5 +81,6 @@ function ProfitLossSheet({
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
DashboardConnect,
|
DashboardConnect,
|
||||||
ProfitLossSheetConnect
|
ProfitLossSheetConnect,
|
||||||
|
SettingsConnect,
|
||||||
)(ProfitLossSheet);
|
)(ProfitLossSheet);
|
||||||
@@ -9,11 +9,11 @@ import { compose, defaultExpanderReducer } from 'utils';
|
|||||||
|
|
||||||
function ProfitLossSheetTable({
|
function ProfitLossSheetTable({
|
||||||
loading,
|
loading,
|
||||||
data,
|
|
||||||
onFetchData,
|
onFetchData,
|
||||||
profitLossTableRows,
|
profitLossTableRows,
|
||||||
profitLossQuery,
|
profitLossQuery,
|
||||||
profitLossColumns
|
profitLossColumns,
|
||||||
|
companyName,
|
||||||
}) {
|
}) {
|
||||||
const columns = useMemo(() => [
|
const columns = useMemo(() => [
|
||||||
{
|
{
|
||||||
@@ -113,11 +113,12 @@ function ProfitLossSheetTable({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<FinancialSheet
|
<FinancialSheet
|
||||||
companyTitle={'Facebook, Incopration'}
|
companyName={companyName}
|
||||||
sheetType={'Profit/Loss Sheet'}
|
sheetType={'Profit/Loss Sheet'}
|
||||||
date={new Date()}
|
date={new Date()}
|
||||||
name="profit-loss-sheet"
|
name="profit-loss-sheet"
|
||||||
loading={loading}>
|
loading={loading}
|
||||||
|
basis={profitLossQuery.basis}>
|
||||||
|
|
||||||
<DataTable
|
<DataTable
|
||||||
className="bigcapital-datatable--financial-report"
|
className="bigcapital-datatable--financial-report"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import React, { useEffect, useCallback, useState, useMemo } from 'react';
|
import React, { useEffect, useCallback, useState, useMemo } from 'react';
|
||||||
import TrialBalanceSheetHeader from "./TrialBalanceSheetHeader";
|
import TrialBalanceSheetHeader from "./TrialBalanceSheetHeader";
|
||||||
import LoadingIndicator from 'components/LoadingIndicator';
|
|
||||||
import TrialBalanceSheetTable from './TrialBalanceSheetTable';
|
import TrialBalanceSheetTable from './TrialBalanceSheetTable';
|
||||||
import useAsync from 'hooks/async';
|
import useAsync from 'hooks/async';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
@@ -10,7 +9,7 @@ import DashboardConnect from 'connectors/Dashboard.connector';
|
|||||||
import TrialBalanceActionsBar from './TrialBalanceActionsBar';
|
import TrialBalanceActionsBar from './TrialBalanceActionsBar';
|
||||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||||
|
import SettingsConnect from 'connectors/Settings.connect';
|
||||||
|
|
||||||
function TrialBalanceSheet({
|
function TrialBalanceSheet({
|
||||||
changePageTitle,
|
changePageTitle,
|
||||||
@@ -18,6 +17,7 @@ function TrialBalanceSheet({
|
|||||||
getTrialBalanceSheetIndex,
|
getTrialBalanceSheetIndex,
|
||||||
getTrialBalanceAccounts,
|
getTrialBalanceAccounts,
|
||||||
trialBalanceSheetLoading,
|
trialBalanceSheetLoading,
|
||||||
|
organizationSettings,
|
||||||
}) {
|
}) {
|
||||||
const [filter, setFilter] = useState({
|
const [filter, setFilter] = useState({
|
||||||
from_date: moment().startOf('year').format('YYYY-MM-DD'),
|
from_date: moment().startOf('year').format('YYYY-MM-DD'),
|
||||||
@@ -72,6 +72,7 @@ function TrialBalanceSheet({
|
|||||||
|
|
||||||
<div class="financial-statement__body">
|
<div class="financial-statement__body">
|
||||||
<TrialBalanceSheetTable
|
<TrialBalanceSheetTable
|
||||||
|
companyName={organizationSettings.name}
|
||||||
trialBalanceSheetAccounts={trialBalanceAccounts}
|
trialBalanceSheetAccounts={trialBalanceAccounts}
|
||||||
trialBalanceSheetIndex={trialBalanceSheetIndex}
|
trialBalanceSheetIndex={trialBalanceSheetIndex}
|
||||||
onFetchData={handleFetchData}
|
onFetchData={handleFetchData}
|
||||||
@@ -86,4 +87,5 @@ function TrialBalanceSheet({
|
|||||||
export default compose(
|
export default compose(
|
||||||
DashboardConnect,
|
DashboardConnect,
|
||||||
TrialBalanceSheetConnect,
|
TrialBalanceSheetConnect,
|
||||||
|
SettingsConnect,
|
||||||
)(TrialBalanceSheet);
|
)(TrialBalanceSheet);
|
||||||
@@ -8,6 +8,7 @@ export default function TrialBalanceSheetTable({
|
|||||||
trialBalanceSheetIndex,
|
trialBalanceSheetIndex,
|
||||||
onFetchData,
|
onFetchData,
|
||||||
loading,
|
loading,
|
||||||
|
companyName,
|
||||||
}) {
|
}) {
|
||||||
const [data, setData] = useState([]);
|
const [data, setData] = useState([]);
|
||||||
|
|
||||||
@@ -88,7 +89,7 @@ export default function TrialBalanceSheetTable({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<FinancialSheet
|
<FinancialSheet
|
||||||
companyTitle={'Facebook, Incopration'}
|
companyName={companyName}
|
||||||
sheetType={'Trial Balance Sheet'}
|
sheetType={'Trial Balance Sheet'}
|
||||||
date={new Date()}
|
date={new Date()}
|
||||||
name="trial-balance"
|
name="trial-balance"
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import currencies from './currencies/currencies.reducer';
|
|||||||
import resources from './resources/resources.reducer';
|
import resources from './resources/resources.reducer';
|
||||||
import financialStatements from './financialStatement/financialStatements.reducer';
|
import financialStatements from './financialStatement/financialStatements.reducer';
|
||||||
import itemCategories from './itemCategories/itemsCateory.reducer';
|
import itemCategories from './itemCategories/itemsCateory.reducer';
|
||||||
|
import settings from './settings/settings.reducer';
|
||||||
|
|
||||||
export default combineReducers({
|
export default combineReducers({
|
||||||
authentication,
|
authentication,
|
||||||
@@ -25,5 +26,6 @@ export default combineReducers({
|
|||||||
resources,
|
resources,
|
||||||
financialStatements,
|
financialStatements,
|
||||||
items,
|
items,
|
||||||
itemCategories
|
itemCategories,
|
||||||
|
settings,
|
||||||
});
|
});
|
||||||
|
|||||||
0
client/src/store/settings/settings.actions.js
Normal file
0
client/src/store/settings/settings.actions.js
Normal file
16
client/src/store/settings/settings.reducer.js
Normal file
16
client/src/store/settings/settings.reducer.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { createReducer } from '@reduxjs/toolkit';
|
||||||
|
import t from 'store/types';
|
||||||
|
|
||||||
|
const initialState = {
|
||||||
|
data: {
|
||||||
|
organization: {
|
||||||
|
name: 'Bigcapital, Limited Liabilities',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default createReducer(initialState, {
|
||||||
|
['asdfas']: (state, action) => {
|
||||||
|
|
||||||
|
},
|
||||||
|
});
|
||||||
0
client/src/store/settings/settings.selectors.js
Normal file
0
client/src/store/settings/settings.selectors.js
Normal file
5
client/src/store/settings/settings.type.js
Normal file
5
client/src/store/settings/settings.type.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
|
||||||
|
};
|
||||||
@@ -11,6 +11,7 @@ import resources from './resources/resource.types';
|
|||||||
import users from './users/users.types';
|
import users from './users/users.types';
|
||||||
import financialStatements from './financialStatement/financialStatements.types';
|
import financialStatements from './financialStatement/financialStatements.types';
|
||||||
import itemCategories from './itemCategories/itemsCategory.type';
|
import itemCategories from './itemCategories/itemsCategory.type';
|
||||||
|
import settings from './settings/settings.type';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...authentication,
|
...authentication,
|
||||||
@@ -25,5 +26,6 @@ export default {
|
|||||||
...resources,
|
...resources,
|
||||||
...users,
|
...users,
|
||||||
...financialStatements,
|
...financialStatements,
|
||||||
...itemCategories
|
...itemCategories,
|
||||||
|
...settings
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.financial-sheet{
|
.financial-sheet{
|
||||||
@@ -76,6 +77,20 @@
|
|||||||
color: #777;
|
color: #777;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.tr.no-results{
|
||||||
|
.td{
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 20px;
|
||||||
|
color: #666;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__inner{
|
||||||
|
&.is-loading{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&__basis{
|
&__basis{
|
||||||
color: #888;
|
color: #888;
|
||||||
@@ -85,8 +100,7 @@
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
.dashboard__loading-indicator{
|
.dashboard__loading-indicator{
|
||||||
margin-left: auto;
|
margin: 60px auto 0;
|
||||||
margin-right: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&--expended{
|
&--expended{
|
||||||
@@ -106,7 +120,7 @@
|
|||||||
&--journal{
|
&--journal{
|
||||||
.financial-sheet__table{
|
.financial-sheet__table{
|
||||||
.tbody{
|
.tbody{
|
||||||
.tr .td{
|
.tr:not(.no-results) .td{
|
||||||
padding: 0.4rem;
|
padding: 0.4rem;
|
||||||
color: #444;
|
color: #444;
|
||||||
border-bottom-color: #F0F0F0;
|
border-bottom-color: #F0F0F0;
|
||||||
|
|||||||
Reference in New Issue
Block a user