Skip to content

Commit 8e043ed

Browse files
authored
Merge pull request #120 from devmount/bugs/108-pdf-fixes
PDF fixes
2 parents 7b939ea + 54d89f8 commit 8e043ed

File tree

3 files changed

+4
-36
lines changed

3 files changed

+4
-36
lines changed

app/Filament/Resources/SettingResource.php

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
use App\Filament\Resources\SettingResource\Pages;
66
use App\Models\Setting;
7-
use Filament\Forms\Components;
87
use Filament\Resources\Resource;
9-
use Filament\Tables\Actions;
108
use Filament\Tables\Columns;
119
use Filament\Tables\Table;
1210

@@ -19,44 +17,14 @@ public static function table(Table $table): Table
1917
{
2018
return $table
2119
->defaultSort('weight', 'asc')
22-
->reorderable('weight')
2320
->columns([
2421
Columns\TextColumn::make('field')
2522
->label(__('field'))
2623
->state(fn (Setting $record): string => "{$record->label} (<code>{$record->field}</code>)")
2724
->html(),
28-
Columns\TextColumn::make('value')
25+
Columns\TextInputColumn::make('value')
2926
->label(__('value'))
30-
->limit(),
31-
])
32-
->filters([
33-
//
34-
])
35-
->actions([
36-
Actions\EditAction::make()
37-
->label('')
38-
->form(fn (Setting $record) => match ($record->type) {
39-
'text', 'email', 'tel', 'url', 'number' => [
40-
Components\TextInput::make('value')
41-
->label($record->label)
42-
->email($record->type === 'email')
43-
->tel($record->type === 'tel')
44-
->url($record->type === 'url')
45-
->numeric($record->type === 'number')
46-
->autofocus()
47-
],
48-
'textarea' => [
49-
Components\Textarea::make('value')
50-
->label($record->label)
51-
->autosize()
52-
->autofocus()
53-
],
54-
default => [
55-
Components\TextInput::make('value')
56-
->label($record->label)
57-
->autofocus()
58-
]
59-
}),
27+
->grow(),
6028
])
6129
->paginated(false);
6230
}

app/Services/InvoiceService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public static function generatePdf(Invoice $invoice): string {
270270

271271
$posdata = collect([
272272
'description' => trim($position->description),
273-
'hours' => Number::format($billedPerProject ? '' : $poshours, 1, locale: $lang),
273+
'hours' => $billedPerProject ? '' : Number::format($poshours, 1, locale: $lang),
274274
'price' => $billedPerProject ? '' : Number::currency($invoice->price, 'EUR', locale: $lang),
275275
'title' => $invoice->undated ? "{$num}. {$label['position']}" : $posdate,
276276
'total' => $billedPerProject ? '' : Number::currency($invoice->price * $poshours, 'EUR', locale: $lang),

app/Services/PdfTemplate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class PdfTemplate extends PdfDocument
2424
protected int $nFiles;
2525
protected bool $openAttachmentPane = false;
2626

27-
public function __construct(string $lang = null, DocumentType $type = DocumentType::INVOICE)
27+
public function __construct(?string $lang = null, DocumentType $type = DocumentType::INVOICE)
2828
{
2929
// Init
3030
$this->lang = $lang ?? config('app.locale');

0 commit comments

Comments
 (0)