mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
WIP Financial statements.
This commit is contained in:
@@ -111,4 +111,24 @@ export const parseDateRangeQuery = (keyword) => {
|
||||
from_date: moment().startOf(query.range).toDate(),
|
||||
to_date: moment().endOf(query.range).toDate(),
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
export const defaultExpanderReducer = (tableRows, level) => {
|
||||
let currentLevel = 1;
|
||||
const expended = [];
|
||||
|
||||
const walker = (rows, parentIndex = null) => {
|
||||
return rows.forEach((row, index) => {
|
||||
const _index = parentIndex ? `${parentIndex}.${index}` : `${index}`;
|
||||
expended[_index] = true;
|
||||
|
||||
if (row.children && currentLevel < level) {
|
||||
walker(row.children, _index);
|
||||
}
|
||||
currentLevel++;
|
||||
}, {});
|
||||
};
|
||||
walker(tableRows);
|
||||
return expended;
|
||||
}
|
||||
Reference in New Issue
Block a user