mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
feat: payment receive of customers invoices.
This commit is contained in:
@@ -52,28 +52,29 @@ export const fetchPaymentReceive = ({ id }) => {
|
||||
new Promise((resovle, reject) => {
|
||||
ApiService.get(`sales/payment_receives/${id}`, {})
|
||||
.then((response) => {
|
||||
dispatch({
|
||||
type: t.RELOAD_INVOICES,
|
||||
payload: {
|
||||
sales_invoices: response.data.paymentReceive.entries.map(
|
||||
(e) => e.invoice,
|
||||
),
|
||||
},
|
||||
});
|
||||
dispatch({
|
||||
type: t.PAYMENT_RECEIVE_SET,
|
||||
payload: {
|
||||
id,
|
||||
paymentReceive: response.data.paymentReceive,
|
||||
|
||||
},
|
||||
});
|
||||
dispatch({
|
||||
type: t.INVOICES_ITEMS_SET,
|
||||
payload: {
|
||||
sales_invoices: response.data.sale_invoice.receivable_invoices,
|
||||
},
|
||||
});
|
||||
dispatch({
|
||||
type: t.INVOICES_RECEIVABLE_BY_PAYMENT_ID,
|
||||
payload: {
|
||||
paymentReceiveid: response.data.id,
|
||||
saleInvoices: response.data.sale_invoice.receivable_invoices,
|
||||
},
|
||||
});
|
||||
resovle(response);
|
||||
})
|
||||
.catch((error) => {
|
||||
// const { response } = error;
|
||||
// const { data } = response;
|
||||
// reject(data?.errors);
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user