diff --git a/src/components/FinancialSheet/FinancialSheet.js b/src/components/FinancialSheet/FinancialSheet.js index 329005948..f7eb905ec 100644 --- a/src/components/FinancialSheet/FinancialSheet.js +++ b/src/components/FinancialSheet/FinancialSheet.js @@ -31,6 +31,7 @@ export function FinancialSheet({ minimal = false, fullWidth = false, currentDate = true, + className, }) { const format = 'DD MMMM YYYY'; const formattedFromDate = useMemo( @@ -59,7 +60,11 @@ export function FinancialSheet({ ); return ( - + {companyName && {companyName}} {sheetType && {sheetType}} diff --git a/src/containers/FinancialStatements/APAgingSummary/APAgingSummary.js b/src/containers/FinancialStatements/APAgingSummary/APAgingSummary.js index 85a6d509b..91e2050b5 100644 --- a/src/containers/FinancialStatements/APAgingSummary/APAgingSummary.js +++ b/src/containers/FinancialStatements/APAgingSummary/APAgingSummary.js @@ -6,7 +6,8 @@ import { FinancialStatement } from 'components'; import APAgingSummaryHeader from './APAgingSummaryHeader'; import APAgingSummaryActionsBar from './APAgingSummaryActionsBar'; -import APAgingSummaryTable from './APAgingSummaryTable'; +import { APAgingSummaryBody } from './APAgingSummaryBody'; + import DashboardPageContent from 'components/Dashboard/DashboardPageContent'; import { APAgingSummaryProvider } from './APAgingSummaryProvider'; import { APAgingSummarySheetLoadingBar } from './components'; @@ -67,7 +68,7 @@ function APAgingSummary({ pageFilter={filter} onSubmitFilter={handleFilterSubmit} /> - + diff --git a/src/containers/FinancialStatements/APAgingSummary/APAgingSummaryTable.js b/src/containers/FinancialStatements/APAgingSummary/APAgingSummaryTable.js index e5d71abe7..e2ab82bec 100644 --- a/src/containers/FinancialStatements/APAgingSummary/APAgingSummaryTable.js +++ b/src/containers/FinancialStatements/APAgingSummary/APAgingSummaryTable.js @@ -8,6 +8,8 @@ import { TableStyle } from 'common'; import { useAPAgingSummaryContext } from './APAgingSummaryProvider'; import { useAPAgingSummaryColumns } from './components'; +import { tableRowTypesToClassnames } from 'utils'; + /** * AP aging summary table sheet. */ @@ -24,8 +26,6 @@ export default function APAgingSummaryTable({ // AP aging summary columns. const columns = useAPAgingSummaryColumns(); - const rowClassNames = (row) => [`row-type--${row.original.rowType}`]; - return ( - + [`row-type--${row.original.rowType}`]; - return ( - + ); } +const PurchasesByItemsSheet = styled(FinancialSheet)` + min-width: 850px; +`; + const PurchasesByItemsDataTable = styled(DataTable)` .table { .tbody { diff --git a/src/containers/FinancialStatements/SalesByItems/SalesByItemsTable.js b/src/containers/FinancialStatements/SalesByItems/SalesByItemsTable.js index 2ded60fa3..6d3cad86a 100644 --- a/src/containers/FinancialStatements/SalesByItems/SalesByItemsTable.js +++ b/src/containers/FinancialStatements/SalesByItems/SalesByItemsTable.js @@ -1,5 +1,6 @@ import React from 'react'; import intl from 'react-intl-universal'; +import styled from 'styled-components'; import { DataTable, FinancialSheet } from 'components'; @@ -23,15 +24,14 @@ export default function SalesByItemsTable({ companyName }) { const columns = useSalesByItemsTableColumns(); return ( - - - + ); } + +const SalesByItemsSheet = styled(FinancialSheet)` + min-width: 850px; +`; + +const SalesByItemsDataTable = 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; + } + } + } +`; diff --git a/src/containers/FinancialStatements/reducers.js b/src/containers/FinancialStatements/reducers.js index 3305a1c41..88f788412 100644 --- a/src/containers/FinancialStatements/reducers.js +++ b/src/containers/FinancialStatements/reducers.js @@ -115,7 +115,7 @@ export const ARAgingSummaryTableRowsMapper = (sheet, total) => { const agingRow = mapAging(customer.aging); rows.push({ - rowType: 'customer', + row_types: 'customer', name: customer.customer_name, ...agingRow, current: customer.current.formatted_amount, @@ -129,7 +129,7 @@ export const ARAgingSummaryTableRowsMapper = (sheet, total) => { ...rows, { name: '', - rowType: 'total', + row_types: 'total', current: sheet.total.current.formatted_amount, ...mapAging(sheet.total.aging), total: sheet.total.total.formatted_amount, @@ -150,7 +150,7 @@ export const APAgingSummaryTableRowsMapper = (sheet, total) => { const agingRow = mapAging(vendor.aging); rows.push({ - rowType: 'vendor', + row_types: 'vendor', name: vendor.vendor_name, ...agingRow, current: vendor.current.formatted_amount, @@ -164,7 +164,7 @@ export const APAgingSummaryTableRowsMapper = (sheet, total) => { ...rows, { name: '', - rowType: 'total', + row_types: 'total', current: sheet.total.current.formatted_amount, ...mapAging(sheet.total.aging), total: sheet.total.total.formatted_amount, @@ -182,7 +182,7 @@ export const inventoryValuationReducer = (sheet) => { } if (sheet.total) { results.push({ - rowType: 'total', + row_types: 'total', ...sheet.total, }); } @@ -199,7 +199,7 @@ export const purchasesByItemsReducer = (sheet) => { } if (sheet.total) { results.push({ - rowType: 'total', + row_types: 'total', ...sheet.total, }); } @@ -215,7 +215,7 @@ export const salesByItemsReducer = (sheet) => { } if (sheet.total) { results.push({ - rowType: 'total', + row_types: 'total', ...sheet.total, }); } diff --git a/src/style/pages/FinancialStatements/ARAgingSummary.scss b/src/style/pages/FinancialStatements/ARAgingSummary.scss index 584ebd775..2199f87b2 100644 --- a/src/style/pages/FinancialStatements/ARAgingSummary.scss +++ b/src/style/pages/FinancialStatements/ARAgingSummary.scss @@ -13,25 +13,7 @@ } } .tbody{ - .tr:not(.no-results) { - .td{ - border-bottom: 0; - padding-top: 0.4rem; - padding-bottom: 0.4rem; - } - &:not(:first-child) .td{ - border-top: 1px solid transparent; - } - &.row-type--total{ - font-weight: 500; - - .td{ - border-top: 1px solid #BBB; - border-bottom: 3px double #333; - } - } - - } + } } } diff --git a/src/style/pages/FinancialStatements/InventoryItemDetails.scss b/src/style/pages/FinancialStatements/InventoryItemDetails.scss index b795ad410..dc7031f84 100644 --- a/src/style/pages/FinancialStatements/InventoryItemDetails.scss +++ b/src/style/pages/FinancialStatements/InventoryItemDetails.scss @@ -14,59 +14,7 @@ } .tbody { - .tr .td { - padding-top: 0.2rem; - padding-bottom: 0.2rem; - border-top-color: transparent; - border-bottom-color: transparent; - - &.date { - >div { - display: flex; - } - - span.force-width { - position: relative; - } - } - } - - .tr:not(.no-results) .td { - border-left: 1px solid #ececec; - } - - .tr:last-child .td { - border-bottom: 1px solid #ddd; - } - - .tr.row-type { - &--ITEM { - .td { - &.transaction_type { - border-left-color: transparent; - } - } - - &:not(:first-child).is-expanded .td { - border-top: 1px solid #ddd; - } - } - - &--ITEM, - &--OPENING_ENTRY, - &--CLOSING_ENTRY { - font-weight: 500; - } - - &--ITEM { - &.is-expanded { - .td.value .cell-inner { - display: none; - } - } - } - } - } + } } } diff --git a/src/style/pages/FinancialStatements/SalesAndPurchasesSheet.scss b/src/style/pages/FinancialStatements/SalesAndPurchasesSheet.scss index c968fd11d..348cf69bd 100644 --- a/src/style/pages/FinancialStatements/SalesAndPurchasesSheet.scss +++ b/src/style/pages/FinancialStatements/SalesAndPurchasesSheet.scss @@ -12,18 +12,7 @@ text-align: right; } } - .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; - } - } + } } }