Korrektur Buchungstexte bei Auslagenerstattungen
This commit is contained in:
@@ -93,7 +93,7 @@ class ExportController extends CommonController {
|
||||
'amount' => $invoice->amount,
|
||||
'recipient_name' => $invoice->contact_bank_owner,
|
||||
'recipient_iban' => $invoice->contact_bank_iban,
|
||||
'payment_purpose' => $invoice->payment_purpose ?? 'Auslagenerstattung Rechnungsnummer ' . $invoice->invoice_number,
|
||||
'payment_purpose' => $invoice->paymentPurposeText(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +71,26 @@ class Invoice extends InstancedModel
|
||||
'denied_reason',
|
||||
];
|
||||
|
||||
/**
|
||||
* Der Verwendungszweck für Überweisung, Buchungstext und Anzeige.
|
||||
*
|
||||
* Der Freitext gewinnt, wenn einer erfasst wurde. Sonst benennt der Text den Vorgang: eine
|
||||
* Beitragserstattung ist keine Auslage des Teilis, sondern die Rücknahme seiner Zahlung -- auf dem
|
||||
* Kontoauszug muss der Unterschied erkennbar sein. Genannt wird die Abrechnungsnummer, und zwar als
|
||||
* Belegnummer: unter "Rechnungsnummer" gibt es sie nirgends.
|
||||
*/
|
||||
public function paymentPurposeText() : string {
|
||||
if ($this->payment_purpose !== null) {
|
||||
return $this->payment_purpose;
|
||||
}
|
||||
|
||||
$subject = $this->type === InvoiceType::INVOICE_TYPE_PARTICIPATION_REFUND
|
||||
? 'Beitragserstattung'
|
||||
: 'Auslagenerstattung';
|
||||
|
||||
return $subject . ' Belegnummer ' . $this->invoice_number;
|
||||
}
|
||||
|
||||
public function costUnit() : BelongsTo{
|
||||
return $this->belongsTo(CostUnit::class);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class InvoiceResource {
|
||||
$returnData['id'] = $this->invoice->id;
|
||||
$returnData['donation'] = $this->invoice->donation;
|
||||
$returnData['externalPayment'] = null !== $this->invoice->payment_purpose;
|
||||
$returnData['paymentPurpose'] = $this->invoice->payment_purpose ?? 'Auslagenerstattung Rechnungsnummer ' . $returnData['invoiceNumber'];
|
||||
$returnData['paymentPurpose'] = $this->invoice->paymentPurposeText();
|
||||
$returnData['accountOwner'] = $this->invoice->contact_bank_owner ?? '--';
|
||||
$returnData['accountIban'] = $this->invoice->contact_bank_iban ?? '--';
|
||||
$returnData['status'] = $this->invoice->status;
|
||||
|
||||
Reference in New Issue
Block a user