Bläddra i källkod

wip fix bugs

3.x
Andrew Wallo 9 månader sedan
förälder
incheckning
650ae5e128

+ 1
- 21
app/Filament/Company/Pages/Reports/AccountTransactions.php Visa fil

6
 use App\DTO\ReportDTO;
6
 use App\DTO\ReportDTO;
7
 use App\Filament\Company\Pages\Accounting\Transactions;
7
 use App\Filament\Company\Pages\Accounting\Transactions;
8
 use App\Models\Accounting\Account;
8
 use App\Models\Accounting\Account;
9
-use App\Models\Accounting\JournalEntry;
10
 use App\Models\Common\Client;
9
 use App\Models\Common\Client;
11
 use App\Models\Common\Vendor;
10
 use App\Models\Common\Vendor;
12
 use App\Services\ExportService;
11
 use App\Services\ExportService;
21
 use Filament\Tables\Actions\Action;
20
 use Filament\Tables\Actions\Action;
22
 use Guava\FilamentClusters\Forms\Cluster;
21
 use Guava\FilamentClusters\Forms\Cluster;
23
 use Illuminate\Contracts\Support\Htmlable;
22
 use Illuminate\Contracts\Support\Htmlable;
24
-use Illuminate\Database\Eloquent\Builder;
25
 use Illuminate\Support\Collection;
23
 use Illuminate\Support\Collection;
26
 use Symfony\Component\HttpFoundation\StreamedResponse;
24
 use Symfony\Component\HttpFoundation\StreamedResponse;
27
 
25
 
200
         ];
198
         ];
201
     }
199
     }
202
 
200
 
203
-    public function hasNoTransactionsForSelectedAccount(): bool
204
-    {
205
-        $query = JournalEntry::query();
206
-        $selectedAccountId = $this->getFilterState('selectedAccount');
207
-
208
-        if ($selectedAccountId !== 'all') {
209
-            $query->where('account_id', $selectedAccountId);
210
-        }
211
-
212
-        if ($this->getFilterState('startDate') && $this->getFilterState('endDate')) {
213
-            $query->whereHas('transaction', function (Builder $query) {
214
-                $query->whereBetween('posted_at', [$this->getFormattedStartDate(), $this->getFormattedEndDate()]);
215
-            });
216
-        }
217
-
218
-        return $query->doesntExist();
219
-    }
220
-
221
     public function tableHasEmptyState(): bool
201
     public function tableHasEmptyState(): bool
222
     {
202
     {
223
-        return $this->hasNoTransactionsForSelectedAccount();
203
+        return empty($this->report?->getCategories());
224
     }
204
     }
225
 }
205
 }

+ 27
- 27
composer.lock Visa fil

497
         },
497
         },
498
         {
498
         {
499
             "name": "aws/aws-sdk-php",
499
             "name": "aws/aws-sdk-php",
500
-            "version": "3.336.14",
500
+            "version": "3.336.15",
501
             "source": {
501
             "source": {
502
                 "type": "git",
502
                 "type": "git",
503
                 "url": "https://github.com/aws/aws-sdk-php.git",
503
                 "url": "https://github.com/aws/aws-sdk-php.git",
504
-                "reference": "dc9ac0ab313bbfc4e41635ce6d6083f28d202bf0"
504
+                "reference": "f8028ef4b8dcb0acfe86c33e207fd3cb0b9cbf3b"
505
             },
505
             },
506
             "dist": {
506
             "dist": {
507
                 "type": "zip",
507
                 "type": "zip",
508
-                "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/dc9ac0ab313bbfc4e41635ce6d6083f28d202bf0",
509
-                "reference": "dc9ac0ab313bbfc4e41635ce6d6083f28d202bf0",
508
+                "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/f8028ef4b8dcb0acfe86c33e207fd3cb0b9cbf3b",
509
+                "reference": "f8028ef4b8dcb0acfe86c33e207fd3cb0b9cbf3b",
510
                 "shasum": ""
510
                 "shasum": ""
511
             },
511
             },
512
             "require": {
512
             "require": {
589
             "support": {
589
             "support": {
590
                 "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
590
                 "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
591
                 "issues": "https://github.com/aws/aws-sdk-php/issues",
591
                 "issues": "https://github.com/aws/aws-sdk-php/issues",
592
-                "source": "https://github.com/aws/aws-sdk-php/tree/3.336.14"
592
+                "source": "https://github.com/aws/aws-sdk-php/tree/3.336.15"
593
             },
593
             },
594
-            "time": "2025-01-13T19:04:40+00:00"
594
+            "time": "2025-01-14T19:03:58+00:00"
595
         },
595
         },
596
         {
596
         {
597
             "name": "aws/aws-sdk-php-laravel",
597
             "name": "aws/aws-sdk-php-laravel",
3053
         },
3053
         },
3054
         {
3054
         {
3055
             "name": "laravel/framework",
3055
             "name": "laravel/framework",
3056
-            "version": "v11.37.0",
3056
+            "version": "v11.38.2",
3057
             "source": {
3057
             "source": {
3058
                 "type": "git",
3058
                 "type": "git",
3059
                 "url": "https://github.com/laravel/framework.git",
3059
                 "url": "https://github.com/laravel/framework.git",
3060
-                "reference": "6cb103d2024b087eae207654b3f4b26646119ba5"
3060
+                "reference": "9d290aa90fcad44048bedca5219d2b872e98772a"
3061
             },
3061
             },
3062
             "dist": {
3062
             "dist": {
3063
                 "type": "zip",
3063
                 "type": "zip",
3064
-                "url": "https://api.github.com/repos/laravel/framework/zipball/6cb103d2024b087eae207654b3f4b26646119ba5",
3065
-                "reference": "6cb103d2024b087eae207654b3f4b26646119ba5",
3064
+                "url": "https://api.github.com/repos/laravel/framework/zipball/9d290aa90fcad44048bedca5219d2b872e98772a",
3065
+                "reference": "9d290aa90fcad44048bedca5219d2b872e98772a",
3066
                 "shasum": ""
3066
                 "shasum": ""
3067
             },
3067
             },
3068
             "require": {
3068
             "require": {
3263
                 "issues": "https://github.com/laravel/framework/issues",
3263
                 "issues": "https://github.com/laravel/framework/issues",
3264
                 "source": "https://github.com/laravel/framework"
3264
                 "source": "https://github.com/laravel/framework"
3265
             },
3265
             },
3266
-            "time": "2025-01-02T20:10:21+00:00"
3266
+            "time": "2025-01-15T00:06:46+00:00"
3267
         },
3267
         },
3268
         {
3268
         {
3269
             "name": "laravel/prompts",
3269
             "name": "laravel/prompts",
3270
-            "version": "v0.3.2",
3270
+            "version": "v0.3.3",
3271
             "source": {
3271
             "source": {
3272
                 "type": "git",
3272
                 "type": "git",
3273
                 "url": "https://github.com/laravel/prompts.git",
3273
                 "url": "https://github.com/laravel/prompts.git",
3274
-                "reference": "0e0535747c6b8d6d10adca8b68293cf4517abb0f"
3274
+                "reference": "749395fcd5f8f7530fe1f00dfa84eb22c83d94ea"
3275
             },
3275
             },
3276
             "dist": {
3276
             "dist": {
3277
                 "type": "zip",
3277
                 "type": "zip",
3278
-                "url": "https://api.github.com/repos/laravel/prompts/zipball/0e0535747c6b8d6d10adca8b68293cf4517abb0f",
3279
-                "reference": "0e0535747c6b8d6d10adca8b68293cf4517abb0f",
3278
+                "url": "https://api.github.com/repos/laravel/prompts/zipball/749395fcd5f8f7530fe1f00dfa84eb22c83d94ea",
3279
+                "reference": "749395fcd5f8f7530fe1f00dfa84eb22c83d94ea",
3280
                 "shasum": ""
3280
                 "shasum": ""
3281
             },
3281
             },
3282
             "require": {
3282
             "require": {
3320
             "description": "Add beautiful and user-friendly forms to your command-line applications.",
3320
             "description": "Add beautiful and user-friendly forms to your command-line applications.",
3321
             "support": {
3321
             "support": {
3322
                 "issues": "https://github.com/laravel/prompts/issues",
3322
                 "issues": "https://github.com/laravel/prompts/issues",
3323
-                "source": "https://github.com/laravel/prompts/tree/v0.3.2"
3323
+                "source": "https://github.com/laravel/prompts/tree/v0.3.3"
3324
             },
3324
             },
3325
-            "time": "2024-11-12T14:59:47+00:00"
3325
+            "time": "2024-12-30T15:53:31+00:00"
3326
         },
3326
         },
3327
         {
3327
         {
3328
             "name": "laravel/sanctum",
3328
             "name": "laravel/sanctum",
9782
         },
9782
         },
9783
         {
9783
         {
9784
             "name": "laravel/pint",
9784
             "name": "laravel/pint",
9785
-            "version": "v1.19.0",
9785
+            "version": "v1.20.0",
9786
             "source": {
9786
             "source": {
9787
                 "type": "git",
9787
                 "type": "git",
9788
                 "url": "https://github.com/laravel/pint.git",
9788
                 "url": "https://github.com/laravel/pint.git",
9789
-                "reference": "8169513746e1bac70c85d6ea1524d9225d4886f0"
9789
+                "reference": "53072e8ea22213a7ed168a8a15b96fbb8b82d44b"
9790
             },
9790
             },
9791
             "dist": {
9791
             "dist": {
9792
                 "type": "zip",
9792
                 "type": "zip",
9793
-                "url": "https://api.github.com/repos/laravel/pint/zipball/8169513746e1bac70c85d6ea1524d9225d4886f0",
9794
-                "reference": "8169513746e1bac70c85d6ea1524d9225d4886f0",
9793
+                "url": "https://api.github.com/repos/laravel/pint/zipball/53072e8ea22213a7ed168a8a15b96fbb8b82d44b",
9794
+                "reference": "53072e8ea22213a7ed168a8a15b96fbb8b82d44b",
9795
                 "shasum": ""
9795
                 "shasum": ""
9796
             },
9796
             },
9797
             "require": {
9797
             "require": {
9844
                 "issues": "https://github.com/laravel/pint/issues",
9844
                 "issues": "https://github.com/laravel/pint/issues",
9845
                 "source": "https://github.com/laravel/pint"
9845
                 "source": "https://github.com/laravel/pint"
9846
             },
9846
             },
9847
-            "time": "2024-12-30T16:20:10+00:00"
9847
+            "time": "2025-01-14T16:20:53+00:00"
9848
         },
9848
         },
9849
         {
9849
         {
9850
             "name": "laravel/sail",
9850
             "name": "laravel/sail",
9851
-            "version": "v1.39.1",
9851
+            "version": "v1.40.0",
9852
             "source": {
9852
             "source": {
9853
                 "type": "git",
9853
                 "type": "git",
9854
                 "url": "https://github.com/laravel/sail.git",
9854
                 "url": "https://github.com/laravel/sail.git",
9855
-                "reference": "1a3c7291bc88de983b66688919a4d298d68ddec7"
9855
+                "reference": "237e70656d8eface4839de51d101284bd5d0cf71"
9856
             },
9856
             },
9857
             "dist": {
9857
             "dist": {
9858
                 "type": "zip",
9858
                 "type": "zip",
9859
-                "url": "https://api.github.com/repos/laravel/sail/zipball/1a3c7291bc88de983b66688919a4d298d68ddec7",
9860
-                "reference": "1a3c7291bc88de983b66688919a4d298d68ddec7",
9859
+                "url": "https://api.github.com/repos/laravel/sail/zipball/237e70656d8eface4839de51d101284bd5d0cf71",
9860
+                "reference": "237e70656d8eface4839de51d101284bd5d0cf71",
9861
                 "shasum": ""
9861
                 "shasum": ""
9862
             },
9862
             },
9863
             "require": {
9863
             "require": {
9907
                 "issues": "https://github.com/laravel/sail/issues",
9907
                 "issues": "https://github.com/laravel/sail/issues",
9908
                 "source": "https://github.com/laravel/sail"
9908
                 "source": "https://github.com/laravel/sail"
9909
             },
9909
             },
9910
-            "time": "2024-11-27T15:42:28+00:00"
9910
+            "time": "2025-01-13T16:57:11+00:00"
9911
         },
9911
         },
9912
         {
9912
         {
9913
             "name": "mockery/mockery",
9913
             "name": "mockery/mockery",

+ 6
- 6
package-lock.json Visa fil

1235
             "license": "MIT"
1235
             "license": "MIT"
1236
         },
1236
         },
1237
         "node_modules/electron-to-chromium": {
1237
         "node_modules/electron-to-chromium": {
1238
-            "version": "1.5.80",
1239
-            "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.80.tgz",
1240
-            "integrity": "sha512-LTrKpW0AqIuHwmlVNV+cjFYTnXtM9K37OGhpe0ZI10ScPSxqVSryZHIY3WnCS5NSYbBODRTZyhRMS2h5FAEqAw==",
1238
+            "version": "1.5.82",
1239
+            "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.82.tgz",
1240
+            "integrity": "sha512-Zq16uk1hfQhyGx5GpwPAYDwddJuSGhtRhgOA2mCxANYaDT79nAeGnaXogMGng4KqLaJUVnOnuL0+TDop9nLOiA==",
1241
             "dev": true,
1241
             "dev": true,
1242
             "license": "ISC"
1242
             "license": "ISC"
1243
         },
1243
         },
1907
             }
1907
             }
1908
         },
1908
         },
1909
         "node_modules/postcss": {
1909
         "node_modules/postcss": {
1910
-            "version": "8.5.0",
1911
-            "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.0.tgz",
1912
-            "integrity": "sha512-27VKOqrYfPncKA2NrFOVhP5MGAfHKLYn/Q0mz9cNQyRAKYi3VNHwYU2qKKqPCqgBmeeJ0uAFB56NumXZ5ZReXg==",
1910
+            "version": "8.5.1",
1911
+            "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.1.tgz",
1912
+            "integrity": "sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==",
1913
             "dev": true,
1913
             "dev": true,
1914
             "funding": [
1914
             "funding": [
1915
                 {
1915
                 {

+ 2
- 2
resources/views/components/company/tables/reports/account-transactions.blade.php Visa fil

2
     use App\Filament\Company\Pages\Accounting\Transactions;
2
     use App\Filament\Company\Pages\Accounting\Transactions;
3
     use App\Models\Accounting\Bill;
3
     use App\Models\Accounting\Bill;
4
     use App\Filament\Company\Resources\Purchases\BillResource\Pages\ViewBill;
4
     use App\Filament\Company\Resources\Purchases\BillResource\Pages\ViewBill;
5
-    use App\Filament\Company\Resources\Sales\InvoiceResource\Pages\ViewEstimate;
5
+    use App\Filament\Company\Resources\Sales\InvoiceResource\Pages\ViewInvoice;
6
 
6
 
7
     $iconPosition = \Filament\Support\Enums\IconPosition::After;
7
     $iconPosition = \Filament\Support\Enums\IconPosition::After;
8
 @endphp
8
 @endphp
68
                                         <x-filament::link
68
                                         <x-filament::link
69
                                             :href="$cell['tableAction']['model'] === Bill::class
69
                                             :href="$cell['tableAction']['model'] === Bill::class
70
                                                 ? ViewBill::getUrl(['record' => $cell['tableAction']['id']])
70
                                                 ? ViewBill::getUrl(['record' => $cell['tableAction']['id']])
71
-                                                : ViewEstimate::getUrl(['record' => $cell['tableAction']['id']])"
71
+                                                : ViewInvoice::getUrl(['record' => $cell['tableAction']['id']])"
72
                                             target="_blank"
72
                                             target="_blank"
73
                                             color="primary"
73
                                             color="primary"
74
                                             icon="heroicon-o-arrow-top-right-on-square"
74
                                             icon="heroicon-o-arrow-top-right-on-square"

+ 1
- 1
resources/views/filament/company/pages/reports/account-transactions.blade.php Visa fil

6
     </x-filament::section>
6
     </x-filament::section>
7
 
7
 
8
     <x-company.tables.container :report-loaded="$this->reportLoaded">
8
     <x-company.tables.container :report-loaded="$this->reportLoaded">
9
-        @if($this->report && ! $this->tableHasEmptyState())
9
+        @if(! $this->tableHasEmptyState())
10
             <x-company.tables.reports.account-transactions :report="$this->report"/>
10
             <x-company.tables.reports.account-transactions :report="$this->report"/>
11
         @else
11
         @else
12
             <x-filament-tables::empty-state
12
             <x-filament-tables::empty-state

Laddar…
Avbryt
Spara