mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 04:10:32 +00:00
66 lines
1.5 KiB
TypeScript
66 lines
1.5 KiB
TypeScript
// @ts-nocheck
|
|
import React from 'react';
|
|
import intl from 'react-intl-universal';
|
|
import styled from 'styled-components';
|
|
|
|
import { TableStyle } from '@/constants';
|
|
import { ReportDataTable, FinancialSheet } from '@/components';
|
|
import { tableRowTypesToClassnames } from '@/utils';
|
|
|
|
import { useCustomersBalanceSummaryContext } from './CustomersBalanceSummaryProvider';
|
|
import { useCustomersSummaryColumns } from './components';
|
|
|
|
/**
|
|
* Customers balance summary table.
|
|
*/
|
|
export default function CustomersBalanceSummaryTable({
|
|
// #ownProps
|
|
companyName,
|
|
}) {
|
|
const {
|
|
CustomerBalanceSummary: { table, query },
|
|
} = useCustomersBalanceSummaryContext();
|
|
|
|
// Retrieves the customers summary columns.
|
|
const columns = useCustomersSummaryColumns();
|
|
|
|
return (
|
|
<FinancialSheet
|
|
companyName={companyName}
|
|
sheetType={intl.get('customers_balance_summary')}
|
|
asDate={query.as_date}
|
|
>
|
|
<CustomerBalanceDataTable
|
|
columns={columns}
|
|
data={table.data}
|
|
rowClassNames={tableRowTypesToClassnames}
|
|
noInitialFetch={true}
|
|
styleName={TableStyle.Constrant}
|
|
/>
|
|
</FinancialSheet>
|
|
);
|
|
}
|
|
|
|
const CustomerBalanceDataTable = styled(ReportDataTable)`
|
|
.table {
|
|
.tbody {
|
|
.tr:not(.no-results) {
|
|
.td {
|
|
border-bottom: 0;
|
|
padding-top: 0.4rem;
|
|
padding-bottom: 0.4rem;
|
|
}
|
|
|
|
&.row_type--TOTAL {
|
|
font-weight: 500;
|
|
|
|
.td {
|
|
border-top: 1px solid #bbb;
|
|
border-bottom: 3px double #333;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;
|