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)
if(props.mode === "create" && (route.query || props.createQuery)) {
console.log(route.query)
let data = !props.inModal ? route.query : props.createQuery

View File

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

0
package-lock.json generated Normal file
View File

View File

@@ -52,6 +52,7 @@
"@vue-leaflet/vue-leaflet": "^0.10.1",
"@vuepic/vue-datepicker": "^7.4.0",
"@zip.js/zip.js": "^2.7.32",
"array-sort": "^1.0.0",
"axios": "^1.6.7",
"base64-arraybuffer": "^1.0.2",
"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 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
customers.value = (await supabase.from("customers").select()).data
vendors.value = (await supabase.from("vendors").select()).data
@@ -711,7 +711,7 @@ const archiveStatement = async () => {
:ui-menu="{ width: 'min-w-max' }"
v-model="customerAccountToSave"
searchable
:search-attributes="['number','label']"
:search-attributes="['number','name']"
>
<template #label>
<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 DocumentUploadModal from "~/components/DocumentUploadModal.vue";
import dayjs from "dayjs";
import arraySort from "array-sort";
definePageMeta({
middleware: "auth"
@@ -291,6 +292,20 @@ const renderedFileList = computed(() => {
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 => {
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]
})

View File

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

View File

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