Added Titlesums Correction

This commit is contained in:
2025-02-04 14:48:08 +01:00
parent 4f72c53648
commit d586f8d9a6

View File

@@ -549,7 +549,7 @@ const documentTotal = computed(() => {
if(row.mode === 'title'){
titleSums[`${row.pos} - ${row.text}`] = 0
lastTitle = `${row.pos} - ${row.text}`
} else if(!['pagebreak','text'].includes(row.mode)){
} else if(!['pagebreak','text'].includes(row.mode) && lastTitle !== ""){
titleSums[lastTitle] = Number(titleSums[lastTitle]) + Number(Number(row.quantity) * Number(row.price) * (1 - Number(row.discountPercent) /100) )
}
})
@@ -707,9 +707,11 @@ const getDocumentData = () => {
let contactPerson = profileStore.getProfileById(itemInfo.value.contactPerson)
let returnTitleSums = {}
if(Object.keys(documentTotal.value.titleSums).length > 0) {
Object.keys(documentTotal.value.titleSums).forEach(key => {
returnTitleSums[key] = renderCurrency(documentTotal.value.titleSums[key])
})
}
console.log(returnTitleSums)