payment plans wip
This commit is contained in:
1 parent
3a74e45a3a
commit
61594777d7
15 files changed
+560
-158
No files matched your search
@@ -8,34 +8,30 @@ use Filament\Support\Contracts\HasLabel;
|
||||
|
||||
enum ProjektStatus: string implements HasColor, HasIcon, HasLabel
|
||||
{
|
||||
case TEST = 'test';
|
||||
case ENTWURF = 'entwurf';
|
||||
case ENFASSUNG = 'endfassung';
|
||||
case Entwurf = 'entwurf';
|
||||
case Endfassung = 'endfassung';
|
||||
|
||||
public function getLabel(): ?string
|
||||
{
|
||||
return match ($this) {
|
||||
self::TEST => 'Test',
|
||||
self::ENTWURF => 'Entwurf',
|
||||
self::ENFASSUNG => 'Endfassung',
|
||||
self::Entwurf => 'Entwurf',
|
||||
self::Endfassung => 'Endfassung',
|
||||
};
|
||||
}
|
||||
|
||||
public function getColor(): string|array|null
|
||||
{
|
||||
return match ($this) {
|
||||
self::TEST => 'gray',
|
||||
self::ENTWURF => 'primary',
|
||||
self::ENFASSUNG => 'success',
|
||||
self::Entwurf => 'primary',
|
||||
self::Endfassung => 'success',
|
||||
};
|
||||
}
|
||||
|
||||
public function getIcon(): ?string
|
||||
{
|
||||
return match ($this) {
|
||||
self::TEST => 'lucide-file-cog',
|
||||
self::ENTWURF => 'lucide-file-pen',
|
||||
self::ENFASSUNG => 'lucide-file-check',
|
||||
self::Entwurf => 'lucide-file-pen',
|
||||
self::Endfassung => 'lucide-file-check',
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
use Filament\Support\Contracts\HasDescription;
|
||||
use Filament\Support\Contracts\HasIcon;
|
||||
use Filament\Support\Contracts\HasLabel;
|
||||
use ToneGabes\BetterOptions\Contracts\HasExtraText;
|
||||
|
||||
enum Zahlungen: string implements HasDescription, HasExtraText, HasIcon, HasLabel
|
||||
{
|
||||
case gutachten = 'gutachten';
|
||||
case monat = 'monat';
|
||||
case jahr = 'jahr';
|
||||
|
||||
public function getIcon(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::gutachten => 'licude-credit-card',
|
||||
self::monat => 'licude-credit-card',
|
||||
self::jahr => 'licude-credit-card',
|
||||
};
|
||||
}
|
||||
|
||||
public function getLabel(): ?string
|
||||
{
|
||||
return match ($this) {
|
||||
self::gutachten => 'Zahlung pro Gutachten',
|
||||
self::monat => 'Zahlung Monatlich',
|
||||
self::jahr => 'Zahlung Jährlich',
|
||||
};
|
||||
}
|
||||
|
||||
public function getExtraText(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::gutachten => 'Zahlung pro Gutachten',
|
||||
self::monat => 'Zahlung Monatlich',
|
||||
self::jahr => 'Zahlung Jährlich',
|
||||
};
|
||||
}
|
||||
|
||||
public function getDescription(): ?string
|
||||
{
|
||||
return match ($this) {
|
||||
self::gutachten => 'Zahlungen können für jedes Gutachten einzeln getätigt werden',
|
||||
self::monat => 'Zahlung erfolgt monatlich, ohne Begrenzung für die erstellten Gutachten',
|
||||
self::jahr => 'Zahlung erfolgt jährlich, ohne Begrenzung für die erstellten Gutachten, Gutachter oder Auftraggeber',
|
||||
};
|
||||
}
|
||||
|
||||
public function getIcons(): ?string
|
||||
{
|
||||
return match ($this) {
|
||||
self::gutachten => 'licude-battery-low',
|
||||
self::monat => 'licude-battery-medium',
|
||||
self::jahr => 'licude-battery-full',
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -148,7 +148,7 @@ class Register extends BaseRegister
|
||||
size="sm"
|
||||
wire:submit="register"
|
||||
>
|
||||
Register
|
||||
Registrieren
|
||||
</x-filament::button>
|
||||
BLADE))),
|
||||
|
||||
|
||||
@@ -5,8 +5,12 @@ namespace App\Filament\Resources\Kontos\Schemas;
|
||||
use App\Models\Konto;
|
||||
use Danielebarbaro\LaravelVatEuValidator\Rules\VatNumber;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
use ToneGabes\BetterOptions\Forms\Components\RadioCards;
|
||||
use ToneGabes\Filament\Icons\Enums\Phosphor;
|
||||
use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput;
|
||||
|
||||
class KontoForm
|
||||
@@ -15,47 +19,68 @@ class KontoForm
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextInput::make('company')
|
||||
->label('Firma')
|
||||
->required(),
|
||||
TextInput::make('email')
|
||||
->label('E-Mail')
|
||||
->unique(table: Konto::class)
|
||||
->required(),
|
||||
TextInput::make('address')
|
||||
->label('Adresse')
|
||||
->required(),
|
||||
TextInput::make('location')
|
||||
->label('Ort')
|
||||
->required(),
|
||||
TextInput::make('plz')
|
||||
->label('Postleitzahl')
|
||||
->required(),
|
||||
PhoneInput::make('phone')
|
||||
->label('Telefon')
|
||||
->defaultCountry('AT'),
|
||||
TextInput::make('country')
|
||||
->label('Land')
|
||||
->default('Österreich')
|
||||
->required(),
|
||||
TextInput::make('uid_number')
|
||||
->label('UID Nummer')
|
||||
->rules([new VatNumber])
|
||||
->required(),
|
||||
TextInput::make('title')
|
||||
->label('Title')
|
||||
->required(),
|
||||
Select::make('gender')
|
||||
->label('Geschlecht')
|
||||
RadioCards::make('plan_id')
|
||||
->label('Zahlungsplan')
|
||||
->columns(3)
|
||||
->options([
|
||||
'Herr' => 'Herr',
|
||||
'Frau' => 'Frau',
|
||||
'Non-binary' => 'Non-binary',
|
||||
1 => 'Einsteiger ',
|
||||
2 => 'Gelegentlich',
|
||||
3 => 'Viel in Verwendung',
|
||||
])
|
||||
->required(),
|
||||
TextInput::make('name')
|
||||
->label('Name')
|
||||
->required(),
|
||||
->descriptions([
|
||||
1 => 'Bezahlung bei der Erstellung eines Gutachtens.',
|
||||
2 => 'Zahlung Monatlich ohne Begrenzung der Gutachten.',
|
||||
3 => 'Zahlung Jährlich, ohne Begrenzung der Mitarbeiter, Gutachter und Auftraggeber.',
|
||||
])
|
||||
->icons([
|
||||
1 => Phosphor::Airplane->thin(),
|
||||
2 => Phosphor::AirplaneTakeoff->thin(),
|
||||
3 => Phosphor::AirplaneInFlight->thin(),
|
||||
])->columnSpanFull(),
|
||||
Section::make('Firma')
|
||||
->inlineLabel()
|
||||
->schema([
|
||||
TextInput::make('company')
|
||||
->label('Firma')
|
||||
->required(),
|
||||
TextInput::make('uid_number')
|
||||
->label('UID Nummer')
|
||||
->rules([new VatNumber])
|
||||
->required(),
|
||||
Textarea::make('address')
|
||||
->label('Adresse')
|
||||
->required(),
|
||||
TextInput::make('country')
|
||||
->label('Land')
|
||||
->default('Österreich')
|
||||
->required(),
|
||||
])->columnSpanFull(),
|
||||
Section::make('Kontaktperson')
|
||||
->inlineLabel()
|
||||
->schema([
|
||||
TextInput::make('title')
|
||||
->label('Title')
|
||||
->required(),
|
||||
Select::make('gender')
|
||||
->label('Geschlecht')
|
||||
->options([
|
||||
'Herr' => 'Herr',
|
||||
'Frau' => 'Frau',
|
||||
'Non-binary' => 'Non-binary',
|
||||
])
|
||||
->required(),
|
||||
TextInput::make('name')
|
||||
->label('Name')
|
||||
->required(),
|
||||
TextInput::make('email')
|
||||
->label('E-Mail')
|
||||
->unique(table: Konto::class)
|
||||
->required(),
|
||||
PhoneInput::make('phone')
|
||||
->label('Telefon')
|
||||
->defaultCountry('AT'),
|
||||
])->columnSpanFull(),
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -8,12 +8,8 @@ use Filament\Forms\Components\RichEditor;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Support\Enums\FontWeight;
|
||||
use Filament\Support\Enums\TextSize;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Ysfkaya\FilamentPhoneInput\PhoneInputNumberType;
|
||||
use Ysfkaya\FilamentPhoneInput\Tables\PhoneColumn;
|
||||
|
||||
class KontosTable
|
||||
{
|
||||
@@ -21,30 +17,12 @@ class KontosTable
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
// TextColumn::make('id'),
|
||||
// TextColumn::make('gender')->label('Geschlecht'),
|
||||
// TextColumn::make('title')->label('Title'),
|
||||
// TextColumn::make('first_name')->label('Vorname'),
|
||||
|
||||
// PhoneColumn::make('phone')
|
||||
// ->label('Telefon')
|
||||
// ->displayFormat(PhoneInputNumberType::INTERNATIONAL),
|
||||
// TextColumn::make('email')
|
||||
// ->copyable()
|
||||
// ->copyMessage('E-Mail wurde kopiert')
|
||||
// ->copyMessageDuration(1500)
|
||||
// ->label('E-mail'),
|
||||
|
||||
TextColumn::make('company')->label('Firma')
|
||||
->description(fn ($record): string => $record->address),
|
||||
|
||||
TextColumn::make('plan.name')
|
||||
->icon(Heroicon::CurrencyEuro)
|
||||
// ->iconColor('success')
|
||||
// ->badge()
|
||||
->label('Plan')
|
||||
->description(fn ($record): string => $record->plan->payment)
|
||||
->wrap(),
|
||||
->label('Zahlungs Plan')
|
||||
->description(fn ($record): string => $record->plan->payment),
|
||||
|
||||
TextColumn::make('guthaben')
|
||||
->size(TextSize::Large)
|
||||
@@ -63,11 +41,9 @@ class KontosTable
|
||||
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make()->label(''),
|
||||
EditAction::make(),
|
||||
Action::make('Laden')
|
||||
->label('')
|
||||
->icon('heroicon-o-credit-card')
|
||||
->color('danger')
|
||||
->schema([
|
||||
TextInput::make('subject')->required(),
|
||||
RichEditor::make('body')->required(),
|
||||
|
||||
Reference in new issue
Block a user