Merge branch 'refs/heads/beta'
This commit is contained in:
13
app.vue
13
app.vue
@@ -12,6 +12,15 @@ const viewport = useViewport()
|
|||||||
console.log('Breakpoint updated:', oldBreakpoint, '->', newBreakpoint)
|
console.log('Breakpoint updated:', oldBreakpoint, '->', newBreakpoint)
|
||||||
})*/
|
})*/
|
||||||
|
|
||||||
|
const platform = ref('default')
|
||||||
|
|
||||||
|
const setup = async () => {
|
||||||
|
if(await useCapacitor().getIsPhone()) {
|
||||||
|
platform.value = "mobile"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setup()
|
||||||
|
|
||||||
const dev = process.dev
|
const dev = process.dev
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
@@ -55,9 +64,9 @@ useSeoMeta({
|
|||||||
<NuxtPage/>
|
<NuxtPage/>
|
||||||
</NuxtLayout>
|
</NuxtLayout>
|
||||||
|
|
||||||
<UNotifications/>
|
<UNotifications :class="platform === 'mobile' ? ['mb-14'] : []"/>
|
||||||
<USlideovers />
|
<USlideovers />
|
||||||
<UModals />
|
<UModals/>
|
||||||
<VitePwaManifest/>
|
<VitePwaManifest/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
inModal: {
|
inModal: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
},
|
||||||
|
platform: {
|
||||||
|
type: String,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -233,6 +236,9 @@ const updateItem = async () => {
|
|||||||
v-if="!props.inModal"
|
v-if="!props.inModal"
|
||||||
:ui="{center: 'flex items-stretch gap-1.5 min-w-0'}"
|
:ui="{center: 'flex items-stretch gap-1.5 min-w-0'}"
|
||||||
>
|
>
|
||||||
|
<template #toggle>
|
||||||
|
<div v-if="platform === 'mobile'"></div>
|
||||||
|
</template>
|
||||||
<template #left>
|
<template #left>
|
||||||
<UButton
|
<UButton
|
||||||
icon="i-heroicons-chevron-left"
|
icon="i-heroicons-chevron-left"
|
||||||
@@ -245,11 +251,12 @@ const updateItem = async () => {
|
|||||||
<template #center>
|
<template #center>
|
||||||
<h1
|
<h1
|
||||||
v-if="item"
|
v-if="item"
|
||||||
:class="['text-xl','font-medium']"
|
:class="['text-xl','font-medium', 'text-center']"
|
||||||
>{{item.id ? `${dataType.labelSingle} bearbeiten` : `${dataType.labelSingle} erstellen` }}</h1>
|
>{{item.id ? `${dataType.labelSingle} bearbeiten` : `${dataType.labelSingle} erstellen` }}</h1>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<ButtonWithConfirm
|
<ButtonWithConfirm
|
||||||
|
v-if="platform !== 'mobile'"
|
||||||
color="rose"
|
color="rose"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
@confirmed="dataStore.updateItem(type,{...item,archived: true}, oldItem)"
|
@confirmed="dataStore.updateItem(type,{...item,archived: true}, oldItem)"
|
||||||
@@ -279,7 +286,7 @@ const updateItem = async () => {
|
|||||||
<UButton
|
<UButton
|
||||||
@click="router.push(item.id ? `/standardEntity/${type}/show/${item.id}` : `/standardEntity/${type}`)"
|
@click="router.push(item.id ? `/standardEntity/${type}/show/${item.id}` : `/standardEntity/${type}`)"
|
||||||
color="red"
|
color="red"
|
||||||
class="ml-2"
|
class="ml-1"
|
||||||
>
|
>
|
||||||
Abbrechen
|
Abbrechen
|
||||||
</UButton>
|
</UButton>
|
||||||
@@ -323,10 +330,10 @@ const updateItem = async () => {
|
|||||||
<UForm
|
<UForm
|
||||||
class="p-5"
|
class="p-5"
|
||||||
>
|
>
|
||||||
<div class="flex flex-row">
|
<div :class="platform === 'mobile' ?['flex','flex-col'] : ['flex','flex-row']">
|
||||||
<div
|
<div
|
||||||
v-for="(columnName,index) in dataType.inputColumns"
|
v-for="(columnName,index) in dataType.inputColumns"
|
||||||
:class="['w-1/2', ... index < dataType.inputColumns.length -1 ? ['mr-5'] : []]"
|
:class="platform === 'mobile' ? ['w-full'] : [`w-1/${dataType.inputColumns.length}`, ... index < dataType.inputColumns.length -1 ? ['mr-5'] : []]"
|
||||||
>
|
>
|
||||||
<UDivider>{{columnName}}</UDivider>
|
<UDivider>{{columnName}}</UDivider>
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ const filteredRows = computed(() => {
|
|||||||
:label="`+ ${dataType.labelSingle}`"
|
:label="`+ ${dataType.labelSingle}`"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
v-if="platform === 'mobile'"
|
v-if="platform === 'mobile'"
|
||||||
@click="router.push(`/mobile/standardEntity/${type}/create`)"
|
@click="router.push(`/standardEntity/${type}/create`)"
|
||||||
/>
|
/>
|
||||||
<UDashboardNavbar :title="dataType.label" :badge="filteredRows.length">
|
<UDashboardNavbar :title="dataType.label" :badge="filteredRows.length">
|
||||||
<template #toggle>
|
<template #toggle>
|
||||||
|
|||||||
@@ -21,9 +21,12 @@ const showAddHistoryItemModal = ref(false)
|
|||||||
const colorMode = useColorMode()
|
const colorMode = useColorMode()
|
||||||
|
|
||||||
const items = ref([])
|
const items = ref([])
|
||||||
|
const platform = ref("default")
|
||||||
|
|
||||||
const setup = async () => {
|
const setup = async () => {
|
||||||
|
|
||||||
|
if(await useCapacitor().getIsPhone()) platform.value = "mobile"
|
||||||
|
|
||||||
if(props.type && props.elementId){
|
if(props.type && props.elementId){
|
||||||
items.value = (await supabase.from("historyitems").select().eq(props.type,props.elementId).order("created_at",{ascending: true})).data || []
|
items.value = (await supabase.from("historyitems").select().eq(props.type,props.elementId).order("created_at",{ascending: true})).data || []
|
||||||
} else {
|
} else {
|
||||||
@@ -102,10 +105,16 @@ const renderText = (text) => {
|
|||||||
<template>
|
<template>
|
||||||
<UModal
|
<UModal
|
||||||
v-model="showAddHistoryItemModal"
|
v-model="showAddHistoryItemModal"
|
||||||
|
|
||||||
>
|
>
|
||||||
<UCard>
|
<UCard class="h-full">
|
||||||
<template #header>
|
<template #header>
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<h3 class="text-base font-semibold leading-6 text-gray-900 dark:text-white">
|
||||||
Eintrag hinzufügen
|
Eintrag hinzufügen
|
||||||
|
</h3>
|
||||||
|
<UButton color="gray" variant="ghost" icon="i-heroicons-x-mark-20-solid" class="-my-1" @click="showAddHistoryItemModal = false" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<UFormGroup
|
<UFormGroup
|
||||||
|
|||||||
@@ -160,7 +160,40 @@ export const useCreateWorkingTimesPdf = async (input,backgroundSourceBuffer) =>
|
|||||||
|
|
||||||
let rowHeight = 115
|
let rowHeight = 115
|
||||||
|
|
||||||
input.times.forEach(time => {
|
|
||||||
|
let splitted = []
|
||||||
|
|
||||||
|
let reversedInput = input.times.slice().reverse()
|
||||||
|
|
||||||
|
const splittedLength = Math.floor((reversedInput.length - 25) / 40)
|
||||||
|
|
||||||
|
splitted.push(reversedInput.slice(0,25))
|
||||||
|
|
||||||
|
let lastIndex = 25
|
||||||
|
for (let i = 0; i < splittedLength; ++i ) {
|
||||||
|
splitted.push(reversedInput.slice(lastIndex, lastIndex + (i + 1) * 40))
|
||||||
|
lastIndex = lastIndex + (i + 1) * 40 + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
splitted.push(reversedInput.slice(lastIndex, reversedInput.length))
|
||||||
|
|
||||||
|
|
||||||
|
splitted.forEach((chunk,index) => {
|
||||||
|
if(index > 0) {
|
||||||
|
const page = pdfDoc.addPage()
|
||||||
|
|
||||||
|
page.drawPage(secondPageBackground, {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
})
|
||||||
|
|
||||||
|
pages.push(page)
|
||||||
|
pageCounter++
|
||||||
|
rowHeight = 20
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
chunk.forEach(time => {
|
||||||
pages[pageCounter - 1].drawText(`${dayjs(time.startDate).format("HH:mm DD.MM.YY")}`,{
|
pages[pageCounter - 1].drawText(`${dayjs(time.startDate).format("HH:mm DD.MM.YY")}`,{
|
||||||
x: getCoordinatesForPDFLib(20,rowHeight,pages[pageCounter -1]).x,
|
x: getCoordinatesForPDFLib(20,rowHeight,pages[pageCounter -1]).x,
|
||||||
y: getCoordinatesForPDFLib(20,rowHeight,pages[pageCounter -1]).y,
|
y: getCoordinatesForPDFLib(20,rowHeight,pages[pageCounter -1]).y,
|
||||||
@@ -182,6 +215,10 @@ export const useCreateWorkingTimesPdf = async (input,backgroundSourceBuffer) =>
|
|||||||
rowHeight += 6
|
rowHeight += 6
|
||||||
|
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uri.value = await pdfDoc.saveAsBase64({dataUri: true})
|
uri.value = await pdfDoc.saveAsBase64({dataUri: true})
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export default defineNuxtConfig({
|
|||||||
transpile: ['@vuepic/vue-datepicker']
|
transpile: ['@vuepic/vue-datepicker']
|
||||||
},
|
},
|
||||||
|
|
||||||
modules: ['@pinia/nuxt', '@nuxt/ui', '@nuxt/content', '@nuxtjs/supabase', "nuxt-editorjs", '@nuxtjs/fontaine', '@vite-pwa/nuxt', 'nuxt-viewport', 'nuxt-tiptap-editor', '@nuxtjs/leaflet'],
|
modules: ['@pinia/nuxt', '@nuxt/ui', '@nuxt/content', '@nuxtjs/supabase', "nuxt-editorjs", '@nuxtjs/fontaine', 'nuxt-viewport', 'nuxt-tiptap-editor', '@nuxtjs/leaflet'],
|
||||||
|
|
||||||
routeRules: {
|
routeRules: {
|
||||||
'/printing': {ssr: false}
|
'/printing': {ssr: false}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nuxtjs/leaflet": "^1.2.3",
|
"@nuxtjs/leaflet": "^1.2.3",
|
||||||
"@nuxtjs/supabase": "^1.1.4",
|
"@nuxtjs/supabase": "^1.1.4",
|
||||||
"@vite-pwa/nuxt": "^0.3.3",
|
|
||||||
"nuxt": "^3.14.1592",
|
"nuxt": "^3.14.1592",
|
||||||
"nuxt-tiptap-editor": "^1.2.0",
|
"nuxt-tiptap-editor": "^1.2.0",
|
||||||
"vite-plugin-pwa": "^0.17.3",
|
"vite-plugin-pwa": "^0.17.3",
|
||||||
|
|||||||
@@ -716,10 +716,10 @@ const documentReport = computed(() => {
|
|||||||
let totalHoursSellingPrice = 0
|
let totalHoursSellingPrice = 0
|
||||||
|
|
||||||
|
|
||||||
itemInfo.value.rows.forEach(row => {
|
itemInfo.value.rows.filter(i => !i.optional && !i.alternative).forEach(row => {
|
||||||
if(row.product) {
|
if(row.product) {
|
||||||
let product = products.value.find(i => i.id === row.product)
|
let product = products.value.find(i => i.id === row.product)
|
||||||
console.log(product)
|
console.log(product.purchasePrice)
|
||||||
|
|
||||||
totalProductsPurchasePrice += product.purchasePrice * row.quantity
|
totalProductsPurchasePrice += product.purchasePrice * row.quantity
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ definePageMeta({
|
|||||||
<UDashboardPanelContent>
|
<UDashboardPanelContent>
|
||||||
|
|
||||||
<UButton
|
<UButton
|
||||||
class="w-full my-1">
|
class="w-full my-1"
|
||||||
|
to="/standardEntity/absencerequests"
|
||||||
|
>
|
||||||
Abwesenheiten
|
Abwesenheiten
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
@@ -18,15 +20,21 @@ definePageMeta({
|
|||||||
Kalender
|
Kalender
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
class="w-full my-1">
|
class="w-full my-1"
|
||||||
|
to="/standardEntity/customers"
|
||||||
|
>
|
||||||
Kunden
|
Kunden
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
class="w-full my-1">
|
class="w-full my-1"
|
||||||
|
to="/standardEntity/vendors"
|
||||||
|
>
|
||||||
Lieferanten
|
Lieferanten
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
class="w-full my-1">
|
class="w-full my-1"
|
||||||
|
to="/standardEntity/plants"
|
||||||
|
>
|
||||||
Objekte
|
Objekte
|
||||||
</UButton>
|
</UButton>
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import isoWeek from "dayjs/plugin/isoWeek"
|
|||||||
import isBetween from "dayjs/plugin/isBetween"
|
import isBetween from "dayjs/plugin/isBetween"
|
||||||
import DocumentList from "~/components/DocumentList.vue";
|
import DocumentList from "~/components/DocumentList.vue";
|
||||||
import DocumentUpload from "~/components/DocumentUpload.vue";
|
import DocumentUpload from "~/components/DocumentUpload.vue";
|
||||||
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
dayjs.extend(customParseFormat)
|
dayjs.extend(customParseFormat)
|
||||||
dayjs.extend(isoWeek)
|
dayjs.extend(isoWeek)
|
||||||
dayjs.extend(isBetween)
|
dayjs.extend(isBetween)
|
||||||
@@ -131,6 +132,10 @@ const saveProfile = async () => {
|
|||||||
await dataStore.updateItem('profiles',data,oldItemInfo.value)
|
await dataStore.updateItem('profiles',data,oldItemInfo.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const addAutomaticHourCorrection = async () => {
|
||||||
|
itemInfo.value.automaticHourCorrections.push({mode: 'correct', id: uuidv4(), weekday: 1, bookingTimeUTC: {hour: 0, minute: 0}, rangeStartUTC: {hour: 0, minute: 0}, rangeEndUTC: {hour: 0, minute: 0}})
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -161,9 +166,9 @@ const saveProfile = async () => {
|
|||||||
label: 'Informationen'
|
label: 'Informationen'
|
||||||
},{
|
},{
|
||||||
label: 'Logbuch'
|
label: 'Logbuch'
|
||||||
},/*{
|
},{
|
||||||
label: 'Zeiterfassung'
|
label: 'Zeiterfassung'
|
||||||
},*/{
|
},{
|
||||||
label: 'Vertragsdaten'
|
label: 'Vertragsdaten'
|
||||||
},{
|
},{
|
||||||
label: 'Dokumente'
|
label: 'Dokumente'
|
||||||
@@ -326,9 +331,9 @@ const saveProfile = async () => {
|
|||||||
:preloadedContent="emailSignature"
|
:preloadedContent="emailSignature"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<UDivider>Newsletter</UDivider>
|
<!--<UDivider>Newsletter</UDivider>
|
||||||
|
|
||||||
<!-- <UButton
|
<UButton
|
||||||
@click="addToNewsletter"
|
@click="addToNewsletter"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
>
|
>
|
||||||
@@ -501,6 +506,127 @@ const saveProfile = async () => {
|
|||||||
</template>
|
</template>
|
||||||
</UTable>
|
</UTable>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else-if="item.label === 'Zeiterfassung'">
|
||||||
|
<UButton
|
||||||
|
@click="addAutomaticHourCorrection"
|
||||||
|
>
|
||||||
|
+ Korrektur
|
||||||
|
</UButton>
|
||||||
|
<UButton
|
||||||
|
@click="saveProfile"
|
||||||
|
class="ml-3"
|
||||||
|
>
|
||||||
|
Speichern
|
||||||
|
</UButton>
|
||||||
|
|
||||||
|
<UDivider class="my-3" />
|
||||||
|
|
||||||
|
<InputGroup class="w-full" v-for="item in itemInfo.automaticHourCorrections">
|
||||||
|
<UFormGroup
|
||||||
|
label="Modus"
|
||||||
|
>
|
||||||
|
<USelectMenu
|
||||||
|
v-model="item.mode"
|
||||||
|
:options="[{key: 'correct', label: 'Korrigieren'},{key: 'automatic-checkout', label: 'Automatisches ausbuchen'}]"
|
||||||
|
option-attribute="label"
|
||||||
|
value-attribute="key"
|
||||||
|
class="w-80"
|
||||||
|
/>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Wochentag"
|
||||||
|
>
|
||||||
|
<USelectMenu
|
||||||
|
v-model="item.weekday"
|
||||||
|
:options="[{key: 1, label: 'Montag'},{key: 2, label: 'Dienstag'},{key: 3, label: 'Mittwoch'},{key: 4, label: 'Donnerstag'},{key: 5, label: 'Freitag'},{key: 6, label: 'Samstag'},{key: 7, label: 'Sonntag'},]"
|
||||||
|
option-attribute="label"
|
||||||
|
value-attribute="key"
|
||||||
|
class="w-40"
|
||||||
|
/>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Zeitraum Start"
|
||||||
|
v-if="item.mode === 'correct'"
|
||||||
|
>
|
||||||
|
<InputGroup>
|
||||||
|
<UInput
|
||||||
|
v-model="item.rangeStartUTC.hour"
|
||||||
|
placeholder="Stunde UTC"
|
||||||
|
class="w-20"
|
||||||
|
/>
|
||||||
|
<UInput
|
||||||
|
v-model="item.rangeStartUTC.minute"
|
||||||
|
placeholder="Minute UTC"
|
||||||
|
class="w-20"
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Zeitraum Ende"
|
||||||
|
v-if="item.mode === 'correct'"
|
||||||
|
>
|
||||||
|
<InputGroup>
|
||||||
|
<UInput
|
||||||
|
v-model="item.rangeEndUTC.hour"
|
||||||
|
placeholder="Stunde UTC"
|
||||||
|
class="w-20"
|
||||||
|
/>
|
||||||
|
<UInput
|
||||||
|
v-model="item.rangeEndUTC.minute"
|
||||||
|
placeholder="Minute UTC"
|
||||||
|
class="w-20"
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Korrigieren zu"
|
||||||
|
v-if="item.mode === 'correct'"
|
||||||
|
>
|
||||||
|
<InputGroup>
|
||||||
|
<UInput
|
||||||
|
v-model="item.bookingTimeUTC.hour"
|
||||||
|
placeholder="Stunde UTC"
|
||||||
|
class="w-20"
|
||||||
|
/>
|
||||||
|
<UInput
|
||||||
|
v-model="item.bookingTimeUTC.minute"
|
||||||
|
placeholder="Minute UTC"
|
||||||
|
class="w-20"
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Ausbuchen"
|
||||||
|
v-if="item.mode === 'automatic-checkout'"
|
||||||
|
>
|
||||||
|
<InputGroup>
|
||||||
|
<UInput
|
||||||
|
v-model="item.bookingTimeUTC.hour"
|
||||||
|
placeholder="Stunde UTC"
|
||||||
|
class="w-20"
|
||||||
|
/>
|
||||||
|
<UInput
|
||||||
|
v-model="item.bookingTimeUTC.minute"
|
||||||
|
placeholder="Minute UTC"
|
||||||
|
class="w-20"
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup
|
||||||
|
label="Entfernen"
|
||||||
|
>
|
||||||
|
<UButton
|
||||||
|
icon="i-heroicons-x-mark"
|
||||||
|
variant="outline"
|
||||||
|
color="red"
|
||||||
|
@click="itemInfo.automaticHourCorrections = itemInfo.automaticHourCorrections.filter(i => i.id !== item.id)"
|
||||||
|
/>
|
||||||
|
</UFormGroup>
|
||||||
|
|
||||||
|
</InputGroup>
|
||||||
|
|
||||||
|
</div>
|
||||||
</UCard>
|
</UCard>
|
||||||
</template>
|
</template>
|
||||||
</UTabs>
|
</UTabs>
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ setupPage()
|
|||||||
:type="route.params.type"
|
:type="route.params.type"
|
||||||
:item="item"
|
:item="item"
|
||||||
:mode="mode"
|
:mode="mode"
|
||||||
|
:platform="platform"
|
||||||
/>
|
/>
|
||||||
<EntityList
|
<EntityList
|
||||||
v-else-if="loaded && mode === 'list'"
|
v-else-if="loaded && mode === 'list'"
|
||||||
|
|||||||
@@ -903,14 +903,36 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
label: "Einkaufspreis",
|
label: "Einkaufspreis",
|
||||||
component: purchasePrice,
|
component: purchasePrice,
|
||||||
inputType: "number",
|
inputType: "number",
|
||||||
inputTrailing: "EUR"
|
inputTrailing: "EUR",
|
||||||
|
inputChangeFunction: function (row) {
|
||||||
|
if(row.markupPercentage) {
|
||||||
|
row.sellingPrice = row.purchasePrice * (1+row.markupPercentage/100);
|
||||||
|
} else {
|
||||||
|
row.sellingPrice = row.purchasePrice;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
key: "markupPercentage",
|
||||||
|
label: "Aufschlag",
|
||||||
|
inputType: "number",
|
||||||
|
inputTrailing: "%",
|
||||||
|
inputChangeFunction: function (row) {
|
||||||
|
if(row.sellingPrice) {
|
||||||
|
row.sellingPrice = row.purchasePrice * (1+row.markupPercentage/100);
|
||||||
|
}
|
||||||
|
}
|
||||||
},{
|
},{
|
||||||
key: "sellingPrice",
|
key: "sellingPrice",
|
||||||
label: "Verkaufpreispreis",
|
label: "Verkaufpreispreis",
|
||||||
required: true,
|
required: true,
|
||||||
component: sellingPrice,
|
component: sellingPrice,
|
||||||
inputType: "number",
|
inputType: "number",
|
||||||
inputTrailing: "EUR"
|
inputTrailing: "EUR",
|
||||||
|
inputChangeFunction: function (row) {
|
||||||
|
if(row.markupPercentage) {
|
||||||
|
row.purchasePrice = (row.sellingPrice / (1+row.markupPercentage/100)).toFixed(4);
|
||||||
|
}
|
||||||
|
}
|
||||||
},{
|
},{
|
||||||
key: "taxPercentage",
|
key: "taxPercentage",
|
||||||
label: "Umsatzsteuer",
|
label: "Umsatzsteuer",
|
||||||
|
|||||||
@@ -40,7 +40,10 @@ export const useProfileStore = defineStore('profile', () => {
|
|||||||
let profiles = (await supabase.from("profiles").select("*, role(*)")).data
|
let profiles = (await supabase.from("profiles").select("*, role(*)")).data
|
||||||
let activeProfileConnection = profileconnections.find(i => i.active)
|
let activeProfileConnection = profileconnections.find(i => i.active)
|
||||||
if(activeProfileConnection) {
|
if(activeProfileConnection) {
|
||||||
|
if(!await useCapacitor().getIsPhone()) {
|
||||||
toast.add({title: 'Aktives Profil ausgewählt'})
|
toast.add({title: 'Aktives Profil ausgewählt'})
|
||||||
|
}
|
||||||
|
|
||||||
console.log("Active Profile selected")
|
console.log("Active Profile selected")
|
||||||
activeProfile.value = profiles.find(i => i.id === activeProfileConnection.profile_id)
|
activeProfile.value = profiles.find(i => i.id === activeProfileConnection.profile_id)
|
||||||
currentTenant.value = activeProfile.value.tenant
|
currentTenant.value = activeProfile.value.tenant
|
||||||
|
|||||||
Reference in New Issue
Block a user