Andrew Wallo 7 månader sedan
förälder
incheckning
62d69c7dc2

+ 4
- 5
app/Models/Accounting/DocumentLineItem.php Visa fil

4
 
4
 
5
 use Akaunting\Money\Money;
5
 use Akaunting\Money\Money;
6
 use App\Casts\DocumentMoneyCast;
6
 use App\Casts\DocumentMoneyCast;
7
-use App\Casts\MoneyCast;
8
 use App\Concerns\Blamable;
7
 use App\Concerns\Blamable;
9
 use App\Concerns\CompanyOwned;
8
 use App\Concerns\CompanyOwned;
10
 use App\Enums\Accounting\AdjustmentCategory;
9
 use App\Enums\Accounting\AdjustmentCategory;
42
     ];
41
     ];
43
 
42
 
44
     protected $casts = [
43
     protected $casts = [
45
-        'unit_price' => MoneyCast::class,
44
+        'unit_price' => DocumentMoneyCast::class,
46
         'subtotal' => DocumentMoneyCast::class,
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
     public function documentable(): MorphTo
51
     public function documentable(): MorphTo

+ 6
- 6
database/migrations/2024_11_13_220301_create_document_line_items_table.php Visa fil

17
             $table->morphs('documentable');
17
             $table->morphs('documentable');
18
             $table->foreignId('offering_id')->nullable()->constrained()->nullOnDelete();
18
             $table->foreignId('offering_id')->nullable()->constrained()->nullOnDelete();
19
             $table->string('description')->nullable();
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
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
26
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
27
             $table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
27
             $table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
28
             $table->timestamps();
28
             $table->timestamps();

+ 1
- 1
database/migrations/2024_11_14_230753_create_adjustments_table.php Visa fil

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

+ 7
- 7
database/migrations/2024_11_27_221657_create_bills_table.php Visa fil

24
             $table->string('currency_code')->nullable();
24
             $table->string('currency_code')->nullable();
25
             $table->string('discount_method')->default('per_line_item');
25
             $table->string('discount_method')->default('per_line_item');
26
             $table->string('discount_computation')->default('percentage');
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
             $table->text('notes')->nullable();
34
             $table->text('notes')->nullable();
35
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
35
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
36
             $table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
36
             $table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();

+ 5
- 5
database/migrations/2024_11_27_223000_create_estimates_table.php Visa fil

32
             $table->string('currency_code')->nullable();
32
             $table->string('currency_code')->nullable();
33
             $table->string('discount_method')->default('per_line_item');
33
             $table->string('discount_method')->default('per_line_item');
34
             $table->string('discount_computation')->default('percentage');
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
             $table->text('terms')->nullable(); // terms, notes
40
             $table->text('terms')->nullable(); // terms, notes
41
             $table->text('footer')->nullable();
41
             $table->text('footer')->nullable();
42
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
42
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();

+ 5
- 5
database/migrations/2024_11_27_223001_create_recurring_invoices_table.php Visa fil

42
             $table->string('currency_code')->nullable();
42
             $table->string('currency_code')->nullable();
43
             $table->string('discount_method')->default('per_line_item');
43
             $table->string('discount_method')->default('per_line_item');
44
             $table->string('discount_computation')->default('percentage');
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
             $table->text('terms')->nullable(); // terms, notes
50
             $table->text('terms')->nullable(); // terms, notes
51
             $table->text('footer')->nullable();
51
             $table->text('footer')->nullable();
52
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
52
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();

+ 7
- 7
database/migrations/2024_11_27_223015_create_invoices_table.php Visa fil

32
             $table->string('currency_code')->nullable();
32
             $table->string('currency_code')->nullable();
33
             $table->string('discount_method')->default('per_line_item');
33
             $table->string('discount_method')->default('per_line_item');
34
             $table->string('discount_computation')->default('percentage');
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
             $table->text('terms')->nullable(); // terms, notes
42
             $table->text('terms')->nullable(); // terms, notes
43
             $table->text('footer')->nullable();
43
             $table->text('footer')->nullable();
44
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
44
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();

+ 1
- 1
resources/views/components/company/document-template/footer.blade.php Visa fil

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
     {{ $slot }}
2
     {{ $slot }}
3
 </footer>
3
 </footer>

+ 1
- 1
resources/views/components/company/document-template/header.blade.php Visa fil

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

+ 1
- 1
resources/views/components/company/document-template/line-items.blade.php Visa fil

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

+ 14
- 12
resources/views/components/icons/document-header-decoration.blade.php Visa fil

4
 ])
4
 ])
5
 
5
 
6
 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 72" aria-hidden="true" fill="none" {{ $attributes }}>
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
 </svg>
21
 </svg>

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

1
 <x-company.document-template.container class="classic-template-container">
1
 <x-company.document-template.container class="classic-template-container">
2
     <!-- Header Section -->
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
                 @if($formattedAddress = $document->company->getFormattedAddressHtml())
7
                 @if($formattedAddress = $document->company->getFormattedAddressHtml())
8
                     {!! $formattedAddress !!}
8
                     {!! $formattedAddress !!}
9
                 @endif
9
                 @endif
10
             </div>
10
             </div>
11
         </div>
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
             @if($document->logo && $document->showLogo)
14
             @if($document->logo && $document->showLogo)
15
                 <x-company.document-template.logo :src="$document->logo"/>
15
                 <x-company.document-template.logo :src="$document->logo"/>
16
             @endif
16
             @endif
17
         </div>
17
         </div>
18
     </x-company.document-template.header>
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
         <div class="items-center flex">
21
         <div class="items-center flex">
22
             <hr class="grow-[2] py-0.5 border-solid border-y-2" style="border-color: {{ $document->accentColor }};">
22
             <hr class="grow-[2] py-0.5 border-solid border-y-2" style="border-color: {{ $document->accentColor }};">
23
             <x-icons.document-header-decoration
23
             <x-icons.document-header-decoration
27
             />
27
             />
28
             <hr class="grow-[2] py-0.5 border-solid border-y-2" style="border-color: {{ $document->accentColor }};">
28
             <hr class="grow-[2] py-0.5 border-solid border-y-2" style="border-color: {{ $document->accentColor }};">
29
         </div>
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
         <div class="flex justify-between items-end">
34
         <div class="flex justify-between items-end">
33
             <!-- Billing Details -->
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
                 @if($formattedAddress = $document->client->getFormattedAddressHtml())
39
                 @if($formattedAddress = $document->client->getFormattedAddressHtml())
38
                     {!! $formattedAddress !!}
40
                     {!! $formattedAddress !!}
39
                 @endif
41
                 @endif
40
             </div>
42
             </div>
41
 
43
 
42
-            <div class="text-sm tracking-tight">
44
+            <div class="text-sm">
43
                 <table class="min-w-full">
45
                 <table class="min-w-full">
44
                     <tbody>
46
                     <tbody>
45
                     <tr>
47
                     <tr>
46
                         <td class="font-semibold text-right pr-2">{{ $document->label->number }}:</td>
48
                         <td class="font-semibold text-right pr-2">{{ $document->label->number }}:</td>
47
                         <td class="text-left pl-2">{{ $document->number }}</td>
49
                         <td class="text-left pl-2">{{ $document->number }}</td>
48
                     </tr>
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
                     <tr>
57
                     <tr>
54
                         <td class="font-semibold text-right pr-2">{{ $document->label->date }}:</td>
58
                         <td class="font-semibold text-right pr-2">{{ $document->label->date }}:</td>
55
                         <td class="text-left pl-2">{{ $document->date }}</td>
59
                         <td class="text-left pl-2">{{ $document->date }}</td>
65
     </x-company.document-template.metadata>
69
     </x-company.document-template.metadata>
66
 
70
 
67
     <!-- Line Items -->
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
         <table class="w-full text-left table-fixed">
73
         <table class="w-full text-left table-fixed">
70
             <thead class="text-sm leading-relaxed">
74
             <thead class="text-sm leading-relaxed">
71
             <tr>
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
                 <th class="text-center w-[10%] py-4">{{ $document->columnLabel->units }}</th>
77
                 <th class="text-center w-[10%] py-4">{{ $document->columnLabel->units }}</th>
74
                 <th class="text-right w-[20%] py-4">{{ $document->columnLabel->price }}</th>
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
             </tr>
80
             </tr>
77
             </thead>
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
             @foreach($document->lineItems as $item)
83
             @foreach($document->lineItems as $item)
80
                 <tr>
84
                 <tr>
81
-                    <td class="text-left pl-6 font-semibold py-3">
85
+                    <td class="text-left font-semibold py-3">
82
                         {{ $item->name }}
86
                         {{ $item->name }}
83
                         @if($item->description)
87
                         @if($item->description)
84
                             <div class="text-gray-600 font-normal line-clamp-2 mt-1">{{ $item->description }}</div>
88
                             <div class="text-gray-600 font-normal line-clamp-2 mt-1">{{ $item->description }}</div>
86
                     </td>
90
                     </td>
87
                     <td class="text-center py-3">{{ $item->quantity }}</td>
91
                     <td class="text-center py-3">{{ $item->quantity }}</td>
88
                     <td class="text-right py-3">{{ $item->unitPrice }}</td>
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
                 </tr>
94
                 </tr>
91
             @endforeach
95
             @endforeach
92
             </tbody>
96
             </tbody>
93
         </table>
97
         </table>
94
 
98
 
95
         <!-- Financial Details and Notes -->
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
             <!-- Notes Section -->
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
             </div>
104
             </div>
102
 
105
 
103
             <!-- Financial Summary -->
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
                     <tr>
110
                     <tr>
108
                         <td class="text-right font-semibold py-2">Subtotal:</td>
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
                     </tr>
113
                     </tr>
111
                     @if($document->discount)
114
                     @if($document->discount)
112
                         <tr class="text-success-800 dark:text-success-600">
115
                         <tr class="text-success-800 dark:text-success-600">
113
                             <td class="text-right py-2">Discount:</td>
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
                                 ({{ $document->discount }})
118
                                 ({{ $document->discount }})
116
                             </td>
119
                             </td>
117
                         </tr>
120
                         </tr>
119
                     @if($document->tax)
122
                     @if($document->tax)
120
                         <tr>
123
                         <tr>
121
                             <td class="text-right py-2">Tax:</td>
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
                         </tr>
126
                         </tr>
124
                     @endif
127
                     @endif
125
                     <tr>
128
                     <tr>
126
                         <td class="text-right font-semibold border-t py-2">Total:</td>
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
                     </tr>
131
                     </tr>
129
                     @if($document->amountDue)
132
                     @if($document->amountDue)
130
                         <tr>
133
                         <tr>
131
                             <td class="text-right font-semibold border-t-4 border-double py-2">{{ $document->label->amountDue }}
134
                             <td class="text-right font-semibold border-t-4 border-double py-2">{{ $document->label->amountDue }}
132
                                 ({{ $document->currencyCode }}):
135
                                 ({{ $document->currencyCode }}):
133
                             </td>
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
                         </tr>
138
                         </tr>
136
                     @endif
139
                     @endif
137
                     </tbody>
140
                     </tbody>
141
     </x-company.document-template.line-items>
144
     </x-company.document-template.line-items>
142
 
145
 
143
     <!-- Footer -->
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
     </x-company.document-template.footer>
150
     </x-company.document-template.footer>
148
 </x-company.document-template.container>
151
 </x-company.document-template.container>

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

1
 <x-company.document-template.container class="default-template-container">
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
         <div class="w-2/3">
4
         <div class="w-2/3">
5
             @if($document->logo && $document->showLogo)
5
             @if($document->logo && $document->showLogo)
6
                 <x-company.document-template.logo :src="$document->logo"/>
6
                 <x-company.document-template.logo :src="$document->logo"/>
8
         </div>
8
         </div>
9
 
9
 
10
         <div class="w-1/3 text-right">
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
             </div>
24
             </div>
17
         </div>
25
         </div>
18
     </x-company.document-template.header>
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
         <div class="flex justify-between items-end">
29
         <div class="flex justify-between items-end">
29
             <!-- Billing Details -->
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
                 @if($formattedAddress = $document->client->getFormattedAddressHtml())
34
                 @if($formattedAddress = $document->client->getFormattedAddressHtml())
34
                     {!! $formattedAddress !!}
35
                     {!! $formattedAddress !!}
35
                 @endif
36
                 @endif
36
             </div>
37
             </div>
37
 
38
 
38
-            <div class="text-sm tracking-tight">
39
+            <div class="text-sm">
39
                 <table class="min-w-full">
40
                 <table class="min-w-full">
40
                     <tbody>
41
                     <tbody>
41
                     <tr>
42
                     <tr>
73
                 <th class="text-right pr-6 w-[20%] py-2">{{ $document->columnLabel->amount }}</th>
74
                 <th class="text-right pr-6 w-[20%] py-2">{{ $document->columnLabel->amount }}</th>
74
             </tr>
75
             </tr>
75
             </thead>
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
             @foreach($document->lineItems as $item)
78
             @foreach($document->lineItems as $item)
78
                 <tr>
79
                 <tr>
79
                     <td class="text-left pl-6 font-semibold py-3">
80
                     <td class="text-left pl-6 font-semibold py-3">
88
                 </tr>
89
                 </tr>
89
             @endforeach
90
             @endforeach
90
             </tbody>
91
             </tbody>
91
-            <tfoot class="text-sm tracking-tight summary-section">
92
+            <tfoot class="text-sm summary-section">
92
             <tr>
93
             <tr>
93
                 <td class="pl-6 py-2" colspan="2"></td>
94
                 <td class="pl-6 py-2" colspan="2"></td>
94
                 <td class="text-right font-semibold py-2">Subtotal:</td>
95
                 <td class="text-right font-semibold py-2">Subtotal:</td>
129
     </x-company.document-template.line-items>
130
     </x-company.document-template.line-items>
130
 
131
 
131
     <!-- Footer Notes -->
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
     </x-company.document-template.footer>
144
     </x-company.document-template.footer>
138
 </x-company.document-template.container>
145
 </x-company.document-template.container>

+ 7
- 7
resources/views/filament/infolists/components/document-templates/modern.blade.php Visa fil

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

Laddar…
Avbryt
Spara