Bladeren bron

refactor

3.x
Andrew Wallo 7 maanden geleden
bovenliggende
commit
62d69c7dc2

+ 4
- 5
app/Models/Accounting/DocumentLineItem.php Bestand weergeven

@@ -4,7 +4,6 @@ namespace App\Models\Accounting;
4 4
 
5 5
 use Akaunting\Money\Money;
6 6
 use App\Casts\DocumentMoneyCast;
7
-use App\Casts\MoneyCast;
8 7
 use App\Concerns\Blamable;
9 8
 use App\Concerns\CompanyOwned;
10 9
 use App\Enums\Accounting\AdjustmentCategory;
@@ -42,11 +41,11 @@ class DocumentLineItem extends Model
42 41
     ];
43 42
 
44 43
     protected $casts = [
45
-        'unit_price' => MoneyCast::class,
44
+        'unit_price' => DocumentMoneyCast::class,
46 45
         'subtotal' => DocumentMoneyCast::class,
47
-        'tax_total' => MoneyCast::class,
48
-        'discount_total' => MoneyCast::class,
49
-        'total' => MoneyCast::class,
46
+        'tax_total' => DocumentMoneyCast::class,
47
+        'discount_total' => DocumentMoneyCast::class,
48
+        'total' => DocumentMoneyCast::class,
50 49
     ];
51 50
 
52 51
     public function documentable(): MorphTo

+ 6
- 6
database/migrations/2024_11_13_220301_create_document_line_items_table.php Bestand weergeven

@@ -17,12 +17,12 @@ return new class extends Migration
17 17
             $table->morphs('documentable');
18 18
             $table->foreignId('offering_id')->nullable()->constrained()->nullOnDelete();
19 19
             $table->string('description')->nullable();
20
-            $table->integer('quantity')->default(1);
21
-            $table->integer('unit_price')->default(0);
22
-            $table->integer('subtotal')->storedAs('quantity * unit_price');
23
-            $table->integer('total')->storedAs('(quantity * unit_price) + tax_total - discount_total');
24
-            $table->integer('tax_total')->default(0);
25
-            $table->integer('discount_total')->default(0);
20
+            $table->decimal('quantity', 10, 2)->default(1);
21
+            $table->bigInteger('unit_price')->default(0);
22
+            $table->bigInteger('subtotal')->storedAs('quantity * unit_price');
23
+            $table->bigInteger('total')->storedAs('(quantity * unit_price) + tax_total - discount_total');
24
+            $table->bigInteger('tax_total')->default(0);
25
+            $table->bigInteger('discount_total')->default(0);
26 26
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
27 27
             $table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
28 28
             $table->timestamps();

+ 1
- 1
database/migrations/2024_11_14_230753_create_adjustments_table.php Bestand weergeven

@@ -20,7 +20,7 @@ return new class extends Migration
20 20
             $table->string('category')->default('tax');
21 21
             $table->string('type')->default('sales');
22 22
             $table->boolean('recoverable')->default(false);
23
-            $table->integer('rate')->default(0);
23
+            $table->bigInteger('rate')->default(0);
24 24
             $table->string('computation')->default('percentage');
25 25
             $table->string('scope')->nullable();
26 26
             $table->dateTime('start_date')->nullable();

+ 7
- 7
database/migrations/2024_11_27_221657_create_bills_table.php Bestand weergeven

@@ -24,13 +24,13 @@ return new class extends Migration
24 24
             $table->string('currency_code')->nullable();
25 25
             $table->string('discount_method')->default('per_line_item');
26 26
             $table->string('discount_computation')->default('percentage');
27
-            $table->integer('discount_rate')->default(0);
28
-            $table->integer('subtotal')->default(0);
29
-            $table->integer('tax_total')->default(0);
30
-            $table->integer('discount_total')->default(0);
31
-            $table->integer('total')->default(0);
32
-            $table->integer('amount_paid')->default(0);
33
-            $table->integer('amount_due')->storedAs('total - amount_paid');
27
+            $table->bigInteger('discount_rate')->default(0);
28
+            $table->bigInteger('subtotal')->default(0);
29
+            $table->bigInteger('tax_total')->default(0);
30
+            $table->bigInteger('discount_total')->default(0);
31
+            $table->bigInteger('total')->default(0);
32
+            $table->bigInteger('amount_paid')->default(0);
33
+            $table->bigInteger('amount_due')->storedAs('total - amount_paid');
34 34
             $table->text('notes')->nullable();
35 35
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
36 36
             $table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();

+ 5
- 5
database/migrations/2024_11_27_223000_create_estimates_table.php Bestand weergeven

@@ -32,11 +32,11 @@ return new class extends Migration
32 32
             $table->string('currency_code')->nullable();
33 33
             $table->string('discount_method')->default('per_line_item');
34 34
             $table->string('discount_computation')->default('percentage');
35
-            $table->integer('discount_rate')->default(0);
36
-            $table->integer('subtotal')->default(0);
37
-            $table->integer('tax_total')->default(0);
38
-            $table->integer('discount_total')->default(0);
39
-            $table->integer('total')->default(0);
35
+            $table->bigInteger('discount_rate')->default(0);
36
+            $table->bigInteger('subtotal')->default(0);
37
+            $table->bigInteger('tax_total')->default(0);
38
+            $table->bigInteger('discount_total')->default(0);
39
+            $table->bigInteger('total')->default(0);
40 40
             $table->text('terms')->nullable(); // terms, notes
41 41
             $table->text('footer')->nullable();
42 42
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();

+ 5
- 5
database/migrations/2024_11_27_223001_create_recurring_invoices_table.php Bestand weergeven

@@ -42,11 +42,11 @@ return new class extends Migration
42 42
             $table->string('currency_code')->nullable();
43 43
             $table->string('discount_method')->default('per_line_item');
44 44
             $table->string('discount_computation')->default('percentage');
45
-            $table->integer('discount_rate')->default(0);
46
-            $table->integer('subtotal')->default(0);
47
-            $table->integer('tax_total')->default(0);
48
-            $table->integer('discount_total')->default(0);
49
-            $table->integer('total')->default(0);
45
+            $table->bigInteger('discount_rate')->default(0);
46
+            $table->bigInteger('subtotal')->default(0);
47
+            $table->bigInteger('tax_total')->default(0);
48
+            $table->bigInteger('discount_total')->default(0);
49
+            $table->bigInteger('total')->default(0);
50 50
             $table->text('terms')->nullable(); // terms, notes
51 51
             $table->text('footer')->nullable();
52 52
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();

+ 7
- 7
database/migrations/2024_11_27_223015_create_invoices_table.php Bestand weergeven

@@ -32,13 +32,13 @@ return new class extends Migration
32 32
             $table->string('currency_code')->nullable();
33 33
             $table->string('discount_method')->default('per_line_item');
34 34
             $table->string('discount_computation')->default('percentage');
35
-            $table->integer('discount_rate')->default(0);
36
-            $table->integer('subtotal')->default(0);
37
-            $table->integer('tax_total')->default(0);
38
-            $table->integer('discount_total')->default(0);
39
-            $table->integer('total')->default(0);
40
-            $table->integer('amount_paid')->default(0);
41
-            $table->integer('amount_due')->storedAs('total - amount_paid');
35
+            $table->bigInteger('discount_rate')->default(0);
36
+            $table->bigInteger('subtotal')->default(0);
37
+            $table->bigInteger('tax_total')->default(0);
38
+            $table->bigInteger('discount_total')->default(0);
39
+            $table->bigInteger('total')->default(0);
40
+            $table->bigInteger('amount_paid')->default(0);
41
+            $table->bigInteger('amount_due')->storedAs('total - amount_paid');
42 42
             $table->text('terms')->nullable(); // terms, notes
43 43
             $table->text('footer')->nullable();
44 44
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();

+ 1
- 1
resources/views/components/company/document-template/footer.blade.php Bestand weergeven

@@ -1,3 +1,3 @@
1
-<footer {{ $attributes->class(['doc-template-footer text-xs text-gray-600 dark:text-gray-300 min-h-60']) }}>
1
+<footer {{ $attributes->class(['doc-template-footer min-h-60']) }}>
2 2
     {{ $slot }}
3 3
 </footer>

+ 1
- 1
resources/views/components/company/document-template/header.blade.php Bestand weergeven

@@ -1,3 +1,3 @@
1
-<header {{ $attributes->class(['doc-template-header flex py-2 relative']) }}>
1
+<header {{ $attributes->class(['doc-template-header flex p-6 relative']) }}>
2 2
     {{ $slot }}
3 3
 </header>

+ 1
- 1
resources/views/components/company/document-template/line-items.blade.php Bestand weergeven

@@ -1,3 +1,3 @@
1
-<div {{ $attributes->class(['doc-template-line-items py-6']) }}>
1
+<div {{ $attributes->class(['doc-template-line-items py-4']) }}>
2 2
     {{ $slot }}
3 3
 </div>

+ 14
- 12
resources/views/components/icons/document-header-decoration.blade.php Bestand weergeven

@@ -4,16 +4,18 @@
4 4
 ])
5 5
 
6 6
 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 72" aria-hidden="true" fill="none" {{ $attributes }}>
7
-   <g stroke="{{ $color }}" stroke-width="2">
8
-       <path d="M20 57.038v-42.076c.33.025.664.038 1 .038 7.18 0 13-5.82 13-13 0-.336-.013-.67-.038-1h172.076c-.025.33-.038.664-.038 1 0 7.18 5.82 13 13 13 .336 0 .67-.013 1-.038v42.076c-.33-.025-.664-.038-1-.038-7.18 0-13 5.82-13 13 0 .336.013.67.038 1h-172.076c.025-.33.038-.664.038-1 0-7.18-5.82-13-13-13-.336 0-.67.013-1 .038z" />
9
-       <path d="M26 51.503v-31.007c.33.024.664.037 1 .037 7.18 0 13-5.626 13-12.567 0-.325.013-.648-.038-.967h160.076c-.025.319-.038.641-.038.967 0 6.94 5.82 12.567 13 12.567.336 0 .67-.012 1-.037v31.007c-.33-.024-.664-.037-1-.037-7.18 0-13 5.626-13 12.567 0 .325.013.648.038.967h-160.076c.025-.319.038-.641.038-.967 0-6.94-5.82-12.567-13-12.567-.336 0-.67.012-1 .037z" />
10
-   </g>
11
-   <text
12
-       x="50%"
13
-       y="50%"
14
-       text-anchor="middle"
15
-       dominant-baseline="middle"
16
-       class="text-3xl font-light tracking-tight"
17
-       fill="{{ $color }}"
18
-   >{{ $text }}</text>
7
+    <g stroke="{{ $color }}" stroke-width="2">
8
+        <path
9
+            d="M20 57.038v-42.076c.33.025.664.038 1 .038 7.18 0 13-5.82 13-13 0-.336-.013-.67-.038-1h172.076c-.025.33-.038.664-.038 1 0 7.18 5.82 13 13 13 .336 0 .67-.013 1-.038v42.076c-.33-.025-.664-.038-1-.038-7.18 0-13 5.82-13 13 0 .336.013.67.038 1h-172.076c.025-.33.038-.664.038-1 0-7.18-5.82-13-13-13-.336 0-.67.013-1 .038z"/>
10
+        <path
11
+            d="M26 51.503v-31.007c.33.024.664.037 1 .037 7.18 0 13-5.626 13-12.567 0-.325.013-.648-.038-.967h160.076c-.025.319-.038.641-.038.967 0 6.94 5.82 12.567 13 12.567.336 0 .67-.012 1-.037v31.007c-.33-.024-.664-.037-1-.037-7.18 0-13 5.626-13 12.567 0 .325.013.648.038.967h-160.076c.025-.319.038-.641.038-.967 0-6.94-5.82-12.567-13-12.567-.336 0-.67.012-1 .037z"/>
12
+    </g>
13
+    <text
14
+        x="50%"
15
+        y="50%"
16
+        text-anchor="middle"
17
+        dominant-baseline="middle"
18
+        class="text-3xl font-light"
19
+        fill="{{ $color }}"
20
+    >{{ $text }}</text>
19 21
 </svg>

+ 39
- 36
resources/views/filament/infolists/components/document-templates/classic.blade.php Bestand weergeven

@@ -1,23 +1,23 @@
1 1
 <x-company.document-template.container class="classic-template-container">
2 2
     <!-- Header Section -->
3
-    <x-company.document-template.header class="default-template-header">
4
-        <div class="w-2/3 text-left ml-6">
5
-            <div class="text-sm tracking-tight">
6
-                <h2 class="text-lg font-semibold">{{ $document->company->name }}</h2>
3
+    <x-company.document-template.header class="classic-template-header">
4
+        <div class="w-2/3 text-left">
5
+            <div class="text-sm">
6
+                <strong class="text-sm block">{{ $document->company->name }}</strong>
7 7
                 @if($formattedAddress = $document->company->getFormattedAddressHtml())
8 8
                     {!! $formattedAddress !!}
9 9
                 @endif
10 10
             </div>
11 11
         </div>
12 12
 
13
-        <div class="w-1/3 flex justify-end mr-6">
13
+        <div class="w-1/3 flex justify-end">
14 14
             @if($document->logo && $document->showLogo)
15 15
                 <x-company.document-template.logo :src="$document->logo"/>
16 16
             @endif
17 17
         </div>
18 18
     </x-company.document-template.header>
19 19
 
20
-    <x-company.document-template.metadata class="classic-template-metadata space-y-8">
20
+    <x-company.document-template.metadata class="classic-template-metadata space-y-4">
21 21
         <div class="items-center flex">
22 22
             <hr class="grow-[2] py-0.5 border-solid border-y-2" style="border-color: {{ $document->accentColor }};">
23 23
             <x-icons.document-header-decoration
@@ -27,29 +27,33 @@
27 27
             />
28 28
             <hr class="grow-[2] py-0.5 border-solid border-y-2" style="border-color: {{ $document->accentColor }};">
29 29
         </div>
30
-        <div class="mt-2 text-base text-center text-gray-600 dark:text-gray-400">{{ $document->subheader }}</div>
30
+        @if ($document->subheader)
31
+            <p class="text-sm text-center text-gray-600 dark:text-gray-400">{{ $document->subheader }}</p>
32
+        @endif
31 33
 
32 34
         <div class="flex justify-between items-end">
33 35
             <!-- Billing Details -->
34
-            <div class="text-sm tracking-tight">
35
-                <h3 class="text-gray-600 dark:text-gray-400 font-medium tracking-tight mb-1">BILL TO</h3>
36
-                <p class="text-base font-bold">{{ $document->client->name }}</p>
36
+            <div class="text-sm">
37
+                <h3 class="text-gray-600 dark:text-gray-400 font-medium mb-1">BILL TO</h3>
38
+                <p class="text-sm font-bold">{{ $document->client->name }}</p>
37 39
                 @if($formattedAddress = $document->client->getFormattedAddressHtml())
38 40
                     {!! $formattedAddress !!}
39 41
                 @endif
40 42
             </div>
41 43
 
42
-            <div class="text-sm tracking-tight">
44
+            <div class="text-sm">
43 45
                 <table class="min-w-full">
44 46
                     <tbody>
45 47
                     <tr>
46 48
                         <td class="font-semibold text-right pr-2">{{ $document->label->number }}:</td>
47 49
                         <td class="text-left pl-2">{{ $document->number }}</td>
48 50
                     </tr>
49
-                    <tr>
50
-                        <td class="font-semibold text-right pr-2">{{ $document->label->referenceNumber }}:</td>
51
-                        <td class="text-left pl-2">{{ $document->referenceNumber }}</td>
52
-                    </tr>
51
+                    @if($document->referenceNumber)
52
+                        <tr>
53
+                            <td class="font-semibold text-right pr-2">{{ $document->label->referenceNumber }}:</td>
54
+                            <td class="text-left pl-2">{{ $document->referenceNumber }}</td>
55
+                        </tr>
56
+                    @endif
53 57
                     <tr>
54 58
                         <td class="font-semibold text-right pr-2">{{ $document->label->date }}:</td>
55 59
                         <td class="text-left pl-2">{{ $document->date }}</td>
@@ -65,20 +69,20 @@
65 69
     </x-company.document-template.metadata>
66 70
 
67 71
     <!-- Line Items -->
68
-    <x-company.document-template.line-items class="classic-template-line-items">
72
+    <x-company.document-template.line-items class="classic-template-line-items px-6">
69 73
         <table class="w-full text-left table-fixed">
70 74
             <thead class="text-sm leading-relaxed">
71 75
             <tr>
72
-                <th class="text-left pl-6 w-[50%] py-4">{{ $document->columnLabel->items }}</th>
76
+                <th class="text-left w-[50%] py-4">{{ $document->columnLabel->items }}</th>
73 77
                 <th class="text-center w-[10%] py-4">{{ $document->columnLabel->units }}</th>
74 78
                 <th class="text-right w-[20%] py-4">{{ $document->columnLabel->price }}</th>
75
-                <th class="text-right pr-6 w-[20%] py-4">{{ $document->columnLabel->amount }}</th>
79
+                <th class="text-right w-[20%] py-4">{{ $document->columnLabel->amount }}</th>
76 80
             </tr>
77 81
             </thead>
78
-            <tbody class="text-sm tracking-tight border-y-2 border-dotted border-gray-300">
82
+            <tbody class="text-sm border-y-2 border-dotted border-gray-300">
79 83
             @foreach($document->lineItems as $item)
80 84
                 <tr>
81
-                    <td class="text-left pl-6 font-semibold py-3">
85
+                    <td class="text-left font-semibold py-3">
82 86
                         {{ $item->name }}
83 87
                         @if($item->description)
84 88
                             <div class="text-gray-600 font-normal line-clamp-2 mt-1">{{ $item->description }}</div>
@@ -86,32 +90,31 @@
86 90
                     </td>
87 91
                     <td class="text-center py-3">{{ $item->quantity }}</td>
88 92
                     <td class="text-right py-3">{{ $item->unitPrice }}</td>
89
-                    <td class="text-right pr-6 py-3">{{ $item->subtotal }}</td>
93
+                    <td class="text-right py-3">{{ $item->subtotal }}</td>
90 94
                 </tr>
91 95
             @endforeach
92 96
             </tbody>
93 97
         </table>
94 98
 
95 99
         <!-- Financial Details and Notes -->
96
-        <div class="flex justify-between text-sm tracking-tight space-x-1">
100
+        <div class="flex justify-between text-sm space-x-1 pt-4">
97 101
             <!-- Notes Section -->
98
-            <div class="w-[60%] border border-dashed border-gray-300 p-2 mt-4">
99
-                <h4 class="font-semibold mb-2">Notes</h4>
100
-                <p>{{ $document->footer }}</p>
102
+            <div class="w-[60%] py-2">
103
+                <p class="font-semibold">{{ $document->footer }}</p>
101 104
             </div>
102 105
 
103 106
             <!-- Financial Summary -->
104
-            <div class="w-[40%] mt-2">
105
-                <table class="w-full table-fixed">
106
-                    <tbody class="text-sm tracking-tight">
107
+            <div class="w-[40%]">
108
+                <table class="w-full table-fixed whitespace-nowrap">
109
+                    <tbody class="text-sm">
107 110
                     <tr>
108 111
                         <td class="text-right font-semibold py-2">Subtotal:</td>
109
-                        <td class="text-right pr-6 py-2">{{ $document->subtotal }}</td>
112
+                        <td class="text-right py-2">{{ $document->subtotal }}</td>
110 113
                     </tr>
111 114
                     @if($document->discount)
112 115
                         <tr class="text-success-800 dark:text-success-600">
113 116
                             <td class="text-right py-2">Discount:</td>
114
-                            <td class="text-right pr-6 py-2">
117
+                            <td class="text-right py-2">
115 118
                                 ({{ $document->discount }})
116 119
                             </td>
117 120
                         </tr>
@@ -119,19 +122,19 @@
119 122
                     @if($document->tax)
120 123
                         <tr>
121 124
                             <td class="text-right py-2">Tax:</td>
122
-                            <td class="text-right pr-6 py-2">{{ $document->tax }}</td>
125
+                            <td class="text-right py-2">{{ $document->tax }}</td>
123 126
                         </tr>
124 127
                     @endif
125 128
                     <tr>
126 129
                         <td class="text-right font-semibold border-t py-2">Total:</td>
127
-                        <td class="text-right border-t pr-6 py-2">{{ $document->total }}</td>
130
+                        <td class="text-right border-t py-2">{{ $document->total }}</td>
128 131
                     </tr>
129 132
                     @if($document->amountDue)
130 133
                         <tr>
131 134
                             <td class="text-right font-semibold border-t-4 border-double py-2">{{ $document->label->amountDue }}
132 135
                                 ({{ $document->currencyCode }}):
133 136
                             </td>
134
-                            <td class="text-right border-t-4 border-double pr-6 py-2">{{ $document->amountDue }}</td>
137
+                            <td class="text-right border-t-4 border-double py-2">{{ $document->amountDue }}</td>
135 138
                         </tr>
136 139
                     @endif
137 140
                     </tbody>
@@ -141,8 +144,8 @@
141 144
     </x-company.document-template.line-items>
142 145
 
143 146
     <!-- Footer -->
144
-    <x-company.document-template.footer class="classic-template-footer tracking-tight min-h-48">
145
-        <h4 class="font-semibold px-6 mb-2 text-sm">Terms & Conditions</h4>
146
-        <p class="px-6 break-words line-clamp-4 text-sm">{{ $document->terms }}</p>
147
+    <x-company.document-template.footer class="classic-template-footer min-h-48 p-6 text-sm">
148
+        <h4 class="font-semibold mb-2">Terms & Conditions</h4>
149
+        <p class="break-words line-clamp-4">{{ $document->terms }}</p>
147 150
     </x-company.document-template.footer>
148 151
 </x-company.document-template.container>

+ 32
- 25
resources/views/filament/infolists/components/document-templates/default.blade.php Bestand weergeven

@@ -1,6 +1,6 @@
1 1
 <x-company.document-template.container class="default-template-container">
2 2
 
3
-    <x-company.document-template.header class="default-template-header border-b-2 p-6 pb-4">
3
+    <x-company.document-template.header class="default-template-header border-b">
4 4
         <div class="w-2/3">
5 5
             @if($document->logo && $document->showLogo)
6 6
                 <x-company.document-template.logo :src="$document->logo"/>
@@ -8,34 +8,35 @@
8 8
         </div>
9 9
 
10 10
         <div class="w-1/3 text-right">
11
-            <div class="text-sm tracking-tight">
12
-                <h2 class="text-lg font-semibold">{{ $document->company->name }}</h2>
13
-                @if($formattedAddress = $document->company->getFormattedAddressHtml())
14
-                    {!! $formattedAddress !!}
15
-                @endif
11
+            <div class="space-y-4">
12
+                <div>
13
+                    <h1 class="text-3xl font-light uppercase">{{ $document->header }}</h1>
14
+                    @if ($document->subheader)
15
+                        <p class="text-sm text-gray-600 dark:text-gray-400">{{ $document->subheader }}</p>
16
+                    @endif
17
+                </div>
18
+                <div class="text-sm">
19
+                    <strong class="text-sm block">{{ $document->company->name }}</strong>
20
+                    @if($formattedAddress = $document->company->getFormattedAddressHtml())
21
+                        {!! $formattedAddress !!}
22
+                    @endif
23
+                </div>
16 24
             </div>
17 25
         </div>
18 26
     </x-company.document-template.header>
19 27
 
20
-    <x-company.document-template.metadata class="default-template-metadata space-y-8">
21
-        <div>
22
-            <h1 class="text-4xl font-light uppercase">{{ $document->header }}</h1>
23
-            @if ($document->subheader)
24
-                <h2 class="text-base text-gray-600 dark:text-gray-400">{{ $document->subheader }}</h2>
25
-            @endif
26
-        </div>
27
-
28
+    <x-company.document-template.metadata class="default-template-metadata space-y-4">
28 29
         <div class="flex justify-between items-end">
29 30
             <!-- Billing Details -->
30
-            <div class="text-sm tracking-tight">
31
-                <h3 class="text-gray-600 dark:text-gray-400 font-medium tracking-tight mb-1">BILL TO</h3>
32
-                <p class="text-base font-bold">{{ $document->client->name }}</p>
31
+            <div class="text-sm">
32
+                <h3 class="text-gray-600 dark:text-gray-400 font-medium mb-1">BILL TO</h3>
33
+                <p class="text-sm font-bold">{{ $document->client->name }}</p>
33 34
                 @if($formattedAddress = $document->client->getFormattedAddressHtml())
34 35
                     {!! $formattedAddress !!}
35 36
                 @endif
36 37
             </div>
37 38
 
38
-            <div class="text-sm tracking-tight">
39
+            <div class="text-sm">
39 40
                 <table class="min-w-full">
40 41
                     <tbody>
41 42
                     <tr>
@@ -73,7 +74,7 @@
73 74
                 <th class="text-right pr-6 w-[20%] py-2">{{ $document->columnLabel->amount }}</th>
74 75
             </tr>
75 76
             </thead>
76
-            <tbody class="text-sm tracking-tight border-b-2 border-gray-300">
77
+            <tbody class="text-sm border-b-2 border-gray-300">
77 78
             @foreach($document->lineItems as $item)
78 79
                 <tr>
79 80
                     <td class="text-left pl-6 font-semibold py-3">
@@ -88,7 +89,7 @@
88 89
                 </tr>
89 90
             @endforeach
90 91
             </tbody>
91
-            <tfoot class="text-sm tracking-tight summary-section">
92
+            <tfoot class="text-sm summary-section">
92 93
             <tr>
93 94
                 <td class="pl-6 py-2" colspan="2"></td>
94 95
                 <td class="text-right font-semibold py-2">Subtotal:</td>
@@ -129,10 +130,16 @@
129 130
     </x-company.document-template.line-items>
130 131
 
131 132
     <!-- Footer Notes -->
132
-    <x-company.document-template.footer class="default-template-footer tracking-tight">
133
-        <p class="px-6 text-sm">{{ $document->footer }}</p>
134
-        <span class="border-t-2 my-2 border-gray-300 block w-full"></span>
135
-        <h4 class="font-semibold px-6 mb-2 text-sm">Terms & Conditions</h4>
136
-        <p class="px-6 break-words line-clamp-4 text-sm">{{ $document->terms }}</p>
133
+    <x-company.document-template.footer class="classic-template-footer min-h-48 flex flex-col text-sm p-6">
134
+        <div>
135
+            <h4 class="font-semibold mb-2">Terms & Conditions</h4>
136
+            <p class="break-words line-clamp-4">{{ $document->terms }}</p>
137
+        </div>
138
+
139
+        @if($document->footer)
140
+            <div class="mt-auto text-center py-4">
141
+                <p class="font-semibold">{{ $document->footer }}</p>
142
+            </div>
143
+        @endif
137 144
     </x-company.document-template.footer>
138 145
 </x-company.document-template.container>

+ 7
- 7
resources/views/filament/infolists/components/document-templates/modern.blade.php Bestand weergeven

@@ -28,9 +28,9 @@
28 28
 
29 29
         <div class="flex justify-between items-end">
30 30
             <!-- Billing Details -->
31
-            <div class="text-sm tracking-tight">
32
-                <h3 class="text-gray-600 dark:text-gray-400 font-medium tracking-tight mb-1">BILL TO</h3>
33
-                <p class="text-base font-bold"
31
+            <div class="text-sm">
32
+                <h3 class="text-gray-600 dark:text-gray-400 font-medium mb-1">BILL TO</h3>
33
+                <p class="text-sm font-bold"
34 34
                    style="color: {{ $document->accentColor }}">{{ $document->client->name }}</p>
35 35
 
36 36
                 @if($formattedAddress = $document->client->getFormattedAddressHtml())
@@ -38,7 +38,7 @@
38 38
                 @endif
39 39
             </div>
40 40
 
41
-            <div class="text-sm tracking-tight">
41
+            <div class="text-sm">
42 42
                 <table class="min-w-full">
43 43
                     <tbody>
44 44
                     <tr>
@@ -76,7 +76,7 @@
76 76
                 <th class="text-right pr-6 w-[20%] py-4">{{ $document->columnLabel->amount }}</th>
77 77
             </tr>
78 78
             </thead>
79
-            <tbody class="text-sm tracking-tight border-y-2">
79
+            <tbody class="text-sm border-y-2">
80 80
             @foreach($document->lineItems as $index => $item)
81 81
                 <tr @class(['bg-gray-100 dark:bg-gray-800' => $index % 2 === 0])>
82 82
                     <td class="text-left pl-6 font-semibold py-3">
@@ -91,7 +91,7 @@
91 91
                 </tr>
92 92
             @endforeach
93 93
             </tbody>
94
-            <tfoot class="text-sm tracking-tight summary-section">
94
+            <tfoot class="text-sm summary-section">
95 95
             <tr>
96 96
                 <td class="pl-6 py-2" colspan="2"></td>
97 97
                 <td class="text-right font-semibold py-2">Subtotal:</td>
@@ -132,7 +132,7 @@
132 132
     </x-company.document-template.line-items>
133 133
 
134 134
     <!-- Footer Notes -->
135
-    <x-company.document-template.footer class="modern-template-footer tracking-tight">
135
+    <x-company.document-template.footer class="modern-template-footer">
136 136
         <h4 class="font-semibold px-6 text-sm" style="color: {{ $document->accentColor }}">
137 137
             Terms & Conditions
138 138
         </h4>

Laden…
Annuleren
Opslaan