better handling payment purpose
This commit is contained in:
@@ -89,12 +89,13 @@
|
||||
<template>
|
||||
<table v-if="localData.invoices.length > 0" class="invoice-list-table">
|
||||
<tr>
|
||||
<td colspan="6">{{props.data.costUnit.name}}</td>
|
||||
<td colspan="7">{{props.data.costUnit.name}}</td>
|
||||
</tr>
|
||||
|
||||
<tr v-for="invoice in localData.invoices" :id="'invoice_' + invoice.id">
|
||||
<td>{{invoice.invoiceNumber}}</td>
|
||||
<td>{{invoice.invoiceType}}</td>
|
||||
<td>{{invoice.invoiceTypeShort}}</td>
|
||||
<td style="max-width: 250px;">{{invoice.purpose}}</td>
|
||||
<td>
|
||||
{{invoice.amount}}
|
||||
</td>
|
||||
@@ -114,7 +115,7 @@
|
||||
</tr>
|
||||
|
||||
<tr v-if="props.data.endpoint === 'approved'">
|
||||
<td colspan="5"></td>
|
||||
<td colspan="6"></td>
|
||||
<td>
|
||||
<a style="font-size: 10pt;" class="link" @click="exportPayouts()">Genehmigte Abrechnungen exportieren</a>
|
||||
</td>
|
||||
|
||||
+11
-8
@@ -148,7 +148,7 @@ class CreateIncomeSurplusStatementCommand
|
||||
$rows[] = [
|
||||
'number' => (string) $invoice->invoice_number,
|
||||
'date' => $invoice->created_at?->format('d.m.Y') ?? '',
|
||||
'purpose' => $this->purpose($invoice->type_other, $invoice->comment),
|
||||
'purpose' => $this->purpose($invoice->purposeText(), $invoice->comment),
|
||||
'amount' => Amount::fromString($invoice->amount),
|
||||
];
|
||||
}
|
||||
@@ -166,18 +166,21 @@ class CreateIncomeSurplusStatementCommand
|
||||
}
|
||||
|
||||
/**
|
||||
* Wofür der Beleg steht.
|
||||
* Wofür der Beleg steht, um die Anmerkung ergänzt.
|
||||
*
|
||||
* `type_other` trägt seit der Pflichtangabe "Was wurde eingekauft" zu jeder Abrechnung den Zweck,
|
||||
* nicht mehr nur bei "Sonstige Kosten". Ältere Belege haben das Feld leer -- dann bleibt die
|
||||
* Anmerkung, und fehlt auch die, bleibt die Zelle leer. Ein Platzhalter wie "--" würde in der
|
||||
* Belegliste nur Platz kosten.
|
||||
* Den Zweck selbst bestimmt {@see \App\Models\Invoice::purposeText()} -- dieselbe Ermittlung wie in
|
||||
* der Beleg-Übersicht, damit ein Beleg nicht an zwei Stellen Verschiedenes über sich behauptet. Die
|
||||
* Anmerkung kommt nur hier dazu: Auf der Aufstellung steht der Beleg für sich, ohne die Detailansicht
|
||||
* daneben.
|
||||
*
|
||||
* Ältere Belege haben keinen Zweck erfasst -- dann bleibt die Anmerkung, und fehlt auch die, bleibt
|
||||
* die Zelle leer. Ein Platzhalter wie "--" würde in der Belegliste nur Platz kosten.
|
||||
*/
|
||||
private function purpose(?string $typeOther, ?string $comment): string
|
||||
private function purpose(?string $purpose, ?string $comment): string
|
||||
{
|
||||
$parts = [];
|
||||
|
||||
foreach ([$typeOther, $comment] as $part) {
|
||||
foreach ([$purpose, $comment] as $part) {
|
||||
if (trim((string) $part) !== '') {
|
||||
$parts[] = trim((string) $part);
|
||||
}
|
||||
|
||||
@@ -45,12 +45,13 @@
|
||||
<template>
|
||||
<table v-if="localData.invoices.length > 0" class="invoice-list-table">
|
||||
<tr>
|
||||
<td colspan="6">{{props.data.title}}</td>
|
||||
<td colspan="7">{{props.data.title}}</td>
|
||||
</tr>
|
||||
|
||||
<tr v-for="invoice in localData.invoices" :id="'invoice_' + invoice.id">
|
||||
<td>{{invoice.invoiceNumber}}</td>
|
||||
<td>{{invoice.invoiceType}}</td>
|
||||
<td>{{invoice.invoiceTypeShort}}</td>
|
||||
<td style="max-width: 250px;">{{invoice.purpose}}</td>
|
||||
<td>
|
||||
{{invoice.amount}}
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user