refactor(Cashflow)

refactor(InventoryValuation)
This commit is contained in:
a.bouhuolia
2022-02-12 18:59:34 +02:00
parent 4cc0a8c41e
commit b249335a73
5 changed files with 29 additions and 10 deletions

View File

@@ -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';

View File

@@ -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}

View File

@@ -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,

View File

@@ -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;
}
}
}
`;

View File

@@ -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