mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
Fix : FetchReceipt
This commit is contained in:
@@ -152,13 +152,13 @@ function ReceiptsDataTable({
|
|||||||
width: 140,
|
width: 140,
|
||||||
className: 'deposit_account',
|
className: 'deposit_account',
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
id: 'send_to_email',
|
// id: 'send_to_email',
|
||||||
Header: formatMessage({ id: 'email' }),
|
// Header: formatMessage({ id: 'email' }),
|
||||||
accessor: 'send_to_email',
|
// accessor: 'send_to_email',
|
||||||
width: 140,
|
// width: 140,
|
||||||
className: 'send_to_email',
|
// className: 'send_to_email',
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
id: 'amount',
|
id: 'amount',
|
||||||
Header: formatMessage({ id: 'amount' }),
|
Header: formatMessage({ id: 'amount' }),
|
||||||
|
|||||||
@@ -54,10 +54,9 @@ export const fetchReceipt = ({ id }) => {
|
|||||||
new Promise((resovle, reject) => {
|
new Promise((resovle, reject) => {
|
||||||
ApiService.get(`sales/receipts/${id}`)
|
ApiService.get(`sales/receipts/${id}`)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
const { receipt } = response.data;
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: t.RECEIPT_SET,
|
type: t.RECEIPT_SET,
|
||||||
payload: { id, receipt },
|
payload: { id, sale_receipt: response.data.sale_receipt },
|
||||||
});
|
});
|
||||||
resovle(response);
|
resovle(response);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -18,12 +18,14 @@ const defaultReceipt = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const reducer = createReducer(initialState, {
|
const reducer = createReducer(initialState, {
|
||||||
|
|
||||||
[t.RECEIPT_SET]: (state, action) => {
|
[t.RECEIPT_SET]: (state, action) => {
|
||||||
const { id, receipt } = action.payload;
|
const { id, sale_receipt } = action.payload;
|
||||||
const _receipt = state.items[id] || {};
|
const _receipt = state.items[id] || {};
|
||||||
state.items[id] = { ...defaultReceipt, ..._receipt, ...receipt };
|
state.items[id] = { ...defaultReceipt, ..._receipt, ...sale_receipt };
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
[t.RECEIPTS_ITEMS_SET]: (state, action) => {
|
[t.RECEIPTS_ITEMS_SET]: (state, action) => {
|
||||||
const { sales_receipts } = action.payload;
|
const { sales_receipts } = action.payload;
|
||||||
const _receipts = {};
|
const _receipts = {};
|
||||||
|
|||||||
Reference in New Issue
Block a user