Many Changes
This commit is contained in:
@@ -457,7 +457,7 @@ const renderCurrency = (value, currency = "€") => {
|
||||
const documentTotal = computed(() => {
|
||||
let totalNet = 0
|
||||
let total19 = 0
|
||||
let totalGross = 0
|
||||
let total7 = 0
|
||||
|
||||
itemInfo.value.rows.forEach(row => {
|
||||
if(!['pagebreak','title','text'].includes(row.mode)){
|
||||
@@ -466,11 +466,13 @@ const documentTotal = computed(() => {
|
||||
|
||||
if(row.taxPercent === 19) {
|
||||
total19 = total19 + Number(rowPrice * 0.19)
|
||||
} else if(row.taxPercent === 7) {
|
||||
total7 = total7 + Number(rowPrice * 0.07)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
totalGross = totalNet + total19
|
||||
let totalGross = Number(totalNet.toFixed(2)) + Number(total19.toFixed(2)) + Number(total7.toFixed(2))
|
||||
|
||||
let totalGrossAlreadyPaid = 0
|
||||
|
||||
@@ -488,19 +490,14 @@ const documentTotal = computed(() => {
|
||||
|
||||
let sumToPay = totalGross - totalGrossAlreadyPaid
|
||||
|
||||
|
||||
|
||||
return {
|
||||
totalNet: totalNet,
|
||||
total19: total19,
|
||||
total7: total7,
|
||||
totalGross: totalGross,
|
||||
totalGrossAlreadyPaid: totalGrossAlreadyPaid,
|
||||
totalSumToPay: sumToPay
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
const processDieselPosition = () => {
|
||||
@@ -831,14 +828,13 @@ const closeDocument = async () => {
|
||||
|
||||
await generateDocument()
|
||||
|
||||
let fileData = {
|
||||
tags: [],
|
||||
project: null
|
||||
}
|
||||
let fileData = {}
|
||||
|
||||
fileData.project = itemInfo.value.project
|
||||
fileData.createdDocument = itemInfo.value.id
|
||||
fileData.tags.push(dataStore.documentTypesForCreation[itemInfo.value.type].labelSingle)
|
||||
fileData.createddocument = itemInfo.value.id
|
||||
fileData.folder = (await supabase.from("folders").select("id").eq("tenant", profileStore.currentTenant).eq("function", itemInfo.value.type).eq("year",dayjs().format("YYYY")).single()).data.id
|
||||
|
||||
let tag = (await supabase.from("filetags").select("id").eq("tenant", profileStore.currentTenant).eq("createddocumenttype", itemInfo.value.type).single()).data
|
||||
|
||||
function dataURLtoFile(dataurl, filename) {
|
||||
var arr = dataurl.split(","),
|
||||
@@ -854,7 +850,7 @@ const closeDocument = async () => {
|
||||
|
||||
let file = dataURLtoFile(uri.value, `${itemInfo.value.documentNumber}.pdf`)
|
||||
|
||||
await dataStore.uploadFiles(fileData, [file], true)
|
||||
await dataStore.uploadFiles(fileData, [file],[tag.id], true)
|
||||
|
||||
await router.push(`/createDocument/show/${itemInfo.value.id}`)
|
||||
|
||||
@@ -894,13 +890,28 @@ const setRowData = (row) => {
|
||||
<template>
|
||||
<UDashboardNavbar>
|
||||
<template #right>
|
||||
<!-- <ButtonWithConfirm
|
||||
v-if="itemInfo.state === 'Entwurf'"
|
||||
color="rose"
|
||||
variant="outline"
|
||||
@confirmed="dataStore.updateItem('createddocuments',{id:itemInfo.id,archived: true}),
|
||||
router.push('/createDocument')"
|
||||
>
|
||||
<template #button>
|
||||
Archivieren
|
||||
</template>
|
||||
<template #header>
|
||||
<span class="text-md text-black font-bold">Archivieren bestätigen</span>
|
||||
</template>
|
||||
Möchten Sie diesen Ausgangsbeleg wirklich archivieren?
|
||||
</ButtonWithConfirm>-->
|
||||
<UButton
|
||||
icon="i-mdi-content-save"
|
||||
@click="saveDocument('Entwurf',true)"
|
||||
v-if="itemInfo.type !== 'serialInvoices' "
|
||||
:disabled="!itemInfo.customer"
|
||||
>
|
||||
Entwurf
|
||||
Entwurf speichern
|
||||
</UButton>
|
||||
<UButton
|
||||
@click="closeDocument"
|
||||
@@ -952,7 +963,7 @@ const setRowData = (row) => {
|
||||
v-model="itemInfo.type"
|
||||
value-attribute="type"
|
||||
option-attribute="label"
|
||||
@input="setDocumentTypeConfig"
|
||||
@change="setDocumentTypeConfig"
|
||||
class="flex-auto"
|
||||
>
|
||||
<template #label>
|
||||
|
||||
Reference in New Issue
Block a user