Procházet zdrojové kódy

Modifiche dashboard

ferrari před 4 měsíci
rodič
revize
00566fd3c1

+ 5 - 4
app/Http/Livewire/Dashboard.php

@@ -4,6 +4,7 @@ namespace App\Http\Livewire;
 
 use Livewire\Component;
 use Carbon\Carbon;
+use DateTimeZone;
 use Illuminate\Support\Facades\Log;
 
 class Dashboard extends Component
@@ -26,7 +27,7 @@ class Dashboard extends Component
     public $expiredCertificatesChange = 0;
     public $suspendedSubscriptionsChange = 0;
 
-    public $toReceive = 0;
+    public $received = 0;
     public $toPay = 0;
 
     public $courses = [];
@@ -200,7 +201,7 @@ class Dashboard extends Component
             $currentMonth = now()->format('Y-m');
             Log::info('Calculating financial stats for month', ['month' => $currentMonth]);
 
-            $this->toReceive = \App\Models\Record::where('type', 'IN')
+            $this->received = \App\Models\Record::where('type', 'IN')
                 ->whereRaw('DATE_FORMAT(date, "%Y-%m") = ?', [$currentMonth])
                 ->where(function ($query) {
                     $query->where('deleted', false)->orWhere('deleted', null);
@@ -216,7 +217,7 @@ class Dashboard extends Component
 
             $endTime = microtime(true);
             Log::info('Financial stats loaded successfully', [
-                'to_receive' => $this->toReceive,
+                'received' => $this->received,
                 'to_pay' => $this->toPay,
                 'execution_time_ms' => round(($endTime - $startTime) * 1000, 2)
             ]);
@@ -624,7 +625,7 @@ class Dashboard extends Component
                 $newNote = [
                     'id' => uniqid(),
                     'text' => trim($this->notes),
-                    'created_at' => now()->format('d/m/Y H:i'),
+                    'created_at' => now()->timezone('Europe/Rome')->format('d/m/Y H:i'),
                     'completed' => false
                 ];
 

+ 7 - 0
public/css/new_style.css

@@ -9,6 +9,7 @@
     --color-outile: #8979ff;
     --color-rosso: #d6234f;
     --color-verde: #339e8e;
+    --color-arancione: #FFB624;
 }
 
 ::-webkit-scrollbar {
@@ -473,6 +474,11 @@ body .dashboard-container .card-income .dashboard-card-value {
     color: var(--color-verde);
 }
 
+body .dashboard-container .card-receive .dashboard-card-icon,
+body .dashboard-container .card-receive .dashboard-card-value {
+    color: var(--color-arancione);
+}
+
 body .dashboard-container .card-expense .dashboard-card-icon,
 body .dashboard-container .card-expense .dashboard-card-value {
     color: var(--color-rosso);
@@ -484,6 +490,7 @@ body .dashboard-container .card-delta .dashboard-card-value {
 }
 
 body .dashboard-container .card-income .dashboard-card-value,
+body .dashboard-container .card-receive .dashboard-card-value,
 body .dashboard-container .card-expense .dashboard-card-value,
 body .dashboard-container .card-delta .dashboard-card-value {
     font-size: 30px;

+ 18 - 10
resources/views/livewire/dashboard.blade.php

@@ -219,12 +219,20 @@
             <!-- Financial Cards moved here -->
             <div class="dashboard-card dashboard-stat card-inverted card-income">
                 <div class="dashboard-card-header">
-                    <div class="dashboard-card-title">Da incassare<br/><small><small><i>{{$current_month}}</i></small></small></div>
+                    <div class="dashboard-card-title">Incassato<br/><small><small><i>{{$current_month}}</i></small></small></div>
                     <i class="dashboard-card-icon fa-solid fa-money-bill-trend-up"></i>
                 </div>
-                <div class="dashboard-card-value">{{number_format($toReceive, 2, ",", ".")}}</div>
+                <div class="dashboard-card-value">{{number_format($received, 2, ",", ".")}}</div>
             </div>
 
+            {{-- <div class="dashboard-card dashboard-stat card-inverted card-receive">
+                <div class="dashboard-card-header">
+                    <div class="dashboard-card-title">Da incassare<br/><small><small><i>{{$current_month}}</i></small></small></div>
+                    <i class="dashboard-card-icon fa-solid fa-money-bill-trend-up"></i>
+                </div>
+                <div class="dashboard-card-value">{{number_format($toPay, 2, ",", ".")}}</div>
+            </div> --}}
+
             <div class="dashboard-card dashboard-stat card-inverted card-expense">
                 <div class="dashboard-card-header">
                     <div class="dashboard-card-title">Da pagare<br/><small><small><i>{{$current_month}}</i></small></small></div>
@@ -263,14 +271,14 @@
 
 @push('scripts')
 <script>
-    window.addEventListener('note-saved', event => {
-        // Show success message
-        if (typeof toastr !== 'undefined') {
-            toastr.success('Nota salvata con successo!');
-        } else {
-            alert('Nota salvata con successo!');
-        }
-    });
+    // window.addEventListener('note-saved', event => {
+    //     // Show success message
+    //     if (typeof toastr !== 'undefined') {
+    //         toastr.success('Nota salvata con successo!');
+    //     } else {
+    //         alert('Nota salvata con successo!');
+    //     }
+    // });
 
     window.addEventListener('courses-activated', event => {
         if (typeof toastr !== 'undefined') {