Added Taxtypes
Added 13b Added Error Check for Timespan
This commit is contained in:
@@ -21,6 +21,7 @@ const showServiceSelectionModal = ref(false)
|
||||
|
||||
const itemInfo = ref({
|
||||
type: "invoices",
|
||||
taxType: "Standard",
|
||||
customer: null,
|
||||
contact: null,
|
||||
address: {
|
||||
@@ -34,6 +35,7 @@ const itemInfo = ref({
|
||||
documentNumberTitle: "Rechnungsnummer",
|
||||
documentDate: dayjs(),
|
||||
deliveryDate: dayjs(),
|
||||
deliveryDateEnd: null,
|
||||
deliveryDateType: "Lieferdatum",
|
||||
dateOfPerformance: null,
|
||||
paymentDays: profileStore.ownTenant.standardPaymentDays,
|
||||
@@ -447,6 +449,11 @@ const findDocumentErrors = computed(() => {
|
||||
|
||||
if(itemInfo.value.project === null) errors.push({message: "Es ist kein Projekt ausgewählt", type: "info"})
|
||||
|
||||
if(['Lieferzeitraum','Leistungszeitraum'].includes(itemInfo.value.deliveryDateType)) {
|
||||
if(itemInfo.value.deliveryDateEnd === null) errors.push({message: `Es ist kein Enddatum für den ${itemInfo.value.deliveryDateType} angegeben`, type: "breaking"})
|
||||
}
|
||||
|
||||
|
||||
if(itemInfo.value.rows.length === 0) {
|
||||
errors.push({message: "Es sind keine Positionen angegeben", type: "breaking"})
|
||||
} else {
|
||||
@@ -610,7 +617,19 @@ const getDocumentData = () => {
|
||||
})
|
||||
}
|
||||
|
||||
let rows = itemInfo.value.rows.map(row => {
|
||||
let rows = itemInfo.value.rows
|
||||
|
||||
if(itemInfo.value.taxType === "13b UStG") {
|
||||
rows = rows.map(row => {
|
||||
return {
|
||||
...row,
|
||||
taxPercent: 0
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
rows = itemInfo.value.rows.map(row => {
|
||||
|
||||
let unit = dataStore.units.find(i => i.id === row.unit)
|
||||
|
||||
@@ -663,6 +682,7 @@ const getDocumentData = () => {
|
||||
|
||||
const returnData = {
|
||||
type: itemInfo.value.type,
|
||||
taxType: itemInfo.value.taxType,
|
||||
adressLine: `${businessInfo.name}, ${businessInfo.street}, ${businessInfo.zip} ${businessInfo.city}`,
|
||||
recipient: {
|
||||
name: customerData.name,
|
||||
@@ -877,6 +897,7 @@ const saveDocument = async (state,resetup = false) => {
|
||||
|
||||
let createData = {
|
||||
type: itemInfo.value.type,
|
||||
taxType: itemInfo.value.type === "invoices" ? itemInfo.value.taxType : null,
|
||||
state: itemInfo.value.state || "Entwurf",
|
||||
customer: itemInfo.value.customer,
|
||||
contact: itemInfo.value.contact,
|
||||
@@ -1129,6 +1150,17 @@ const setRowData = (row) => {
|
||||
|
||||
</UFormGroup>
|
||||
|
||||
<UFormGroup
|
||||
label="Steuertyp:"
|
||||
v-if="itemInfo.type === 'invoices'"
|
||||
>
|
||||
<USelectMenu
|
||||
:options="['Standard','13b UStG']"
|
||||
v-model="itemInfo.taxType"
|
||||
class="w-full"
|
||||
></USelectMenu>
|
||||
</UFormGroup>
|
||||
|
||||
<UFormGroup
|
||||
label="Briefpapier:"
|
||||
>
|
||||
@@ -1834,6 +1866,7 @@ const setRowData = (row) => {
|
||||
<USelectMenu
|
||||
:options="[19,7,0]"
|
||||
v-model="row.taxPercent"
|
||||
:disabled="itemInfo.taxType === '13b UStG'"
|
||||
>
|
||||
<template #option="{option}">
|
||||
{{option}} %
|
||||
|
||||
Reference in New Issue
Block a user