Andrew Wallo 5 月之前
父節點
當前提交
ac7bfde0de

+ 1
- 1
resources/views/components/company/document-template/container.blade.php 查看文件

@@ -7,7 +7,7 @@
7 7
         @class([
8 8
             'doc-template-paper bg-[#ffffff] shadow-xl ring-1 ring-gray-950/5 dark:ring-white/10',
9 9
             'w-full max-w-[820px] min-h-[1066px] max-h-[1200px] overflow-y-auto' => $preview === false,
10
-            'w-[38.25rem] h-[49.5rem] overflow-hidden' => $preview === true,
10
+            'aspect-[1/1.3] overflow-hidden' => $preview === true,
11 11
         ])
12 12
         @style([
13 13
             'scrollbar-width: thin;' => $preview === false,

+ 33
- 24
resources/views/filament/company/components/document-templates/classic.blade.php 查看文件

@@ -13,7 +13,7 @@
13 13
 
14 14
 <x-company.document-template.container class="classic-template-container" preview>
15 15
     <!-- Header Section -->
16
-    <x-company.document-template.header class="default-template-header">
16
+    <x-company.document-template.header class="classic-template-header">
17 17
         <div class="w-2/3 text-left">
18 18
             <div class="text-xs">
19 19
                 <strong class="text-xs block">{{ $document->company->name }}</strong>
@@ -30,7 +30,7 @@
30 30
         </div>
31 31
     </x-company.document-template.header>
32 32
 
33
-    <x-company.document-template.metadata class="classic-template-metadata space-y-2">
33
+    <x-company.document-template.metadata class="classic-template-metadata space-y-4">
34 34
         <div class="items-center flex">
35 35
             <hr class="grow-[2] py-0.5 border-solid border-y-2" style="border-color: {{ $document->accentColor }};">
36 36
             <x-icons.document-header-decoration
@@ -61,10 +61,12 @@
61 61
                         <td class="font-semibold text-right pr-2">{{ $document->label->number }}:</td>
62 62
                         <td class="text-left pl-2">{{ $document->number }}</td>
63 63
                     </tr>
64
-                    <tr>
65
-                        <td class="font-semibold text-right pr-2">{{ $document->label->referenceNumber }}:</td>
66
-                        <td class="text-left pl-2">{{ $document->referenceNumber }}</td>
67
-                    </tr>
64
+                    @if($document->referenceNumber)
65
+                        <tr>
66
+                            <td class="font-semibold text-right pr-2">{{ $document->label->referenceNumber }}:</td>
67
+                            <td class="text-left pl-2">{{ $document->referenceNumber }}</td>
68
+                        </tr>
69
+                    @endif
68 70
                     <tr>
69 71
                         <td class="font-semibold text-right pr-2">{{ $document->label->date }}:</td>
70 72
                         <td class="text-left pl-2">{{ $document->date }}</td>
@@ -82,28 +84,33 @@
82 84
     <!-- Line Items -->
83 85
     <x-company.document-template.line-items class="classic-template-line-items px-6">
84 86
         <table class="w-full text-left table-fixed">
85
-            <thead class="text-xs leading-8">
87
+            <thead class="text-xs leading-relaxed">
86 88
             <tr>
87
-                <th class="text-left">{{ $document->columnLabel->items }}</th>
88
-                <th class="text-center">{{ $document->columnLabel->units }}</th>
89
-                <th class="text-right">{{ $document->columnLabel->price }}</th>
90
-                <th class="text-right">{{ $document->columnLabel->amount }}</th>
89
+                <th class="text-left w-[50%] py-4">{{ $document->columnLabel->items }}</th>
90
+                <th class="text-center w-[10%] py-4">{{ $document->columnLabel->units }}</th>
91
+                <th class="text-right w-[20%] py-4">{{ $document->columnLabel->price }}</th>
92
+                <th class="text-right w-[20%] py-4">{{ $document->columnLabel->amount }}</th>
91 93
             </tr>
92 94
             </thead>
93
-            <tbody class="text-xs border-t-2 border-b-2 border-dotted border-gray-300 leading-8">
95
+            <tbody class="text-xs border-y-2 border-dotted border-gray-300">
94 96
             @foreach($document->lineItems as $item)
95 97
                 <tr>
96
-                    <td class="text-left font-semibold">{{ $item->name }}</td>
97
-                    <td class="text-center">{{ $item->quantity }}</td>
98
-                    <td class="text-right">{{ $item->unitPrice }}</td>
99
-                    <td class="text-right">{{ $item->subtotal }}</td>
98
+                    <td class="text-left font-semibold py-3">
99
+                        {{ $item->name }}
100
+                        @if($item->description)
101
+                            <div class="text-gray-600 font-normal line-clamp-2 mt-1">{{ $item->description }}</div>
102
+                        @endif
103
+                    </td>
104
+                    <td class="text-center py-3">{{ $item->quantity }}</td>
105
+                    <td class="text-right py-3">{{ $item->unitPrice }}</td>
106
+                    <td class="text-right py-3">{{ $item->subtotal }}</td>
100 107
                 </tr>
101 108
             @endforeach
102 109
             </tbody>
103 110
         </table>
104 111
 
105 112
         <!-- Financial Details and Notes -->
106
-        <div class="flex justify-between text-xs space-x-1 pt-2">
113
+        <div class="flex justify-between text-xs space-x-1 pt-4">
107 114
             <!-- Notes Section -->
108 115
             <div class="w-[60%] py-2">
109 116
                 <p class="font-semibold">{{ $document->footer }}</p>
@@ -113,10 +120,12 @@
113 120
             <div class="w-[40%]">
114 121
                 <table class="w-full table-fixed whitespace-nowrap">
115 122
                     <tbody class="text-xs">
116
-                    <tr>
117
-                        <td class="text-right font-semibold py-2">Subtotal:</td>
118
-                        <td class="text-right py-2">{{ $document->subtotal }}</td>
119
-                    </tr>
123
+                    @if($document->subtotal)
124
+                        <tr>
125
+                            <td class="text-right font-semibold py-2">Subtotal:</td>
126
+                            <td class="text-right py-2">{{ $document->subtotal }}</td>
127
+                        </tr>
128
+                    @endif
120 129
                     @if($document->discount)
121 130
                         <tr class="text-success-800">
122 131
                             <td class="text-right py-2">Discount:</td>
@@ -150,8 +159,8 @@
150 159
     </x-company.document-template.line-items>
151 160
 
152 161
     <!-- Footer -->
153
-    <x-company.document-template.footer class="classic-template-footer text-xs">
154
-        <h4 class="font-semibold px-6 mb-2">Terms & Conditions</h4>
155
-        <p class="px-6 break-words line-clamp-4">{{ $document->terms }}</p>
162
+    <x-company.document-template.footer class="classic-template-footer p-6 text-xs">
163
+        <h4 class="font-semibold mb-2">Terms & Conditions</h4>
164
+        <p class="break-words line-clamp-4">{{ $document->terms }}</p>
156 165
     </x-company.document-template.footer>
157 166
 </x-company.document-template.container>

+ 59
- 42
resources/views/filament/company/components/document-templates/default.blade.php 查看文件

@@ -38,7 +38,7 @@
38 38
         </div>
39 39
     </x-company.document-template.header>
40 40
 
41
-    <x-company.document-template.metadata class="default-template-metadata space-y-2">
41
+    <x-company.document-template.metadata class="default-template-metadata space-y-4">
42 42
         <div class="flex justify-between items-end">
43 43
             <!-- Billing Details -->
44 44
             <div class="text-xs">
@@ -56,10 +56,12 @@
56 56
                         <td class="font-semibold text-right pr-2">{{ $document->label->number }}:</td>
57 57
                         <td class="text-left pl-2">{{ $document->number }}</td>
58 58
                     </tr>
59
-                    <tr>
60
-                        <td class="font-semibold text-right pr-2">{{ $document->label->referenceNumber }}:</td>
61
-                        <td class="text-left pl-2">{{ $document->referenceNumber }}</td>
62
-                    </tr>
59
+                    @if($document->referenceNumber)
60
+                        <tr>
61
+                            <td class="font-semibold text-right pr-2">{{ $document->label->referenceNumber }}:</td>
62
+                            <td class="text-left pl-2">{{ $document->referenceNumber }}</td>
63
+                        </tr>
64
+                    @endif
63 65
                     <tr>
64 66
                         <td class="font-semibold text-right pr-2">{{ $document->label->date }}:</td>
65 67
                         <td class="text-left pl-2">{{ $document->date }}</td>
@@ -77,58 +79,73 @@
77 79
     <!-- Line Items Table -->
78 80
     <x-company.document-template.line-items class="default-template-line-items">
79 81
         <table class="w-full text-left table-fixed">
80
-            <thead class="text-xs leading-8" style="background: {{ $document->accentColor }}">
82
+            <thead class="text-xs leading-relaxed" style="background: {{ $document->accentColor }}">
81 83
             <tr class="text-white">
82
-                <th class="text-left pl-6">{{ $document->columnLabel->items }}</th>
83
-                <th class="text-center">{{ $document->columnLabel->units }}</th>
84
-                <th class="text-right">{{ $document->columnLabel->price }}</th>
85
-                <th class="text-right pr-6">{{ $document->columnLabel->amount }}</th>
84
+                <th class="text-left pl-6 w-[50%] py-2">{{ $document->columnLabel->items }}</th>
85
+                <th class="text-center w-[10%] py-2">{{ $document->columnLabel->units }}</th>
86
+                <th class="text-right w-[20%] py-2">{{ $document->columnLabel->price }}</th>
87
+                <th class="text-right pr-6 w-[20%] py-2">{{ $document->columnLabel->amount }}</th>
86 88
             </tr>
87 89
             </thead>
88
-            <tbody class="text-xs border-b-2 border-gray-300 leading-8">
90
+            <tbody class="text-xs border-b-2 border-gray-300">
89 91
             @foreach($document->lineItems as $item)
90 92
                 <tr>
91
-                    <td class="text-left pl-6 font-semibold">{{ $item->name }}</td>
92
-                    <td class="text-center">{{ $item->quantity }}</td>
93
-                    <td class="text-right">{{ $item->unitPrice }}</td>
94
-                    <td class="text-right pr-6">{{ $item->subtotal }}</td>
93
+                    <td class="text-left pl-6 font-semibold py-3">
94
+                        {{ $item->name }}
95
+                        @if($item->description)
96
+                            <div class="text-gray-600 font-normal line-clamp-2 mt-1">{{ $item->description }}</div>
97
+                        @endif
98
+                    </td>
99
+                    <td class="text-center py-3">{{ $item->quantity }}</td>
100
+                    <td class="text-right py-3">{{ $item->unitPrice }}</td>
101
+                    <td class="text-right pr-6 py-3">{{ $item->subtotal }}</td>
95 102
                 </tr>
96 103
             @endforeach
97 104
             </tbody>
98
-            <tfoot class="text-xs leading-loose">
99
-            <tr>
100
-                <td class="pl-6" colspan="2"></td>
101
-                <td class="text-right font-semibold">Subtotal:</td>
102
-                <td class="text-right pr-6">{{ $document->subtotal }}</td>
103
-            </tr>
104
-            <tr class="text-success-800">
105
-                <td class="pl-6" colspan="2"></td>
106
-                <td class="text-right">Discount (5%):</td>
107
-                <td class="text-right pr-6">({{ $document->discount }})</td>
108
-            </tr>
109
-            <tr>
110
-                <td class="pl-6" colspan="2"></td>
111
-                <td class="text-right">Tax:</td>
112
-                <td class="text-right pr-6">{{ $document->tax }}</td>
113
-            </tr>
114
-            <tr>
115
-                <td class="pl-6" colspan="2"></td>
116
-                <td class="text-right font-semibold border-t">Total:</td>
117
-                <td class="text-right border-t pr-6">{{ $document->total }}</td>
118
-            </tr>
105
+            <tfoot class="text-xs summary-section">
106
+            @if($document->subtotal)
107
+                <tr>
108
+                    <td class="pl-6 py-2" colspan="2"></td>
109
+                    <td class="text-right font-semibold py-2">Subtotal:</td>
110
+                    <td class="text-right pr-6 py-2">{{ $document->subtotal }}</td>
111
+                </tr>
112
+            @endif
113
+            @if($document->discount)
114
+                <tr class="text-success-800">
115
+                    <td class="pl-6 py-2" colspan="2"></td>
116
+                    <td class="text-right py-2">Discount:</td>
117
+                    <td class="text-right pr-6 py-2">
118
+                        ({{ $document->discount }})
119
+                    </td>
120
+                </tr>
121
+            @endif
122
+            @if($document->tax)
123
+                <tr>
124
+                    <td class="pl-6 py-2" colspan="2"></td>
125
+                    <td class="text-right py-2">Tax:</td>
126
+                    <td class="text-right pr-6 py-2">{{ $document->tax }}</td>
127
+                </tr>
128
+            @endif
119 129
             <tr>
120
-                <td class="pl-6" colspan="2"></td>
121
-                <td class="text-right font-semibold border-t-4 border-double">{{ $document->label->amountDue }}
122
-                    ({{ $document->currencyCode }}):
123
-                </td>
124
-                <td class="text-right border-t-4 border-double pr-6">{{ $document->amountDue }}</td>
130
+                <td class="pl-6 py-2" colspan="2"></td>
131
+                <td class="text-right font-semibold border-t py-2">Total:</td>
132
+                <td class="text-right border-t pr-6 py-2">{{ $document->total }}</td>
125 133
             </tr>
134
+            @if($document->amountDue)
135
+                <tr>
136
+                    <td class="pl-6 py-2" colspan="2"></td>
137
+                    <td class="text-right font-semibold border-t-4 border-double py-2">{{ $document->label->amountDue }}
138
+                        ({{ $document->currencyCode }}):
139
+                    </td>
140
+                    <td class="text-right border-t-4 border-double pr-6 py-2">{{ $document->amountDue }}</td>
141
+                </tr>
142
+            @endif
126 143
             </tfoot>
127 144
         </table>
128 145
     </x-company.document-template.line-items>
129 146
 
130 147
     <!-- Footer Notes -->
131
-    <x-company.document-template.footer class="default-template-footer min-h-48 flex flex-col text-xs p-6">
148
+    <x-company.document-template.footer class="classic-template-footer flex flex-col text-xs p-6">
132 149
         <div>
133 150
             <h4 class="font-semibold mb-2">Terms & Conditions</h4>
134 151
             <p class="break-words line-clamp-4">{{ $document->terms }}</p>

+ 39
- 35
resources/views/filament/company/components/document-templates/modern.blade.php 查看文件

@@ -18,12 +18,12 @@
18 18
         <!-- Logo -->
19 19
         <div class="w-2/3">
20 20
             @if($document->logo && $document->showLogo)
21
-                <x-company.document-template.logo class="ml-6" :src="$document->logo"/>
21
+                <x-company.document-template.logo class="ml-8" :src="$document->logo"/>
22 22
             @endif
23 23
         </div>
24 24
 
25 25
         <!-- Ribbon Container -->
26
-        <div class="w-1/3 absolute right-0 top-0 p-2 h-28 flex flex-col justify-end rounded-bl-sm"
26
+        <div class="w-1/3 absolute right-0 top-0 p-3 h-28 flex flex-col justify-end rounded-bl-sm"
27 27
              style="background: {{ $document->accentColor }};">
28 28
             @if($document->header)
29 29
                 <h1 class="text-3xl font-bold text-white text-center uppercase">{{ $document->header }}</h1>
@@ -32,9 +32,9 @@
32 32
     </x-company.document-template.header>
33 33
 
34 34
     <!-- Company Details -->
35
-    <x-company.document-template.metadata class="modern-template-metadata space-y-6">
35
+    <x-company.document-template.metadata class="modern-template-metadata space-y-8">
36 36
         <div class="text-xs">
37
-            <h2 class="text-xs font-semibold">{{ $document->company->name }}</h2>
37
+            <h2 class="text-base font-semibold">{{ $document->company->name }}</h2>
38 38
             @if($formattedAddress = $document->company->getFormattedAddressHtml())
39 39
                 {!! $formattedAddress !!}
40 40
             @endif
@@ -82,63 +82,65 @@
82 82
     <!-- Line Items Table -->
83 83
     <x-company.document-template.line-items class="modern-template-line-items">
84 84
         <table class="w-full text-left table-fixed">
85
-            <thead class="text-xs leading-8">
85
+            <thead class="text-xs leading-relaxed">
86 86
             <tr class="text-gray-600">
87
-                <th class="text-left pl-6 w-[50%]">{{ $document->columnLabel->items }}</th>
88
-                <th class="text-center w-[10%]">{{ $document->columnLabel->units }}</th>
89
-                <th class="text-right w-[20%]">{{ $document->columnLabel->price }}</th>
90
-                <th class="text-right pr-6 w-[20%]">{{ $document->columnLabel->amount }}</th>
87
+                <th class="text-left pl-6 w-[50%] py-4">{{ $document->columnLabel->items }}</th>
88
+                <th class="text-center w-[10%] py-4">{{ $document->columnLabel->units }}</th>
89
+                <th class="text-right w-[20%] py-4">{{ $document->columnLabel->price }}</th>
90
+                <th class="text-right pr-6 w-[20%] py-4">{{ $document->columnLabel->amount }}</th>
91 91
             </tr>
92 92
             </thead>
93 93
             <tbody class="text-xs border-y-2">
94 94
             @foreach($document->lineItems as $index => $item)
95 95
                 <tr @class(['bg-gray-100' => $index % 2 === 0])>
96
-                    <td class="text-left pl-6 font-semibold py-2">
96
+                    <td class="text-left pl-6 font-semibold py-3">
97 97
                         {{ $item->name }}
98 98
                         @if($item->description)
99
-                            <div class="text-gray-600 font-normal line-clamp-2">{{ $item->description }}</div>
99
+                            <div class="text-gray-600 font-normal line-clamp-2 mt-1">{{ $item->description }}</div>
100 100
                         @endif
101 101
                     </td>
102
-                    <td class="text-center">{{ $item->quantity }}</td>
103
-                    <td class="text-right">{{ $item->unitPrice }}</td>
104
-                    <td class="text-right pr-6">{{ $item->subtotal }}</td>
102
+                    <td class="text-center py-3">{{ $item->quantity }}</td>
103
+                    <td class="text-right py-3">{{ $item->unitPrice }}</td>
104
+                    <td class="text-right pr-6 py-3">{{ $item->subtotal }}</td>
105 105
                 </tr>
106 106
             @endforeach
107 107
             </tbody>
108
-            <tfoot class="text-xs">
109
-            <tr>
110
-                <td class="pl-6 py-1" colspan="2"></td>
111
-                <td class="text-right font-semibold py-1">Subtotal:</td>
112
-                <td class="text-right pr-6 py-1">{{ $document->subtotal }}</td>
113
-            </tr>
108
+            <tfoot class="text-xs summary-section">
109
+            @if($document->subtotal)
110
+                <tr>
111
+                    <td class="pl-6 py-2" colspan="2"></td>
112
+                    <td class="text-right font-semibold py-2">Subtotal:</td>
113
+                    <td class="text-right pr-6 py-2">{{ $document->subtotal }}</td>
114
+                </tr>
115
+            @endif
114 116
             @if($document->discount)
115 117
                 <tr class="text-success-800">
116
-                    <td class="pl-6 py-1" colspan="2"></td>
117
-                    <td class="text-right py-1">Discount:</td>
118
-                    <td class="text-right pr-6 py-1">
118
+                    <td class="pl-6 py-2" colspan="2"></td>
119
+                    <td class="text-right py-2">Discount:</td>
120
+                    <td class="text-right pr-6 py-2">
119 121
                         ({{ $document->discount }})
120 122
                     </td>
121 123
                 </tr>
122 124
             @endif
123 125
             @if($document->tax)
124 126
                 <tr>
125
-                    <td class="pl-6 py-1" colspan="2"></td>
126
-                    <td class="text-right py-1">Tax:</td>
127
-                    <td class="text-right pr-6 py-1">{{ $document->tax }}</td>
127
+                    <td class="pl-6 py-2" colspan="2"></td>
128
+                    <td class="text-right py-2">Tax:</td>
129
+                    <td class="text-right pr-6 py-2">{{ $document->tax }}</td>
128 130
                 </tr>
129 131
             @endif
130 132
             <tr>
131
-                <td class="pl-6 py-1" colspan="2"></td>
132
-                <td class="text-right font-semibold border-t py-1">Total:</td>
133
-                <td class="text-right border-t pr-6 py-1">{{ $document->total }}</td>
133
+                <td class="pl-6 py-2" colspan="2"></td>
134
+                <td class="text-right font-semibold border-t py-2">Total:</td>
135
+                <td class="text-right border-t pr-6 py-2">{{ $document->total }}</td>
134 136
             </tr>
135 137
             @if($document->amountDue)
136 138
                 <tr>
137
-                    <td class="pl-6 py-1" colspan="2"></td>
138
-                    <td class="text-right font-semibold border-t-4 border-double py-1">{{ $document->label->amountDue }}
139
+                    <td class="pl-6 py-2" colspan="2"></td>
140
+                    <td class="text-right font-semibold border-t-4 border-double py-2">{{ $document->label->amountDue }}
139 141
                         ({{ $document->currencyCode }}):
140 142
                     </td>
141
-                    <td class="text-right border-t-4 border-double pr-6 py-1">{{ $document->amountDue }}</td>
143
+                    <td class="text-right border-t-4 border-double pr-6 py-2">{{ $document->amountDue }}</td>
142 144
                 </tr>
143 145
             @endif
144 146
             </tfoot>
@@ -146,10 +148,12 @@
146 148
     </x-company.document-template.line-items>
147 149
 
148 150
     <!-- Footer Notes -->
149
-    <x-company.document-template.footer class="modern-template-footer text-xs">
150
-        <h4 class="font-semibold px-6" style="color: {{ $document->accentColor }}">Terms & Conditions</h4>
151
+    <x-company.document-template.footer class="modern-template-footer">
152
+        <h4 class="font-semibold px-6 text-xs" style="color: {{ $document->accentColor }}">
153
+            Terms & Conditions
154
+        </h4>
151 155
         <span class="border-t-2 my-2 border-gray-300 block w-full"></span>
152
-        <div class="flex justify-between space-x-4 px-6">
156
+        <div class="flex justify-between space-x-4 px-6 text-xs">
153 157
             <p class="w-1/2 break-words line-clamp-4">{{ $document->terms }}</p>
154 158
             <p class="w-1/2 break-words line-clamp-4">{{ $document->footer }}</p>
155 159
         </div>

+ 1
- 1
resources/views/filament/infolists/components/document-templates/classic.blade.php 查看文件

@@ -146,7 +146,7 @@
146 146
     </x-company.document-template.line-items>
147 147
 
148 148
     <!-- Footer -->
149
-    <x-company.document-template.footer class="default-template-footer min-h-48 p-6 text-sm">
149
+    <x-company.document-template.footer class="classic-template-footer min-h-48 p-6 text-sm">
150 150
         <h4 class="font-semibold mb-2">Terms & Conditions</h4>
151 151
         <p class="break-words line-clamp-4">{{ $document->terms }}</p>
152 152
     </x-company.document-template.footer>

Loading…
取消
儲存