feat: payment receive and made form.

This commit is contained in:
Ahmed Bouhuolia
2020-11-05 12:16:28 +02:00
parent 1738a333c7
commit 69e7612b62
42 changed files with 1100 additions and 750 deletions

View File

@@ -16,7 +16,8 @@ const initialState = {
receivable: {
byCustomerId: [],
byPaymentReceiveId: [],
}
},
byPaymentReceiveId: {},
};
const defaultInvoice = {
@@ -115,6 +116,13 @@ const reducer = createReducer(initialState, {
state.receivable.byCustomerId[customerId] = saleInvoiceIds
},
[t.INVOICES_BY_PAYMENT_ID]: (state, action) => {
const { paymentReceiveId, saleInvoices } = action.payload;
const saleInvoiceIds = saleInvoices.map((saleInvoice) => saleInvoice.id);
state.byPaymentReceiveId[paymentReceiveId] = saleInvoiceIds;
},
});
export default createTableQueryReducers('sales_invoices', reducer);