|
|
@@ -1,9 +1,55 @@
|
|
1
|
1
|
<?php
|
|
2
|
|
-use App\Models\Role;
|
|
|
2
|
+use App\Models\RigaFatturazione;
|
|
|
3
|
+use App\Models\Attivita;
|
|
3
|
4
|
use Illuminate\Support\Facades\Auth;
|
|
|
5
|
+use Illuminate\Support\Facades\Session;
|
|
4
|
6
|
?>
|
|
5
|
7
|
@php
|
|
6
|
8
|
$configData = Helper::appClasses();
|
|
|
9
|
+
|
|
|
10
|
+$fattureEmesse = collect($fattureEmesse ?? []);
|
|
|
11
|
+$attivitaId = (int) Session::get('attivita_attuale');
|
|
|
12
|
+$attivitaNome = $attivitaId > 0
|
|
|
13
|
+ ? (Attivita::find($attivitaId)?->nome ?? 'Attività')
|
|
|
14
|
+ : (Auth::user()->hasRole('superadmin') ? 'Tutte le attività' : 'Nessuna attività');
|
|
|
15
|
+
|
|
|
16
|
+$periodoLabel = now()->translatedFormat('F Y');
|
|
|
17
|
+$periodoHint = 'Sintesi consumi: gratuiti, da pagare e già pagati';
|
|
|
18
|
+
|
|
|
19
|
+$righeQuery = RigaFatturazione::query();
|
|
|
20
|
+if ($attivitaId > 0) {
|
|
|
21
|
+ $righeQuery->where('attivita_id', $attivitaId);
|
|
|
22
|
+} elseif (! Auth::user()->hasRole('superadmin')) {
|
|
|
23
|
+ $righeQuery->whereRaw('1 = 0');
|
|
|
24
|
+}
|
|
|
25
|
+
|
|
|
26
|
+$importoRiga = function ($riga) {
|
|
|
27
|
+ $qta = (int) ($riga->qta ?? 1);
|
|
|
28
|
+ if ($qta < 1) {
|
|
|
29
|
+ $qta = 1;
|
|
|
30
|
+ }
|
|
|
31
|
+
|
|
|
32
|
+ return (float) ($riga->prezzo ?? 0) * $qta;
|
|
|
33
|
+};
|
|
|
34
|
+
|
|
|
35
|
+$righe = (clone $righeQuery)->get(['id', 'prezzo', 'qta', 'stato']);
|
|
|
36
|
+
|
|
|
37
|
+$righeGratis = $righe->where('stato', RigaFatturazione::GRATUITO);
|
|
|
38
|
+$righeDaPagare = $righe->whereIn('stato', [RigaFatturazione::REGISTRATO, RigaFatturazione::FATTURATO]);
|
|
|
39
|
+$righePagate = $righe->where('stato', RigaFatturazione::PAGATO);
|
|
|
40
|
+
|
|
|
41
|
+$countGratis = $righeGratis->count();
|
|
|
42
|
+$countDaPagare = $righeDaPagare->count();
|
|
|
43
|
+$countPagati = $righePagate->count();
|
|
|
44
|
+
|
|
|
45
|
+$importoDaPagare = (float) $righeDaPagare->sum($importoRiga);
|
|
|
46
|
+$importoPagati = (float) $righePagate->sum($importoRiga);
|
|
|
47
|
+
|
|
|
48
|
+$importoFattureEmesse = (float) $fattureEmesse->sum(function ($f) {
|
|
|
49
|
+ return (float) ($f->totale_imponibile ?? 0);
|
|
|
50
|
+});
|
|
|
51
|
+$countFatture = $fattureEmesse->count();
|
|
|
52
|
+$mostraTutti = request()->boolean('tutti_i_consumi');
|
|
7
|
53
|
@endphp
|
|
8
|
54
|
|
|
9
|
55
|
@extends('layouts/layoutMaster')
|
|
|
@@ -20,7 +66,6 @@ $configData = Helper::appClasses();
|
|
20
|
66
|
])
|
|
21
|
67
|
@endsection
|
|
22
|
68
|
|
|
23
|
|
-<!-- Vendor Scripts -->
|
|
24
|
69
|
@section('vendor-script')
|
|
25
|
70
|
@vite([
|
|
26
|
71
|
'resources/assets/vendor/libs/moment/moment.js',
|
|
|
@@ -28,155 +73,262 @@ $configData = Helper::appClasses();
|
|
28
|
73
|
'resources/assets/vendor/libs/@form-validation/popular.js',
|
|
29
|
74
|
'resources/assets/vendor/libs/@form-validation/bootstrap5.js',
|
|
30
|
75
|
'resources/assets/vendor/libs/@form-validation/auto-focus.js',
|
|
31
|
|
-'resources/assets/vendor/libs/@form-validation/popular.js',
|
|
32
|
|
-'resources/assets/vendor/libs/@form-validation/bootstrap5.js',
|
|
33
|
|
-'resources/assets/vendor/libs/@form-validation/auto-focus.js',
|
|
34
|
76
|
'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js'
|
|
35
|
77
|
])
|
|
36
|
78
|
@endsection
|
|
37
|
79
|
|
|
38
|
80
|
@section('pageTitle')
|
|
39
|
81
|
<div class="d-flex flex-column">
|
|
40
|
|
- <h4 class="mb-1 text-sm-small mt-md-4 mt-lg-4">
|
|
41
|
|
- <i class="bx bxs-coin d-none d-md-inline-flex d-lg-inline-flex"></i>Consumi e Fatturazione</h4>
|
|
42
|
|
- <!-- <nav aria-label="breadcrumb" style="font-size: smaller;" class="d-none d-md-block d-lg-block">
|
|
43
|
|
- <ol class="breadcrumb breadcrumb-custom-icon">
|
|
44
|
|
-
|
|
45
|
|
- <li class="breadcrumb-item">
|
|
46
|
|
- <a href="#">Fatturazione</a>
|
|
47
|
|
- <i class="breadcrumb-icon icon-base bx bx-chevron-right align-middle"></i>
|
|
48
|
|
- </li>
|
|
49
|
|
-
|
|
50
|
|
- </ol>
|
|
51
|
|
- </nav> -->
|
|
|
82
|
+ <h4 class="mb-0 text-sm-small">
|
|
|
83
|
+ <i class="bx bxs-coin d-none d-md-inline-flex d-lg-inline-flex"></i>Consumi e Fatturazione
|
|
|
84
|
+ </h4>
|
|
|
85
|
+ <nav aria-label="breadcrumb" style="font-size: smaller;" class="d-none d-md-block d-lg-block">
|
|
|
86
|
+ <ol class="breadcrumb breadcrumb-custom-icon mb-0">
|
|
|
87
|
+ <li class="breadcrumb-item">
|
|
|
88
|
+ <a href="#">Fatturazione</a>
|
|
|
89
|
+ <i class="breadcrumb-icon icon-base bx bx-chevron-right align-middle"></i>
|
|
|
90
|
+ </li>
|
|
|
91
|
+ <li class="breadcrumb-item active text-primary">Consumi e fatturazione</li>
|
|
|
92
|
+ </ol>
|
|
|
93
|
+ </nav>
|
|
52
|
94
|
</div>
|
|
53
|
95
|
@endsection
|
|
54
|
96
|
|
|
55
|
97
|
@section('content')
|
|
56
|
98
|
<style>
|
|
57
|
|
- div.upload button:first-child{
|
|
|
99
|
+ div.upload button:first-child {
|
|
58
|
100
|
display: none !important;
|
|
59
|
101
|
}
|
|
60
|
102
|
|
|
61
|
|
-.bx-chef-hat{
|
|
62
|
|
- --svg: url("data:image/svg+xml,%3csvg width='24' height='24' fill='currentColor' viewBox='0 0 24 24' transform='' xmlns='http://www.w3.org/2000/svg'%3e%3c!--Boxicons v3.0.8 https://boxicons.com %7c License https://docs.boxicons.com/free--%3e%3cpath d='M17.13 5.54C16.33 3.42 14.32 2 12 2S7.67 3.42 6.87 5.54A5.506 5.506 0 0 0 2 11c0 2.07 1.18 3.95 3 4.88V18c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-2.12c1.82-.93 3-2.81 3-4.88 0-2.82-2.13-5.15-4.87-5.46m.53 8.75c-.4.14-.67.52-.67.94v1.78H7v-1.78c0-.42-.27-.8-.67-.94-1.4-.5-2.33-1.82-2.33-3.28 0-1.93 1.57-3.5 3.42-3.5.04 0 .14.01.18.02.49 0 .9-.31 1-.78.36-1.61 1.76-2.73 3.41-2.73s3.05 1.12 3.41 2.73c.1.47.51.81 1 .78.06 0 .12 0 .09-.01 1.93 0 3.5 1.57 3.5 3.5 0 1.47-.94 2.79-2.33 3.28ZM5 20h14v2H5z'%3e%3c/path%3e%3c/svg%3e");
|
|
63
|
|
-}
|
|
|
103
|
+ .fatturazione-page .tab-content {
|
|
|
104
|
+ padding: 0 !important;
|
|
|
105
|
+ margin: 0 !important;
|
|
|
106
|
+ border: 0 !important;
|
|
|
107
|
+ box-shadow: none !important;
|
|
|
108
|
+ }
|
|
64
|
109
|
|
|
|
110
|
+ .fatturazione-page .fatturazione-kpi .avatar-initial {
|
|
|
111
|
+ display: inline-flex;
|
|
|
112
|
+ align-items: center;
|
|
|
113
|
+ justify-content: center;
|
|
|
114
|
+ width: 2.5rem;
|
|
|
115
|
+ height: 2.5rem;
|
|
|
116
|
+ }
|
|
65
|
117
|
</style>
|
|
66
|
118
|
|
|
67
|
119
|
@include('_partials.status')
|
|
68
|
120
|
|
|
69
|
|
-<div class="row justify-content-center">
|
|
70
|
|
- <div class="col-xxl mb-4 mt-2">
|
|
71
|
|
- <ul class="nav nav-pills mb-3 gap-1" role="tablist">
|
|
72
|
|
- <li class="nav-item" role="presentation">
|
|
73
|
|
- <button
|
|
74
|
|
- type="button"
|
|
75
|
|
- class="nav-link active"
|
|
76
|
|
- id="tab-consumi"
|
|
77
|
|
- data-bs-toggle="pill"
|
|
78
|
|
- data-bs-target="#pane-consumi"
|
|
79
|
|
- role="tab"
|
|
80
|
|
- aria-controls="pane-consumi"
|
|
81
|
|
- aria-selected="true"
|
|
82
|
|
- >
|
|
83
|
|
- <i class="bx bx-list-ul me-1"></i>Consumi
|
|
84
|
|
- </button>
|
|
85
|
|
- </li>
|
|
86
|
|
- <li class="nav-item" role="presentation">
|
|
87
|
|
- <button
|
|
88
|
|
- type="button"
|
|
89
|
|
- class="nav-link"
|
|
90
|
|
- id="tab-fatturazione"
|
|
91
|
|
- data-bs-toggle="pill"
|
|
92
|
|
- data-bs-target="#pane-fatturazione"
|
|
93
|
|
- role="tab"
|
|
94
|
|
- aria-controls="pane-fatturazione"
|
|
95
|
|
- aria-selected="false"
|
|
96
|
|
- >
|
|
97
|
|
- <i class="bx bx-receipt me-1"></i>Fatturazione
|
|
98
|
|
- @if(($fattureEmesse ?? collect())->count() > 0)
|
|
99
|
|
- <span class="badge rounded-pill bg-danger ms-1">{{ $fattureEmesse->count() }}</span>
|
|
100
|
|
- @endif
|
|
101
|
|
- </button>
|
|
102
|
|
- </li>
|
|
103
|
|
- </ul>
|
|
104
|
|
-
|
|
105
|
|
- <div class="tab-content"
|
|
106
|
|
- style="
|
|
107
|
|
- padding:none;
|
|
108
|
|
- margin:none;
|
|
109
|
|
- border:none;
|
|
110
|
|
- box-shadow:none;"
|
|
111
|
|
- >
|
|
112
|
|
- <div class="tab-pane fade show active" id="pane-consumi" role="tabpanel" aria-labelledby="tab-consumi">
|
|
113
|
|
- <div class="card">
|
|
114
|
|
- <div class="card-body">
|
|
115
|
|
- {{ $dataTable_riga_fatturazione->table(['class' => 'table table-bordered']) }}
|
|
|
121
|
+<div class="fatturazione-page">
|
|
|
122
|
+ {{-- Sintesi --}}
|
|
|
123
|
+ <div class="d-flex flex-wrap align-items-end justify-content-between gap-2 mb-3">
|
|
|
124
|
+ <div>
|
|
|
125
|
+ <!-- <h5 class="mb-1">{{ $attivitaNome }}</h5> -->
|
|
|
126
|
+ <p class="text-muted small mb-0">
|
|
|
127
|
+ {{ $periodoHint }}
|
|
|
128
|
+ <!-- {{ $periodoHint }} · riferimento {{ $periodoLabel }} -->
|
|
|
129
|
+ </p>
|
|
|
130
|
+ </div>
|
|
|
131
|
+ </div>
|
|
|
132
|
+
|
|
|
133
|
+ <div class="row g-3 mb-4 fatturazione-kpi">
|
|
|
134
|
+ <div class="col-12 col-md-4">
|
|
|
135
|
+ <div class="card card-border-shadow-info h-100">
|
|
|
136
|
+ <div class="card-body">
|
|
|
137
|
+ <div class="d-flex align-items-center justify-content-between">
|
|
|
138
|
+ <div>
|
|
|
139
|
+ <span class="text-heading">Gratuiti</span>
|
|
|
140
|
+ <h5 class="mb-0 mt-1 text-info">{{ $countGratis }}</h5>
|
|
|
141
|
+ <small class="text-muted">Sotto soglia / non a pagamento</small>
|
|
|
142
|
+ </div>
|
|
|
143
|
+ <span class="avatar-initial rounded bg-label-info">
|
|
|
144
|
+ <i class="bx bx-gift bx-md"></i>
|
|
|
145
|
+ </span>
|
|
|
146
|
+ </div>
|
|
|
147
|
+ </div>
|
|
|
148
|
+ </div>
|
|
|
149
|
+ </div>
|
|
|
150
|
+
|
|
|
151
|
+ <div class="col-12 col-md-4">
|
|
|
152
|
+ <div class="card card-border-shadow-warning h-100">
|
|
|
153
|
+ <div class="card-body">
|
|
|
154
|
+ <div class="d-flex align-items-center justify-content-between">
|
|
|
155
|
+ <div>
|
|
|
156
|
+ <span class="text-heading">Da pagare</span>
|
|
|
157
|
+ <h5 class="mb-0 mt-1 text-warning">
|
|
|
158
|
+ € {{ number_format($importoDaPagare, 2, ',', '.') }}
|
|
|
159
|
+ </h5>
|
|
|
160
|
+ <small class="text-muted">
|
|
|
161
|
+ {{ $countDaPagare }} {{ $countDaPagare === 1 ? 'consumo' : 'consumi' }} registrati o fatturati
|
|
|
162
|
+ </small>
|
|
|
163
|
+ </div>
|
|
|
164
|
+ <span class="avatar-initial rounded bg-label-warning">
|
|
|
165
|
+ <i class="bx bx-time-five bx-md"></i>
|
|
|
166
|
+ </span>
|
|
|
167
|
+ </div>
|
|
|
168
|
+ </div>
|
|
|
169
|
+ </div>
|
|
|
170
|
+ </div>
|
|
|
171
|
+
|
|
|
172
|
+ <div class="col-12 col-md-4">
|
|
|
173
|
+ <div class="card card-border-shadow-success h-100">
|
|
|
174
|
+ <div class="card-body">
|
|
|
175
|
+ <div class="d-flex align-items-center justify-content-between">
|
|
|
176
|
+ <div>
|
|
|
177
|
+ <span class="text-heading">Pagati</span>
|
|
|
178
|
+ <h5 class="mb-0 mt-1 text-success">
|
|
|
179
|
+ € {{ number_format($importoPagati, 2, ',', '.') }}
|
|
|
180
|
+ </h5>
|
|
|
181
|
+ <small class="text-muted">
|
|
|
182
|
+ {{ $countPagati }} {{ $countPagati === 1 ? 'consumo saldato' : 'consumi saldati' }}
|
|
|
183
|
+ </small>
|
|
|
184
|
+ </div>
|
|
|
185
|
+ <span class="avatar-initial rounded bg-label-success">
|
|
|
186
|
+ <i class="bx bx-check-circle bx-md"></i>
|
|
|
187
|
+ </span>
|
|
116
|
188
|
</div>
|
|
117
|
189
|
</div>
|
|
118
|
190
|
</div>
|
|
|
191
|
+ </div>
|
|
|
192
|
+ </div>
|
|
119
|
193
|
|
|
120
|
|
- <div class="tab-pane fade" id="pane-fatturazione" role="tabpanel" aria-labelledby="tab-fatturazione">
|
|
121
|
|
- <div class="card">
|
|
122
|
|
- <div class="card-body">
|
|
|
194
|
+ {{-- Tab --}}
|
|
|
195
|
+ <ul class="nav nav-pills mb-3 gap-1" role="tablist">
|
|
|
196
|
+ <li class="nav-item" role="presentation">
|
|
|
197
|
+ <button
|
|
|
198
|
+ type="button"
|
|
|
199
|
+ class="nav-link active"
|
|
|
200
|
+ id="tab-consumi"
|
|
|
201
|
+ data-bs-toggle="pill"
|
|
|
202
|
+ data-bs-target="#pane-consumi"
|
|
|
203
|
+ role="tab"
|
|
|
204
|
+ aria-controls="pane-consumi"
|
|
|
205
|
+ aria-selected="true"
|
|
|
206
|
+ >
|
|
|
207
|
+ <i class="bx bx-list-ul me-1"></i>Consumi
|
|
|
208
|
+ @if($countDaPagare > 0)
|
|
|
209
|
+ <span class="badge rounded-pill bg-label-warning ms-1">{{ $countDaPagare }}</span>
|
|
|
210
|
+ @endif
|
|
|
211
|
+ </button>
|
|
|
212
|
+ </li>
|
|
|
213
|
+ <li class="nav-item" role="presentation">
|
|
|
214
|
+ <button
|
|
|
215
|
+ type="button"
|
|
|
216
|
+ class="nav-link"
|
|
|
217
|
+ id="tab-fatturazione"
|
|
|
218
|
+ data-bs-toggle="pill"
|
|
|
219
|
+ data-bs-target="#pane-fatturazione"
|
|
|
220
|
+ role="tab"
|
|
|
221
|
+ aria-controls="pane-fatturazione"
|
|
|
222
|
+ aria-selected="false"
|
|
|
223
|
+ >
|
|
|
224
|
+ <i class="bx bx-receipt me-1"></i>Fatture
|
|
|
225
|
+ @if($countFatture > 0)
|
|
|
226
|
+ <span class="badge rounded-pill bg-label-success ms-1">{{ $countFatture }}</span>
|
|
|
227
|
+ @endif
|
|
|
228
|
+ </button>
|
|
|
229
|
+ </li>
|
|
|
230
|
+ </ul>
|
|
|
231
|
+
|
|
|
232
|
+ <div class="tab-content">
|
|
|
233
|
+ <div class="tab-pane fade show active" id="pane-consumi" role="tabpanel" aria-labelledby="tab-consumi">
|
|
|
234
|
+ <div class="card shadow-sm border">
|
|
|
235
|
+ <div class="card-header d-flex flex-wrap align-items-center justify-content-between gap-2">
|
|
|
236
|
+ <div>
|
|
|
237
|
+ <h6 class="mb-0">Dettaglio consumi</h6>
|
|
|
238
|
+ <small class="text-muted">
|
|
|
239
|
+ @if($mostraTutti)
|
|
|
240
|
+ Vista completa (anche già fatturati).
|
|
|
241
|
+ @else
|
|
|
242
|
+ Vista predefinita: solo consumi non ancora fatturati (registrati / gratuiti).
|
|
|
243
|
+ @endif
|
|
|
244
|
+ </small>
|
|
|
245
|
+ </div>
|
|
|
246
|
+ </div>
|
|
|
247
|
+ <div class="card-body">
|
|
|
248
|
+ {{ $dataTable_riga_fatturazione->table(['class' => 'table table-bordered']) }}
|
|
|
249
|
+ </div>
|
|
|
250
|
+ </div>
|
|
|
251
|
+ </div>
|
|
123
|
252
|
|
|
124
|
|
- <small>
|
|
125
|
|
- <table class="table table-bordered">
|
|
|
253
|
+ <div class="tab-pane fade" id="pane-fatturazione" role="tabpanel" aria-labelledby="tab-fatturazione">
|
|
|
254
|
+ <div class="card shadow-sm border">
|
|
|
255
|
+ <div class="card-header d-flex flex-wrap align-items-center justify-content-between gap-2">
|
|
|
256
|
+ <div>
|
|
|
257
|
+ <h6 class="mb-0">Documenti fattura</h6>
|
|
|
258
|
+ <small class="text-muted">Fatture emesse legate a questa organizzazione.</small>
|
|
|
259
|
+ </div>
|
|
|
260
|
+ @if($countFatture > 0)
|
|
|
261
|
+ <span class="badge bg-label-success">
|
|
|
262
|
+ Totale € {{ number_format($importoFattureEmesse, 2, ',', '.') }}
|
|
|
263
|
+ </span>
|
|
|
264
|
+ @endif
|
|
|
265
|
+ </div>
|
|
|
266
|
+ <div class="card-body">
|
|
|
267
|
+ @if($countFatture === 0)
|
|
|
268
|
+ <div class="text-center text-muted py-5">
|
|
|
269
|
+ <i class="bx bx-receipt bx-lg mb-2 d-block"></i>
|
|
|
270
|
+ <p class="mb-1 fw-medium">Nessuna fattura emessa</p>
|
|
|
271
|
+ <p class="small mb-0">Quando verranno emesse, le troverai qui con importo e stato.</p>
|
|
|
272
|
+ </div>
|
|
|
273
|
+ @else
|
|
|
274
|
+ <div class="table-responsive">
|
|
|
275
|
+ <table class="table table-bordered table-hover align-middle mb-0">
|
|
126
|
276
|
<thead>
|
|
127
|
277
|
<tr>
|
|
128
|
|
- <th>Numero Fattura</th>
|
|
129
|
|
- <th>Data Fattura</th>
|
|
|
278
|
+ <th>Numero</th>
|
|
|
279
|
+ <th>Data</th>
|
|
130
|
280
|
<th>Descrizione</th>
|
|
131
|
|
- <th>Importo Fattura</th>
|
|
132
|
|
- <th>Stato Fattura</th>
|
|
133
|
|
- <th>Azioni</th>
|
|
|
281
|
+ <th class="text-end">Importo</th>
|
|
|
282
|
+ <th>Stato</th>
|
|
|
283
|
+ <th class="text-center" style="width: 90px;">Apri</th>
|
|
134
|
284
|
</tr>
|
|
135
|
285
|
</thead>
|
|
136
|
286
|
<tbody>
|
|
137
|
|
- @foreach($fattureEmesse as $fattura)
|
|
|
287
|
+ @foreach($fattureEmesse->sortByDesc('created_at') as $fattura)
|
|
138
|
288
|
<tr>
|
|
139
|
|
- <td>{{ $fattura->numero_fattura }}</td>
|
|
140
|
|
- <td>{{ $fattura->created_at->format('d/m/Y') }}</td>
|
|
141
|
|
- <td>{{ $fattura->note }}</td>
|
|
142
|
|
- <td>{{ number_format($fattura->totale_imponibile, 2, ',', '.') }} €</td>
|
|
|
289
|
+ <td class="fw-medium">{{ $fattura->numero_fattura ?: '—' }}</td>
|
|
|
290
|
+ <td>{{ optional($fattura->created_at)->format('d/m/Y') ?? '—' }}</td>
|
|
|
291
|
+ <td>{{ $fattura->note ?: '—' }}</td>
|
|
|
292
|
+ <td class="text-end">
|
|
|
293
|
+ € {{ number_format((float) ($fattura->totale_imponibile ?? 0), 2, ',', '.') }}
|
|
|
294
|
+ </td>
|
|
143
|
295
|
<td>@include('fattura.stato', ['entity' => $fattura])</td>
|
|
144
|
|
- <td>
|
|
145
|
|
- <a href="{{ route('fattura.show', ['fattura_id' => $fattura->id]) }}" class="btn btn-primary btn-sm">
|
|
146
|
|
- <i class="bx bx-arrow-back rotate-180"></i>
|
|
|
296
|
+ <td class="text-center">
|
|
|
297
|
+ <a
|
|
|
298
|
+ href="{{ route('fattura.show', ['fattura_id' => $fattura->id]) }}"
|
|
|
299
|
+ class="btn btn-sm btn-primary"
|
|
|
300
|
+ title="Apri fattura"
|
|
|
301
|
+ >
|
|
|
302
|
+ <i class="bx bx-show"></i>
|
|
147
|
303
|
</a>
|
|
148
|
304
|
</td>
|
|
149
|
305
|
</tr>
|
|
150
|
|
- @endforeach
|
|
151
|
|
- </tbody>
|
|
152
|
|
- </table>
|
|
153
|
|
- </small>
|
|
154
|
|
- </div>
|
|
|
306
|
+ @endforeach
|
|
|
307
|
+ </tbody>
|
|
|
308
|
+ </table>
|
|
|
309
|
+ </div>
|
|
|
310
|
+ @endif
|
|
155
|
311
|
</div>
|
|
156
|
312
|
</div>
|
|
157
|
313
|
</div>
|
|
158
|
314
|
</div>
|
|
159
|
315
|
</div>
|
|
160
|
|
-
|
|
161
|
316
|
@endsection
|
|
162
|
317
|
|
|
163
|
318
|
@section('page-script')
|
|
164
|
|
-
|
|
165
|
|
-{{$dataTable_riga_fatturazione->scripts(attributes: ['type' => 'module'])}}
|
|
|
319
|
+{{ $dataTable_riga_fatturazione->scripts(attributes: ['type' => 'module']) }}
|
|
166
|
320
|
|
|
167
|
321
|
@if(Auth::user()->hasRole('superadmin'))
|
|
168
|
322
|
<script type="module">
|
|
169
|
|
- $(document).ready(function(){
|
|
170
|
|
- // Editor edit
|
|
|
323
|
+ $(document).ready(function () {
|
|
171
|
324
|
$("#dataTable_riga_fatturazione").on('click', 'a.editor_edit', function (e) {
|
|
172
|
325
|
e.preventDefault();
|
|
173
|
|
- window.LaravelDataTables["dataTable_riga_fatturazione-editor"].edit( $(this).closest('tr'), {
|
|
|
326
|
+ window.LaravelDataTables["dataTable_riga_fatturazione-editor"].edit($(this).closest('tr'), {
|
|
174
|
327
|
title: 'Modifica',
|
|
175
|
328
|
buttons: 'Aggiorna',
|
|
176
|
329
|
});
|
|
177
|
330
|
});
|
|
178
|
331
|
|
|
179
|
|
- // Editor delete
|
|
180
|
332
|
$("#dataTable_riga_fatturazione").on('click', 'a.editor_delete', function (e) {
|
|
181
|
333
|
e.preventDefault();
|
|
182
|
334
|
window.LaravelDataTables["dataTable_riga_fatturazione-editor"].remove($(this).closest('tr'), {
|
|
|
@@ -184,30 +336,28 @@ $configData = Helper::appClasses();
|
|
184
|
336
|
message: 'Sei sicuro di voler eliminare il record selezionato?',
|
|
185
|
337
|
buttons: 'Cancella record'
|
|
186
|
338
|
});
|
|
187
|
|
- } );
|
|
|
339
|
+ });
|
|
188
|
340
|
|
|
189
|
|
- $("#dataTable_riga_fatturazione").on('dblclick', 'tbody td', function (e) {
|
|
190
|
|
- window.LaravelDataTables["dataTable_riga_fatturazione-editor"].edit( $(this).closest('tr'), {
|
|
|
341
|
+ $("#dataTable_riga_fatturazione").on('dblclick', 'tbody td', function () {
|
|
|
342
|
+ window.LaravelDataTables["dataTable_riga_fatturazione-editor"].edit($(this).closest('tr'), {
|
|
191
|
343
|
title: 'Modifica',
|
|
192
|
344
|
buttons: 'Aggiorna',
|
|
193
|
345
|
});
|
|
194
|
346
|
});
|
|
195
|
|
-
|
|
196
|
347
|
});
|
|
197
|
|
-
|
|
198
|
348
|
</script>
|
|
199
|
349
|
@endif
|
|
200
|
350
|
|
|
201
|
351
|
<script>
|
|
202
|
|
- function initComplete_riga_fatturazione(){
|
|
|
352
|
+ function initComplete_riga_fatturazione() {
|
|
203
|
353
|
$('div.dt-buttons button').removeClass('btn-secondary');
|
|
204
|
354
|
$('div.dt-search').addClass('mt-0 mb-4');
|
|
205
|
355
|
}
|
|
206
|
356
|
|
|
207
|
|
- function mostra_tutti_i_consumi(tutti_i_consumi){
|
|
208
|
|
- if(tutti_i_consumi){
|
|
|
357
|
+ function mostra_tutti_i_consumi(tutti_i_consumi) {
|
|
|
358
|
+ if (tutti_i_consumi) {
|
|
209
|
359
|
window.location.href = "{{ route('riga-fatturazione.index', ['tutti_i_consumi' => true]) }}";
|
|
210
|
|
- }else{
|
|
|
360
|
+ } else {
|
|
211
|
361
|
window.location.href = "{{ route('riga-fatturazione.index') }}";
|
|
212
|
362
|
}
|
|
213
|
363
|
}
|