loadFile(documentId)"
/>
+
+ Keine Dateien zum zuweisen verfügbar
+
{
{{dataStore.vendors.find(vendor => vendor.id === itemInfo.vendor) ? dataStore.vendors.find(vendor => vendor.id === itemInfo.vendor).name : 'Lieferant auswählen'}}
-
- + Lieferant
-
+ itemInfo.vendor = data.id"
+ />
@@ -345,6 +363,9 @@ const createIncomingInvoice = async () => {
{{dataStore.accounts.find(account => account.id === item.account) ? dataStore.accounts.find(account => account.id === item.account).label : "Keine Kategorie ausgewählt" }}
+
+ {{option.number}} - {{option.label}}
+
@@ -352,18 +373,25 @@ const createIncomingInvoice = async () => {
label="Kostenstelle"
class=" mb-3"
>
-
+
- {{dataStore.getCostCentresComposed.find(account => account.id === item.costCentre) ? dataStore.getCostCentresComposed.find(account => account.id === item.costCentre).label : "Keine Kostenstelle ausgewählt" }}
+ {{costcentres.find(i => i.id === item.costCentre) ? costcentres.find(i => i.id === item.costCentre).name : "Keine Kostenstelle ausgewählt" }}
+
+
+ {{option.number}} - Fahrzeug - {{option.name}}
+ {{option.number}} - Projekt - {{option.name}}
+ {{option.number}} - Inventarartikel - {{option.name}}
+ {{option.number}} - {{option.name}}
@@ -374,6 +402,11 @@ const createIncomingInvoice = async () => {
icon="i-heroicons-x-mark"
@click="item.costCentre = null"
/>
+ setCostCentre(item,data)"
+ />
diff --git a/pages/incomingInvoices/edit/[id].vue b/pages/incomingInvoices/edit/[id].vue
index b029af0..97b0e12 100644
--- a/pages/incomingInvoices/edit/[id].vue
+++ b/pages/incomingInvoices/edit/[id].vue
@@ -2,6 +2,7 @@
import InputGroup from "~/components/InputGroup.vue";
import dayjs from "dayjs";
import HistoryDisplay from "~/components/HistoryDisplay.vue";
+import {useSupabaseSelect} from "~/composables/useSupabase.js";
definePageMeta({
middleware: "auth"
@@ -34,10 +35,14 @@ const itemInfo = ref({
]
})
+const costcentres = ref([])
+
const setup = async () => {
let filetype = (await supabase.from("filetags").select().eq("tenant",profileStore.currentTenant).eq("incomingDocumentType","invoices").single()).data.id
console.log(filetype)
+ costcentres.value = await useSupabaseSelect("costcentres")
+
itemInfo.value = await useSupabaseSelectSingle("incominginvoices", route.params.id, "*, files(*)")
await loadFile(itemInfo.value.files[itemInfo.value.files.length-1].id)
@@ -322,20 +327,27 @@ const updateIncomingInvoice = async () => {
-
+
- {{dataStore.getCostCentresComposed.find(account => account.id === item.costCentre) ? dataStore.getCostCentresComposed.find(account => account.id === item.costCentre).label : "Keine Kostenstelle ausgewählt" }}
+ {{costcentres.find(i => i.id === item.costCentre) ? costcentres.find(i => i.id === item.costCentre).name : "Keine Kostenstelle ausgewählt" }}
+
+
+ Fahrzeug - {{option.name}}
+ Projekt - {{option.name}}
+ Inventarartikel - {{option.name}}
+ {{option.name}}
diff --git a/pages/settings/numberRanges.vue b/pages/settings/numberRanges.vue
index 67de159..72c2e37 100644
--- a/pages/settings/numberRanges.vue
+++ b/pages/settings/numberRanges.vue
@@ -39,6 +39,9 @@ const resources = {
},
deliveryNotes: {
label: "Lieferscheine"
+ },
+ costcentres: {
+ label: "Kostenstellen"
}
}
diff --git a/stores/data.js b/stores/data.js
index d78c5c5..e00361e 100644
--- a/stores/data.js
+++ b/stores/data.js
@@ -1957,6 +1957,134 @@ export const useDataStore = defineStore('data', () => {
}
]
},
+ costcentres: {
+ isArchivable: true,
+ label: "Kostenstellen",
+ labelSingle: "Kostenstelle",
+ isStandardEntity: true,
+ redirect:true,
+ numberRangeHolder: "number",
+ historyItemHolder: "costcentre",
+ supabaseSortColumn: "number",
+ supabaseSelectWithInformation: "*, project(*), vehicle(*), inventoryitem(*)",
+ filters: [{
+ name: "Archivierte ausblenden",
+ default: true,
+ "filterFunction": function (row) {
+ if(!row.archived) {
+ return true
+ } else {
+ return false
+ }
+ }
+ }],
+ templateColumns: [
+ {
+ key: 'number',
+ label: "Nummer",
+ inputIsNumberRange: true,
+ inputType: "text"
+ }, {
+ key: "name",
+ label: "Name",
+ required: true,
+ title: true,
+ inputType: "text",
+ },
+ {
+ key: "description",
+ label: "Beschreibung",
+ inputType: "textarea"
+ },
+ {
+ key: "vehicle",
+ label: "Fahrzeug",
+ component: vehicle,
+ inputType: "select",
+ selectDataType: "vehicles",
+ selectOptionAttribute: "licensePlate",
+ selectSearchAttributes: ['licensePlate'],
+ },
+ {
+ key: "inventoryitem",
+ label: "Inventarartikel",
+ inputType: "select",
+ selectDataType: "inventoryitems",
+ selectOptionAttribute: "name",
+ selectSearchAttributes: ['name'],
+ },
+ {
+ key: "project",
+ label: "Projekt",
+ component: project,
+ inputType: "select",
+ selectDataType: "projects",
+ selectOptionAttribute: "name",
+ selectSearchAttributes: ['name'],
+ },
+ {
+ key: "profiles",
+ label: "Berechtigte Benutzer",
+ inputType: "select",
+ selectDataType: "profiles",
+ selectOptionAttribute: "fullName",
+ selectSearchAttributes: ['fullName'],
+ selectMultiple: true,
+ component: profiles
+ },
+ ],
+ showTabs: [{label: 'Informationen'},{label: 'Auswertung Kostenstelle'}]
+ },
+ ownaccounts: {
+ isArchivable: true,
+ label: "zusätzliche Buchungskonten",
+ labelSingle: "zusätzliches Buchungskonto",
+ isStandardEntity: true,
+ redirect:true,
+ historyItemHolder: "ownaccount",
+ supabaseSortColumn: "number",
+ supabaseSelectWithInformation: "*",
+ filters: [{
+ name: "Archivierte ausblenden",
+ default: true,
+ "filterFunction": function (row) {
+ if(!row.archived) {
+ return true
+ } else {
+ return false
+ }
+ }
+ }],
+ templateColumns: [
+ {
+ key: 'number',
+ label: "Nummer",
+ inputType: "text"
+ }, {
+ key: "name",
+ label: "Name",
+ required: true,
+ title: true,
+ inputType: "text",
+ },
+ {
+ key: "description",
+ label: "Beschreibung",
+ inputType: "textarea"
+ },
+ {
+ key: "profiles",
+ label: "Berechtigte Benutzer",
+ inputType: "select",
+ selectDataType: "profiles",
+ selectOptionAttribute: "fullName",
+ selectSearchAttributes: ['fullName'],
+ selectMultiple: true,
+ component: profiles
+ },
+ ],
+ showTabs: [{label: 'Informationen'}]
+ },
}
const documentTypesForCreation = ref({