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