diff --git a/app/Invoice/Actions/HasValidation.php b/app/Invoice/Actions/HasValidation.php index a473b78a..195f7488 100644 --- a/app/Invoice/Actions/HasValidation.php +++ b/app/Invoice/Actions/HasValidation.php @@ -16,6 +16,7 @@ trait HasValidation return [ 'status' => ['required', 'string', 'max:255', Rule::in(InvoiceStatus::values())], 'via' => ['required', 'string', 'max:255', Rule::in(BillKind::values())], + 'usage' => 'required|max:255|string', 'to' => 'array', 'to.address' => 'required|string|max:255', 'to.location' => 'required|string|max:255', @@ -42,6 +43,7 @@ trait HasValidation 'to.location' => 'Ort', 'status' => 'Status', 'via' => 'Rechnungsweg', + 'usage' => 'Verwendungszweck', ]; } } diff --git a/app/Invoice/Models/Invoice.php b/app/Invoice/Models/Invoice.php index 062dd584..d1d5b51a 100644 --- a/app/Invoice/Models/Invoice.php +++ b/app/Invoice/Models/Invoice.php @@ -47,6 +47,7 @@ class Invoice extends Model 'greeting' => 'Liebe Familie ' . $member->lastname, 'status' => InvoiceStatus::NEW, 'via' => $member->bill_kind, + 'usage' => 'Mitgliedsbeitrag für Familie ' . $member->lastname, ]); } diff --git a/app/Invoice/Resources/InvoiceResource.php b/app/Invoice/Resources/InvoiceResource.php index d521a743..145ea5e5 100644 --- a/app/Invoice/Resources/InvoiceResource.php +++ b/app/Invoice/Resources/InvoiceResource.php @@ -34,6 +34,7 @@ class InvoiceResource extends JsonResource 'via' => $this->via->value, 'positions' => InvoicePositionResource::collection($this->whenLoaded('positions')), 'greeting' => $this->greeting, + 'usage' => $this->usage, 'links' => [ 'update' => route('invoice.update', ['invoice' => $this->getModel()]), 'destroy' => route('invoice.destroy', ['invoice' => $this->getModel()]), @@ -65,6 +66,7 @@ class InvoiceResource extends JsonResource 'greeting' => '', 'status' => InvoiceStatus::NEW->value, 'via' => null, + 'usage' => '', ], 'default_position' => [ 'id' => null, diff --git a/resources/js/views/invoice/Index.vue b/resources/js/views/invoice/Index.vue index bb666599..bb70b392 100644 --- a/resources/js/views/invoice/Index.vue +++ b/resources/js/views/invoice/Index.vue @@ -31,11 +31,9 @@
- - - + + + @@ -45,6 +43,7 @@ +