feat: Merge sales branch

This commit is contained in:
Ahmed Bouhuolia
2020-08-19 02:17:23 +02:00
parent c2a60e6ba5
commit b46570dc01
97 changed files with 9901 additions and 48 deletions

View File

@@ -0,0 +1,29 @@
import { connect } from 'react-redux';
import { getResourceViews } from 'store/customViews/customViews.selectors';
import {
getReceiptCurrentPageFactory,
getReceiptsTableQueryFactory,
getReceiptsPaginationMetaFactory,
} from 'store/receipt/receipt.selector';
export default (mapState) => {
const getReceiptsItems = getReceiptCurrentPageFactory();
const getReceiptPaginationMeta = getReceiptsPaginationMetaFactory();
const getReceiptsTableQuery = getReceiptsTableQueryFactory();
const mapStateToProps = (state, props) => {
const tableQuery = getReceiptsTableQuery(state, props);
const mapped = {
receiptsCurrentPage: getReceiptsItems(state, props, tableQuery),
receiptview:getResourceViews(state, props, 'sales_receipts'),
receiptItems: state.sales_receipts.items,
receiptTableQuery: tableQuery,
receiptsPagination: getReceiptPaginationMeta(state, props, tableQuery),
receiptsLoading: state.sales_receipts.loading,
};
return mapState ? mapState(mapped, state, props) : mapped;
};
return connect(mapStateToProps);
};