+ */
+ public function attachments(): array
+ {
+ return [];
+ }
+}
diff --git a/app/Models/CostUnit.php b/app/Models/CostUnit.php
index c8332f3..afb66e3 100644
--- a/app/Models/CostUnit.php
+++ b/app/Models/CostUnit.php
@@ -3,6 +3,7 @@
namespace App\Models;
use App\Scopes\InstancedModel;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
@@ -42,4 +43,8 @@ class CostUnit extends InstancedModel
public function invoices() : hasMany {
return $this->hasMany(Invoice::class);
}
+
+ public function tenant() : BelongsTo {
+ return $this->belongsTo(Tenant::class, 'tenant', 'slug');
+ }
}
diff --git a/app/Resources/InvoiceResource.php b/app/Resources/InvoiceResource.php
index f26fb74..478a40f 100644
--- a/app/Resources/InvoiceResource.php
+++ b/app/Resources/InvoiceResource.php
@@ -49,7 +49,7 @@ class InvoiceResource {
$returnData['deniedReason'] = $this->invoice->denied_reason ?? '--';
$returnData['travelDirection'] = $this->invoice->travel_direction ?? '--';
$returnData['travelReason'] = $this->invoice->travel_reason ?? '--';
- $returnData['distance'] = $this->invoice->distance;
+ $returnData['distance'] = $this->invoice->distance ?? '--';
$returnData['distanceAllowance'] = new Amount($this->invoice->costUnit()->first()->distance_allowance, '')->toString();
$returnData['passengers'] = $this->invoice->passengers ? 'Ja' : 'Nein';
$returnData['transportation'] = $this->invoice->transportation ? 'Ja' : 'Nein';
diff --git a/resources/views/emails/invoices/changed_invoice_state.blade.php b/resources/views/emails/invoices/changed_invoice_state.blade.php
new file mode 100644
index 0000000..3cf2f32
--- /dev/null
+++ b/resources/views/emails/invoices/changed_invoice_state.blade.php
@@ -0,0 +1,90 @@
+
+
+
+Hallo {{$invoice['contactName']}},
+
+ soeben wurde eine Abrechnung, die eingereicht hast, bearbeitet.
+ In der nachfolgenden Übersicht findest du weitere Details zu der Abrechnung:
+
+
+
+
+
+
+ |
+ Veranstaltung / Kostenstelle:
+ |
+
+ {{$costUnit['name']}}
+ |
+
+
+
+ |
+ Betrag:
+ |
+
+ {{$invoice['amount']}}
+ |
+
+
+
+ |
+ Grund der Abrechnung:
+ |
+
+ {{$invoiceType}}
+ |
+
+
+ @if($invoice['travelDirection'] !== '--')
+
+ |
+ Reiseweg:
+ |
+
+ {{$invoice['travelDirection'] }}
+ |
+
+ @endif
+
+ @if($invoice['distance'] !== '--')
+
+ |
+ Entfernung:
+ |
+
+ {{$invoice['distance'] }} km
+ |
+
+ @endif
+
+
+ |
+ Neuer Status:
+ |
+
+ {{$invoiceStatus}}
+ |
+
+
+ @if($invoice['deniedReason'] !== '--')
+
+ |
+ Begründung:
+ |
+
+ {!! $invoice['deniedReason'] !!}
+ |
+
+ @endif
+
+
+
+
+ Wenn du mit der Entscheidung nicht einverstanden bist, oder du Fragen zum weiteren Ablauf hast, kontaktiere bitte bitte die Aktionsleitung auf den bekannten Wegen oder gerne per E-Mail unter der Adresse:
+ {{$costUnitContactMail}}
+
+
+