Merge branch 'dev' into beta

# Conflicts:
#	package-lock.json
This commit is contained in:
2025-04-22 14:47:06 +02:00
8 changed files with 46 additions and 7 deletions

View File

@@ -91,7 +91,6 @@ const setupQuery = () => {
console.log(props.mode) console.log(props.mode)
if(props.mode === "create" && (route.query || props.createQuery)) { if(props.mode === "create" && (route.query || props.createQuery)) {
console.log(route.query)
let data = !props.inModal ? route.query : props.createQuery let data = !props.inModal ? route.query : props.createQuery

View File

@@ -11,6 +11,7 @@ const props = defineProps({
}, },
createQuery: { createQuery: {
type: Object, type: Object,
default: {}
}, },
buttonShow: { buttonShow: {
type: Boolean, type: Boolean,

0
package-lock.json generated Normal file
View File

View File

@@ -52,6 +52,7 @@
"@vue-leaflet/vue-leaflet": "^0.10.1", "@vue-leaflet/vue-leaflet": "^0.10.1",
"@vuepic/vue-datepicker": "^7.4.0", "@vuepic/vue-datepicker": "^7.4.0",
"@zip.js/zip.js": "^2.7.32", "@zip.js/zip.js": "^2.7.32",
"array-sort": "^1.0.0",
"axios": "^1.6.7", "axios": "^1.6.7",
"base64-arraybuffer": "^1.0.2", "base64-arraybuffer": "^1.0.2",
"buffer": "^6.0.3", "buffer": "^6.0.3",

View File

@@ -49,7 +49,7 @@ const setup = async () => {
const documents = createddocuments.value.filter(i => i.type === "invoices" ||i.type === "advanceInvoices") const documents = createddocuments.value.filter(i => i.type === "invoices" ||i.type === "advanceInvoices")
const incominginvoices = (await useSupabaseSelect("incominginvoices","*, statementallocations(*), vendor(id,name)")).filter(i => i.state === "Gebucht") const incominginvoices = (await useSupabaseSelect("incominginvoices","*, statementallocations(*), vendor(id,name)")).filter(i => i.state === "Gebucht")
accounts.value = (await supabase.from("accounts").select()).data accounts.value = (await supabase.from("accounts").select().order("number",{ascending: true})).data
ownaccounts.value = (await supabase.from("ownaccounts").select()).data ownaccounts.value = (await supabase.from("ownaccounts").select()).data
customers.value = (await supabase.from("customers").select()).data customers.value = (await supabase.from("customers").select()).data
vendors.value = (await supabase.from("vendors").select()).data vendors.value = (await supabase.from("vendors").select()).data
@@ -711,7 +711,7 @@ const archiveStatement = async () => {
:ui-menu="{ width: 'min-w-max' }" :ui-menu="{ width: 'min-w-max' }"
v-model="customerAccountToSave" v-model="customerAccountToSave"
searchable searchable
:search-attributes="['number','label']" :search-attributes="['number','name']"
> >
<template #label> <template #label>
<span v-if="customerAccountToSave">{{customers.find(i => i.id === customerAccountToSave).customerNumber}} - {{customers.find(i => i.id === customerAccountToSave).name}}</span> <span v-if="customerAccountToSave">{{customers.find(i => i.id === customerAccountToSave).customerNumber}} - {{customers.find(i => i.id === customerAccountToSave).name}}</span>

View File

@@ -6,6 +6,7 @@ import {useSupabaseSelectSingle} from "~/composables/useSupabase.js";
import DocumentDisplayModal from "~/components/DocumentDisplayModal.vue"; import DocumentDisplayModal from "~/components/DocumentDisplayModal.vue";
import DocumentUploadModal from "~/components/DocumentUploadModal.vue"; import DocumentUploadModal from "~/components/DocumentUploadModal.vue";
import dayjs from "dayjs"; import dayjs from "dayjs";
import arraySort from "array-sort";
definePageMeta({ definePageMeta({
middleware: "auth" middleware: "auth"
@@ -291,6 +292,20 @@ const renderedFileList = computed(() => {
type: "file" type: "file"
} }
}) })
console.log(currentFolders.value)
arraySort(files, (a,b) => {
let aVal = a.path ? a.path.split("/")[a.path.split("/").length -1] : null
let bVal = b.path ? b.path.split("/")[b.path.split("/").length -1] : null
if(aVal && bVal) {
return aVal.localeCompare(bVal)
} else if(!aVal && bVal) {
return 1
} else {
return -1
}
}, {reverse: true})
let folders = currentFolders.value.map(i => { let folders = currentFolders.value.map(i => {
return { return {
@@ -300,6 +315,15 @@ const renderedFileList = computed(() => {
} }
}) })
arraySort(folders, "label")
/*folders.sort(function(a, b) {
// Compare the 2 dates
if (a.name < b.name) return -1;
if (a.name > b.name) return 1;
return 0;
});*/
return [...folders,...files] return [...folders,...files]
}) })

View File

@@ -37,13 +37,15 @@ const itemInfo = ref({
const availableDocuments = ref([]) const availableDocuments = ref([])
const costcentres = ref([]) const costcentres = ref([])
const accounts = ref([])
const vendors = ref([])
const setup = async () => { const setup = async () => {
let filetype = (await supabase.from("filetags").select().eq("tenant",profileStore.currentTenant).eq("incomingDocumentType","invoices").single()).data.id let filetype = (await supabase.from("filetags").select().eq("tenant",profileStore.currentTenant).eq("incomingDocumentType","invoices").single()).data.id
console.log(filetype) console.log(filetype)
let ids = (await supabase.from("files").select("id").eq("tenant",profileStore.currentTenant).eq("type", filetype).is("incominginvoice",null)).data.map(i => i.id) let ids = (await supabase.from("files").select("id").eq("tenant",profileStore.currentTenant).eq("type", filetype).is("incominginvoice",null)).data.map(i => i.id)
availableDocuments.value = await useFiles().selectSomeDocuments(ids) availableDocuments.value = await useFiles().selectSomeDocuments(ids)
accounts.value = (await supabase.from("accounts").select().order("number",{ascending:true})).data
vendors.value = await useSupabaseSelect("vendors")
} }
setup() setup()
@@ -229,6 +231,7 @@ const setCostCentre = async (item,data) => {
class="flex-auto" class="flex-auto"
searchable-placeholder="Suche..." searchable-placeholder="Suche..."
:color="!itemInfo.vendor ? 'rose' : 'primary'" :color="!itemInfo.vendor ? 'rose' : 'primary'"
@change="vendors.find(i => i.id === itemInfo.vendor).defaultPaymentMethod ? itemInfo.paymentType = vendors.find(i => i.id === itemInfo.vendor).defaultPaymentMethod : null"
> >
<template #option="{option}"> <template #option="{option}">
{{option.vendorNumber}} - {{option.name}} {{option.vendorNumber}} - {{option.name}}
@@ -351,7 +354,7 @@ const setCostCentre = async (item,data) => {
class="mb-3" class="mb-3"
> >
<USelectMenu <USelectMenu
:options="dataStore.accounts" :options="accounts"
option-attribute="label" option-attribute="label"
value-attribute="id" value-attribute="id"
searchable searchable
@@ -361,7 +364,7 @@ const setCostCentre = async (item,data) => {
:color="!item.account ? 'rose' : 'primary'" :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" }} {{accounts.find(account => account.id === item.account) ? accounts.find(account => account.id === item.account).label : "Keine Kategorie ausgewählt" }}
</template> </template>
<template #option="{option}"> <template #option="{option}">
{{option.number}} - {{option.label}} {{option.number}} - {{option.label}}

View File

@@ -1152,6 +1152,17 @@ export const useDataStore = defineStore('data', () => {
inputType: "bool", inputType: "bool",
component: sepa component: sepa
}, },
{
key: "defaultPaymentMethod",
label: "Standard Zahlungsmethode",
inputType: "select",
selectValueAttribute: "label",
selectManualOptions: [
{label:"Einzug"},
{label:"Überweisung"},
{label:"Kreditkarte"},
],
},
{ {
key: "notes", key: "notes",
label: "Notizen", label: "Notizen",