Fix Invoice/Estimate template issues and Add Payment Receipt, Custom Payment Modes and Item units

This commit is contained in:
Jay Makwana
2020-01-05 07:22:36 +00:00
committed by Mohit Panjwani
parent 56a955befd
commit 4c33a5d88c
112 changed files with 5050 additions and 331 deletions

View File

@ -26,7 +26,6 @@ export const addItem = ({ commit, dispatch, state }, data) => {
return new Promise((resolve, reject) => {
window.axios.post('/api/items', data).then((response) => {
commit(types.ADD_ITEM, response.data)
resolve(response)
}).catch((err) => {
reject(err)
@ -90,3 +89,57 @@ export const selectItem = ({ commit, dispatch, state }, data) => {
commit(types.SET_SELECT_ALL_STATE, false)
}
}
export const addItemUnit = ({ commit, dispatch, state }, data) => {
return new Promise((resolve, reject) => {
window.axios.post(`/api/units`, data).then((response) => {
commit(types.ADD_ITEM_UNIT, response.data)
resolve(response)
}).catch((err) => {
reject(err)
})
})
}
export const updateItemUnit = ({ commit, dispatch, state }, data) => {
return new Promise((resolve, reject) => {
window.axios.put(`/api/units/${data.id}`, data).then((response) => {
commit(types.UPDATE_ITEM_UNIT, response.data)
resolve(response)
}).catch((err) => {
reject(err)
})
})
}
export const fetchItemUnits = ({ commit, dispatch, state }) => {
return new Promise((resolve, reject) => {
window.axios.get(`/api/units`).then((response) => {
commit(types.SET_ITEM_UNITS, response.data.units)
resolve(response)
}).catch((err) => {
reject(err)
})
})
}
export const fatchItemUnit = ({ commit, dispatch, state }, id) => {
return new Promise((resolve, reject) => {
window.axios.get(`/api/units/${id}`).then((response) => {
resolve(response)
}).catch((err) => {
reject(err)
})
})
}
export const deleteItemUnit = ({ commit, dispatch, state }, id) => {
return new Promise((resolve, reject) => {
window.axios.delete(`/api/units/${id}`).then((response) => {
commit(types.DELETE_ITEM_UNIT, id)
resolve(response)
}).catch((err) => {
reject(err)
})
})
}