mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
feat(server): table sheet pdf
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
|
||||
import { kebabCase } from 'lodash';
|
||||
import { ITableRow } from '@/interfaces';
|
||||
|
||||
export const formatNumber = (balance, { noCents, divideOn1000 }): string => {
|
||||
let formattedBalance: number = parseFloat(balance);
|
||||
@@ -10,4 +11,20 @@ export const formatNumber = (balance, { noCents, divideOn1000 }): string => {
|
||||
formattedBalance /= 1000;
|
||||
}
|
||||
return formattedBalance;
|
||||
};
|
||||
};
|
||||
|
||||
export const tableClassNames = (rows: ITableRow[]) => {
|
||||
return rows.map((row) => {
|
||||
const classNames =
|
||||
row?.rowTypes?.map((rowType) => `row-type--${kebabCase(rowType)}`) || [];
|
||||
|
||||
if (row.id) {
|
||||
classNames.push(`row-id--${kebabCase(row.id)}`);
|
||||
}
|
||||
|
||||
return {
|
||||
...row,
|
||||
classNames,
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user