promotion wip
This commit is contained in:
1 parent
61594777d7
commit
3c5698a550
17 files changed
+176
-303
No files matched your search
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
use Filament\Support\Contracts\HasDescription;
|
||||
use Filament\Support\Contracts\HasIcon;
|
||||
use Filament\Support\Contracts\HasLabel;
|
||||
use ToneGabes\BetterOptions\Contracts\HasExtraText;
|
||||
use ToneGabes\Filament\Icons\Enums\Phosphor;
|
||||
|
||||
enum Plan: string implements HasDescription, HasExtraText, HasIcon, HasLabel
|
||||
{
|
||||
case Standard = 'standard';
|
||||
case Smart = 'smart';
|
||||
case Premium = 'premium';
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Standard => 'Zahlungen können für jedes Gutachten einzeln getätigt werden',
|
||||
self::Smart => 'Zahlung erfolgt monatlich, ohne Begrenzung für die erstellten Gutachten',
|
||||
self::Premium => 'Zahlung erfolgt jährlich, ohne Begrenzung für die erstellten Gutachten, Gutachter oder Auftraggeber',
|
||||
};
|
||||
}
|
||||
|
||||
public function getExtraText(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Standard => 'model.standard',
|
||||
self::Smart => 'model.smart',
|
||||
self::Premium => 'model.premium',
|
||||
};
|
||||
}
|
||||
|
||||
public function getIcon(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Standard => Phosphor::Airplane->thin(),
|
||||
self::Smart => Phosphor::AirplaneTakeoff->thin(),
|
||||
self::Premium => Phosphor::AirplaneInFlight->thin(),
|
||||
};
|
||||
}
|
||||
|
||||
public function getLabel(): ?string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Standard => 'Per Gutachten',
|
||||
self::Smart => 'Monatlich',
|
||||
self::Premium => 'Jährlich',
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
<?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',
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
namespace App\Filament\Resources\Kontos\Schemas;
|
||||
|
||||
use Alkoumi\FilamentImageRadioButton\Forms\Components\ImageRadioGroup;
|
||||
use App\Models\Konto;
|
||||
use App\Models\Plan;
|
||||
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
|
||||
@@ -19,24 +19,13 @@ class KontoForm
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
RadioCards::make('plan_id')
|
||||
->label('Zahlungsplan')
|
||||
->columns(3)
|
||||
->options([
|
||||
1 => 'Einsteiger ',
|
||||
2 => 'Gelegentlich',
|
||||
3 => 'Viel in Verwendung',
|
||||
])
|
||||
->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(),
|
||||
ImageRadioGroup::make('plan_id')
|
||||
->animation(true)
|
||||
->disk('public')
|
||||
->label('Plan')
|
||||
->required()
|
||||
->columnSpanFull()
|
||||
->options(fn () => Plan::pluck('file', 'id')->toArray()),
|
||||
Section::make('Firma')
|
||||
->inlineLabel()
|
||||
->schema([
|
||||
|
||||
@@ -41,8 +41,10 @@ class KontosTable
|
||||
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
EditAction::make()->label('')->color('gray'),
|
||||
Action::make('Laden')
|
||||
->label('')
|
||||
->color('gray')
|
||||
->icon('heroicon-o-credit-card')
|
||||
->schema([
|
||||
TextInput::make('subject')->required(),
|
||||
|
||||
@@ -15,8 +15,10 @@ class PlanForm
|
||||
TextInput::make('name')->required(),
|
||||
TextInput::make('payment')->label('Zahlung')->required(),
|
||||
Textarea::make('description')->label('Beschreibung')->required(),
|
||||
TextInput::make('number_user')->required()->label('Anzahl Benutzer')->numeric(),
|
||||
TextInput::make('number_gutachter')->required()->label('Anzahl Gutachter')->numeric(),
|
||||
TextInput::make('limit_user')->required()->label('Anzahl Benutzer')->numeric(),
|
||||
TextInput::make('limit_auftraggeber')->required()->label('Anzahl Auftraggeber')->numeric(),
|
||||
TextInput::make('limit_gutachter')->required()->label('Anzahl Gutachter')->numeric(),
|
||||
TextInput::make('limit_gutachten')->required()->label('Anzahl Projekte')->numeric(),
|
||||
])->inlineLabel()->columns(1);
|
||||
}
|
||||
}
|
||||
@@ -12,11 +12,14 @@ class PlansTable
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('name'),
|
||||
TextColumn::make('payment')->label('Zahlungsart'),
|
||||
TextColumn::make('gutachten')->badge()->label('Anzahl'),
|
||||
TextColumn::make('number_user')->label('Benutzer')->badge(),
|
||||
TextColumn::make('number_gutachter')->label('Gutachter')->badge(),
|
||||
TextColumn::make('name')
|
||||
->description(fn ($record): string => $record->description)
|
||||
->wrap(),
|
||||
TextColumn::make('payment')->label('Plan'),
|
||||
TextColumn::make('limit_user')->label('B')->tooltip('Benutzer')->badge(),
|
||||
TextColumn::make('limit_auftraggeber')->label('A')->tooltip('Auftraggeber')->badge(),
|
||||
TextColumn::make('limit_gutachter')->label('G')->tooltip('Gutachter')->badge(),
|
||||
TextColumn::make('limit_gutachten')->label('P')->tooltip('Projekte')->badge(),
|
||||
TextColumn::make('preis')->money('EUR'),
|
||||
])
|
||||
->recordActions([
|
||||
@@ -24,3 +27,9 @@ class PlansTable
|
||||
]);
|
||||
}
|
||||
}
|
||||
// `file` varchar(255) DEFAULT NULL,
|
||||
// `preis` int(11) NOT NULL DEFAULT 0,
|
||||
// `limit_user` int(11) NOT NULL DEFAULT 1,
|
||||
// `limit_auftraggeber` int(11) NOT NULL DEFAULT 1,
|
||||
// `limit_gutachter` int(11) NOT NULL DEFAULT 1,
|
||||
// `limit_gutachten` int(11) D
|
||||
Reference in new issue
Block a user