55 lines
1.6 KiB
PHP
55 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Enumerations;
|
|
|
|
use App\Scopes\CommonModel;
|
|
|
|
class InvoiceType extends CommonModel {
|
|
public const INVOICE_TYPE_TRAVELLING = 'travelling';
|
|
|
|
public const INVOICE_TYPE_PROGRAM = 'program';
|
|
|
|
public const INVOICE_TYPE_OTHER = 'other';
|
|
|
|
public const INVOICE_TYPE_ACCOMMODATION = 'accommodation';
|
|
|
|
public const INVOICE_TYPE_CATERING = 'catering';
|
|
|
|
public const INVOICE_TYPE_LOGSTIC = 'logistic';
|
|
|
|
public const INVOICE_TYPE_TECHNICAL = 'technical';
|
|
|
|
public const INVOICE_TYPE_MANAGEMENT = 'management';
|
|
|
|
/**
|
|
* Erstattung eines Teilnahmebeitrags. Entsteht ausschließlich aus einem bestätigten
|
|
* Erstattungsvorgang und ist deshalb nicht von Hand wählbar ({@see self::selectable()}).
|
|
*/
|
|
public const INVOICE_TYPE_PARTICIPATION_REFUND = 'participation_refund';
|
|
|
|
protected $fillable = [
|
|
'slug',
|
|
'name',
|
|
'sort_order',
|
|
'selectable',
|
|
];
|
|
|
|
protected $casts = [
|
|
'sort_order' => 'integer',
|
|
'selectable' => 'boolean',
|
|
];
|
|
|
|
/**
|
|
* Die Typen, die in einem Formular zur Auswahl stehen dürfen -- nach Sortierung.
|
|
*
|
|
* Automatisch vergebene Typen bleiben außen vor: Ihre Abrechnungen entstehen aus einem Vorgang, der
|
|
* die Daten mitbringt; von Hand gewählt stünde ein leerer Rahmen ohne diesen Vorgang da.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Collection<int, self>
|
|
*/
|
|
public static function selectable(): \Illuminate\Database\Eloquent\Collection
|
|
{
|
|
return self::where('selectable', true)->orderBy('sort_order')->get();
|
|
}
|
|
}
|