Fixed Problems in LinkedDocuments and Storno
This commit is contained in:
@@ -156,12 +156,18 @@ const setupPage = async () => {
|
||||
|
||||
setPosNumbers()
|
||||
|
||||
if(linkedDocuments.find(i => i.agriculture.dieselUsage)){
|
||||
console.log(linkedDocuments)
|
||||
|
||||
if(linkedDocuments.find(i => i.rows.find( x => x.agriculture.dieselUsage))){
|
||||
console.log("has diesel")
|
||||
|
||||
//Remove Existing Total Diesel Pos
|
||||
itemInfo.value.rows = itemInfo.value.rows.filter(i => i.key !== "dieselPos")
|
||||
|
||||
//Add Total Title
|
||||
itemInfo.value.rows.push({
|
||||
id:uuidv4(),
|
||||
mode: "text",
|
||||
mode: "title",
|
||||
text: "Allgemein"
|
||||
})
|
||||
|
||||
@@ -443,6 +449,7 @@ const findDocumentErrors = computed(() => {
|
||||
errors.push({message: "Es sind keine Positionen angegeben", type: "breaking"})
|
||||
} else {
|
||||
itemInfo.value.rows.forEach(row => {
|
||||
|
||||
if(row.mode === "normal" && !row.product) errors.push({message: `In Position ${row.pos} ist kein Artikel ausgewählt`, type: "breaking"})
|
||||
if(row.mode === "service" && !row.service) errors.push({message: `In Position ${row.pos} ist keine Leistung ausgewählt`, type: "breaking"})
|
||||
if(row.mode === "title" && !row.text) errors.push({message: `In Position ${row.pos} ist kein Titel hinterlegt`, type: "breaking"})
|
||||
@@ -451,15 +458,17 @@ const findDocumentErrors = computed(() => {
|
||||
|
||||
if(["normal","service","free"].includes(row.mode)){
|
||||
|
||||
if(!row.taxPercent) errors.push({message: `In Position ${row.pos} ist kein Steuersatz hinterlegt`, type: "breaking"})
|
||||
if(!row.price || row.price === 0) errors.push({message: `In Position ${row.pos} ist kein Preis hinterlegt`, type: "breaking"})
|
||||
if(!row.taxPercent && typeof row.taxPercent !== "number") errors.push({message: `In Position ${row.pos} ist kein Steuersatz hinterlegt`, type: "breaking"})
|
||||
if(!row.price && typeof row.price !== "number") errors.push({message: `In Position ${row.pos} ist kein Preis hinterlegt`, type: "breaking"})
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(row.agriculture){
|
||||
if(row.agriculture.dieselUsage && (!row.agriculture.dieselPrice || row.agriculture.dieselPrice === 0)) {
|
||||
if(row.agriculture.dieselUsage && (!row.agriculture.dieselPrice && typeof row.agriculture.dieselPrice !== "number")) {
|
||||
errors.push({message: `In Position ${row.pos} ist kein Dieselpreis hinterlegt`, type: "breaking"})
|
||||
} else if(row.agriculture.dieselUsage && row.agriculture.dieselPrice === 0) {
|
||||
errors.push({message: `In Position ${row.pos} ist 0,00 € als Dieselpreis hinterlegt`, type: "info"})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -552,7 +561,6 @@ const processDieselPosition = () => {
|
||||
if(row.agriculture && row.agriculture.dieselUsage) {
|
||||
agricultureData.dieselUsageTotal += Number(row.agriculture.dieselUsage)
|
||||
agricultureData.dieselPriceTotal += Number(row.agriculture.dieselPrice) * Number(row.agriculture.dieselUsage)
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
@@ -970,7 +978,7 @@ const setRowData = (row) => {
|
||||
v-if="itemInfo.type !== 'serialInvoices' "
|
||||
:disabled="!itemInfo.customer"
|
||||
>
|
||||
Entwurf speichern
|
||||
Speichern
|
||||
</UButton>
|
||||
<UButton
|
||||
@click="closeDocument"
|
||||
|
||||
Reference in New Issue
Block a user