@@ -622,7 +622,7 @@ export const useCreatePdf = async (invoiceData,backgroundSourceBuffer) => {
|
||||
maxWidth: 240
|
||||
})
|
||||
|
||||
console.log(row)
|
||||
console.log(row.text.match(/.{1,35}/g))
|
||||
|
||||
if(invoiceData.type !== "deliveryNotes") {
|
||||
pages[pageCounter - 1].drawText(row.text.match(/.{1,35}/g).join("\n"), {
|
||||
@@ -933,8 +933,6 @@ export const useCreatePdf = async (invoiceData,backgroundSourceBuffer) => {
|
||||
//console.log(rowHeight)
|
||||
//rowHeight += 25
|
||||
|
||||
let endTextDiff = 45
|
||||
|
||||
if(invoiceData.type !== "deliveryNotes"){
|
||||
pages[pageCounter - 1].drawRectangle({
|
||||
...getCoordinatesForPDFLib(20,rowHeight, page1),
|
||||
@@ -1014,86 +1012,11 @@ export const useCreatePdf = async (invoiceData,backgroundSourceBuffer) => {
|
||||
maxWidth: 240,
|
||||
font:fontBold
|
||||
})
|
||||
|
||||
if(invoiceData.total.totalGrossAlreadyPaid !== "0,00 €") {
|
||||
pages[pageCounter - 1].drawText("Bereits bezahlt:", {
|
||||
...getCoordinatesForPDFLib(21,rowHeight+21, page1),
|
||||
size:11,
|
||||
color:rgb(0,0,0),
|
||||
lineHeight:11,
|
||||
opacity: 1,
|
||||
maxWidth: 240,
|
||||
font: fontBold
|
||||
})
|
||||
|
||||
pages[pageCounter - 1].drawText(invoiceData.total.totalGrossAlreadyPaid, {
|
||||
y: getCoordinatesForPDFLib(21,rowHeight+21,page1).y,
|
||||
x: getCoordinatesForPDFLib(21,rowHeight+21,page1).x + 500 - fontBold.widthOfTextAtSize(invoiceData.total.totalGrossAlreadyPaid,11),
|
||||
size:11,
|
||||
color:rgb(0,0,0),
|
||||
lineHeight:11,
|
||||
opacity: 1,
|
||||
maxWidth: 240,
|
||||
font:fontBold
|
||||
})
|
||||
|
||||
pages[pageCounter - 1].drawRectangle({
|
||||
...getCoordinatesForPDFLib(20,rowHeight +32, page1),
|
||||
width: 180 * 2.83,
|
||||
height: 8 * 2.83,
|
||||
color: rgb(0,0,0),
|
||||
opacity: 0.25
|
||||
})
|
||||
|
||||
pages[pageCounter - 1].drawText("Offene Summe:", {
|
||||
...getCoordinatesForPDFLib(21,rowHeight+29, page1),
|
||||
size:11,
|
||||
color:rgb(0,0,0),
|
||||
lineHeight:11,
|
||||
opacity: 1,
|
||||
maxWidth: 240,
|
||||
font: fontBold
|
||||
})
|
||||
|
||||
pages[pageCounter - 1].drawText(invoiceData.total.totalSumToPay, {
|
||||
y: getCoordinatesForPDFLib(21,rowHeight+29,page1).y,
|
||||
x: getCoordinatesForPDFLib(21,rowHeight+29,page1).x + 500 - fontBold.widthOfTextAtSize(invoiceData.total.totalSumToPay,11),
|
||||
size:11,
|
||||
color:rgb(0,0,0),
|
||||
lineHeight:11,
|
||||
opacity: 1,
|
||||
maxWidth: 240,
|
||||
font:fontBold
|
||||
})
|
||||
|
||||
invoiceData.usedAdvanceInvoices.forEach((advanceInvoice,index) => {
|
||||
//For Each Advance Invoice
|
||||
|
||||
pages[pageCounter - 1].drawText(String(advanceInvoice.documentNumber), {
|
||||
...getCoordinatesForPDFLib(21,rowHeight+36+5*index, page1),
|
||||
size:11,
|
||||
color:rgb(0,0,0),
|
||||
lineHeight:11,
|
||||
opacity: 1,
|
||||
maxWidth: 240
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
endTextDiff = 22
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
pages[pageCounter - 1].drawText(invoiceData.endText,{
|
||||
...getCoordinatesForPDFLib(20,rowHeight+endTextDiff, page1),
|
||||
...getCoordinatesForPDFLib(20,rowHeight+22, page1),
|
||||
size: 10,
|
||||
color: rgb(0,0,0),
|
||||
lineHeight: 10,
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
|
||||
|
||||
/*const rights2 = ref({
|
||||
projects: {
|
||||
label: "Projekte",
|
||||
children: {
|
||||
viewOwnProjects: {label: "Eigene Projekte sehen"},
|
||||
viewAllProjects: {label: "Alle Projekte sehen"},
|
||||
}
|
||||
},
|
||||
createUser: {label: "Benutzer erstellen"},
|
||||
modifyUser: {label: "Benutzer bearbeiten"},
|
||||
deactivateUser: {label: "Benutzer sperren"},
|
||||
createProject: {label: "Projekt erstellen"},
|
||||
|
||||
createTask: {label: "Aufgabe erstellen"},
|
||||
viewOwnTasks: {label:"Eigene Aufgaben sehen"},
|
||||
viewAllTasks: {label: "Alle Aufgaben sehen"},
|
||||
trackOwnTime: {label:"Eigene Zeite erfassen"},
|
||||
createOwnTime: {label:"Eigene Zeiten erstellen"},
|
||||
createTime: {label:"Zeiten erstellen"},
|
||||
viewOwnTimes: {label:"Eigene Zeiten anzeigen"},
|
||||
viewTimes: {label:"Zeiten anzeigen"},
|
||||
})*/
|
||||
|
||||
|
||||
|
||||
|
||||
export const useRole = () => {
|
||||
const supabase = useSupabaseClient()
|
||||
const dataStore = useDataStore()
|
||||
|
||||
|
||||
const rights = ref({
|
||||
projects: {
|
||||
label: "Projekte"
|
||||
},
|
||||
"projects-viewAll": {
|
||||
label: "Alle Projekte einsehen",
|
||||
parent: "projects"
|
||||
},
|
||||
"projects-viewOwn": {
|
||||
label: "Eigene Projekte einsehen",
|
||||
parent: "projects"
|
||||
},
|
||||
"projects-create": {
|
||||
label: "Projekte erstellen",
|
||||
parent: "projects"
|
||||
},
|
||||
contracts: {
|
||||
label: "Verträge"
|
||||
},
|
||||
objects: {
|
||||
label: "Objekte"
|
||||
},
|
||||
checks: {
|
||||
label: "Überprüfungen"
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
let role = dataStore.activeProfile.role
|
||||
|
||||
/*const checkRight = (right) => {
|
||||
let rightsToCheck = [right]
|
||||
|
||||
if(rights.value[right].parent) {
|
||||
rightsToCheck.push(rights.value[right].parent)
|
||||
}
|
||||
|
||||
let hasAllNeccessaryRights = false
|
||||
|
||||
rightsToCheck.forEach(i => {
|
||||
if(role.rights.includes(i)){
|
||||
hasAllNeccessaryRights = true
|
||||
} else {
|
||||
hasAllNeccessaryRights = false
|
||||
}
|
||||
})
|
||||
|
||||
return hasAllNeccessaryRights
|
||||
}*/
|
||||
|
||||
const checkRight = (right) => {
|
||||
let rightsToCheck = [right]
|
||||
|
||||
//console.log(right.split("-"))
|
||||
|
||||
if(right.split("-").length > 1) {
|
||||
rightsToCheck.push(right.split("-")[0])
|
||||
}
|
||||
//console.log(rightsToCheck)
|
||||
|
||||
let hasAllNeccessaryRights = true
|
||||
|
||||
//console.log(role.rights)
|
||||
|
||||
rightsToCheck.forEach(i => {
|
||||
if(!role.rights.includes(i)){
|
||||
hasAllNeccessaryRights = false
|
||||
}
|
||||
})
|
||||
|
||||
//console.log(hasAllNeccessaryRights)
|
||||
|
||||
return hasAllNeccessaryRights
|
||||
}
|
||||
|
||||
return {
|
||||
role,
|
||||
checkRight
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,12 +33,14 @@ export const useSupabaseSelectDocuments = async (select = '*', sortColumn = null
|
||||
.from("documents")
|
||||
.select(select)
|
||||
.eq("tenant", dataStore.currentTenant)
|
||||
.eq("folderPath", folderPath)
|
||||
.order(sortColumn, {ascending: true})).data
|
||||
} else {
|
||||
data = (await supabase
|
||||
.from("documents")
|
||||
.select(select)
|
||||
.eq("tenant", dataStore.currentTenant)).data
|
||||
.eq("tenant", dataStore.currentTenant)
|
||||
.eq("folderPath",folderPath)).data
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user