feat( financial statment) :sales & purchases by items & inventory query.

This commit is contained in:
elforjani3
2021-03-29 19:32:52 +02:00
parent 0479614b82
commit 95fdaab3ea
10 changed files with 328 additions and 30 deletions

View File

@@ -27,7 +27,7 @@ import { saveInvoke, compose } from 'utils';
*/
function APAgingSummaryActionsBar({
// #withPayableAgingSummary
payableAgingFilter,
isFilterDrawerOpen,
// #withARAgingSummaryActions
toggleAPAgingSummaryFilterDrawer: toggleFilterDrawerDisplay,
@@ -66,14 +66,14 @@ function APAgingSummaryActionsBar({
className={classNames(Classes.MINIMAL, 'button--table-views')}
icon={<Icon icon="cog-16" iconSize={16} />}
text={
payableAgingFilter ? (
isFilterDrawerOpen ? (
<T id={'hide_customizer'} />
) : (
<T id={'customize_report'} />
)
}
onClick={handleFilterToggleClick}
active={payableAgingFilter}
active={isFilterDrawerOpen}
/>
<NavbarDivider />
<Popover

View File

@@ -308,3 +308,53 @@ export const APAgingSummaryTableRowsMapper = (sheet, total) => {
},
];
};
export const inventoryValuationReducer = (sheet) => {
const results = [];
if (sheet.items) {
sheet.items.forEach((item) => {
results.push(item);
});
}
if (sheet.total) {
results.push({
rowType: 'total',
...sheet.total,
});
}
return results;
};
export const purchasesByItemsReducer = (sheet) => {
const results = [];
if (sheet.items) {
sheet.items.forEach((item) => {
results.push(item);
});
}
if (sheet.total) {
results.push({
rowType: 'total',
...sheet.total,
});
}
return results;
};
export const salesByItemsReducer = (sheet) => {
const results = [];
if (sheet.items) {
sheet.items.forEach((item) => {
results.push(item);
});
}
if (sheet.total) {
results.push({
rowType: 'total',
...sheet.total,
});
}
return results;
};