Changes in workingtimes.vue

This commit is contained in:
2024-03-18 09:10:18 +01:00
parent 73d3c6311a
commit 39a2f19b0d
2 changed files with 15 additions and 7 deletions

View File

@@ -170,6 +170,7 @@ export const useDataStore = defineStore('data', () => {
const incominginvoices = ref([])
const bankAccounts = ref([])
const bankStatements = ref([])
const bankrequisitions = ref([])
const historyItems = ref([])
const numberRanges = ref([])
const notifications = ref([])
@@ -316,6 +317,7 @@ export const useDataStore = defineStore('data', () => {
await fetchIncomingInvoices()
await fetchBankAccounts()
await fetchBankStatements()
await fetchBankRequisitions()
await fetchHistoryItems()
await fetchNumberRanges()
await fetchNotifications()
@@ -363,6 +365,7 @@ export const useDataStore = defineStore('data', () => {
incominginvoices.value= []
bankAccounts.value= []
bankStatements.value= []
bankrequisitions.value= []
historyItems.value = []
numberRanges.value = []
notifications.value = []
@@ -384,7 +387,7 @@ export const useDataStore = defineStore('data', () => {
}
function hasRight (right) {
const role = profiles.value.find(i => i.id === user.value.id).role
const role = profiles.value.find(i => i.id === activeProfile.value.id).role
const grantedRights = roles.value.find(i => i.key === role).rights
if(grantedRights.includes(right)){
@@ -582,6 +585,9 @@ export const useDataStore = defineStore('data', () => {
async function fetchBankStatements () {
bankStatements.value = (await supabase.from("bankstatements").select().eq('tenant', currentTenant.value).order("date", {ascending:false})).data
}
async function fetchBankRequisitions () {
bankrequisitions.value = (await supabase.from("bankrequisitions").select().eq('status', "LN")).data
}
async function fetchEvents () {
events.value = (await supabase.from("events").select().eq('tenant', currentTenant.value)).data
}
@@ -1161,6 +1167,7 @@ export const useDataStore = defineStore('data', () => {
incominginvoices,
bankAccounts,
bankStatements,
bankrequisitions,
historyItems,
numberRanges,
notifications,
@@ -1190,6 +1197,7 @@ export const useDataStore = defineStore('data', () => {
fetchOwnProfiles,
fetchBankAccounts,
fetchBankStatements,
fetchBankRequisitions,
fetchEvents,
fetchContracts,
fetchContacts,