diff --git a/spaces/app.vue b/spaces/app.vue
index 90a99a6..42eb075 100644
--- a/spaces/app.vue
+++ b/spaces/app.vue
@@ -49,7 +49,8 @@ const navLinks = [
},
{
label: "Artikel",
- to: "/products"
+ to: "/products",
+ icon: "i-heroicons-puzzle-piece"
},
{
label: "Dokumente",
@@ -58,7 +59,8 @@ const navLinks = [
},
{
label: "Inventar",
- to: "/inventory"
+ to: "/inventory",
+ icon: "i-heroicons-square-3-stack-3d"
}
]
diff --git a/spaces/pages/planningBoard.vue b/spaces/pages/planningBoard.vue
index a32970c..b581a0b 100644
--- a/spaces/pages/planningBoard.vue
+++ b/spaces/pages/planningBoard.vue
@@ -55,6 +55,9 @@ const calendarOptions = reactive({
newEventData.value.end = info.endStr
openNewEventModal.value = true
},
+ eventClick: function (info){
+ console.log(info)
+ },
resourceGroupField: "type",
resources: resources,
nowIndicator:true
diff --git a/spaces/pages/projects/[id].vue b/spaces/pages/projects/[id].vue
index 75e300e..83074c0 100644
--- a/spaces/pages/projects/[id].vue
+++ b/spaces/pages/projects/[id].vue
@@ -6,12 +6,11 @@ definePageMeta({
const supabase = useSupabaseClient()
const route = useRoute()
-const {getProjectById, getFormSubmitsWithLabelProp} = useDataStore()
-const {forms, formSubmits} = storeToRefs(useDataStore())
+const {getProjectById, getFormSubmitsWithLabelProp, getTimesByProjectId} = useDataStore()
+const {forms, formSubmits, times} = storeToRefs(useDataStore())
const currentProject = getProjectById(Number(route.params.id))
-
const formSubmissionsComposed = getFormSubmitsWithLabelProp
const formModalOpen = ref(false)
const newFormSubmissionData = ref({
@@ -20,6 +19,28 @@ const newFormSubmissionData = ref({
submitted: false
})
+const timeTableRows = [
+ {
+ key:"user",
+ label: "Benutzer"
+ },{
+ key:"start",
+ label: "Start"
+ },{
+ key:"end",
+ label:"Ende"
+ },{
+ key:"duration",
+ label: "Dauer"
+ },{
+ key: "type",
+ label: "Typ"
+ },{
+ key:"notes",
+ label: "Notizen"
+ },
+]
+
const addNewFormSubmission = async () => {
//Add Form Submission
const {data:insertData,error:insertError} = await supabase
@@ -227,7 +248,11 @@ const phaseInfo = ref({
-
Hier wird aktuell noch gearbeitet
+ Projekt Zeit: {{currentProject.projectHours.toString().replace(".",":")}} Stunden
+
Hier wird aktuell noch gearbeitet
diff --git a/spaces/pages/projects/index.vue b/spaces/pages/projects/index.vue
index 90a5056..b2278d2 100644
--- a/spaces/pages/projects/index.vue
+++ b/spaces/pages/projects/index.vue
@@ -1,7 +1,16 @@
-
-
+
+
+
+
+
+
+ {{dataStore.getVendorInvoicesByProjectId(selectedItem.id)}}–>
-
+
-->
@@ -88,10 +104,33 @@ definePageMeta({
})
const supabase = useSupabaseClient()
-
+const router = useRouter()
const {projects,customers} = storeToRefs(useDataStore())
const {fetchProjects} = useDataStore()
+const projectColumns = [
+ {
+ key: 'name',
+ label: "Name.",
+ sortable: true
+ },
+ {
+ key: "customer",
+ label: "Kundennummer",
+ sortable: true
+ },
+ {
+ key: "notes",
+ label: "Notizen",
+ sortable: true
+ }
+]
+
+const selectProject = (project) => {
+ router.push(`/projects/${project.id} `)
+}
+
+
//const projects = (await supabase.from("projects").select()).data
//const customers = (await supabase.from("customers").select()).data
@@ -125,7 +164,7 @@ const createProject = async () => {
\ No newline at end of file
diff --git a/spaces/pages/timetracking.vue b/spaces/pages/timetracking.vue
index 3b82d50..2e5c6f6 100644
--- a/spaces/pages/timetracking.vue
+++ b/spaces/pages/timetracking.vue
@@ -52,6 +52,11 @@ const stopStartedTime = async () => {
runningTimeInfo.value.end = new Date().toISOString()
+ const mapNumRange = (num, inMin, inMax, outMin, outMax) =>
+ ((num - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin;
+
+ runningTimeInfo.value.duration = Math.round(mapNumRange(Math.abs(new Date(runningTimeInfo.value.end) - new Date(runningTimeInfo.value.start))/1000/60,0,60,0,1)*100)/100
+
const {data,error} = await supabase
.from("times")
.update(runningTimeInfo.value)
diff --git a/spaces/stores/data.ts b/spaces/stores/data.ts
index ad8bafa..cfb58c1 100644
--- a/spaces/stores/data.ts
+++ b/spaces/stores/data.ts
@@ -122,8 +122,35 @@ export const useDataStore = defineStore('data', {
getOpenTasksCount: (state) => state.tasks.filter(task => task.categorie != "Erledigt").length,
movementsBySpace: (state) => (spaceId:number) => state.movements.filter(move => move.spaceId === spaceId),
getProductById: (state) => (productId:number) => state.products.find(product => product.id === productId),
- getProjectById: (state) => (projectId:number) => state.projects.find(project => project.id === projectId),
+ getProjectById: (state) => (projectId:number) => {
+ let project = state.projects.find(project => project.id === projectId)
+
+ let projectHours = 0
+
+ let projectTimes = state.times.filter(time => time.projectId === projectId)
+ projectTimes.forEach(time => projectHours += time.duration)
+
+ project.projectHours = projectHours
+
+ return project
+
+ },
getCustomerById: (state) => (customerId:number) => state.customers.find(customer => customer.id === customerId),
+ getTimesByProjectId: (state) => (projectId:number) => {
+ let times = state.times.filter(time => time.projectId === projectId)
+ console.log(times.length)
+
+ /*const mapNumRange = (num, inMin, inMax, outMin, outMax) =>
+ ((num - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin;
+
+ times.forEach((time,index) => {
+ times[index].duration = Math.round(mapNumRange(Math.abs(new Date(time.end) - new Date(time.start))/1000/60,0,60,0,1)*100)/100
+
+ })*/
+
+ return times
+
+ },
getFormSubmitsWithLabelProp: (state) => (state.formSubmits.map(submit => {return{...submit, label: submit.id}})),
getResources: (state) => {
return [