feat: payment made form in new and edit mode.

This commit is contained in:
Ahmed Bouhuolia
2020-11-01 17:40:40 +02:00
parent f76abb3f79
commit 70269d382a
24 changed files with 812 additions and 551 deletions

View File

@@ -5,6 +5,7 @@ import {
editBill,
fetchBillsTable,
fetchBill,
fetchDueBills,
} from 'store/Bills/bills.actions';
import t from 'store/types';
@@ -15,6 +16,7 @@ const mapDispatchToProps = (dispatch) => ({
requestDeleteBill: (id) => dispatch(deleteBill({ id })),
requestFetchBillsTable: (query = {}) =>
dispatch(fetchBillsTable({ query: { ...query } })),
requestFetchDueBills: (vendorId) => dispatch(fetchDueBills({ vendorId })),
changeBillView: (id) =>
dispatch({

View File

@@ -4,14 +4,16 @@ import {
getBillCurrentPageFactory,
getBillPaginationMetaFactory,
getBillTableQueryFactory,
getVendorDueBillsFactory
getVendorPayableBillsFactory,
getPayableBillsByPaymentMadeFactory
} from 'store/Bills/bills.selectors';
export default (mapState) => {
const getBillsItems = getBillCurrentPageFactory();
const getBillsPaginationMeta = getBillPaginationMetaFactory();
const getBillTableQuery = getBillTableQueryFactory();
const getVendorDueBills = getVendorDueBillsFactory();
const getVendorPayableBills = getVendorPayableBillsFactory();
const getPayableBillsByPaymentMade = getPayableBillsByPaymentMadeFactory();
const mapStateToProps = (state, props) => {
const tableQuery = getBillTableQuery(state, props);
@@ -26,7 +28,8 @@ export default (mapState) => {
billsLoading: state.bills.loading,
nextBillNumberChanged: state.bills.nextBillNumberChanged,
vendorDueBills: getVendorDueBills(state, props),
vendorPayableBills: getVendorPayableBills(state, props),
paymentMadePayableBills: getPayableBillsByPaymentMade(state, props),
};
return mapState ? mapState(mapped, state, props) : mapped;
};