mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
Fix : Auto-Increment Dialog
This commit is contained in:
@@ -13,8 +13,7 @@ const initialState = {
|
||||
page: 1,
|
||||
},
|
||||
currentViewId: -1,
|
||||
|
||||
estimateNumberChanged: false,
|
||||
|
||||
};
|
||||
|
||||
const defaultEstimate = {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { createReducer } from '@reduxjs/toolkit';
|
||||
import { createTableQueryReducers } from 'store/queryReducers';
|
||||
import { journalNumberChangedReducer } from 'store/journalNumber.reducer';
|
||||
|
||||
import t from 'store/types';
|
||||
|
||||
@@ -114,7 +115,7 @@ const reducer = createReducer(initialState, {
|
||||
const { customerId, saleInvoices } = action.payload;
|
||||
const saleInvoiceIds = saleInvoices.map((saleInvoice) => saleInvoice.id);
|
||||
|
||||
state.receivable.byCustomerId[customerId] = saleInvoiceIds
|
||||
state.receivable.byCustomerId[customerId] = saleInvoiceIds;
|
||||
},
|
||||
|
||||
[t.INVOICES_BY_PAYMENT_ID]: (state, action) => {
|
||||
@@ -123,6 +124,8 @@ const reducer = createReducer(initialState, {
|
||||
|
||||
state.byPaymentReceiveId[paymentReceiveId] = saleInvoiceIds;
|
||||
},
|
||||
|
||||
...journalNumberChangedReducer(t.INVOICE_NUMBER_CHANGED),
|
||||
});
|
||||
|
||||
export default createTableQueryReducers('sales_invoices', reducer);
|
||||
|
||||
@@ -14,5 +14,7 @@ export default {
|
||||
|
||||
INVOICES_RECEIVABLE_BY_PAYMENT_ID: 'INVOICES_RECEIVABLE_BY_PAYMENT_ID',
|
||||
INVOICES_RECEIVABLE_BY_CUSTOMER_ID: 'INVOICES_RECEIVABLE_BY_CUSTOMER_ID',
|
||||
INVOICES_BY_PAYMENT_ID: 'INVOICES_BY_PAYMENT_ID'
|
||||
INVOICES_BY_PAYMENT_ID: 'INVOICES_BY_PAYMENT_ID',
|
||||
|
||||
INVOICE_NUMBER_CHANGED: 'INVOICE_NUMBER_CHANGED',
|
||||
};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { createReducer } from '@reduxjs/toolkit';
|
||||
import { createTableQueryReducers } from 'store/queryReducers';
|
||||
import t from 'store/types';
|
||||
import { journalNumberChangedReducer } from 'store/journalNumber.reducer';
|
||||
|
||||
const initialState = {
|
||||
items: {},
|
||||
@@ -18,14 +19,12 @@ const defaultReceipt = {
|
||||
};
|
||||
|
||||
const reducer = createReducer(initialState, {
|
||||
|
||||
[t.RECEIPT_SET]: (state, action) => {
|
||||
const { id, sale_receipt } = action.payload;
|
||||
const _receipt = state.items[id] || {};
|
||||
state.items[id] = { ...defaultReceipt, ..._receipt, ...sale_receipt };
|
||||
},
|
||||
|
||||
|
||||
[t.RECEIPTS_ITEMS_SET]: (state, action) => {
|
||||
const { sales_receipts } = action.payload;
|
||||
const _receipts = {};
|
||||
@@ -94,6 +93,7 @@ const reducer = createReducer(initialState, {
|
||||
},
|
||||
};
|
||||
},
|
||||
...journalNumberChangedReducer(t.RECEIPT_NUMBER_CHANGED),
|
||||
});
|
||||
|
||||
export default createTableQueryReducers('sales_receipts', reducer);
|
||||
|
||||
@@ -9,4 +9,5 @@ export default {
|
||||
RECEIPTS_PAGINATION_SET: 'RECEIPTS_PAGINATION_SET',
|
||||
RECEIPTS_PAGE_SET: 'RECEIPTS_PAGE_SET',
|
||||
RECEIPTS_ITEMS_SET: 'RECEIPTS_ITEMS_SET',
|
||||
RECEIPT_NUMBER_CHANGED:'RECEIPT_NUMBER_CHANGED'
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user