mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
refactor(Cashflow)
refactor(InventoryValuation)
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import 'style/pages/FinancialStatements/CashFlowStatement.scss';
|
|
||||||
|
|
||||||
import { FinancialStatement } from 'components';
|
import { FinancialStatement } from 'components';
|
||||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ export default function CashFlowStatementTable({
|
|||||||
}) {
|
}) {
|
||||||
const {
|
const {
|
||||||
cashFlowStatement: { tableRows },
|
cashFlowStatement: { tableRows },
|
||||||
isCashFlowLoading,
|
|
||||||
query,
|
query,
|
||||||
} = useCashFlowStatementContext();
|
} = useCashFlowStatementContext();
|
||||||
|
|
||||||
@@ -31,10 +30,8 @@ export default function CashFlowStatementTable({
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<FinancialSheet
|
<FinancialSheet
|
||||||
name="cash-flow-statement"
|
|
||||||
companyName={companyName}
|
companyName={companyName}
|
||||||
sheetType={intl.get('statement_of_cash_flow')}
|
sheetType={intl.get('statement_of_cash_flow')}
|
||||||
loading={isCashFlowLoading}
|
|
||||||
fromDate={query.from_date}
|
fromDate={query.from_date}
|
||||||
toDate={query.to_date}
|
toDate={query.to_date}
|
||||||
basis={query.basis}
|
basis={query.basis}
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ import { FinancialReportBody } from '../FinancialReportPage';
|
|||||||
import { FinancialSheetSkeleton } from '../../../components/FinancialSheet';
|
import { FinancialSheetSkeleton } from '../../../components/FinancialSheet';
|
||||||
import withCurrentOrganization from 'containers/Organization/withCurrentOrganization';
|
import withCurrentOrganization from 'containers/Organization/withCurrentOrganization';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inventory valuation body.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
*/
|
||||||
function InventoryValuationBodyJSX({
|
function InventoryValuationBodyJSX({
|
||||||
// #withCurrentOrganization
|
// #withCurrentOrganization
|
||||||
organizationName,
|
organizationName,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
import { DataTable, FinancialSheet } from 'components';
|
import { DataTable, FinancialSheet } from 'components';
|
||||||
|
|
||||||
@@ -26,13 +27,13 @@ export default function InventoryValuationTable({
|
|||||||
const columns = useInventoryValuationTableColumns();
|
const columns = useInventoryValuationTableColumns();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FinancialSheet
|
<InventoryValuationSheet
|
||||||
companyName={companyName}
|
companyName={companyName}
|
||||||
sheetType={intl.get('inventory_valuation')}
|
sheetType={intl.get('inventory_valuation')}
|
||||||
asDate={new Date()}
|
asDate={new Date()}
|
||||||
loading={isLoading}
|
loading={isLoading}
|
||||||
>
|
>
|
||||||
<DataTable
|
<InventoryValuationDataTable
|
||||||
columns={columns}
|
columns={columns}
|
||||||
data={tableRows}
|
data={tableRows}
|
||||||
expandable={true}
|
expandable={true}
|
||||||
@@ -45,6 +46,27 @@ export default function InventoryValuationTable({
|
|||||||
'there_were_no_inventory_transactions_during_the_selected_date_range',
|
'there_were_no_inventory_transactions_during_the_selected_date_range',
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</FinancialSheet>
|
</InventoryValuationSheet>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const InventoryValuationSheet = styled(FinancialSheet)`
|
||||||
|
min-width: 850px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const InventoryValuationDataTable = styled(DataTable)`
|
||||||
|
.table {
|
||||||
|
.tbody {
|
||||||
|
.tr .td {
|
||||||
|
border-bottom: 0;
|
||||||
|
padding-top: 0.4rem;
|
||||||
|
padding-bottom: 0.4rem;
|
||||||
|
}
|
||||||
|
.tr.row_type--total .td {
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
font-weight: 500;
|
||||||
|
border-bottom: 3px double #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ export default function ProfitLossSheetTable({
|
|||||||
// Profit/Loss sheet context.
|
// Profit/Loss sheet context.
|
||||||
const {
|
const {
|
||||||
profitLossSheet: { table, query },
|
profitLossSheet: { table, query },
|
||||||
isLoading,
|
|
||||||
} = useProfitLossSheetContext();
|
} = useProfitLossSheetContext();
|
||||||
|
|
||||||
// Retrieves the profit/loss table columns.
|
// Retrieves the profit/loss table columns.
|
||||||
@@ -33,8 +32,6 @@ export default function ProfitLossSheetTable({
|
|||||||
sheetType={<T id={'profit_loss_sheet'} />}
|
sheetType={<T id={'profit_loss_sheet'} />}
|
||||||
fromDate={query.from_date}
|
fromDate={query.from_date}
|
||||||
toDate={query.to_date}
|
toDate={query.to_date}
|
||||||
name="profit-loss-sheet"
|
|
||||||
loading={isLoading}
|
|
||||||
basis={query.basis}
|
basis={query.basis}
|
||||||
>
|
>
|
||||||
<ProfitLossDataTable
|
<ProfitLossDataTable
|
||||||
|
|||||||
Reference in New Issue
Block a user