Teilnahmerechnungen erstellen
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Scopes\CommonModel;
|
||||
use App\Support\Text;
|
||||
|
||||
/**
|
||||
* @property string $slug
|
||||
@@ -12,6 +13,14 @@ use App\Scopes\CommonModel;
|
||||
* @property string $account_name
|
||||
* @property string $account_iban
|
||||
* @property string $account_bic
|
||||
* @property string|null $invoice_sender_name
|
||||
* @property string|null $address_1
|
||||
* @property string|null $address_2
|
||||
* @property string|null $address_3
|
||||
* @property string|null $phone
|
||||
* @property string|null $tax_number
|
||||
* @property string|null $vat_id
|
||||
* @property string|null $invoice_prefix
|
||||
* @property string $city
|
||||
* @property string $postcode
|
||||
* @property boolean $download_exports
|
||||
@@ -29,16 +38,42 @@ use App\Scopes\CommonModel;
|
||||
*/
|
||||
class Tenant extends CommonModel
|
||||
{
|
||||
/**
|
||||
* Ohne ausdrückliche Angabe ist das Präfix der Rechnungsnummer der großgeschriebene Slug
|
||||
* (`wm` -> `WM`). Hier und nicht als DB-Default, weil er sich aus einer anderen Spalte ableitet.
|
||||
*/
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::creating(static function (self $tenant): void {
|
||||
$tenant->invoice_prefix ??= strtoupper((string) $tenant->slug);
|
||||
});
|
||||
}
|
||||
|
||||
public static function getTempDirectory() : string {
|
||||
return app('tenant')->slug . '/temp-data/';
|
||||
}
|
||||
|
||||
/**
|
||||
* Bezeichnung des Rechnungsstellers.
|
||||
*
|
||||
* `name` ist ein internes Kürzel ("Wilde Möhre"); auf einer Rechnung steht die vollständige
|
||||
* Bezeichnung mit Rechtsform. Ohne eigene Angabe bleibt es beim Namen des Mandanten.
|
||||
*/
|
||||
public function invoiceSenderName() : string {
|
||||
return Text::nullIfBlank($this->invoice_sender_name) ?? (string) $this->name;
|
||||
}
|
||||
public const PRIMARY_TENANT_NAME = 'LV';
|
||||
|
||||
protected $fillable = [
|
||||
'slug',
|
||||
'name',
|
||||
'invoice_sender_name',
|
||||
'address_1',
|
||||
'address_2',
|
||||
'address_3',
|
||||
'email',
|
||||
'email_finance',
|
||||
'phone',
|
||||
'url',
|
||||
'account_name',
|
||||
'account_iban',
|
||||
@@ -57,6 +92,9 @@ class Tenant extends CommonModel
|
||||
'tax_exemption_reason',
|
||||
'tax_exemption_note',
|
||||
'vat_pricing_mode',
|
||||
'tax_number',
|
||||
'vat_id',
|
||||
'invoice_prefix',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
|
||||
Reference in New Issue
Block a user