Luca Parisio 8 months ago
parent
commit
98b60eec1e

+ 2 - 2
app/Http/Livewire/Member.php

@@ -410,7 +410,7 @@ class Member extends Component
     {
         foreach ($records as $record) {
             // $this->categories[] = array('id' => $record->id, 'name' => str_repeat(" / ", $indentation) . $record->name);
-            $this->categories[] = array('id' => $record->id, 'name' => $record->getTree());
+            $this->categories[] = array('id' => $record->id, 'name' => $record->getTree(), 'indentation' => $indentation);
             if (count($record->childs))
                 $this->getCategories($record->childs, $indentation + 1);
         }
@@ -454,7 +454,7 @@ class Member extends Component
 
         $this->categories = array();
 
-        $this->getCategories(\App\Models\Category::select('id', 'name')->where('parent_id', null)->get(), 0);
+        $this->getCategories(\App\Models\Category::select('id', 'name')->where('parent_id', null)->orderBy('name')->get(), 0);
 
         $this->courses = \App\Models\Course::select('id', 'name')->where('enabled', null)->get();
 

+ 4 - 0
app/Http/Livewire/RecordINOUT.php

@@ -467,6 +467,10 @@ class RecordINOUT extends Component
         $datas = [];
         if (env('FISCAL_YEAR_MONTH_FROM', 1) > 1)
         {
+
+            if (date("m") < env('FISCAL_YEAR_MONTH_FROM', 1))
+                $year -= 1;
+
             for($m=env('FISCAL_YEAR_MONTH_FROM', 1);$m<=12;$m++)
             {
                 $datas[] = $m . "-" . $year;

+ 2 - 2
resources/views/livewire/member.blade.php

@@ -2295,7 +2295,7 @@
             setTimeout(() => {
                 $(".select2-results__option").each(function(){
                     var txt = $(this).html();
-                    var count = (txt.match(/-/g) || []).length;
+                    var count = (txt.match(/-/g) || []).length;                    
                     $(this).addClass('paddingLeftSelect' + count);
                 });
             }, 100);
@@ -2305,7 +2305,7 @@
             setTimeout(() => {
                 $(".select2-results__option").each(function(){
                     var txt = $(this).html();
-                    var count = (txt.match(/-/g) || []).length;
+                    var count = (txt.match(/-/g) || []).length;     
                     $(this).addClass('paddingLeftSelect' + count);
                 });
             }, 100);