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(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
|
||||
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>
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
@@ -529,11 +529,11 @@ const archiveStatement = async () => {
|
||||
</UCard>
|
||||
<UCard
|
||||
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>
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
@@ -810,8 +810,8 @@ const archiveStatement = async () => {
|
||||
icon="i-heroicons-check"
|
||||
variant="outline"
|
||||
class="mr-3"
|
||||
v-if="!itemInfo.statementallocations.find(i => i.cd_id === document.id)"
|
||||
@click="saveAllocation({cd_id: document.id, bankstatement: itemInfo.id, amount: Number(Number(document.openSum) < manualAllocationSum ? document.openSum : manualAllocationSum), description: allocationDescription})"
|
||||
v-if="!itemInfo.statementallocations.find(i => i.createddocument === document.id)"
|
||||
@click="saveAllocation({createddocument: document.id, bankstatement: itemInfo.id, amount: Number(Number(document.openSum) < manualAllocationSum ? document.openSum : manualAllocationSum), description: allocationDescription})"
|
||||
/>
|
||||
|
||||
<UButton
|
||||
@@ -835,8 +835,8 @@ const archiveStatement = async () => {
|
||||
icon="i-heroicons-check"
|
||||
variant="outline"
|
||||
class="mr-3"
|
||||
v-if="!itemInfo.statementallocations.find(i => i.ii_id === 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})"
|
||||
v-if="!itemInfo.statementallocations.find(i => i.incominginvoice === item.id)"
|
||||
@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
|
||||
variant="outline"
|
||||
|
||||
@@ -1506,7 +1506,20 @@ const setRowData = async (row, service = {sellingPriceComposed: {}}, product = {
|
||||
}
|
||||
|
||||
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.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) {
|
||||
console.log("Product Detected")
|
||||
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.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)) {
|
||||
row.taxPercent = 0
|
||||
} 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}}
|
||||
</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"
|
||||
>
|
||||
{{row.state}}
|
||||
</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"
|
||||
>
|
||||
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
|
||||
v-else-if="row.state === 'Gebucht'"
|
||||
|
||||
@@ -39,9 +39,9 @@ const openEmail = () => {
|
||||
|
||||
const openBankstatements = () => {
|
||||
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 {
|
||||
navigateTo(`/banking/statements/edit/${itemInfo.value.statementallocations[0].bs_id}`)
|
||||
navigateTo(`/banking/statements/edit/${itemInfo.value.statementallocations[0].bankstatement}`)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -105,12 +105,21 @@ const openBankstatements = () => {
|
||||
Kunde
|
||||
</UButton>
|
||||
<UButton
|
||||
v-if="itemInfo.linkedDocument"
|
||||
@click="router.push(`/standardEntity/createDocument/show/${itemInfo.linkedDocument}`)"
|
||||
v-if="itemInfo.createddocument"
|
||||
@click="router.push(`/createDocument/show/${itemInfo.createddocument}`)"
|
||||
icon="i-heroicons-link"
|
||||
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
|
||||
v-if="itemInfo.statementallocations?.length > 0"
|
||||
|
||||
Reference in New Issue
Block a user