fix credits

This commit is contained in:
salam committed 2026-05-11 14:21:27 +02:00
1 parent 9a355aa812
commit 3196e17116
9 files changed
+43 -18

No files matched your search

@@ -67,6 +67,17 @@ class KontoForm
->label('Telefon')
->defaultCountry('AT'),
])->columnSpanFull(),
// Tab::make('Guthaben')
// ->icon('lucide-euro')
// ->inlineLabel()
// ->schema([
// TextInput::make('guthaben')
// ->numeric()
// ->minValue(1)
// ->maxValue(100)
// ->label('Guthaben laden')
// ->prefixIcon('lucide-coins'),
// ])->columnSpanFull(),
])->columnSpanFull(),
]);
}
@@ -38,15 +38,15 @@ class KontosTable
])
->recordActions([
EditAction::make()->iconButton(),
Action::make('Guthaben laden')
->iconButton()
->color('gray')
->icon('heroicon-o-credit-card')
->schema([
TextInput::make('subject')->required(),
RichEditor::make('body')->required(),
])
->action(function (array $data) {}),
// Action::make('Guthaben laden')
// ->iconButton()
// ->color('gray')
// ->icon('heroicon-o-credit-card')
// ->schema([
// TextInput::make('subject')->required(),
// RichEditor::make('body')->required(),
// ])
// ->action(function (array $data) {}),
]);
}
}
@@ -34,7 +34,7 @@ class EditProjekte extends EditRecord
*/
Action::make('freischalten')
->hidden(fn ($record): bool => $record->bezahlt_am ? true : false)
->color('warning')
->color('success')
->visible(fn (): bool => Auth::user()->konto->guthaben)
->requiresConfirmation()
->modalHeading('Gutachten freischalten?')
@@ -56,16 +56,20 @@ class EditProjekte extends EditRecord
}
}),
Action::make('bezahlen')
->color('danger')
->color('primary')
->icon('phosphor-euro')
->hidden(fn ($record): bool => $record->bezahlt_am ? true : false)
->visible(fn (): bool => Auth::user()->konto->guthaben)
->visible(fn (): bool => Auth::user()->konto->guthaben == 0)
->label('Konto laden')
->tooltip('Konto laden um Gutachten freizuschalten.')
->requiresConfirmation()
->modalHeading('Kein Guthaben')
->modalIcon('heroicon-o-exclamation-triangle')
->modalDescription('Bitte laden sie Ihr Konto auf')
->modalSubmitActionLabel('Konto aufladen'),
->tooltip('Konto laden (Dirket nur bei Büro AVF möglich).')
->action(function () {
Konto::where('id', Auth::user()->konto_id)->update(['guthaben' => 10]);
}),
// ->requiresConfirmation()
// ->modalHeading('Kein Guthaben')
// ->modalIcon('heroicon-o-exclamation-triangle')
// ->modalDescription('Bitte laden sie Ihr Konto auf. (nicht aktive)')
// ->modalSubmitActionLabel('Konto aufladen'),
/**
* EVALUATE
*/
@@ -112,6 +112,7 @@ class ProjektAllgemeinflaechensRelationManager extends RelationManager
->title('Allgemeinflächen gelöscht'),
),
CreateAction::make()
->hidden(fn (): bool => $this->ownerRecord->bezahlt_am ? false : true)
->icon('phosphor-file-plus')
->createAnother(false),
])
@@ -361,6 +361,7 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
->headerActions([
Action::make('generate')
->action(fn (CreateProjektInhaltsverzeichnis $createInhaltsverzeichnis) => $createInhaltsverzeichnis->create($this->ownerRecord))
->hidden(fn (): bool => $this->ownerRecord->bezahlt_am ? false : true)
->requiresConfirmation()
->modalHeading('Inhaltsverzeichnis neu generieren')
->modalDescription('Bestehende Daten werden gelöscht.')
@@ -369,6 +370,7 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
->tooltip('Inhaltsverzeichnis wird neu erstellt.')
->icon('phosphor-gear'),
CreateAction::make()
->hidden(fn (): bool => $this->ownerRecord->bezahlt_am ? false : true)
->icon('phosphor-file-plus')
->createAnother(false),
])
@@ -159,6 +159,7 @@ class ProjektMethodesRelationManager extends RelationManager
Action::make('erstellen')
->action(fn (CreateProjektMethoden $createProjektMethoden) => $createProjektMethoden->create($this->ownerRecord))
->requiresConfirmation()
->hidden(fn (): bool => $this->ownerRecord->bezahlt_am ? false : true)
->modalHeading('Raum Methoden erstellen')
->modalDescription(new HtmlString('Daten werden aus der Tabelle "Objekte im Detail" generiert. Änderungen werden übernommen nicht mehr verwendete Objekte gelöscht. <br>Um die Tabelle neu zu generieren bitte die Tabelle vorher leeren.'))
->modalSubmitActionLabel('Generieren')
@@ -144,6 +144,7 @@ class ProjektObjekteImDetailRelationManager extends RelationManager
Action::make('import-text')
->icon('phosphor-upload')
->modalIcon('phosphor-file-csv')
->hidden(fn (): bool => $this->ownerRecord->bezahlt_am ? false : true)
->color('info')
->label('Hochladen')
->modalHeading('Objekte im Detail hochladen')
@@ -160,11 +161,13 @@ class ProjektObjekteImDetailRelationManager extends RelationManager
ImportObjekteDirect::run($data, $this->ownerRecord->id);
}),
CreateAction::make()
->hidden(fn (): bool => $this->ownerRecord->bezahlt_am ? false : true)
->icon('phosphor-file-plus')
->createAnother(false),
Action::make('nutzwerte')
->label('Nutzwerte')
->icon('phosphor-calculator')
->hidden(fn (): bool => $this->ownerRecord->bezahlt_am ? false : true)
->action(function () {
$res = ProjektObjekteImDetail::with('methode')
->where('projekte_id', $this->getOwnerRecord()->id)
@@ -271,11 +271,13 @@ class ProjektObjekteRelationManager extends RelationManager
->headerActions([
CreateAction::make()
->modalHeading('Objekt erstellen')
->hidden(fn (): bool => $this->ownerRecord->bezahlt_am ? false : true)
->modalDescription('Die dazugehörigen Räume werde in "Objekte im Detail" erstellt.')
->icon('phosphor-file-plus')
->createAnother(false),
Action::make('projekt_merkmale')
->icon('phosphor-pen')
->hidden(fn (): bool => $this->ownerRecord->bezahlt_am ? false : true)
->modalCancelAction(fn (Action $action) => $action->label('Schließen'))
->modalSubmitAction(false)
->modalHeading('ProjektMerkmale')
@@ -53,6 +53,7 @@ class ProjektPlatzhalterRelationManager extends RelationManager
->headerActions([
Action::make('generate')
->action(fn (CreatePlatzhalter $createPlatzhalter) => $createPlatzhalter->create($this->ownerRecord))
->hidden(fn (): bool => $this->ownerRecord->bezahlt_am ? false : true)
->requiresConfirmation()
->modalHeading('Platzhalter neu generieren')
->modalDescription('Bestehende Platzhalter bleiben erhalten, neue werden hinzugefügt und nicht mehr verwendete werden gelöscht.')