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({
|
const itemInfo = ref({
|
||||||
type: "invoices",
|
type: "invoices",
|
||||||
|
taxType: "Standard",
|
||||||
customer: null,
|
customer: null,
|
||||||
contact: null,
|
contact: null,
|
||||||
address: {
|
address: {
|
||||||
@@ -34,6 +35,7 @@ const itemInfo = ref({
|
|||||||
documentNumberTitle: "Rechnungsnummer",
|
documentNumberTitle: "Rechnungsnummer",
|
||||||
documentDate: dayjs(),
|
documentDate: dayjs(),
|
||||||
deliveryDate: dayjs(),
|
deliveryDate: dayjs(),
|
||||||
|
deliveryDateEnd: null,
|
||||||
deliveryDateType: "Lieferdatum",
|
deliveryDateType: "Lieferdatum",
|
||||||
dateOfPerformance: null,
|
dateOfPerformance: null,
|
||||||
paymentDays: profileStore.ownTenant.standardPaymentDays,
|
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(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) {
|
if(itemInfo.value.rows.length === 0) {
|
||||||
errors.push({message: "Es sind keine Positionen angegeben", type: "breaking"})
|
errors.push({message: "Es sind keine Positionen angegeben", type: "breaking"})
|
||||||
} else {
|
} 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)
|
let unit = dataStore.units.find(i => i.id === row.unit)
|
||||||
|
|
||||||
@@ -663,6 +682,7 @@ const getDocumentData = () => {
|
|||||||
|
|
||||||
const returnData = {
|
const returnData = {
|
||||||
type: itemInfo.value.type,
|
type: itemInfo.value.type,
|
||||||
|
taxType: itemInfo.value.taxType,
|
||||||
adressLine: `${businessInfo.name}, ${businessInfo.street}, ${businessInfo.zip} ${businessInfo.city}`,
|
adressLine: `${businessInfo.name}, ${businessInfo.street}, ${businessInfo.zip} ${businessInfo.city}`,
|
||||||
recipient: {
|
recipient: {
|
||||||
name: customerData.name,
|
name: customerData.name,
|
||||||
@@ -877,6 +897,7 @@ const saveDocument = async (state,resetup = false) => {
|
|||||||
|
|
||||||
let createData = {
|
let createData = {
|
||||||
type: itemInfo.value.type,
|
type: itemInfo.value.type,
|
||||||
|
taxType: itemInfo.value.type === "invoices" ? itemInfo.value.taxType : null,
|
||||||
state: itemInfo.value.state || "Entwurf",
|
state: itemInfo.value.state || "Entwurf",
|
||||||
customer: itemInfo.value.customer,
|
customer: itemInfo.value.customer,
|
||||||
contact: itemInfo.value.contact,
|
contact: itemInfo.value.contact,
|
||||||
@@ -1129,6 +1150,17 @@ const setRowData = (row) => {
|
|||||||
|
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
|
|
||||||
|
<UFormGroup
|
||||||
|
label="Steuertyp:"
|
||||||
|
v-if="itemInfo.type === 'invoices'"
|
||||||
|
>
|
||||||
|
<USelectMenu
|
||||||
|
:options="['Standard','13b UStG']"
|
||||||
|
v-model="itemInfo.taxType"
|
||||||
|
class="w-full"
|
||||||
|
></USelectMenu>
|
||||||
|
</UFormGroup>
|
||||||
|
|
||||||
<UFormGroup
|
<UFormGroup
|
||||||
label="Briefpapier:"
|
label="Briefpapier:"
|
||||||
>
|
>
|
||||||
@@ -1834,6 +1866,7 @@ const setRowData = (row) => {
|
|||||||
<USelectMenu
|
<USelectMenu
|
||||||
:options="[19,7,0]"
|
:options="[19,7,0]"
|
||||||
v-model="row.taxPercent"
|
v-model="row.taxPercent"
|
||||||
|
:disabled="itemInfo.taxType === '13b UStG'"
|
||||||
>
|
>
|
||||||
<template #option="{option}">
|
<template #option="{option}">
|
||||||
{{option}} %
|
{{option}} %
|
||||||
|
|||||||
Reference in New Issue
Block a user