Merge branch 'dev' into beta
This commit is contained in:
@@ -25,8 +25,8 @@ const setupPage = async () => {
|
|||||||
})
|
})
|
||||||
draftInvoicesCount.value = draftDocuments.length
|
draftInvoicesCount.value = draftDocuments.length
|
||||||
|
|
||||||
let bankstatements = await useSupabaseSelect("bankstatements","*, statementallocations(*)","date",true)
|
let bankstatements = (await useSupabaseSelect("bankstatements","*, statementallocations(*)","date",true)).filter(i => !i.archived)
|
||||||
unallocatedStatements.value = bankstatements.filter(i => calculateOpenSum(i) !== 0).length
|
unallocatedStatements.value = bankstatements.filter(i => Number(calculateOpenSum(i)) !== 0).length
|
||||||
}
|
}
|
||||||
|
|
||||||
setupPage()
|
setupPage()
|
||||||
@@ -42,7 +42,7 @@ const getDocumentSum = (doc) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const calculateOpenSum = (statement) => {
|
const calculateOpenSum = (statement) => {
|
||||||
let startingAmount = statement.amount || 0
|
/*let startingAmount = statement.amount || 0
|
||||||
|
|
||||||
statement.statementallocations.forEach(item => {
|
statement.statementallocations.forEach(item => {
|
||||||
if(item.cd_id) {
|
if(item.cd_id) {
|
||||||
@@ -52,7 +52,15 @@ const calculateOpenSum = (statement) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
return startingAmount.toFixed(2)
|
return startingAmount.toFixed(2)*/
|
||||||
|
|
||||||
|
let startingAmount = 0
|
||||||
|
|
||||||
|
statement.statementallocations.forEach(item => {
|
||||||
|
startingAmount += Math.abs(item.amount)
|
||||||
|
})
|
||||||
|
|
||||||
|
return (Math.abs(statement.amount) - startingAmount).toFixed(2)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
const phasesCounter = ref({})
|
const phasesCounter = ref({})
|
||||||
|
|
||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
const projects = await useSupabaseSelect("projects")
|
const projects = (await useSupabaseSelect("projects")).filter(i => !i.archived)
|
||||||
|
|
||||||
projects.forEach(project => {
|
projects.forEach(project => {
|
||||||
if(project.phases && project.phases.length > 0){
|
if(project.phases && project.phases.length > 0){
|
||||||
|
|||||||
21
composables/useSum.js
Normal file
21
composables/useSum.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
export const useSum = () => {
|
||||||
|
|
||||||
|
const getIncomingInvoiceSum = (invoice) => {
|
||||||
|
let sum = 0
|
||||||
|
invoice.accounts.forEach(account => {
|
||||||
|
console.log(account)
|
||||||
|
|
||||||
|
|
||||||
|
sum += account.amountTax
|
||||||
|
sum += account.amountNet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
return sum.toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
|
return {getIncomingInvoiceSum}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@ defineShortcuts({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const profileStore = useProfileStore()
|
const profileStore = useProfileStore()
|
||||||
|
const tempStore = useTempStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const supabase = useSupabaseClient()
|
const supabase = useSupabaseClient()
|
||||||
|
|
||||||
@@ -55,7 +56,13 @@ const selectedColumns = ref(templateColumns)
|
|||||||
const columns = computed(() => templateColumns.filter((column) => selectedColumns.value.includes(column)))
|
const columns = computed(() => templateColumns.filter((column) => selectedColumns.value.includes(column)))
|
||||||
|
|
||||||
|
|
||||||
const searchString = ref('')
|
const searchString = ref(tempStore.searchStrings["bankstatements"] ||'')
|
||||||
|
|
||||||
|
const clearSearchString = () => {
|
||||||
|
tempStore.clearSearchString("bankstatements")
|
||||||
|
searchString.value = ''
|
||||||
|
}
|
||||||
|
|
||||||
const filterAccount = ref(bankaccounts || [])
|
const filterAccount = ref(bankaccounts || [])
|
||||||
const showOnlyNotAssigned = ref(true)
|
const showOnlyNotAssigned = ref(true)
|
||||||
|
|
||||||
@@ -84,7 +91,7 @@ setupPage()
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<UDashboardNavbar title="Bankbuchungen">
|
<UDashboardNavbar title="Bankbuchungen" :badge="filteredRows.length">
|
||||||
<template #right>
|
<template #right>
|
||||||
<UInput
|
<UInput
|
||||||
id="searchinput"
|
id="searchinput"
|
||||||
@@ -95,11 +102,19 @@ setupPage()
|
|||||||
placeholder="Suche..."
|
placeholder="Suche..."
|
||||||
class="hidden lg:block"
|
class="hidden lg:block"
|
||||||
@keydown.esc="$event.target.blur()"
|
@keydown.esc="$event.target.blur()"
|
||||||
|
@change="tempStore.modifySearchString('bankstatements',searchString)"
|
||||||
>
|
>
|
||||||
<template #trailing>
|
<template #trailing>
|
||||||
<UKbd value="/" />
|
<UKbd value="/" />
|
||||||
</template>
|
</template>
|
||||||
</UInput>
|
</UInput>
|
||||||
|
<UButton
|
||||||
|
icon="i-heroicons-x-mark"
|
||||||
|
variant="outline"
|
||||||
|
color="rose"
|
||||||
|
@click="clearSearchString()"
|
||||||
|
v-if="searchString.length > 0"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
<UDashboardToolbar>
|
<UDashboardToolbar>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ const oldItemInfo = ref({})
|
|||||||
const openDocuments = ref([])
|
const openDocuments = ref([])
|
||||||
const allocatedDocuments = ref([])
|
const allocatedDocuments = ref([])
|
||||||
const openIncomingInvoices = ref([])
|
const openIncomingInvoices = ref([])
|
||||||
|
const allocatedIncomingInvoices = ref([])
|
||||||
|
|
||||||
const accounts = ref([])
|
const accounts = ref([])
|
||||||
|
|
||||||
@@ -36,15 +37,16 @@ const setup = async () => {
|
|||||||
}
|
}
|
||||||
if(itemInfo.value) oldItemInfo.value = JSON.parse(JSON.stringify(itemInfo.value))
|
if(itemInfo.value) oldItemInfo.value = JSON.parse(JSON.stringify(itemInfo.value))
|
||||||
|
|
||||||
|
manualAllocationSum.value = calculateOpenSum.value
|
||||||
|
|
||||||
const documents = (await useSupabaseSelect("createddocuments","*, statementallocations(*), customer(id,name)")).filter(i => i.type === "invoices" ||i.type === "advanceInvoices")
|
const documents = (await useSupabaseSelect("createddocuments","*, statementallocations(*), customer(id,name)")).filter(i => i.type === "invoices" ||i.type === "advanceInvoices")
|
||||||
|
const incominginvoices = (await useSupabaseSelect("incominginvoices","*, statementallocations(*), vendor(id,name)"))
|
||||||
|
|
||||||
accounts.value = (await supabase.from("accounts").select()).data
|
accounts.value = (await supabase.from("accounts").select()).data
|
||||||
|
|
||||||
openDocuments.value = documents.filter(i => i.statementallocations.reduce((n,{amount}) => n + amount, 0).toFixed(2) !== getDocumentSum(i).toFixed(2))
|
openDocuments.value = documents.filter(i => i.statementallocations.reduce((n,{amount}) => n + amount, 0).toFixed(2) !== getDocumentSum(i).toFixed(2))
|
||||||
openDocuments.value = openDocuments.value.map(i => {
|
openDocuments.value = openDocuments.value.map(i => {
|
||||||
|
|
||||||
console.log()
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...i,
|
...i,
|
||||||
docTotal: getDocumentSum(i, i.usedAdvanceInvoices.map(i => getDocumentSum(documents.find(x => x.id === i)))),
|
docTotal: getDocumentSum(i, i.usedAdvanceInvoices.map(i => getDocumentSum(documents.find(x => x.id === i)))),
|
||||||
@@ -56,8 +58,10 @@ const setup = async () => {
|
|||||||
console.log(openDocuments.value)
|
console.log(openDocuments.value)
|
||||||
|
|
||||||
allocatedDocuments.value = documents.filter(i => i.statementallocations.find(x => x.bs_id === itemInfo.value.id))
|
allocatedDocuments.value = documents.filter(i => i.statementallocations.find(x => x.bs_id === itemInfo.value.id))
|
||||||
|
allocatedIncomingInvoices.value = incominginvoices.filter(i => i.statementallocations.find(x => x.bs_id === itemInfo.value.id))
|
||||||
console.log(allocatedDocuments.value)
|
console.log(allocatedDocuments.value)
|
||||||
openIncomingInvoices.value = (await useSupabaseSelect("incominginvoices","*, statementallocations(*)")).filter(i => i.statementallocations.length === 0 || i.statementallocations.find(x => x.bs_id === itemInfo.value.id))
|
console.log(allocatedIncomingInvoices.value)
|
||||||
|
openIncomingInvoices.value = (await useSupabaseSelect("incominginvoices","*, statementallocations(*), vendor(*)")).filter(i => i.statementallocations.length === 0 )
|
||||||
//console.log(openIncomingInvoices.value)
|
//console.log(openIncomingInvoices.value)
|
||||||
|
|
||||||
// return incominginvoices.value.filter(i => bankstatements.value.filter(x => x.assignments.find(y => y.type === 'incomingInvoice' && y.id === i.id)).length === 0)
|
// return incominginvoices.value.filter(i => bankstatements.value.filter(x => x.assignments.find(y => y.type === 'incomingInvoice' && y.id === i.id)).length === 0)
|
||||||
@@ -144,6 +148,9 @@ const selectAccount = (id) => {
|
|||||||
showAccountSelection.value = false
|
showAccountSelection.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const manualAllocationSum = ref(itemInfo.value.amount || 0)
|
||||||
|
|
||||||
const saveAllocation = async (allocation) => {
|
const saveAllocation = async (allocation) => {
|
||||||
const {data,error} = await supabase.from("statementallocations").insert({
|
const {data,error} = await supabase.from("statementallocations").insert({
|
||||||
...allocation,
|
...allocation,
|
||||||
@@ -152,8 +159,11 @@ const saveAllocation = async (allocation) => {
|
|||||||
|
|
||||||
if(data) {
|
if(data) {
|
||||||
await setup()
|
await setup()
|
||||||
|
accountToSave.value = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const removeAllocation = async (allocationId) => {
|
const removeAllocation = async (allocationId) => {
|
||||||
@@ -163,13 +173,20 @@ const removeAllocation = async (allocationId) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const searchString = ref("")
|
const searchString = ref("")
|
||||||
const filteredRows = computed(() => {
|
const filteredDocuments = computed(() => {
|
||||||
|
|
||||||
|
|
||||||
return useSearch(searchString.value, openDocuments.value)
|
return useSearch(searchString.value, openDocuments.value)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const filteredIncomingInvoices = computed(() => {
|
||||||
|
|
||||||
|
|
||||||
|
return useSearch(searchString.value, openIncomingInvoices.value)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
setup()
|
setup()
|
||||||
|
|
||||||
@@ -209,11 +226,14 @@ setup()
|
|||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
|
|
||||||
<UDashboardPanelContent
|
<UDashboardPanelContent
|
||||||
class="flex flex-row"
|
class="flex flex-row workingContainer"
|
||||||
v-if="!loading"
|
v-if="!loading"
|
||||||
>
|
>
|
||||||
|
<div
|
||||||
|
class="mx-auto w-2/5"
|
||||||
|
>
|
||||||
|
<div class="px-2">
|
||||||
<UCard
|
<UCard
|
||||||
class="w-2/5 mx-auto "
|
|
||||||
v-if="itemInfo"
|
v-if="itemInfo"
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
@@ -272,8 +292,8 @@ setup()
|
|||||||
<span class="font-semibold">Partner IBAN:</span>
|
<span class="font-semibold">Partner IBAN:</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span v-if="itemInfo.debIban">{{itemInfo.debIban}}</span>
|
<span v-if="itemInfo.debIban">{{separateIBAN(itemInfo.debIban)}}</span>
|
||||||
<span v-else-if="itemInfo.credIban">{{itemInfo.credIban}}</span>
|
<span v-else-if="itemInfo.credIban">{{separateIBAN(itemInfo.credIban)}}</span>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -285,7 +305,7 @@ setup()
|
|||||||
{{dataStore.getBankAccountById(itemInfo.account) ? dataStore.getBankAccountById(itemInfo.account).name || separateIBAN(dataStore.getBankAccountById(itemInfo.account).iban) : ""}}
|
{{dataStore.getBankAccountById(itemInfo.account) ? dataStore.getBankAccountById(itemInfo.account).name || separateIBAN(dataStore.getBankAccountById(itemInfo.account).iban) : ""}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="flex-row flex justify-between">
|
<!-- <tr class="flex-row flex justify-between">
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<span class="font-semibold">Buchungen:</span>
|
<span class="font-semibold">Buchungen:</span>
|
||||||
</td>
|
</td>
|
||||||
@@ -296,13 +316,13 @@ setup()
|
|||||||
>
|
>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<!-- <span v-if="itemInfo.createdDocument"><nuxt-link :to="`/createDocument/show/${itemInfo.createdDocument}`">{{dataStore.createddocuments.find(i => i.id === itemInfo.createdDocument).documentNumber}}</nuxt-link></span>
|
<!– <span v-if="itemInfo.createdDocument"><nuxt-link :to="`/createDocument/show/${itemInfo.createdDocument}`">{{dataStore.createddocuments.find(i => i.id === itemInfo.createdDocument).documentNumber}}</nuxt-link></span>
|
||||||
<span v-else-if="itemInfo.incomingInvoice"><nuxt-link :to="`/incominInvoices/show/${itemInfo.incomingInvoice}`">{{dataStore.getIncomingInvoiceById(itemInfo.incomingInvoice).reference}}</nuxt-link></span>-->
|
<span v-else-if="itemInfo.incomingInvoice"><nuxt-link :to="`/incominInvoices/show/${itemInfo.incomingInvoice}`">{{dataStore.getIncomingInvoiceById(itemInfo.incomingInvoice).reference}}</nuxt-link></span>–>
|
||||||
<span v-if="item.cd_id">
|
<span v-if="item.cd_id">
|
||||||
{{dataStore.getCreatedDocumentById(item.cd_id).documentNumber}}
|
{{dataStore.getCreatedDocumentById(item.cd_id).documentNumber}}
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="item.ii_id">
|
<span v-else-if="item.ii_id">
|
||||||
{{dataStore.getVendorById(dataStore.getIncomingInvoiceById(item.ii_id).vendor).name}} - {{dataStore.getIncomingInvoiceById(item.ii_id).reference}}
|
<!– {{dataStore.getVendorById(dataStore.getIncomingInvoiceById(item.ii_id).vendor).name}} - {{dataStore.getIncomingInvoiceById(item.ii_id).reference}}–>
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="item.account">
|
<span v-else-if="item.account">
|
||||||
Buchungskonto: {{accounts.find(i => i.id === item.account).number}} {{accounts.find(i => i.id === item.account).label}}
|
Buchungskonto: {{accounts.find(i => i.id === item.account).number}} {{accounts.find(i => i.id === item.account).label}}
|
||||||
@@ -322,7 +342,7 @@ setup()
|
|||||||
v-else-if="item.ii_id"
|
v-else-if="item.ii_id"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>-->
|
||||||
<tr class="flex-row flex justify-between">
|
<tr class="flex-row flex justify-between">
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<span class="font-semibold">Beschreibung:</span>
|
<span class="font-semibold">Beschreibung:</span>
|
||||||
@@ -339,9 +359,8 @@ setup()
|
|||||||
|
|
||||||
</UCard>
|
</UCard>
|
||||||
|
|
||||||
<div class="w-2/5 mx-auto">
|
|
||||||
<UAlert
|
<UAlert
|
||||||
class="mb-3"
|
class="mb-3 mt-3"
|
||||||
:color="calculateOpenSum > 0 ? 'rose' : 'primary'"
|
:color="calculateOpenSum > 0 ? 'rose' : 'primary'"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
:title="calculateOpenSum > 0 ? `${displayCurrency(calculateOpenSum)} von ${displayCurrency(Math.abs(itemInfo.amount))} nicht zugewiesen` : 'Kontobewegung vollständig zugewiesen'"
|
:title="calculateOpenSum > 0 ? `${displayCurrency(calculateOpenSum)} von ${displayCurrency(Math.abs(itemInfo.amount))} nicht zugewiesen` : 'Kontobewegung vollständig zugewiesen'"
|
||||||
@@ -354,6 +373,11 @@ setup()
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</UAlert>
|
</UAlert>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="scrollList mt-3 px-2">
|
||||||
|
<UDivider>Vorhandene Buchungen</UDivider>
|
||||||
|
|
||||||
<UCard
|
<UCard
|
||||||
class="mt-5"
|
class="mt-5"
|
||||||
@@ -373,7 +397,6 @@ setup()
|
|||||||
@click="removeAllocation(itemInfo.statementallocations.find(i => i.account === item.account).id)"
|
@click="removeAllocation(itemInfo.statementallocations.find(i => i.account === item.account).id)"
|
||||||
/>
|
/>
|
||||||
</UCard>
|
</UCard>
|
||||||
|
|
||||||
<UCard
|
<UCard
|
||||||
class="mt-5"
|
class="mt-5"
|
||||||
:ui="{ring: itemInfo.statementallocations.find(i => i.cd_id === document.id) ? 'ring-primary-500' : 'ring-gray-200 dark:ring-gray-800'}"
|
:ui="{ring: itemInfo.statementallocations.find(i => i.cd_id === document.id) ? 'ring-primary-500' : 'ring-gray-200 dark:ring-gray-800'}"
|
||||||
@@ -407,7 +430,44 @@ setup()
|
|||||||
@click="router.push(`/createDocument/show/${document.id}`)"
|
@click="router.push(`/createDocument/show/${document.id}`)"
|
||||||
/>
|
/>
|
||||||
</UCard>
|
</UCard>
|
||||||
|
<UCard
|
||||||
|
class="mt-5"
|
||||||
|
:ui="{ring: itemInfo.statementallocations.find(i => i.ii_id === invoice.id) ? 'ring-primary-500' : 'ring-gray-200 dark:ring-gray-800'}"
|
||||||
|
v-for="invoice in allocatedIncomingInvoices"
|
||||||
|
>
|
||||||
|
<template #header>
|
||||||
|
<div class="flex flex-row justify-between">
|
||||||
|
<span>{{invoice.vendor ? invoice.vendor.name : ""}} - {{invoice.reference}}</span>
|
||||||
|
<span class="font-semibold text-nowrap">{{displayCurrency(getInvoiceSum(invoice))}}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<UButton
|
||||||
|
icon="i-heroicons-check"
|
||||||
|
variant="outline"
|
||||||
|
class="mr-3"
|
||||||
|
v-if="!itemInfo.statementallocations.find(i => i.ii_id === invoice.id)"
|
||||||
|
@click="saveAllocation({ii_id: document.id, bs_id: itemInfo.id, amount: Number(getInvoiceSum(invoice))})"
|
||||||
|
/>
|
||||||
|
<UButton
|
||||||
|
icon="i-heroicons-x-mark"
|
||||||
|
variant="outline"
|
||||||
|
color="rose"
|
||||||
|
class="mr-3"
|
||||||
|
v-if="itemInfo.statementallocations.find(i => i.ii_id === invoice.id)"
|
||||||
|
@click="removeAllocation(itemInfo.statementallocations.find(i => i.ii_id === invoice.id).id)"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<UButton
|
||||||
|
variant="outline"
|
||||||
|
icon="i-heroicons-arrow-right-end-on-rectangle"
|
||||||
|
@click="router.push(`/createDocument/show/${document.id}`)"
|
||||||
|
/>
|
||||||
|
</UCard>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="w-2/5 mx-auto">
|
||||||
|
<div class="px-2">
|
||||||
<UDivider class="my-3">Ohne Beleg buchen</UDivider>
|
<UDivider class="my-3">Ohne Beleg buchen</UDivider>
|
||||||
|
|
||||||
<InputGroup class="mt-3 w-full">
|
<InputGroup class="mt-3 w-full">
|
||||||
@@ -429,17 +489,26 @@ setup()
|
|||||||
{{option.number}} - {{option.label}}
|
{{option.number}} - {{option.label}}
|
||||||
</template>
|
</template>
|
||||||
</USelectMenu>
|
</USelectMenu>
|
||||||
|
<UInput
|
||||||
|
v-model="manualAllocationSum"
|
||||||
|
type="number"
|
||||||
|
step="0.01"
|
||||||
|
>
|
||||||
|
<template #trailing>
|
||||||
|
<span class="text-gray-500 dark:text-gray-400 text-xs">EUR</span>
|
||||||
|
</template>
|
||||||
|
</UInput>
|
||||||
<UButton
|
<UButton
|
||||||
@click="showAccountSelection = true"
|
@click="showAccountSelection = true"
|
||||||
icon="i-heroicons-magnifying-glass"
|
icon="i-heroicons-magnifying-glass"
|
||||||
|
variant="outline"
|
||||||
/>
|
/>
|
||||||
<UButton
|
<UButton
|
||||||
variant="outline"
|
variant="outline"
|
||||||
icon="i-heroicons-check"
|
icon="i-heroicons-check"
|
||||||
@click="saveAllocation({bs_id: itemInfo.id, amount: Number(calculateOpenSum), account: accountToSave })"
|
:disabled="!accountToSave"
|
||||||
>
|
@click="saveAllocation({bs_id: itemInfo.id, amount: manualAllocationSum, account: accountToSave })"
|
||||||
Buchen
|
/>
|
||||||
</UButton>
|
|
||||||
<UButton
|
<UButton
|
||||||
@click="accountToSave = ''"
|
@click="accountToSave = ''"
|
||||||
icon="i-heroicons-x-mark"
|
icon="i-heroicons-x-mark"
|
||||||
@@ -476,7 +545,6 @@ setup()
|
|||||||
>
|
>
|
||||||
Auf Beleg buchen
|
Auf Beleg buchen
|
||||||
</UDivider>
|
</UDivider>
|
||||||
|
|
||||||
<InputGroup
|
<InputGroup
|
||||||
class="mt-3 w-full"
|
class="mt-3 w-full"
|
||||||
>
|
>
|
||||||
@@ -500,12 +568,13 @@ setup()
|
|||||||
@click="searchString = ''"
|
@click="searchString = ''"
|
||||||
/>
|
/>
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="scrollList mt-3 px-2" style="height: 70vh;">
|
||||||
|
|
||||||
<UCard
|
<UCard
|
||||||
class="mt-5"
|
class="mt-5"
|
||||||
:ui="{ring: itemInfo.statementallocations.find(i => i.cd_id === document.id) ? 'ring-primary-500' : 'ring-gray-200 dark:ring-gray-800'}"
|
v-for="document in filteredDocuments"
|
||||||
v-for="document in filteredRows"
|
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex flex-row justify-between">
|
<div class="flex flex-row justify-between">
|
||||||
@@ -520,14 +589,6 @@ setup()
|
|||||||
v-if="!itemInfo.statementallocations.find(i => i.cd_id === document.id)"
|
v-if="!itemInfo.statementallocations.find(i => i.cd_id === document.id)"
|
||||||
@click="saveAllocation({cd_id: document.id, bs_id: itemInfo.id, amount: Number(document.openSum)})"
|
@click="saveAllocation({cd_id: document.id, bs_id: itemInfo.id, amount: Number(document.openSum)})"
|
||||||
/>
|
/>
|
||||||
<UButton
|
|
||||||
icon="i-heroicons-x-mark"
|
|
||||||
variant="outline"
|
|
||||||
color="rose"
|
|
||||||
class="mr-3"
|
|
||||||
v-if="itemInfo.statementallocations.find(i => i.cd_id === document.id)"
|
|
||||||
@click="removeAllocation(itemInfo.statementallocations.find(i => i.ii_id === document.id).id)"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<UButton
|
<UButton
|
||||||
variant="outline"
|
variant="outline"
|
||||||
@@ -538,12 +599,11 @@ setup()
|
|||||||
|
|
||||||
<UCard
|
<UCard
|
||||||
class="mt-5"
|
class="mt-5"
|
||||||
:ui="{ring: /*itemInfo.assignments.find(i => i.id === invoice.id)*/ false ? 'ring-primary-500' : 'ring-gray-200 dark:ring-gray-800'}"
|
v-for="item in filteredIncomingInvoices"
|
||||||
v-for="item in openIncomingInvoices"
|
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex flex-row justify-between">
|
<div class="flex flex-row justify-between">
|
||||||
<span>{{dataStore.getVendorById(item.vendor) ? dataStore.getVendorById(item.vendor).name : ''}} - {{item.reference}}</span>
|
<span>{{item.vendor ? item.vendor.name : ''}} - {{item.reference}}</span>
|
||||||
<span class="font-semibold text-rose-600 text-nowrap">-{{displayCurrency(getInvoiceSum(item))}}</span>
|
<span class="font-semibold text-rose-600 text-nowrap">-{{displayCurrency(getInvoiceSum(item))}}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -554,14 +614,6 @@ setup()
|
|||||||
v-if="!itemInfo.statementallocations.find(i => i.ii_id === item.id)"
|
v-if="!itemInfo.statementallocations.find(i => i.ii_id === item.id)"
|
||||||
@click="saveAllocation({ii_id: item.id, bs_id: itemInfo.id, amount: Number(itemInfo.amount)})"
|
@click="saveAllocation({ii_id: item.id, bs_id: itemInfo.id, amount: Number(itemInfo.amount)})"
|
||||||
/>
|
/>
|
||||||
<UButton
|
|
||||||
icon="i-heroicons-x-mark"
|
|
||||||
variant="outline"
|
|
||||||
color="rose"
|
|
||||||
class="mr-3"
|
|
||||||
v-if="itemInfo.statementallocations.find(i => i.ii_id === item.id)"
|
|
||||||
@click="removeAllocation(itemInfo.statementallocations.find(i => i.ii_id === item.id).id)"
|
|
||||||
/>
|
|
||||||
<UButton
|
<UButton
|
||||||
variant="outline"
|
variant="outline"
|
||||||
icon="i-heroicons-arrow-right-end-on-rectangle"
|
icon="i-heroicons-arrow-right-end-on-rectangle"
|
||||||
@@ -570,10 +622,15 @@ setup()
|
|||||||
|
|
||||||
</UCard>
|
</UCard>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</UDashboardPanelContent>
|
</UDashboardPanelContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.workingContainer {
|
||||||
|
height: 90vh;
|
||||||
|
overflow-y: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -620,7 +620,7 @@ const processDieselPosition = () => {
|
|||||||
itemInfo.value.rows[existingAdblueIndex] = {
|
itemInfo.value.rows[existingAdblueIndex] = {
|
||||||
...itemInfo.value.rows[existingAdblueIndex],
|
...itemInfo.value.rows[existingAdblueIndex],
|
||||||
price: agricultureData.adbluePriceTotal,
|
price: agricultureData.adbluePriceTotal,
|
||||||
text: `${agricultureData.adblueUsageTotal} L Diesel`,
|
text: `${agricultureData.adblueUsageTotal} L AdBlue`,
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -669,7 +669,7 @@ const getDocumentData = () => {
|
|||||||
|
|
||||||
let rows = itemInfo.value.rows
|
let rows = itemInfo.value.rows
|
||||||
|
|
||||||
if(itemInfo.value.taxType === "13b UStG") {
|
if(itemInfo.value.taxType === "13b UStG" || itemInfo.value.taxType === "19 UStG") {
|
||||||
rows = rows.map(row => {
|
rows = rows.map(row => {
|
||||||
return {
|
return {
|
||||||
...row,
|
...row,
|
||||||
@@ -1243,7 +1243,7 @@ const setRowData = (row) => {
|
|||||||
v-if="itemInfo.type === 'invoices'"
|
v-if="itemInfo.type === 'invoices'"
|
||||||
>
|
>
|
||||||
<USelectMenu
|
<USelectMenu
|
||||||
:options="['Standard','13b UStG']"
|
:options="['Standard','13b UStG','19 UStG']"
|
||||||
v-model="itemInfo.taxType"
|
v-model="itemInfo.taxType"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
></USelectMenu>
|
></USelectMenu>
|
||||||
@@ -1954,7 +1954,7 @@ const setRowData = (row) => {
|
|||||||
<USelectMenu
|
<USelectMenu
|
||||||
:options="[19,7,0]"
|
:options="[19,7,0]"
|
||||||
v-model="row.taxPercent"
|
v-model="row.taxPercent"
|
||||||
:disabled="itemInfo.taxType === '13b UStG'"
|
:disabled="itemInfo.taxType === '13b UStG' || itemInfo.taxType === '19 UStG'"
|
||||||
>
|
>
|
||||||
<template #option="{option}">
|
<template #option="{option}">
|
||||||
{{option}} %
|
{{option}} %
|
||||||
|
|||||||
@@ -435,6 +435,7 @@ setupPage()
|
|||||||
v-model="item.taxType"
|
v-model="item.taxType"
|
||||||
value-attribute="key"
|
value-attribute="key"
|
||||||
option-attribute="label"
|
option-attribute="label"
|
||||||
|
:ui-menu="{ width: 'min-w-max' }"
|
||||||
@change="item.amountTax = Number(((item.amountNet ? item.amountNet : 0) * (Number(taxOptions.find(i => i.key === item.taxType).percentage)/100)).toFixed(2))"
|
@change="item.amountTax = Number(((item.amountNet ? item.amountNet : 0) * (Number(taxOptions.find(i => i.key === item.taxType).percentage)/100)).toFixed(2))"
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
|
|||||||
@@ -152,13 +152,13 @@ const createIncomingInvoice = async () => {
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
class="flex justify-between mt-5"
|
class="flex justify-between mt-5 workingContainer"
|
||||||
>
|
>
|
||||||
<object
|
<object
|
||||||
v-if="loadedFile"
|
v-if="loadedFile"
|
||||||
:data="loadedFile.url + '#toolbar=0&navpanes=0&scrollbar=0&statusbar=0&messages=0&scrollbar=0'"
|
:data="loadedFile.url + '#toolbar=0&navpanes=0&scrollbar=0&statusbar=0&messages=0&scrollbar=0'"
|
||||||
type="application/pdf"
|
type="application/pdf"
|
||||||
class="mx-5 documentPreview w-full"
|
class="mx-5 documentPreview"
|
||||||
/>
|
/>
|
||||||
<div class="w-3/5 mx-5">
|
<div class="w-3/5 mx-5">
|
||||||
|
|
||||||
@@ -210,7 +210,7 @@ const createIncomingInvoice = async () => {
|
|||||||
:search-attributes="['name','vendorNumber']"
|
:search-attributes="['name','vendorNumber']"
|
||||||
class="flex-auto"
|
class="flex-auto"
|
||||||
searchable-placeholder="Suche..."
|
searchable-placeholder="Suche..."
|
||||||
:color="!itemInfo.vendor ? 'rose' : ''"
|
:color="!itemInfo.vendor ? 'rose' : 'primary'"
|
||||||
>
|
>
|
||||||
<template #option="{option}">
|
<template #option="{option}">
|
||||||
{{option.vendorNumber}} - {{option.name}}
|
{{option.vendorNumber}} - {{option.name}}
|
||||||
@@ -245,7 +245,7 @@ const createIncomingInvoice = async () => {
|
|||||||
icon="i-heroicons-calendar-days-20-solid"
|
icon="i-heroicons-calendar-days-20-solid"
|
||||||
:label="itemInfo.date ? dayjs(itemInfo.date).format('DD.MM.YYYY') : 'Datum auswählen'"
|
:label="itemInfo.date ? dayjs(itemInfo.date).format('DD.MM.YYYY') : 'Datum auswählen'"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
:color="!itemInfo.date ? 'rose' : ''"
|
:color="!itemInfo.date ? 'rose' : 'primary'"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<template #panel="{ close }">
|
<template #panel="{ close }">
|
||||||
@@ -340,7 +340,7 @@ const createIncomingInvoice = async () => {
|
|||||||
:search-attributes="['label']"
|
:search-attributes="['label']"
|
||||||
searchable-placeholder="Suche..."
|
searchable-placeholder="Suche..."
|
||||||
v-model="item.account"
|
v-model="item.account"
|
||||||
:color="!item.account ? 'rose' : ''"
|
:color="!item.account ? 'rose' : 'primary'"
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
{{dataStore.accounts.find(account => account.id === item.account) ? dataStore.accounts.find(account => account.id === item.account).label : "Keine Kategorie ausgewählt" }}
|
{{dataStore.accounts.find(account => account.id === item.account) ? dataStore.accounts.find(account => account.id === item.account).label : "Keine Kategorie ausgewählt" }}
|
||||||
@@ -382,9 +382,10 @@ const createIncomingInvoice = async () => {
|
|||||||
type="number"
|
type="number"
|
||||||
step="0.01"
|
step="0.01"
|
||||||
v-model="item.amountNet"
|
v-model="item.amountNet"
|
||||||
:color="!item.amountNet ? 'rose' : ''"
|
:color="!item.amountNet ? 'rose' : 'primary'"
|
||||||
:disabled="item.taxType === null"
|
:disabled="item.taxType === null"
|
||||||
@keyup="item.amountTax = Number((item.amountNet * (Number(taxOptions.find(i => i.key === item.taxType).percentage)/100)).toFixed(2))"
|
@keyup="item.amountTax = Number((item.amountNet * (Number(taxOptions.find(i => i.key === item.taxType).percentage)/100)).toFixed(2)),
|
||||||
|
item.amountGross = Number(item.amountNet) + NUmber(item.amountTax)"
|
||||||
>
|
>
|
||||||
<template #trailing>
|
<template #trailing>
|
||||||
<span class="text-gray-500 dark:text-gray-400 text-xs">EUR</span>
|
<span class="text-gray-500 dark:text-gray-400 text-xs">EUR</span>
|
||||||
@@ -403,8 +404,9 @@ const createIncomingInvoice = async () => {
|
|||||||
step="0.01"
|
step="0.01"
|
||||||
:disabled="item.taxType === null"
|
:disabled="item.taxType === null"
|
||||||
v-model="item.amountGross"
|
v-model="item.amountGross"
|
||||||
:color="!item.amountGross ? 'rose' : ''"
|
:color="!item.amountGross ? 'rose' : 'primary'"
|
||||||
@keyup="item.amountNet = Number((item.amountGross / (1 + Number(item.taxType)/100)).toFixed(2)),
|
:ui-menu="{ width: 'min-w-max' }"
|
||||||
|
@keyup="item.amountNet = Number((item.amountGross / (1 + Number(taxOptions.find(i => i.key === item.taxType).percentage)/100)).toFixed(2)),
|
||||||
item.amountTax = Number((item.amountGross - item.amountNet).toFixed(2))"
|
item.amountTax = Number((item.amountGross - item.amountNet).toFixed(2))"
|
||||||
>
|
>
|
||||||
<template #trailing>
|
<template #trailing>
|
||||||
@@ -422,8 +424,10 @@ const createIncomingInvoice = async () => {
|
|||||||
:options="taxOptions"
|
:options="taxOptions"
|
||||||
v-model="item.taxType"
|
v-model="item.taxType"
|
||||||
value-attribute="key"
|
value-attribute="key"
|
||||||
|
:ui-menu="{ width: 'min-w-max' }"
|
||||||
option-attribute="label"
|
option-attribute="label"
|
||||||
@change="item.amountTax = Number(((item.amountNet ? item.amountNet : 0) * (Number(taxOptions.find(i => i.key === item.taxType).percentage)/100)).toFixed(2))"
|
@change="item.amountNet = Number((item.amountGross / (1 + Number(taxOptions.find(i => i.key === item.taxType).percentage)/100)).toFixed(2)),
|
||||||
|
item.amountTax = Number(((item.amountNet ? item.amountNet : 0) * (Number(taxOptions.find(i => i.key === item.taxType).percentage)/100)).toFixed(2))"
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
<span class="truncate">{{taxOptions.find(i => i.key === item.taxType) ? taxOptions.find(i => i.key === item.taxType).label : ""}}</span>
|
<span class="truncate">{{taxOptions.find(i => i.key === item.taxType) ? taxOptions.find(i => i.key === item.taxType).label : ""}}</span>
|
||||||
@@ -464,6 +468,7 @@ const createIncomingInvoice = async () => {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.documentPreview {
|
.documentPreview {
|
||||||
aspect-ratio: 1 / 1.414;
|
aspect-ratio: 1 / 1.414;
|
||||||
|
height: 80vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -486,4 +491,8 @@ const createIncomingInvoice = async () => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.workingContainer {
|
||||||
|
height: 80vh;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import dayjs from "dayjs"
|
import dayjs from "dayjs"
|
||||||
|
import {useSum} from "~/composables/useSum.js";
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: "auth"
|
middleware: "auth"
|
||||||
})
|
})
|
||||||
@@ -38,6 +39,8 @@ defineShortcuts({
|
|||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
|
const sum = useSum()
|
||||||
|
|
||||||
const items = ref([])
|
const items = ref([])
|
||||||
const selectedItem = ref(0)
|
const selectedItem = ref(0)
|
||||||
|
|
||||||
@@ -105,8 +108,7 @@ const getInvoiceSum = (invoice) => {
|
|||||||
const isPaid = (item) => {
|
const isPaid = (item) => {
|
||||||
let amountPaid = 0
|
let amountPaid = 0
|
||||||
item.statementallocations.forEach(allocation => amountPaid += allocation.amount)
|
item.statementallocations.forEach(allocation => amountPaid += allocation.amount)
|
||||||
|
return Math.abs(amountPaid) === Math.abs(Number(getInvoiceSum(item)))
|
||||||
return amountPaid === Number(getInvoiceSum(item))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -170,7 +172,7 @@ const isPaid = (item) => {
|
|||||||
{{row.vendor ? row.vendor.name : ""}}
|
{{row.vendor ? row.vendor.name : ""}}
|
||||||
</template>
|
</template>
|
||||||
<template #amount-data="{row}">
|
<template #amount-data="{row}">
|
||||||
{{displayCurrency(getInvoiceSum(row))}}
|
{{displayCurrency(sum.getIncomingInvoiceSum(row))}}
|
||||||
</template>
|
</template>
|
||||||
<template #dueDate-data="{row}">
|
<template #dueDate-data="{row}">
|
||||||
{{dayjs(row.dueDate).format("DD.MM.YYYY")}}
|
{{dayjs(row.dueDate).format("DD.MM.YYYY")}}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ setupPage()
|
|||||||
<p>Status: {{itemInfo.state}}</p>
|
<p>Status: {{itemInfo.state}}</p>
|
||||||
<p>Datum: {{dayjs(itemInfo.date).format('DD.MM.YYYY')}}</p>
|
<p>Datum: {{dayjs(itemInfo.date).format('DD.MM.YYYY')}}</p>
|
||||||
<p>Fälligkeitsdatum: {{dayjs(itemInfo.dueDate).format('DD.MM.YYYY')}}</p>
|
<p>Fälligkeitsdatum: {{dayjs(itemInfo.dueDate).format('DD.MM.YYYY')}}</p>
|
||||||
<p v-if="itemInfo.vendor">Lieferant: <nuxt-link :to="`/standardEntity/vendors/show/${itemInfo.vendor}`">{{itemInfo.vendor.name}}</nuxt-link></p>
|
<p v-if="itemInfo.vendor">Lieferant: <nuxt-link :to="`/standardEntity/vendors/show/${itemInfo.vendor.id}`">{{itemInfo.vendor.name}}</nuxt-link></p>
|
||||||
<p>Bezahlt: {{itemInfo.paid ? "Ja" : "Nein"}}</p>
|
<p>Bezahlt: {{itemInfo.paid ? "Ja" : "Nein"}}</p>
|
||||||
<p>Beschreibung: {{itemInfo.description}}</p>
|
<p>Beschreibung: {{itemInfo.description}}</p>
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const toast = useToast()
|
|||||||
const mode = ref(route.params.mode || "show")
|
const mode = ref(route.params.mode || "show")
|
||||||
const itemInfo = ref({
|
const itemInfo = ref({
|
||||||
name: "",
|
name: "",
|
||||||
initialPhases: [{label:'',icon:''}]
|
initialPhases: [{ "key": "f31f6fcb-34d5-41a0-9b8f-6c85062f19be", "icon": "i-heroicons-clipboard-document", "label": "Erstkontakt", "active": true, "quickactions": [] }, { "key": "41995d1f-78fa-448b-b6ea-e206645ffb89", "icon": "i-heroicons-wrench-screwdriver", "label": "Umsetzung", "quickactions": [] }, { "key": "267e78ac-9eab-4736-b9c8-4b94c1724494", "icon": "i-heroicons-document-text", "label": "Rechnungsstellung", "quickactions": [] }, { "key": "038df888-53f2-4985-b08e-776ab82df5d3", "icon": "i-heroicons-check", "label": "Abgeschlossen", "quickactions": [] } ]
|
||||||
})
|
})
|
||||||
const oldItemInfo = ref({})
|
const oldItemInfo = ref({})
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,18 @@
|
|||||||
|
|
||||||
const editTemplateModalOpen = ref(false)
|
const editTemplateModalOpen = ref(false)
|
||||||
const itemInfo = ref({})
|
const itemInfo = ref({})
|
||||||
|
const texttemplates = ref([])
|
||||||
|
|
||||||
|
const setup = async () => {
|
||||||
|
texttemplates.value = await useSupabaseSelect("texttemplates")
|
||||||
|
}
|
||||||
|
|
||||||
|
setup()
|
||||||
|
|
||||||
|
const expand = ref({
|
||||||
|
openedRows: [],
|
||||||
|
row: {}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -26,11 +37,8 @@
|
|||||||
</UButton>
|
</UButton>
|
||||||
</template>
|
</template>
|
||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
<UDashboardToolbar>
|
|
||||||
|
|
||||||
</UDashboardToolbar>
|
|
||||||
<UDashboardPanelContent>
|
<UDashboardPanelContent>
|
||||||
<UCard class="mt-5 mx-5">
|
<UCard class="mx-5">
|
||||||
<template #header>
|
<template #header>
|
||||||
Variablen
|
Variablen
|
||||||
</template>
|
</template>
|
||||||
@@ -55,7 +63,39 @@
|
|||||||
|
|
||||||
</UCard>
|
</UCard>
|
||||||
|
|
||||||
<div class="w-3/4 mx-auto mt-5">
|
<UTable
|
||||||
|
class="mt-3"
|
||||||
|
:rows="texttemplates"
|
||||||
|
v-model:expand="expand"
|
||||||
|
:columns="[{key:'name',label:'Name'},{key:'documentType',label:'Dokumententyp'},{key:'default',label:'Standard'},{key:'pos',label:'Position'}]"
|
||||||
|
>
|
||||||
|
<template #documentType-data="{row}">
|
||||||
|
{{dataStore.documentTypesForCreation[row.documentType].label}}
|
||||||
|
</template>
|
||||||
|
<template #default-data="{row}">
|
||||||
|
{{row.default ? "Ja" : "Nein"}}
|
||||||
|
</template>
|
||||||
|
<template #pos-data="{row}">
|
||||||
|
<span v-if="row.pos === 'startText'">Einleitung</span>
|
||||||
|
<span v-else-if="row.pos === 'endText'">Endtext</span>
|
||||||
|
</template>
|
||||||
|
<template #expand="{ row }">
|
||||||
|
<div class="p-4">
|
||||||
|
<p class="text-2xl">{{dataStore.documentTypesForCreation[row.documentType].label}}</p>
|
||||||
|
<p class="text-xl mt-3">{{row.pos === 'startText' ? 'Einleitung' : 'Ende'}}</p>
|
||||||
|
<p class="text-justify mt-3">{{row.text}}</p>
|
||||||
|
<UButton
|
||||||
|
class="mt-3"
|
||||||
|
@click="itemInfo = row;
|
||||||
|
editTemplateModalOpen = true"
|
||||||
|
variant="outline"
|
||||||
|
>Bearbeiten</UButton>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</UTable>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <div class="w-3/4 mx-auto mt-5">
|
||||||
<UCard
|
<UCard
|
||||||
v-for="template in dataStore.texttemplates"
|
v-for="template in dataStore.texttemplates"
|
||||||
class="mb-3"
|
class="mb-3"
|
||||||
@@ -70,7 +110,7 @@
|
|||||||
variant="outline"
|
variant="outline"
|
||||||
/>
|
/>
|
||||||
</UCard>
|
</UCard>
|
||||||
</div>
|
</div>-->
|
||||||
</UDashboardPanelContent>
|
</UDashboardPanelContent>
|
||||||
|
|
||||||
<USlideover
|
<USlideover
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
|
|
||||||
import {useFunctions} from "~/composables/useFunctions.js";
|
import {useFunctions} from "~/composables/useFunctions.js";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
const supabase = useSupabaseClient()
|
const supabase = useSupabaseClient()
|
||||||
const profileStore = useProfileStore()
|
const profileStore = useProfileStore()
|
||||||
@@ -153,33 +154,56 @@ const closeTicket = async () => {
|
|||||||
</template>
|
</template>
|
||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
<UDashboardPanelContent v-if="loaded">
|
<UDashboardPanelContent v-if="loaded">
|
||||||
<UAlert
|
<div
|
||||||
|
v-if="profileStore.currentTenant === 5"
|
||||||
|
v-for="item in itemInfo.ticketmessages"
|
||||||
|
class="mb-3 flex flex-row p-5"
|
||||||
|
:style="item.internal ? 'border: 1px solid red; border-radius: 15px' : item.profile.tenant === 5 ? 'border: 1px solid #69c350; border-radius: 15px' : 'border: 1px solid #fff; border-radius: 15px'"
|
||||||
|
>
|
||||||
|
<UAvatar :alt="item.profile.fullName" class="mr-3"/>
|
||||||
|
<div>
|
||||||
|
<p class="text-xl">{{item.type}} - {{item.profile.fullName}}</p>
|
||||||
|
<p v-html="item.content"></p>
|
||||||
|
<p class="mt-1 text-gray-600 dark:text-gray-400">{{dayjs(item.created_at).format("DD.MM.YYYY HH:mm")}}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <UAlert
|
||||||
v-if="profileStore.currentTenant === 5"
|
v-if="profileStore.currentTenant === 5"
|
||||||
v-for="item in itemInfo.ticketmessages"
|
v-for="item in itemInfo.ticketmessages"
|
||||||
:description="item.content"
|
|
||||||
:avatar="{ alt: item.profile.fullName}"
|
:avatar="{ alt: item.profile.fullName}"
|
||||||
:title="`${item.type} - ${item.profile.fullName}`"
|
:title="`${item.type} - ${item.profile.fullName}`"
|
||||||
class="mb-3"
|
class="mb-3"
|
||||||
:color="item.internal ? 'rose' : item.profile.tenant === 5 ? 'primary' : 'white'"
|
:color="item.internal ? 'rose' : item.profile.tenant === 5 ? 'primary' : 'white'"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
/>
|
>
|
||||||
|
<template #description>
|
||||||
|
<span v-html="item.content"></span>
|
||||||
|
<p class="mt-1 text-gray-600 dark:text-gray-400">{{dayjs(item.created_at).format("DD.MM.YYYY HH:mm")}}</p>
|
||||||
|
</template>
|
||||||
|
</UAlert>-->
|
||||||
<UAlert
|
<UAlert
|
||||||
v-else
|
v-else
|
||||||
v-for="item in itemInfo.ticketmessages.filter(i => !i.internal)"
|
v-for="item in itemInfo.ticketmessages.filter(i => !i.internal)"
|
||||||
:description="item.content"
|
|
||||||
:avatar="{ alt: item.profile.fullName}"
|
:avatar="{ alt: item.profile.fullName}"
|
||||||
:title="`${item.type} - ${item.profile.fullName}`"
|
:title="`${item.type} - ${item.profile.fullName}`"
|
||||||
class="mb-3"
|
class="mb-3"
|
||||||
:color="item.profile.tenant === 5 ? 'primary' : 'white'"
|
:color="item.profile.tenant === 5 ? 'primary' : 'white'"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
/>
|
>
|
||||||
|
<template #description>
|
||||||
|
<p>{{item.content}}</p>
|
||||||
|
<p class="mt-1 text-gray-600 dark:text-gray-400">{{dayjs(item.created_at).format("DD.MM.YYYY HH:mm")}}</p>
|
||||||
|
</template>
|
||||||
|
</UAlert>
|
||||||
|
|
||||||
<InputGroup>
|
<InputGroup>
|
||||||
<UInput
|
<UTextarea
|
||||||
class="w-full mr-2"
|
class="w-full mr-2"
|
||||||
placeholder="Neue Nachricht senden"
|
placeholder="Neue Nachricht senden"
|
||||||
v-model="messageContent"
|
v-model="messageContent"
|
||||||
@keyup.enter="addMessage"
|
|
||||||
/>
|
/>
|
||||||
<UButton
|
<UButton
|
||||||
@click="addMessage"
|
@click="addMessage"
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ const filteredRows = computed(() => {
|
|||||||
<template>
|
<template>
|
||||||
<UDashboardNavbar
|
<UDashboardNavbar
|
||||||
title="Support Tickets"
|
title="Support Tickets"
|
||||||
|
:badge="filteredRows.length"
|
||||||
>
|
>
|
||||||
<template #right>
|
<template #right>
|
||||||
<UButton
|
<UButton
|
||||||
|
|||||||
@@ -599,6 +599,8 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
selectManualOptions: [
|
selectManualOptions: [
|
||||||
{label:"Urlaub"},
|
{label:"Urlaub"},
|
||||||
{label:"Berufsschule"},
|
{label:"Berufsschule"},
|
||||||
|
{label:"Schlechtwetter"},
|
||||||
|
{label:"Saison Kurzarbeitergeld"},
|
||||||
{label:"unbezahlter Urlaub"},
|
{label:"unbezahlter Urlaub"},
|
||||||
{label:"Überstundenausgleich"},
|
{label:"Überstundenausgleich"},
|
||||||
{label:"Sonderurlaub(bezahlt)"},
|
{label:"Sonderurlaub(bezahlt)"},
|
||||||
|
|||||||
Reference in New Issue
Block a user