소스 검색

Altri fix

Luca Parisio 1 년 전
부모
커밋
d50d3f9903

+ 6 - 0
app/Http/Livewire/RecordIN.php

@@ -48,6 +48,7 @@ class RecordIN extends Component
     $vat,
     $virtual,
     $note,
+    $parent,
     $commercial, $update = false, $add = false;
 
     public $currentReceip;
@@ -162,6 +163,7 @@ class RecordIN extends Component
         $this->newMemberFiscalCode = '';
         $this->newMemberFiscalCodeExist = false;
         $this->currentReceip = null;
+        $this->parent = '';
         $this->rows = array();
         $this->rows[] = array('causal_id' => isset($_GET["causalId"]) ? $_GET["causalId"] : null, 'when' => array(array('month' => date("n"), 'year' => date("Y"), 'period' => '')),  'amount' => null, 'vat_id' => null, 'note' => '', 'commercial' => 0);
         $this->emit('load-data-table');
@@ -551,7 +553,10 @@ class RecordIN extends Component
 
                 $exist = \App\Models\Receipt::where('record_id', $id)->orderBy('id', 'DESC')->first();
                 if ($exist != null)
+                {
                     $this->currentReceip = $exist;
+                    $this->parent = $this->currentReceip->parent;
+                }
             }
         } catch (\Exception $ex) {
             session()->flash('error','Errore (' . $ex->getMessage() . ')');
@@ -749,6 +754,7 @@ class RecordIN extends Component
                 'date' => $this->date,
                 'year' => date("Y"),
                 'type' => $this->type,
+                'parent' => $this->parent,
                 'status' => 1,
             ]);
 

+ 10 - 5
app/Http/Livewire/RecordOUT.php

@@ -110,7 +110,7 @@ class RecordOUT extends Component
         $this->type = 'OUT';
         //$this->note = '';
         //$this->amount = null;
-        //$this->commercial = 0;
+        $this->commercial = 0;
         $this->rows = array();
         $this->rows[] = array('causal_id' => null, 'when' => array(array('month' => date("n"), 'year' => date("Y"), 'period' => '')),  'amount' => null, 'note' => '', 'commercial' => 0);
         $this->emit('load-data-table');
@@ -311,7 +311,7 @@ class RecordOUT extends Component
                 //'note' => $this->note,
                 'type' => $this->type,
                 //'amount' => $this->currencyToDouble($this->amount),
-                //'commercial' => $this->commercial,
+                'commercial' => $this->commercial,
             ]);
 
             $this->dataId = $record->id;
@@ -362,7 +362,7 @@ class RecordOUT extends Component
                 //$this->note = $record->note;
                 $this->type = $record->type;
                 //$this->amount = formatPrice($record->amount);
-                //$this->commercial = $record->commercial;
+                $this->commercial = $record->commercial;
                 $this->dataId = $record->id;
                 $this->update = true;
                 $this->add = false;
@@ -396,7 +396,7 @@ class RecordOUT extends Component
                 //'note' => $this->note,
                 'type' => $this->type,
                 //'amount' => $this->currencyToDouble($this->amount),
-                //'commercial' => $this->commercial,
+                'commercial' => $this->commercial,
             ]);
 
             $tot = 0;
@@ -552,7 +552,7 @@ class RecordOUT extends Component
 
     public function delPeriod($idx, $xxx)
     {
-        array_splice($this->rows[$idx]['when'], $xxx, $xxx);
+        array_splice($this->rows[$idx]['when'], $xxx, 1);
         // $this->emit('load-select');
     }
 
@@ -591,4 +591,9 @@ class RecordOUT extends Component
 
     }
 
+    public function multiPeriodCancel()
+    {
+        $this->multiP = false;
+    }
+
 }

+ 2 - 1
app/Models/Receipt.php

@@ -22,7 +22,8 @@ class Receipt extends Model
         'type',
         'amount',
         'commercial',
-        'status'
+        'status',
+        'parent'
     ];
 
     public function rows()

+ 32 - 0
database/migrations/2024_05_23_100000_add_parent_to_receipts_table.php

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('receipts', function (Blueprint $table) {
+            $table->string('parent')->nullable();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('receipts', function (Blueprint $table) {
+            $table->dropColumn('parent');
+        });
+    }
+};

+ 1 - 0
resources/views/layouts/app.blade.php

@@ -20,6 +20,7 @@
   .buttons-print, .buttons-csv{
     background-color: #006099 !important;
   }
+
   </style>
 
 </head>

+ 1 - 1
resources/views/livewire/bank.blade.php

@@ -166,7 +166,7 @@
                 },
                 layout: {
                     topStart: {
-                        buttons: ['csv', 'excel', 'pdf', 'print']
+                        buttons: [{ extend: 'csv', text: 'Esporta' }, 'excel', 'pdf', { extend: 'print', text: 'Stampa' }]
                     }
                 },
                 pagingType: 'numbers',

+ 1 - 1
resources/views/livewire/card.blade.php

@@ -228,7 +228,7 @@
                 },
                 layout: {
                     topStart: {
-                        buttons: ['csv', 'excel', 'pdf', 'print']
+                        buttons: [{ extend: 'csv', text: 'Esporta' }, 'excel', 'pdf', { extend: 'print', text: 'Stampa' }]
                     }
                 },
                 pagingType: 'numbers',

+ 1 - 1
resources/views/livewire/city.blade.php

@@ -141,7 +141,7 @@
                 },
                 layout: {
                     topStart: {
-                        buttons: ['csv', 'excel', 'pdf', 'print']
+                        buttons: [{ extend: 'csv', text: 'Esporta' }, 'excel', 'pdf', { extend: 'print', text: 'Stampa' }]
                     }
                 },
                 pagingType: 'numbers',

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

@@ -1552,14 +1552,14 @@
 
             $('#tablesaw-350').DataTable({
                 //destroy: true,
-                fixedHeader: true,
+                fixedHeader: false,
                 order: [[3, 'asc'], [4, 'asc']],
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
                 layout: {
                     topStart: {
-                        buttons: ['csv', 'excel', 'pdf', 'print']
+                        buttons: [{ extend: 'csv', text: 'Esporta' }, 'excel', 'pdf', { extend: 'print', text: 'Stampa' }]
                     }
                 },
                 pagingType: 'numbers',
@@ -1572,5 +1572,6 @@
 
         }
 
+
     </script>
 @endpush

+ 1 - 1
resources/views/livewire/nation.blade.php

@@ -184,7 +184,7 @@
                 },
                 layout: {
                     topStart: {
-                        buttons: ['csv', 'excel', 'pdf', 'print']
+                        buttons: [{ extend: 'csv', text: 'Esporta' }, 'excel', 'pdf', { extend: 'print', text: 'Stampa' }]
                     }
                 },
                 pagingType: 'numbers',

+ 1 - 1
resources/views/livewire/payment_method.blade.php

@@ -190,7 +190,7 @@
                 },
                 layout: {
                     topStart: {
-                        buttons: ['csv', 'excel', 'pdf', 'print']
+                        buttons: [{ extend: 'csv', text: 'Esporta' }, 'excel', 'pdf', { extend: 'print', text: 'Stampa' }]
                     }
                 },
                 pagingType: 'numbers',

+ 1 - 1
resources/views/livewire/province.blade.php

@@ -173,7 +173,7 @@
                 },
                 layout: {
                     topStart: {
-                        buttons: ['csv', 'excel', 'pdf', 'print']
+                        buttons: [{ extend: 'csv', text: 'Esporta' }, 'excel', 'pdf', { extend: 'print', text: 'Stampa' }]
                     }
                 },
                 pagingType: 'numbers',

+ 8 - 11
resources/views/livewire/records_in.blade.php

@@ -595,18 +595,15 @@
                                         @else
                                             <li>
                                                 <span class="evidence_name">
-                                                    @if($this->member->father_name != '' && $this->member->mother_name != '')
-                                                        <select class="form-control">
-                                                            <option value="1">{{$this->member->father_name}}
-                                                            <option value="2">{{$this->member->mother_name}}
-                                                        </select>
-                                                    @else
+                                                    <select class="form-control" wire:model="parent">
+                                                        <option value="">Seleziona un genitore
                                                         @if($this->member->father_name != '')
-                                                            {{$this->member->father_name}}
-                                                        @else
-                                                            {{$this->member->mother_name}}
+                                                            <option value="{{$this->member->father_name}} {{$this->member->father_fiscal_code}}">{{$this->member->father_name}} {{$this->member->father_fiscal_code}}
                                                         @endif
-                                                    @endif
+                                                        @if($this->member->mother_name != '')
+                                                            <option value="{{$this->member->mother_name}} {{$this->member->mother_fiscal_code}}">{{$this->member->mother_name}} {{$this->member->mother_fiscal_code}}
+                                                        @endif
+                                                    </select>
                                                 </span>
                                             </li>
                                         @endif
@@ -911,7 +908,7 @@
             }
 
             $('#tablesaw-350').DataTable({
-                fixedHeader: true,
+                fixedHeader: false,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },

+ 28 - 0
resources/views/livewire/records_in_out.blade.php

@@ -268,6 +268,34 @@
         {
             border-left: 1px solid grey;
         }
+
+        .select2-selection--multiple{
+            overflow: hidden !important;
+            height: auto !important;
+        }
+        .select2-container {
+            box-sizing: border-box;
+            display: inline-block;
+            margin: 0;
+            position: relative;
+            vertical-align: middle;
+        }
+        .select2-container .select2-selection--single {
+            box-sizing: border-box;
+            cursor: pointer;
+            display: block;
+            height: 38px;
+            user-select: none;
+            -webkit-user-select: none;
+        }
+        .select2-container .select2-selection--single .select2-selection__rendered {
+            display: block;
+            padding-left: 8px;
+            padding-right: 20px;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+        }
     </style>
     <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
     <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>

+ 32 - 22
resources/views/livewire/records_out.blade.php

@@ -264,7 +264,26 @@
                 <section id="accountingExit" class="d-flex"  wire:key='reload-{{$selectId}}'>
                     <div class="accountingExit_data">
                         <form class="form--accounting">
+
+
                                 <div class="row gx-2">
+
+                                    <div class="col-md-12">
+                                        <span class="title-form d-block w-100">Tipologia</span>
+                                        <div class="input-group mb-12">
+                                            <div class="check--invoice d-flex align-items-center">
+                                                <div class="form-check me-3">
+                                                    <input class="form-check-input" type="radio" value="1" wire:model="commercial">
+                                                    <label class="form-check-label" for="flexCheckChecked">&nbsp;Commerciale</label>
+                                                </div>
+                                                <div class="form-check">
+                                                    <input class="form-check-input" type="radio" value="0" wire:model="commercial">
+                                                    <label class="form-check-label" for="flexCheck">&nbsp;Non Commerciale</label>
+                                                </div>
+                                                </div>
+                                        </div>
+                                    </div>
+
                                     <div class="col-md-6">
                                         <span class="title-form d-block w-100">Data di Pagamento</span>
                                         <div class="input-group mb-3">
@@ -337,23 +356,6 @@
                                         </div>
                                     </div>
 
-                                    <div class="row gx-2 mt-5">
-                                        <span class="title-form d-block w-100">Tipologia</span>
-                                        <div class="col-md-12">
-
-                                                <div class="check--invoice d-flex align-items-center">
-                                                <div class="form-check me-3">
-                                                    <input class="form-check-input" type="radio" value="1" id="rows.{{$idx}}.commercial" wire:model="rows.{{$idx}}.commercial">
-                                                    <label class="form-check-label" for="flexCheckChecked">&nbsp;Commerciale</label>
-                                                </div>
-                                                <div class="form-check">
-                                                    <input class="form-check-input" type="radio" value="0" id="rows.{{$idx}}.commercial"  wire:model="rows.{{$idx}}.commercial">
-                                                    <label class="form-check-label" for="flexCheck">&nbsp;Non Commerciale</label>
-                                                </div>
-                                                </div>
-
-                                        </div>
-                                    </div>
 
                                     <div class="row gx-2 mt-5 align-items-center">
                                         <div class="col-md-6">
@@ -379,7 +381,7 @@
                                         <div class="col-md-8">
 
                                             @if($multiP)
-                                                <div class="row">
+                                                <div class="row" style="background-color:lightGrey">
                                                     <div class="col-md-3">
                                                         <span class="title-form d-block w-100">Dal mese</span>
                                                         <div class="input-group mb-3">
@@ -430,10 +432,18 @@
                                                             <input type="number" class="form-control"  wire:model="multiYearTo" >
                                                         </div>
                                                     </div>
+                                                    <div class="col-md-6">
+                                                        <button type="button" class="btn--ui primary" wire:click.prevent="multiPeriodCreate({{$idx}})" style="margin-top:20px">
+                                                            Crea multi periodo
+                                                        </button>
+                                                    </div>
+                                                    <div class="col-md-6">
+                                                        <button type="button" class="btn--ui primary" wire:click.prevent="multiPeriodCancel()" style="margin-top:20px">
+                                                            Annulla multi periodo
+                                                        </button>
+                                                    </div>
                                                 </div>
-                                                <button type="button" class="btn--ui primary" wire:click.prevent="multiPeriodCreate({{$idx}})" style="margin-top:20px">
-                                                    Crea multi periodo
-                                                </button>
+
                                             @else
 
                                                 <div class="row">
@@ -711,7 +721,7 @@
 
         function loadDataTable(){
             $('#tablesaw-350').DataTable({
-                fixedHeader: true,
+                fixedHeader: false,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },

+ 1 - 1
resources/views/livewire/reminders.blade.php

@@ -151,7 +151,7 @@
                 },
                 layout: {
                     topStart: {
-                        buttons: ['csv', 'excel', 'pdf', 'print']
+                        buttons: [{ extend: 'csv', text: 'Esporta' }, 'excel', 'pdf', { extend: 'print', text: 'Stampa' }]
                     }
                 },
                 pagingType: 'numbers',

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

@@ -487,13 +487,13 @@
 
         function loadDataTable(){
             $('#tablesaw-350').DataTable({
-                fixedHeader: true,
+                fixedHeader: false,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
                 layout: {
                     topStart: {
-                        buttons: ['csv', 'excel', 'pdf', 'print']
+                        buttons: [{ extend: 'csv', text: 'Esporta' }, 'excel', 'pdf', { extend: 'print', text: 'Stampa' }]
                     }
                 },
                 pagingType: 'numbers',

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

@@ -375,13 +375,13 @@
 
         function loadDataTable(){
             $('#tablesaw-350').DataTable({
-                fixedHeader: true,
+                fixedHeader: false,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
                 layout: {
                     topStart: {
-                        buttons: ['csv', 'excel', 'pdf', 'print']
+                        buttons: [{ extend: 'csv', text: 'Esporta' }, 'excel', 'pdf', { extend: 'print', text: 'Stampa' }]
                     }
                 },
                 pagingType: 'numbers',

+ 1 - 1
resources/views/livewire/vat.blade.php

@@ -131,7 +131,7 @@
                 },
                 layout: {
                     topStart: {
-                        buttons: ['csv', 'excel', 'pdf', 'print']
+                        buttons: [{ extend: 'csv', text: 'Esporta' }, 'excel', 'pdf', { extend: 'print', text: 'Stampa' }]
                     }
                 },
                 pagingType: 'numbers',

+ 1 - 2
resources/views/receipt.blade.php

@@ -27,8 +27,7 @@
     <hr><br>
     <b>Intestata a</b><br><br>
     @if(!$receipt->member->isAdult())
-        <b>Padre</b>: {{$receipt->member->father_name}}<br><br>
-        <b>Madre</b>: {{$receipt->member->mother_name}}<br><br>
+        <b>Genitore</b>: {{$receipt->parent}}<br><br>
     @endif
     <b>Cognome</b>: {{$receipt->member->last_name}}<br><br>
     <b>Nome</b>: {{$receipt->member->first_name}}<br><br>