Merge branch 'devCorrected' into 'beta'
Dev corrected See merge request fedeo/software!43
This commit is contained in:
@@ -22,7 +22,7 @@ const setupPage = async () => {
|
|||||||
|
|
||||||
finalizedDocuments = finalizedDocuments.filter(i => i.statementallocations.reduce((n,{amount}) => n + amount, 0).toFixed(2) !== useSum().getCreatedDocumentSum(i, documents).toFixed(2))
|
finalizedDocuments = finalizedDocuments.filter(i => i.statementallocations.reduce((n,{amount}) => n + amount, 0).toFixed(2) !== useSum().getCreatedDocumentSum(i, documents).toFixed(2))
|
||||||
|
|
||||||
finalizedDocuments = finalizedDocuments.filter(x => (x.type === 'invoices' || x.type === 'advanceInvoices') && x.state === 'Gebucht' && !items.find(i => i.linkedDocument && i.linkedDocument.id === x.id))
|
finalizedDocuments = finalizedDocuments.filter(x => (x.type === 'invoices' || x.type === 'advanceInvoices') && x.state === 'Gebucht' && !items.find(i => i.createddocument && i.createddocument.id === x.id))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -509,11 +509,11 @@ const archiveStatement = async () => {
|
|||||||
</UCard>
|
</UCard>
|
||||||
<UCard
|
<UCard
|
||||||
class="mt-5"
|
class="mt-5"
|
||||||
v-for="item in itemInfo.statementallocations.filter(i => i.ii_id)"
|
v-for="item in itemInfo.statementallocations.filter(i => i.incominginvoice)"
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex flex-row justify-between">
|
<div class="flex flex-row justify-between">
|
||||||
<span>{{item.ii_id.reference}} - {{vendors.find(i => i.id === item.ii_id.vendor).name}}</span>
|
<span>{{item.incominginvoice.reference}} - {{vendors.find(i => i.id === item.incominginvoice.vendor).name}}</span>
|
||||||
<span class="font-semibold text-nowrap">{{displayCurrency(item.amount)}}</span>
|
<span class="font-semibold text-nowrap">{{displayCurrency(item.amount)}}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -529,11 +529,11 @@ const archiveStatement = async () => {
|
|||||||
</UCard>
|
</UCard>
|
||||||
<UCard
|
<UCard
|
||||||
class="mt-5"
|
class="mt-5"
|
||||||
v-for="item in itemInfo.statementallocations.filter(i => i.cd_id)"
|
v-for="item in itemInfo.statementallocations.filter(i => i.createddocument)"
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex flex-row justify-between">
|
<div class="flex flex-row justify-between">
|
||||||
<span v-if="customers.find(i => i.id === item.cd_id.customer)">{{item.cd_id.documentNumber}} - {{customers.find(i => i.id === item.cd_id.customer).name}}</span>
|
<span v-if="customers.find(i => i.id === item.createddocument.customer)">{{item.createddocument.documentNumber}} - {{customers.find(i => i.id === item.createddocument.customer).name}}</span>
|
||||||
<span class="font-semibold text-nowrap">{{displayCurrency(item.amount)}}</span>
|
<span class="font-semibold text-nowrap">{{displayCurrency(item.amount)}}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -810,8 +810,8 @@ const archiveStatement = async () => {
|
|||||||
icon="i-heroicons-check"
|
icon="i-heroicons-check"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
class="mr-3"
|
class="mr-3"
|
||||||
v-if="!itemInfo.statementallocations.find(i => i.cd_id === document.id)"
|
v-if="!itemInfo.statementallocations.find(i => i.createddocument === document.id)"
|
||||||
@click="saveAllocation({cd_id: document.id, bankstatement: itemInfo.id, amount: Number(Number(document.openSum) < manualAllocationSum ? document.openSum : manualAllocationSum), description: allocationDescription})"
|
@click="saveAllocation({createddocument: document.id, bankstatement: itemInfo.id, amount: Number(Number(document.openSum) < manualAllocationSum ? document.openSum : manualAllocationSum), description: allocationDescription})"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<UButton
|
<UButton
|
||||||
@@ -835,8 +835,8 @@ const archiveStatement = async () => {
|
|||||||
icon="i-heroicons-check"
|
icon="i-heroicons-check"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
class="mr-3"
|
class="mr-3"
|
||||||
v-if="!itemInfo.statementallocations.find(i => i.ii_id === item.id)"
|
v-if="!itemInfo.statementallocations.find(i => i.incominginvoice === item.id)"
|
||||||
@click="saveAllocation({ii_id: item.id, bankstatement: itemInfo.id, amount: Number(Math.abs(getInvoiceSum(item,true)) > Math.abs(manualAllocationSum) ? manualAllocationSum : getInvoiceSum(item,true)), description: allocationDescription})"
|
@click="saveAllocation({incominginvoice: item.id, bankstatement: itemInfo.id, amount: Number(Math.abs(getInvoiceSum(item,true)) > Math.abs(manualAllocationSum) ? manualAllocationSum : getInvoiceSum(item,true)), description: allocationDescription})"
|
||||||
/>
|
/>
|
||||||
<UButton
|
<UButton
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
|||||||
@@ -1506,7 +1506,20 @@ const setRowData = async (row, service = {sellingPriceComposed: {}}, product = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (row.service) {
|
if (row.service) {
|
||||||
row.unit = service.unit ? service.unit : services.value.find(i => i.id === row.service).unit
|
console.log(service)
|
||||||
|
if(service.unit) {
|
||||||
|
row.unit = service.unit
|
||||||
|
} else {
|
||||||
|
let selectedService = services.value.find(i => i.id === row.service)
|
||||||
|
console.log(selectedService)
|
||||||
|
if(selectedService.unit?.id) {
|
||||||
|
row.unit = selectedService.unit.id
|
||||||
|
} else {
|
||||||
|
row.unit = selectedService.unit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//row.unit = service.unit ? service.unit : services.value.find(i => i.id === row.service).unit
|
||||||
row.inputPrice = ((service.sellingPriceComposed.total || service.sellingPrice) ? (service.sellingPriceComposed.total || service.sellingPrice) : (services.value.find(i => i.id === row.service).sellingPriceComposed.total || services.value.find(i => i.id === row.service).sellingPrice))
|
row.inputPrice = ((service.sellingPriceComposed.total || service.sellingPrice) ? (service.sellingPriceComposed.total || service.sellingPrice) : (services.value.find(i => i.id === row.service).sellingPriceComposed.total || services.value.find(i => i.id === row.service).sellingPrice))
|
||||||
row.description = service.description ? service.description : (services.value.find(i => i.id === row.service) ? services.value.find(i => i.id === row.service).description : "")
|
row.description = service.description ? service.description : (services.value.find(i => i.id === row.service) ? services.value.find(i => i.id === row.service).description : "")
|
||||||
|
|
||||||
@@ -1520,14 +1533,14 @@ const setRowData = async (row, service = {sellingPriceComposed: {}}, product = {
|
|||||||
if (row.product) {
|
if (row.product) {
|
||||||
console.log("Product Detected")
|
console.log("Product Detected")
|
||||||
row.unit = product.unit ? product.unit : products.value.find(i => i.id === row.product).unit
|
row.unit = product.unit ? product.unit : products.value.find(i => i.id === row.product).unit
|
||||||
row.inputPrice = (product.sellingPrice ? product.sellingPrice : products.value.find(i => i.id === row.product).sellingPrice)
|
row.inputPrice = (product.selling_price ? product.selling_price : products.value.find(i => i.id === row.product).selling_price)
|
||||||
//row.price = Number((row.originalPrice * (1 + itemInfo.value.customSurchargePercentage /100)).toFixed(2))
|
//row.price = Number((row.originalPrice * (1 + itemInfo.value.customSurchargePercentage /100)).toFixed(2))
|
||||||
row.description = product.description ? product.description : (products.value.find(i => i.id === row.product) ? products.value.find(i => i.id === row.product).description : "")
|
row.description = product.description ? product.description : (products.value.find(i => i.id === row.product) ? products.value.find(i => i.id === row.product).description : "")
|
||||||
|
|
||||||
if (['13b UStG', '19 UStG'].includes(itemInfo.value.taxType)) {
|
if (['13b UStG', '19 UStG'].includes(itemInfo.value.taxType)) {
|
||||||
row.taxPercent = 0
|
row.taxPercent = 0
|
||||||
} else {
|
} else {
|
||||||
row.taxPercent = product.taxPercentage ? product.taxPercentage : products.value.find(i => i.id === row.product).taxPercentage
|
row.taxPercent = product.tax_percentage ? product.tax_percentage : products.value.find(i => i.id === row.product).tax_percentage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -101,16 +101,16 @@
|
|||||||
{{row.state}}
|
{{row.state}}
|
||||||
</span>-->
|
</span>-->
|
||||||
<span
|
<span
|
||||||
v-if="row.state === 'Gebucht' && !items.find(i => i.linkedDocument && i.linkedDocument.id === row.id)"
|
v-if="row.state === 'Gebucht' && !items.find(i => i.createddocument && i.createddocument.id === row.id)"
|
||||||
class="text-primary-500"
|
class="text-primary-500"
|
||||||
>
|
>
|
||||||
{{row.state}}
|
{{row.state}}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
v-else-if="row.state === 'Gebucht' && items.find(i => i.linkedDocument && i.linkedDocument.id === row.id && i.type === 'cancellationInvoices') && ['invoices','advanceInvoices'].includes(row.type)"
|
v-else-if="row.state === 'Gebucht' && items.find(i => i.createddocument && i.createddocument.id === row.id && i.type === 'cancellationInvoices') && ['invoices','advanceInvoices'].includes(row.type)"
|
||||||
class="text-cyan-500"
|
class="text-cyan-500"
|
||||||
>
|
>
|
||||||
Storniert mit {{items.find(i => i.linkedDocument && i.linkedDocument.id === row.id).documentNumber}}
|
Storniert mit {{items.find(i => i.createddocument && i.createddocument.id === row.id).documentNumber}}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
v-else-if="row.state === 'Gebucht'"
|
v-else-if="row.state === 'Gebucht'"
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ const openEmail = () => {
|
|||||||
|
|
||||||
const openBankstatements = () => {
|
const openBankstatements = () => {
|
||||||
if(itemInfo.value.statementallocations.length > 1) {
|
if(itemInfo.value.statementallocations.length > 1) {
|
||||||
navigateTo(`/banking/?filter=${JSON.stringify(itemInfo.value.statementallocations.map(i => i.bs_id))}`)
|
navigateTo(`/banking/?filter=${JSON.stringify(itemInfo.value.statementallocations.map(i => i.bankstatement))}`)
|
||||||
} else {
|
} else {
|
||||||
navigateTo(`/banking/statements/edit/${itemInfo.value.statementallocations[0].bs_id}`)
|
navigateTo(`/banking/statements/edit/${itemInfo.value.statementallocations[0].bankstatement}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -105,12 +105,21 @@ const openBankstatements = () => {
|
|||||||
Kunde
|
Kunde
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
v-if="itemInfo.linkedDocument"
|
v-if="itemInfo.createddocument"
|
||||||
@click="router.push(`/standardEntity/createDocument/show/${itemInfo.linkedDocument}`)"
|
@click="router.push(`/createDocument/show/${itemInfo.createddocument}`)"
|
||||||
icon="i-heroicons-link"
|
icon="i-heroicons-link"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
>
|
>
|
||||||
{{dataStore.documentTypesForCreation[itemInfo.linkedDocument.type].labelSingle}} - {{itemInfo.linkedDocument.documentNumber}}
|
{{dataStore.documentTypesForCreation[itemInfo.createddocument.type].labelSingle}} - {{itemInfo.createddocument.documentNumber}}
|
||||||
|
</UButton>
|
||||||
|
<UButton
|
||||||
|
v-for="item in itemInfo.createddocuments"
|
||||||
|
v-if="itemInfo.createddocuments"
|
||||||
|
@click="router.push(`/createDocument/show/${item.id}`)"
|
||||||
|
icon="i-heroicons-link"
|
||||||
|
variant="outline"
|
||||||
|
>
|
||||||
|
{{dataStore.documentTypesForCreation[item.type].labelSingle}} - {{item.documentNumber}}
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
v-if="itemInfo.statementallocations?.length > 0"
|
v-if="itemInfo.statementallocations?.length > 0"
|
||||||
|
|||||||
Reference in New Issue
Block a user