mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
merge: estimate work branch to master
This commit is contained in:
@@ -80,9 +80,8 @@ const reducer = createReducer(initialState, {
|
||||
|
||||
[t.BILLS_PAGINATION_SET]: (state, action) => {
|
||||
const { pagination, customViewId } = action.payload;
|
||||
|
||||
const mapped = {
|
||||
pageSize: parseInt(pagination.pageSize, 10),
|
||||
pageSize: parseInt(pagination.page_size, 10),
|
||||
page: parseInt(pagination.page, 10),
|
||||
total: parseInt(pagination.total, 10),
|
||||
};
|
||||
@@ -99,7 +98,7 @@ const reducer = createReducer(initialState, {
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
[t.BILL_NUMBER_CHANGED]: (state, action) => {
|
||||
const { isChanged } = action.payload;
|
||||
state.nextBillNumberChanged = isChanged;
|
||||
|
||||
@@ -6,17 +6,12 @@ export const submitEstimate = ({ form }) => {
|
||||
new Promise((resolve, reject) => {
|
||||
ApiService.post('sales/estimates', form)
|
||||
.then((response) => {
|
||||
dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_COMPLETED,
|
||||
});
|
||||
resolve(response);
|
||||
})
|
||||
.catch((error) => {
|
||||
const { response } = error;
|
||||
const { data } = response;
|
||||
dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_COMPLETED,
|
||||
});
|
||||
|
||||
reject(data?.errors);
|
||||
});
|
||||
});
|
||||
@@ -95,21 +90,21 @@ export const fetchEstimatesTable = ({ query = {} }) => {
|
||||
dispatch({
|
||||
type: t.ESTIMATES_PAGE_SET,
|
||||
payload: {
|
||||
sales_estimates: response.data.sales_estimates.results,
|
||||
pagination: response.data.sales_estimates.pagination,
|
||||
sales_estimates: response.data.sales_estimates,
|
||||
pagination: response.data.pagination,
|
||||
customViewId: response.data.customViewId || -1,
|
||||
},
|
||||
});
|
||||
dispatch({
|
||||
type: t.ESTIMATES_ITEMS_SET,
|
||||
payload: {
|
||||
sales_estimates: response.data.sales_estimates.results,
|
||||
sales_estimates: response.data.sales_estimates,
|
||||
},
|
||||
});
|
||||
dispatch({
|
||||
type: t.ESTIMATES_PAGINATION_SET,
|
||||
payload: {
|
||||
pagination: response.data.sales_estimates.pagination,
|
||||
pagination: response.data.pagination,
|
||||
customViewId: response.data.customViewId || -1,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -65,21 +65,21 @@ export const fetchPaymentMadesTable = ({ query = {} }) => {
|
||||
dispatch({
|
||||
type: t.PAYMENT_MADES_PAGE_SET,
|
||||
payload: {
|
||||
bill_payments: response.data.bill_payments.results,
|
||||
pagination: response.data.bill_payments.pagination,
|
||||
bill_payments: response.data.bill_payments,
|
||||
pagination: response.data.pagination,
|
||||
customViewId: response.data.customViewId || -1,
|
||||
},
|
||||
});
|
||||
dispatch({
|
||||
type: t.PAYMENT_MADES_ITEMS_SET,
|
||||
payload: {
|
||||
bill_payments: response.data.bill_payments.results,
|
||||
bill_payments: response.data.bill_payments,
|
||||
},
|
||||
});
|
||||
dispatch({
|
||||
type: t.PAYMENT_MADES_PAGINATION_SET,
|
||||
payload: {
|
||||
pagination: response.data.bill_payments.pagination,
|
||||
pagination: response.data.pagination,
|
||||
customViewId: response.data.customViewId || -1,
|
||||
},
|
||||
});
|
||||
@@ -102,14 +102,6 @@ export const fetchPaymentMade = ({ id }) => {
|
||||
new Promise((resovle, reject) => {
|
||||
ApiService.get(`purchases/bill_payments/${id}`, {})
|
||||
.then((response) => {
|
||||
// dispatch({
|
||||
// type: t.RELOAD_INVOICES,
|
||||
// payload: {
|
||||
// sales_invoices: response.data.paymentReceive.entries.map(
|
||||
// (e) => e.invoice,
|
||||
// ),
|
||||
// },
|
||||
// });
|
||||
dispatch({
|
||||
type: t.PAYMENT_MADE_SET,
|
||||
payload: {
|
||||
|
||||
@@ -12,6 +12,7 @@ const initialState = {
|
||||
page_size: 5,
|
||||
page: 1,
|
||||
},
|
||||
nextPaymentNumberChanged: false,
|
||||
};
|
||||
|
||||
const defaultPaymentMade = {
|
||||
@@ -84,5 +85,11 @@ const reducer = createReducer(initialState, {
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
[t.PAYMENT_MADES_NUMBER_CHANGED]:(state,action)=>{
|
||||
const { isChanged } = action.payload;
|
||||
state.nextPaymentNumberChanged = isChanged
|
||||
|
||||
}
|
||||
});
|
||||
export default createTableQueryReducers('bill_payments', reducer);
|
||||
|
||||
@@ -8,4 +8,5 @@ export default {
|
||||
PAYMENT_MADES_PAGE_SET: 'PAYMENT_MADES_PAGE_SET',
|
||||
PAYMENT_MADES_ITEMS_SET: 'PAYMENT_MADES_ITEMS_SET',
|
||||
PAYMENT_MADES_PAGINATION_SET: 'PAYMENT_MADES_PAGINATION_SET',
|
||||
PAYMENT_MADES_NUMBER_CHANGED:'PAYMENT_MADES_NUMBER_CHANGED'
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user