mirror of
https://github.com/crater-invoice/crater.git
synced 2026-02-10 04:42:40 -05:00
init crater
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import * as types from './mutation-types'
|
||||
|
||||
export const loadEstimateData = ({ commit, dispatch, state }) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
window.axios.get('/api/report/estimate').then((response) => {
|
||||
commit(types.SET_ESTIMATES, response.data)
|
||||
resolve(response)
|
||||
}).catch((err) => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const estimates = (state) => state.estimates
|
||||
19
resources/assets/js/store/modules/reports/estimate/index.js
Normal file
19
resources/assets/js/store/modules/reports/estimate/index.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import mutations from './mutations'
|
||||
import * as actions from './actions'
|
||||
import * as getters from './getters'
|
||||
|
||||
const initialState = {
|
||||
estimates: []
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
|
||||
state: initialState,
|
||||
|
||||
getters: getters,
|
||||
|
||||
actions: actions,
|
||||
|
||||
mutations: mutations
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const SET_ESTIMATES = 'SET_ESTIMATES'
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as types from './mutation-types'
|
||||
|
||||
export default {
|
||||
[types.SET_ESTIMATES] (state, data) {
|
||||
state.estimates = data.estimates
|
||||
}
|
||||
}
|
||||
11
resources/assets/js/store/modules/reports/expense/actions.js
Normal file
11
resources/assets/js/store/modules/reports/expense/actions.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import * as types from './mutation-types'
|
||||
|
||||
export const loadExpensesLink = ({ commit, dispatch, state }, url) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
window.axios.get(`/api/reports/expenses/link`).then((response) => {
|
||||
resolve(response)
|
||||
}).catch((err) => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
19
resources/assets/js/store/modules/reports/expense/index.js
Normal file
19
resources/assets/js/store/modules/reports/expense/index.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import mutations from './mutations'
|
||||
import * as actions from './actions'
|
||||
import * as getters from './getters'
|
||||
|
||||
const initialState = {
|
||||
report: []
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
|
||||
state: initialState,
|
||||
|
||||
getters: getters,
|
||||
|
||||
actions: actions,
|
||||
|
||||
mutations: mutations
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import * as types from './mutation-types'
|
||||
|
||||
export default {
|
||||
|
||||
}
|
||||
12
resources/assets/js/store/modules/reports/invoice/actions.js
Normal file
12
resources/assets/js/store/modules/reports/invoice/actions.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import * as types from './mutation-types'
|
||||
|
||||
export const loadInvoiceData = ({ commit, dispatch, state },data) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
window.axios.post('/api/report/invoice', data).then((response) => {
|
||||
commit(types.SET_INVOICES, response.data)
|
||||
resolve(response)
|
||||
}).catch((err) => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const invoices = (state) => state.invoices
|
||||
19
resources/assets/js/store/modules/reports/invoice/index.js
Normal file
19
resources/assets/js/store/modules/reports/invoice/index.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import mutations from './mutations'
|
||||
import * as actions from './actions'
|
||||
import * as getters from './getters'
|
||||
|
||||
const initialState = {
|
||||
invoices: []
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
|
||||
state: initialState,
|
||||
|
||||
getters: getters,
|
||||
|
||||
actions: actions,
|
||||
|
||||
mutations: mutations
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const SET_INVOICES = 'SET_INVOICES'
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as types from './mutation-types'
|
||||
|
||||
export default {
|
||||
[types.SET_INVOICES] (state, data) {
|
||||
state.invoices = data.invoices
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import * as types from './mutation-types'
|
||||
|
||||
export const loadProfitLossLink = ({ commit, dispatch, state }, url) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
window.axios.get(`/api/reports/profit-loss/link`).then((response) => {
|
||||
resolve(response)
|
||||
}).catch((err) => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import mutations from './mutations'
|
||||
import * as actions from './actions'
|
||||
import * as getters from './getters'
|
||||
|
||||
const initialState = {
|
||||
report: null
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
|
||||
state: initialState,
|
||||
|
||||
getters: getters,
|
||||
|
||||
actions: actions,
|
||||
|
||||
mutations: mutations
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import * as types from './mutation-types'
|
||||
|
||||
export default {
|
||||
|
||||
}
|
||||
21
resources/assets/js/store/modules/reports/sales/actions.js
Normal file
21
resources/assets/js/store/modules/reports/sales/actions.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import * as types from './mutation-types'
|
||||
|
||||
export const loadLinkByCustomer = ({ commit, dispatch, state }, url) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
window.axios.get(`/api/reports/sales/customers/link`).then((response) => {
|
||||
resolve(response)
|
||||
}).catch((err) => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export const loadLinkByItems = ({ commit, dispatch, state }, url) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
window.axios.get(`/api/reports/sales/items/link`).then((response) => {
|
||||
resolve(response)
|
||||
}).catch((err) => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
19
resources/assets/js/store/modules/reports/sales/index.js
Normal file
19
resources/assets/js/store/modules/reports/sales/index.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import mutations from './mutations'
|
||||
import * as actions from './actions'
|
||||
import * as getters from './getters'
|
||||
|
||||
const initialState = {
|
||||
report: null
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
|
||||
state: initialState,
|
||||
|
||||
getters: getters,
|
||||
|
||||
actions: actions,
|
||||
|
||||
mutations: mutations
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import * as types from './mutation-types'
|
||||
|
||||
export default {
|
||||
|
||||
}
|
||||
11
resources/assets/js/store/modules/reports/tax/actions.js
Normal file
11
resources/assets/js/store/modules/reports/tax/actions.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import * as types from './mutation-types'
|
||||
|
||||
export const loadTaxesReportLink = ({ commit, dispatch, state }, url) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
window.axios.get(`/api/reports/tax-summary/link`).then((response) => {
|
||||
resolve(response)
|
||||
}).catch((err) => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
19
resources/assets/js/store/modules/reports/tax/index.js
Normal file
19
resources/assets/js/store/modules/reports/tax/index.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import mutations from './mutations'
|
||||
import * as actions from './actions'
|
||||
import * as getters from './getters'
|
||||
|
||||
const initialState = {
|
||||
report: []
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
|
||||
state: initialState,
|
||||
|
||||
getters: getters,
|
||||
|
||||
actions: actions,
|
||||
|
||||
mutations: mutations
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import * as types from './mutation-types'
|
||||
|
||||
export default {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user