Andrew Wallo 11 months ago
parent
commit
712b5c0f17

+ 20
- 0
resources/views/components/company/tables/category-header.blade.php View File

@@ -0,0 +1,20 @@
1
+@props([
2
+    'categoryHeaders',
3
+    'alignmentClass' => null,
4
+])
5
+
6
+
7
+<tr class="bg-gray-50 dark:bg-white/5">
8
+    @foreach($categoryHeaders as $index => $header)
9
+        <th
10
+            @class([
11
+                'px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6',
12
+                $alignmentClass($index) => $alignmentClass,
13
+            ])
14
+        >
15
+            <span class="text-sm font-semibold leading-6 text-gray-950 dark:text-white">
16
+                {{ $header }}
17
+            </span>
18
+        </th>
19
+    @endforeach
20
+</tr>

+ 23
- 0
resources/views/components/company/tables/cell.blade.php View File

@@ -0,0 +1,23 @@
1
+@props([
2
+    'alignmentClass',
3
+    'indent' => false,
4
+    'bold' => false,
5
+])
6
+
7
+<td
8
+    @class([
9
+        $alignmentClass,
10
+        'last-of-type:pe-1 sm:last-of-type:pe-3',
11
+        'ps-3 sm:ps-6' => $indent,
12
+        'p-0 first-of-type:ps-1 sm:first-of-type:ps-3' => ! $indent,
13
+    ])
14
+>
15
+    <div
16
+        @class([
17
+            'px-3 py-4 text-sm leading-6 text-gray-950 dark:text-white',
18
+            'font-semibold' => $bold,
19
+        ])
20
+    >
21
+        {{ $slot }}
22
+    </div>
23
+</td>

+ 1
- 1
resources/views/components/company/tables/header.blade.php View File

@@ -7,7 +7,7 @@
7 7
 <tr class="bg-gray-50 dark:bg-white/5">
8 8
     @foreach($headers as $headerIndex => $headerCell)
9 9
         <th class="px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6 {{ $alignmentClass($headerIndex) }}">
10
-            <span class="text-sm font-semibold text-gray-950 dark:text-white">
10
+            <span class="text-sm font-semibold leading-6 text-gray-950 dark:text-white">
11 11
                 {{ $headerCell }}
12 12
             </span>
13 13
         </th>

+ 8
- 21
resources/views/components/company/tables/reports/account-transactions.blade.php View File

@@ -1,23 +1,11 @@
1 1
 <table class="w-full table-auto divide-y divide-gray-200 dark:divide-white/5">
2
-    <thead class="divide-y divide-gray-200 dark:divide-white/5">
3
-    <tr class="bg-gray-50 dark:bg-white/5">
4
-        @foreach($report->getHeaders() as $index => $header)
5
-            <th wire:key="header-{{ $index }}"
6
-                class="px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6 {{ $report->getAlignmentClass($index) }}">
7
-                    <span class="text-sm font-semibold text-gray-950 dark:text-white">
8
-                        {{ $header }}
9
-                    </span>
10
-            </th>
11
-        @endforeach
12
-    </tr>
13
-    </thead>
2
+    <x-company.tables.header :headers="$report->getHeaders()" :alignmentClass="[$report, 'getAlignmentClass']"/>
14 3
     @foreach($report->getCategories() as $categoryIndex => $category)
15
-        <tbody wire:key="category-{{ $categoryIndex }}"
16
-               class="divide-y divide-gray-200 whitespace-nowrap dark:divide-white/5">
4
+        <tbody class="divide-y divide-gray-200 whitespace-nowrap dark:divide-white/5">
17 5
         <!-- Category Header -->
18 6
         <tr class="bg-gray-50 dark:bg-white/5">
19 7
             <x-filament-tables::cell colspan="{{ count($report->getHeaders()) }}" class="text-left">
20
-                <div class="px-3 py-2">
8
+                <div class="px-3 py-3.5">
21 9
                     @foreach ($category->header as $headerRow)
22 10
                         <div
23 11
                             class="text-sm {{ $loop->first ? 'font-semibold text-gray-950 dark:text-white' : 'text-gray-500 dark:text-white/50' }}">
@@ -33,14 +21,13 @@
33 21
         </tr>
34 22
         <!-- Transactions Data -->
35 23
         @foreach($category->data as $dataIndex => $transaction)
36
-            <tr wire:key="category-{{ $categoryIndex }}-data-{{ $dataIndex }}"
24
+            <tr
37 25
                 @class([
38 26
                     'bg-gray-50 dark:bg-white/5' => $loop->first || $loop->last || $loop->remaining === 1,
39 27
                 ])
40 28
             >
41 29
                 @foreach($transaction as $cellIndex => $cell)
42 30
                     <x-filament-tables::cell
43
-                        wire:key="category-{{ $categoryIndex }}-data-{{ $dataIndex }}-cell-{{ $cellIndex }}"
44 31
                         @class([
45 32
                            $report->getAlignmentClass($cellIndex),
46 33
                            'whitespace-normal' => $cellIndex === 1,
@@ -80,10 +67,10 @@
80 67
         @endforeach
81 68
         <!-- Spacer Row -->
82 69
         @unless($loop->last)
83
-            <tr wire:key="category-{{ $categoryIndex }}-spacer">
84
-                <x-filament-tables::cell colspan="{{ count($report->getHeaders()) }}">
85
-                    <div class="px-3 py-2 leading-6 invisible">Hidden Text</div>
86
-                </x-filament-tables::cell>
70
+            <tr>
71
+                <td colspan="{{ count($report->getHeaders()) }}">
72
+                    <div class="min-h-12"></div>
73
+                </td>
87 74
             </tr>
88 75
         @endunless
89 76
         </tbody>

+ 11
- 11
resources/views/components/company/tables/reports/balance-sheet-summary.blade.php View File

@@ -2,12 +2,12 @@
2 2
     <thead class="divide-y divide-gray-200 dark:divide-white/5">
3 3
     <tr class="bg-gray-50 dark:bg-white/5">
4 4
         <th class="px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6 text-left">
5
-            <span class="text-sm font-semibold text-gray-950 dark:text-white">
5
+            <span class="text-sm font-semibold leading-6 text-gray-950 dark:text-white">
6 6
                 Accounts
7 7
             </span>
8 8
         </th>
9 9
         <th class="px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6 text-right">
10
-            <span class="text-sm font-semibold text-gray-950 dark:text-white">
10
+            <span class="text-sm font-semibold leading-6 text-gray-950 dark:text-white">
11 11
                 Amount
12 12
             </span>
13 13
         </th>
@@ -17,11 +17,11 @@
17 17
         <tbody class="divide-y divide-gray-200 whitespace-nowrap dark:divide-white/5">
18 18
         <tr class="bg-gray-50 dark:bg-white/5">
19 19
             @foreach($accountCategory->header as $accountCategoryHeaderIndex => $accountCategoryHeaderCell)
20
-                <x-filament-tables::cell class="{{ $accountCategoryHeaderIndex === 0 ? 'text-left' : 'text-right' }}">
21
-                    <div class="px-3 py-2 text-sm leading-6 font-semibold text-gray-950 dark:text-white">
20
+                <th class="px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6 {{ $accountCategoryHeaderIndex === 0 ? 'text-left' : 'text-right' }}">
21
+                    <span class="text-sm font-semibold leading-6 text-gray-950 dark:text-white">
22 22
                         {{ $accountCategoryHeaderCell }}
23
-                    </div>
24
-                </x-filament-tables::cell>
23
+                    </span>
24
+                </th>
25 25
             @endforeach
26 26
         </tr>
27 27
         @foreach($accountCategory->types as $accountType)
@@ -29,7 +29,7 @@
29 29
                 @foreach($accountType->summary as $accountTypeSummaryIndex => $accountTypeSummaryCell)
30 30
                     <x-filament-tables::cell
31 31
                         class="{{ $accountTypeSummaryIndex === 0 ? 'text-left' : 'text-right' }} ps-8">
32
-                        <div class="px-3 py-2 text-sm leading-6 font-normal text-gray-950 dark:text-white">
32
+                        <div class="px-3 py-4 text-sm leading-6 text-gray-950 dark:text-white">
33 33
                             {{ $accountTypeSummaryCell }}
34 34
                         </div>
35 35
                     </x-filament-tables::cell>
@@ -39,16 +39,16 @@
39 39
         <tr>
40 40
             @foreach($accountCategory->summary as $accountCategorySummaryIndex => $accountCategorySummaryCell)
41 41
                 <x-filament-tables::cell class="{{ $accountCategorySummaryIndex === 0 ? 'text-left' : 'text-right' }}">
42
-                    <div class="px-3 py-2 text-sm leading-6 font-semibold text-gray-950 dark:text-white">
42
+                    <div class="px-3 py-4 text-sm leading-6 font-semibold text-gray-950 dark:text-white">
43 43
                         {{ $accountCategorySummaryCell }}
44 44
                     </div>
45 45
                 </x-filament-tables::cell>
46 46
             @endforeach
47 47
         </tr>
48 48
         <tr>
49
-            <x-filament-tables::cell colspan="2">
50
-                <div class="px-3 py-2 leading-6 invisible">Hidden Text</div>
51
-            </x-filament-tables::cell>
49
+            <td colspan="2">
50
+                <div class="min-h-12"></div>
51
+            </td>
52 52
         </tr>
53 53
         </tbody>
54 54
     @endforeach

+ 77
- 93
resources/views/components/company/tables/reports/balance-sheet.blade.php View File

@@ -1,147 +1,131 @@
1 1
 <table class="w-full table-auto divide-y divide-gray-200 dark:divide-white/5">
2
-    <x-company.tables.header :headers="$report->getHeaders()" :alignmentClass="[$report, 'getAlignmentClass']"/>
2
+    <x-company.tables.header :headers="$report->getHeaders()" :alignment-class="[$report, 'getAlignmentClass']"/>
3 3
     @foreach($report->getCategories() as $accountCategory)
4 4
         <tbody class="divide-y divide-gray-200 whitespace-nowrap dark:divide-white/5">
5
-        <tr class="bg-gray-50 dark:bg-white/5">
6
-            @foreach($accountCategory->header as $accountCategoryHeaderIndex => $accountCategoryHeaderCell)
7
-                <x-filament-tables::cell class="{{ $report->getAlignmentClass($accountCategoryHeaderIndex) }}">
8
-                    <div class="px-3 py-2 text-sm leading-6 font-semibold text-gray-950 dark:text-white">
9
-                        {{ $accountCategoryHeaderCell }}
10
-                    </div>
11
-                </x-filament-tables::cell>
12
-            @endforeach
13
-        </tr>
5
+        <x-company.tables.category-header :category-headers="$accountCategory->header"
6
+                                          :alignment-class="[$report, 'getAlignmentClass']"/>
14 7
         @foreach($accountCategory->data as $categoryAccount)
15 8
             <tr>
16 9
                 @foreach($categoryAccount as $accountIndex => $categoryAccountCell)
17
-                    <x-filament-tables::cell class="{{ $report->getAlignmentClass($accountIndex) }}"
18
-                                             style="padding-left: 1.5rem;">
19
-                        <div class="px-3 py-4 text-sm leading-6 text-gray-950 dark:text-white">
20
-                            @if(is_array($categoryAccountCell) && isset($categoryAccountCell['name']))
21
-                                @if($categoryAccountCell['name'] === 'Retained Earnings' && isset($categoryAccountCell['start_date']) && isset($categoryAccountCell['end_date']))
22
-                                    <x-filament::link
23
-                                        color="primary"
24
-                                        target="_blank"
25
-                                        icon="heroicon-o-arrow-top-right-on-square"
26
-                                        :icon-position="\Filament\Support\Enums\IconPosition::After"
27
-                                        :icon-size="\Filament\Support\Enums\IconSize::Small"
28
-                                        href="{{ \App\Filament\Company\Pages\Reports\IncomeStatement::getUrl([
10
+                    <x-company.tables.cell :alignment-class="$report->getAlignmentClass($accountIndex)"
11
+                                           indent="true">
12
+                        @if(is_array($categoryAccountCell) && isset($categoryAccountCell['name']))
13
+                            @if($categoryAccountCell['name'] === 'Retained Earnings' && isset($categoryAccountCell['start_date']) && isset($categoryAccountCell['end_date']))
14
+                                <x-filament::link
15
+                                    color="primary"
16
+                                    target="_blank"
17
+                                    icon="heroicon-o-arrow-top-right-on-square"
18
+                                    :icon-position="\Filament\Support\Enums\IconPosition::After"
19
+                                    :icon-size="\Filament\Support\Enums\IconSize::Small"
20
+                                    href="{{ \App\Filament\Company\Pages\Reports\IncomeStatement::getUrl([
29 21
                                             'startDate' => $categoryAccountCell['start_date'],
30 22
                                             'endDate' => $categoryAccountCell['end_date']
31 23
                                         ]) }}"
32
-                                    >
33
-                                        {{ $categoryAccountCell['name'] }}
34
-                                    </x-filament::link>
35
-                                @elseif(isset($categoryAccountCell['id']) && isset($categoryAccountCell['start_date']) && isset($categoryAccountCell['end_date']))
36
-                                    <x-filament::link
37
-                                        color="primary"
38
-                                        target="_blank"
39
-                                        icon="heroicon-o-arrow-top-right-on-square"
40
-                                        :icon-position="\Filament\Support\Enums\IconPosition::After"
41
-                                        :icon-size="\Filament\Support\Enums\IconSize::Small"
42
-                                        href="{{ \App\Filament\Company\Pages\Reports\AccountTransactions::getUrl([
24
+                                >
25
+                                    {{ $categoryAccountCell['name'] }}
26
+                                </x-filament::link>
27
+                            @elseif(isset($categoryAccountCell['id']) && isset($categoryAccountCell['start_date']) && isset($categoryAccountCell['end_date']))
28
+                                <x-filament::link
29
+                                    color="primary"
30
+                                    target="_blank"
31
+                                    icon="heroicon-o-arrow-top-right-on-square"
32
+                                    :icon-position="\Filament\Support\Enums\IconPosition::After"
33
+                                    :icon-size="\Filament\Support\Enums\IconSize::Small"
34
+                                    href="{{ \App\Filament\Company\Pages\Reports\AccountTransactions::getUrl([
43 35
                                             'startDate' => $categoryAccountCell['start_date'],
44 36
                                             'endDate' => $categoryAccountCell['end_date'],
45 37
                                             'selectedAccount' => $categoryAccountCell['id']
46 38
                                         ]) }}"
47
-                                    >
48
-                                        {{ $categoryAccountCell['name'] }}
49
-                                    </x-filament::link>
50
-                                @else
39
+                                >
51 40
                                     {{ $categoryAccountCell['name'] }}
52
-                                @endif
41
+                                </x-filament::link>
53 42
                             @else
54
-                                {{ $categoryAccountCell }}
43
+                                {{ $categoryAccountCell['name'] }}
55 44
                             @endif
56
-                        </div>
57
-                    </x-filament-tables::cell>
45
+                        @else
46
+                            {{ $categoryAccountCell }}
47
+                        @endif
48
+                    </x-company.tables.cell>
58 49
                 @endforeach
59 50
             </tr>
60 51
         @endforeach
61 52
         @foreach($accountCategory->types as $accountType)
62 53
             <tr class="bg-gray-50 dark:bg-white/5">
63 54
                 @foreach($accountType->header as $accountTypeHeaderIndex => $accountTypeHeaderCell)
64
-                    <x-filament-tables::cell class="{{ $report->getAlignmentClass($accountTypeHeaderIndex) }}"
65
-                                             style="padding-left: 1.5rem;">
66
-                        <div class="px-3 py-2 text-sm leading-6 font-semibold text-gray-950 dark:text-white">
67
-                            {{ $accountTypeHeaderCell }}
68
-                        </div>
69
-                    </x-filament-tables::cell>
55
+                    <x-company.tables.cell :alignment-class="$report->getAlignmentClass($accountTypeHeaderIndex)"
56
+                                           indent="true" bold="true">
57
+                        {{ $accountTypeHeaderCell }}
58
+                    </x-company.tables.cell>
70 59
                 @endforeach
71 60
             </tr>
72 61
             @foreach($accountType->data as $typeAccount)
73 62
                 <tr>
74 63
                     @foreach($typeAccount as $accountIndex => $typeAccountCell)
75
-                        <x-filament-tables::cell class="{{ $report->getAlignmentClass($accountIndex) }}"
76
-                                                 style="padding-left: 1.5rem;">
77
-                            <div class="px-3 py-4 text-sm leading-6 text-gray-950 dark:text-white">
78
-                                @if(is_array($typeAccountCell) && isset($typeAccountCell['name']))
79
-                                    @if($typeAccountCell['name'] === 'Retained Earnings' && isset($typeAccountCell['start_date']) && isset($typeAccountCell['end_date']))
80
-                                        <x-filament::link
81
-                                            color="primary"
82
-                                            target="_blank"
83
-                                            icon="heroicon-o-arrow-top-right-on-square"
84
-                                            :icon-position="\Filament\Support\Enums\IconPosition::After"
85
-                                            :icon-size="\Filament\Support\Enums\IconSize::Small"
86
-                                            href="{{ \App\Filament\Company\Pages\Reports\IncomeStatement::getUrl([
64
+                        <x-company.tables.cell :alignment-class="$report->getAlignmentClass($accountIndex)"
65
+                                               indent="true">
66
+                            @if(is_array($typeAccountCell) && isset($typeAccountCell['name']))
67
+                                @if($typeAccountCell['name'] === 'Retained Earnings' && isset($typeAccountCell['start_date']) && isset($typeAccountCell['end_date']))
68
+                                    <x-filament::link
69
+                                        color="primary"
70
+                                        target="_blank"
71
+                                        icon="heroicon-o-arrow-top-right-on-square"
72
+                                        :icon-position="\Filament\Support\Enums\IconPosition::After"
73
+                                        :icon-size="\Filament\Support\Enums\IconSize::Small"
74
+                                        href="{{ \App\Filament\Company\Pages\Reports\IncomeStatement::getUrl([
87 75
                                             'startDate' => $typeAccountCell['start_date'],
88 76
                                             'endDate' => $typeAccountCell['end_date']
89 77
                                         ]) }}"
90
-                                        >
91
-                                            {{ $typeAccountCell['name'] }}
92
-                                        </x-filament::link>
93
-                                    @elseif(isset($typeAccountCell['id']) && isset($typeAccountCell['start_date']) && isset($typeAccountCell['end_date']))
94
-                                        <x-filament::link
95
-                                            color="primary"
96
-                                            target="_blank"
97
-                                            icon="heroicon-o-arrow-top-right-on-square"
98
-                                            :icon-position="\Filament\Support\Enums\IconPosition::After"
99
-                                            :icon-size="\Filament\Support\Enums\IconSize::Small"
100
-                                            href="{{ \App\Filament\Company\Pages\Reports\AccountTransactions::getUrl([
78
+                                    >
79
+                                        {{ $typeAccountCell['name'] }}
80
+                                    </x-filament::link>
81
+                                @elseif(isset($typeAccountCell['id']) && isset($typeAccountCell['start_date']) && isset($typeAccountCell['end_date']))
82
+                                    <x-filament::link
83
+                                        color="primary"
84
+                                        target="_blank"
85
+                                        icon="heroicon-o-arrow-top-right-on-square"
86
+                                        :icon-position="\Filament\Support\Enums\IconPosition::After"
87
+                                        :icon-size="\Filament\Support\Enums\IconSize::Small"
88
+                                        href="{{ \App\Filament\Company\Pages\Reports\AccountTransactions::getUrl([
101 89
                                             'startDate' => $typeAccountCell['start_date'],
102 90
                                             'endDate' => $typeAccountCell['end_date'],
103 91
                                             'selectedAccount' => $typeAccountCell['id']
104 92
                                         ]) }}"
105
-                                        >
106
-                                            {{ $typeAccountCell['name'] }}
107
-                                        </x-filament::link>
108
-                                    @else
93
+                                    >
109 94
                                         {{ $typeAccountCell['name'] }}
110
-                                    @endif
95
+                                    </x-filament::link>
111 96
                                 @else
112
-                                    {{ $typeAccountCell }}
97
+                                    {{ $typeAccountCell['name'] }}
113 98
                                 @endif
114
-                            </div>
115
-                        </x-filament-tables::cell>
99
+                            @else
100
+                                {{ $typeAccountCell }}
101
+                            @endif
102
+                        </x-company.tables.cell>
116 103
                     @endforeach
117 104
                 </tr>
118 105
             @endforeach
119 106
             <tr>
120 107
                 @foreach($accountType->summary as $accountTypeSummaryIndex => $accountTypeSummaryCell)
121
-                    <x-filament-tables::cell class="{{ $report->getAlignmentClass($accountTypeSummaryIndex) }}"
122
-                                             style="padding-left: 1.5rem;">
123
-                        <div class="px-3 py-3 text-sm leading-6 font-semibold text-gray-950 dark:text-white">
124
-                            {{ $accountTypeSummaryCell }}
125
-                        </div>
126
-                    </x-filament-tables::cell>
108
+                    <x-company.tables.cell :alignment-class="$report->getAlignmentClass($accountTypeSummaryIndex)"
109
+                                           indent="true" bold="true">
110
+                        {{ $accountTypeSummaryCell }}
111
+                    </x-company.tables.cell>
127 112
                 @endforeach
128 113
             </tr>
129 114
         @endforeach
130 115
         <tr>
131 116
             @foreach($accountCategory->summary as $accountCategorySummaryIndex => $accountCategorySummaryCell)
132
-                <x-filament-tables::cell class="{{ $report->getAlignmentClass($accountCategorySummaryIndex) }}">
133
-                    <div class="px-3 py-3 text-sm leading-6 font-semibold text-gray-950 dark:text-white">
134
-                        {{ $accountCategorySummaryCell }}
135
-                    </div>
136
-                </x-filament-tables::cell>
117
+                <x-company.tables.cell :alignment-class="$report->getAlignmentClass($accountCategorySummaryIndex)"
118
+                                       bold="true">
119
+                    {{ $accountCategorySummaryCell }}
120
+                </x-company.tables.cell>
137 121
             @endforeach
138 122
         </tr>
139 123
         <tr>
140
-            <x-filament-tables::cell colspan="{{ count($report->getHeaders()) }}">
141
-                <div class="px-3 py-3 leading-6 invisible">Hidden Text</div>
142
-            </x-filament-tables::cell>
124
+            <td colspan="{{ count($report->getHeaders()) }}">
125
+                <div class="min-h-12"></div>
126
+            </td>
143 127
         </tr>
144 128
         </tbody>
145 129
     @endforeach
146
-    <x-company.tables.footer :totals="$report->getOverallTotals()" :alignmentClass="[$report, 'getAlignmentClass']"/>
130
+    <x-company.tables.footer :totals="$report->getOverallTotals()" :alignment-class="[$report, 'getAlignmentClass']"/>
147 131
 </table>

+ 49
- 81
resources/views/components/company/tables/reports/detailed-report.blade.php View File

@@ -1,99 +1,67 @@
1 1
 <table class="w-full table-auto divide-y divide-gray-200 dark:divide-white/5">
2
-    <thead class="divide-y divide-gray-200 dark:divide-white/5">
3
-    <tr class="bg-gray-50 dark:bg-white/5">
4
-        @foreach($report->getHeaders() as $index => $header)
5
-            <th class="px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6 {{ $report->getAlignmentClass($index) }}">
6
-                <span class="text-sm font-semibold text-gray-950 dark:text-white">
7
-                    {{ $header }}
8
-                </span>
9
-            </th>
10
-        @endforeach
11
-    </tr>
12
-    </thead>
13
-    @foreach($report->getCategories() as $categoryIndex => $category)
2
+    <x-company.tables.header :headers="$report->getHeaders()" :alignment-class="[$report, 'getAlignmentClass']"/>
3
+    @foreach($report->getCategories() as $accountCategory)
14 4
         <tbody class="divide-y divide-gray-200 whitespace-nowrap dark:divide-white/5">
15
-        <tr class="bg-gray-50 dark:bg-white/5">
16
-            @foreach($category->header as $headerIndex => $header)
17
-                <x-filament-tables::cell class="{{ $report->getAlignmentClass($headerIndex) }}">
18
-                    <div class="px-3 py-2 text-sm leading-6 font-semibold text-gray-950 dark:text-white">
19
-                        {{ $header }}
20
-                    </div>
21
-                </x-filament-tables::cell>
22
-            @endforeach
23
-        </tr>
24
-        @foreach($category->data as $dataIndex => $account)
5
+        <x-company.tables.category-header :category-headers="$accountCategory->header"
6
+                                          :alignment-class="[$report, 'getAlignmentClass']"/>
7
+        @foreach($accountCategory->data as $categoryAccount)
25 8
             <tr>
26
-                @foreach($account as $cellIndex => $cell)
27
-                    <x-filament-tables::cell class="{{ $report->getAlignmentClass($cellIndex) }}">
28
-                        <div class="px-3 py-4 text-sm leading-6 text-gray-950 dark:text-white">
29
-                            @if(is_array($cell) && isset($cell['name']))
30
-                                @if($cell['name'] === 'Retained Earnings' && isset($cell['start_date']) && isset($cell['end_date']))
31
-                                    <x-filament::link
32
-                                        color="primary"
33
-                                        target="_blank"
34
-                                        icon="heroicon-o-arrow-top-right-on-square"
35
-                                        :icon-position="\Filament\Support\Enums\IconPosition::After"
36
-                                        :icon-size="\Filament\Support\Enums\IconSize::Small"
37
-                                        href="{{ \App\Filament\Company\Pages\Reports\IncomeStatement::getUrl([
38
-                                            'startDate' => $cell['start_date'],
39
-                                            'endDate' => $cell['end_date']
9
+                @foreach($categoryAccount as $accountIndex => $categoryAccountCell)
10
+                    <x-company.tables.cell :alignment-class="$report->getAlignmentClass($accountIndex)">
11
+                        @if(is_array($categoryAccountCell) && isset($categoryAccountCell['name']))
12
+                            @if($categoryAccountCell['name'] === 'Retained Earnings' && isset($categoryAccountCell['start_date']) && isset($categoryAccountCell['end_date']))
13
+                                <x-filament::link
14
+                                    color="primary"
15
+                                    target="_blank"
16
+                                    icon="heroicon-o-arrow-top-right-on-square"
17
+                                    :icon-position="\Filament\Support\Enums\IconPosition::After"
18
+                                    :icon-size="\Filament\Support\Enums\IconSize::Small"
19
+                                    href="{{ \App\Filament\Company\Pages\Reports\IncomeStatement::getUrl([
20
+                                            'startDate' => $categoryAccountCell['start_date'],
21
+                                            'endDate' => $categoryAccountCell['end_date']
40 22
                                         ]) }}"
41
-                                    >
42
-                                        {{ $cell['name'] }}
43
-                                    </x-filament::link>
44
-                                @elseif(isset($cell['id']) && isset($cell['start_date']) && isset($cell['end_date']))
45
-                                    <x-filament::link
46
-                                        color="primary"
47
-                                        target="_blank"
48
-                                        icon="heroicon-o-arrow-top-right-on-square"
49
-                                        :icon-position="\Filament\Support\Enums\IconPosition::After"
50
-                                        :icon-size="\Filament\Support\Enums\IconSize::Small"
51
-                                        href="{{ \App\Filament\Company\Pages\Reports\AccountTransactions::getUrl([
52
-                                            'startDate' => $cell['start_date'],
53
-                                            'endDate' => $cell['end_date'],
54
-                                            'selectedAccount' => $cell['id']
23
+                                >
24
+                                    {{ $categoryAccountCell['name'] }}
25
+                                </x-filament::link>
26
+                            @elseif(isset($categoryAccountCell['id']) && isset($categoryAccountCell['start_date']) && isset($categoryAccountCell['end_date']))
27
+                                <x-filament::link
28
+                                    color="primary"
29
+                                    target="_blank"
30
+                                    icon="heroicon-o-arrow-top-right-on-square"
31
+                                    :icon-position="\Filament\Support\Enums\IconPosition::After"
32
+                                    :icon-size="\Filament\Support\Enums\IconSize::Small"
33
+                                    href="{{ \App\Filament\Company\Pages\Reports\AccountTransactions::getUrl([
34
+                                            'startDate' => $categoryAccountCell['start_date'],
35
+                                            'endDate' => $categoryAccountCell['end_date'],
36
+                                            'selectedAccount' => $categoryAccountCell['id']
55 37
                                         ]) }}"
56
-                                    >
57
-                                        {{ $cell['name'] }}
58
-                                    </x-filament::link>
59
-                                @else
60
-                                    {{ $cell['name'] }}
61
-                                @endif
38
+                                >
39
+                                    {{ $categoryAccountCell['name'] }}
40
+                                </x-filament::link>
62 41
                             @else
63
-                                {{ $cell }}
42
+                                {{ $categoryAccountCell['name'] }}
64 43
                             @endif
65
-                        </div>
66
-                    </x-filament-tables::cell>
44
+                        @else
45
+                            {{ $categoryAccountCell }}
46
+                        @endif
47
+                    </x-company.tables.cell>
67 48
                 @endforeach
68 49
             </tr>
69 50
         @endforeach
70 51
         <tr>
71
-            @foreach($category->summary as $summaryIndex => $cell)
72
-                <x-filament-tables::cell class="{{ $report->getAlignmentClass($summaryIndex) }}">
73
-                    <div class="px-3 py-2 text-sm leading-6 font-semibold text-gray-950 dark:text-white">
74
-                        {{ $cell }}
75
-                    </div>
76
-                </x-filament-tables::cell>
52
+            @foreach($accountCategory->summary as $accountCategorySummaryIndex => $accountCategorySummaryCell)
53
+                <x-company.tables.cell :alignment-class="$report->getAlignmentClass($accountCategorySummaryIndex)"
54
+                                       bold="true">
55
+                    {{ $accountCategorySummaryCell }}
56
+                </x-company.tables.cell>
77 57
             @endforeach
78 58
         </tr>
79 59
         <tr>
80
-            <x-filament-tables::cell colspan="{{ count($report->getHeaders()) }}">
81
-                <div class="px-3 py-2 leading-6 invisible">Hidden Text</div>
82
-            </x-filament-tables::cell>
60
+            <td colspan="{{ count($report->getHeaders()) }}">
61
+                <div class="min-h-12"></div>
62
+            </td>
83 63
         </tr>
84 64
         </tbody>
85 65
     @endforeach
86
-    @if(! empty($report->getOverallTotals()))
87
-        <tfoot>
88
-        <tr class="bg-gray-50 dark:bg-white/5">
89
-            @foreach($report->getOverallTotals() as $index => $total)
90
-                <x-filament-tables::cell class="{{ $report->getAlignmentClass($index) }}">
91
-                    <div class="px-3 py-2 text-sm leading-6 font-semibold text-gray-950 dark:text-white">
92
-                        {{ $total }}
93
-                    </div>
94
-                </x-filament-tables::cell>
95
-            @endforeach
96
-        </tr>
97
-        </tfoot>
98
-    @endif
66
+    <x-company.tables.footer :totals="$report->getOverallTotals()" :alignment-class="[$report, 'getAlignmentClass']"/>
99 67
 </table>

+ 4
- 4
resources/views/components/company/tables/reports/income-statement-summary.blade.php View File

@@ -2,12 +2,12 @@
2 2
     <thead class="divide-y divide-gray-200 dark:divide-white/5">
3 3
     <tr class="bg-gray-50 dark:bg-white/5">
4 4
         <th class="px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6 text-left">
5
-            <span class="text-sm font-semibold text-gray-950 dark:text-white">
5
+            <span class="text-sm font-semibold leading-6 text-gray-950 dark:text-white">
6 6
                 Accounts
7 7
             </span>
8 8
         </th>
9 9
         <th class="px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6 text-right">
10
-            <span class="text-sm font-semibold text-gray-950 dark:text-white">
10
+            <span class="text-sm font-semibold leading-6 text-gray-950 dark:text-white">
11 11
                 Amount
12 12
             </span>
13 13
         </th>
@@ -18,7 +18,7 @@
18 18
         <tr>
19 19
             @foreach($accountCategory->summary as $accountCategorySummaryIndex => $accountCategorySummaryCell)
20 20
                 <x-filament-tables::cell class="{{ $accountCategorySummaryIndex === 0 ? 'text-left' : 'text-right' }}">
21
-                    <div class="px-3 py-2 text-sm leading-6 font-normal text-gray-950 dark:text-white">
21
+                    <div class="px-3 py-4 text-sm leading-6 font-normal text-gray-950 dark:text-white">
22 22
                         {{ $accountCategorySummaryCell }}
23 23
                     </div>
24 24
                 </x-filament-tables::cell>
@@ -38,7 +38,7 @@
38 38
         @endif
39 39
         </tbody>
40 40
     @endforeach
41
-    @if(! empty($report->getOverallTotals()))
41
+    @if(! empty($report->getSummaryTotals()))
42 42
         <tfoot>
43 43
         <tr class="bg-gray-50 dark:bg-white/5">
44 44
             @foreach($report->getSummaryTotals() as $index => $total)

Loading…
Cancel
Save