mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
chrone: sperate client and server to different repos.
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
import React from 'react';
|
||||
import intl, { init } from 'react-intl-universal';
|
||||
|
||||
import FinancialSheet from 'components/FinancialSheet';
|
||||
import { DataTable } from 'components';
|
||||
|
||||
import { useInventoryValuationContext } from './InventoryValuationProvider';
|
||||
import { useInventoryValuationTableColumns } from './components';
|
||||
|
||||
/**
|
||||
* inventory valuation data table.
|
||||
*/
|
||||
export default function InventoryValuationTable({
|
||||
//#ownProps
|
||||
companyName,
|
||||
}) {
|
||||
// inventory valuation context.
|
||||
const {
|
||||
inventoryValuation: { tableRows },
|
||||
isLoading,
|
||||
} = useInventoryValuationContext();
|
||||
|
||||
// inventory valuation table columns.
|
||||
const columns = useInventoryValuationTableColumns();
|
||||
|
||||
const rowClassNames = (row) => {
|
||||
const { original } = row;
|
||||
const rowTypes = Array.isArray(original.rowType)
|
||||
? original.rowType
|
||||
: [original.rowType];
|
||||
|
||||
return {
|
||||
...rowTypes.reduce((acc, rowType) => {
|
||||
acc[`row_type--${rowType}`] = rowType;
|
||||
return acc;
|
||||
}, {}),
|
||||
};
|
||||
};
|
||||
|
||||
return (
|
||||
<FinancialSheet
|
||||
companyName={companyName}
|
||||
name="inventory-valuation"
|
||||
sheetType={intl.get('inventory_valuation')}
|
||||
asDate={new Date()}
|
||||
loading={isLoading}
|
||||
>
|
||||
<DataTable
|
||||
className="bigcapital-datatable--financial-report"
|
||||
columns={columns}
|
||||
data={tableRows}
|
||||
expandable={true}
|
||||
expandToggleColumn={1}
|
||||
expandColumnSpace={1}
|
||||
sticky={true}
|
||||
rowClassNames={rowClassNames}
|
||||
noResults={intl.get(
|
||||
'there_were_no_inventory_transactions_during_the_selected_date_range',
|
||||
)}
|
||||
/>
|
||||
</FinancialSheet>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user