|
|
@@ -27,15 +27,7 @@
|
|
|
@endforeach
|
|
|
</select>
|
|
|
</div>
|
|
|
- <div class="col-md-2">
|
|
|
- Metodo di pagamento
|
|
|
- <select name="search_payment_method[]" class="form-select filterPaymentMethods me-2" multiple="multiple" wire:model="filterPaymentMethods">
|
|
|
- @foreach($payments as $payment)
|
|
|
- <option value="{{$payment["id"]}}">{!!$payment["name"]!!}
|
|
|
- @endforeach
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- <div class="col-md-2">
|
|
|
+ <div class="col-md-3">
|
|
|
Periodo
|
|
|
<div class="col-12 mb-3">
|
|
|
<select wire:model="selectedPeriod" class="form-select" @if($isFiltering) disabled @endif style="height: 43px!important;">
|
|
|
@@ -267,7 +259,33 @@
|
|
|
@endif
|
|
|
@endif
|
|
|
</div>
|
|
|
- <div class="col-md-2">
|
|
|
+ </div>
|
|
|
+ <div class="row g-3">
|
|
|
+ <div class="col-md-3">
|
|
|
+ Metodo di pagamento
|
|
|
+ <select name="search_payment_method[]" class="form-select filterPaymentMethods me-2" multiple="multiple" wire:model="filterPaymentMethods">
|
|
|
+ @foreach($payments as $payment)
|
|
|
+ <option value="{{$payment["id"]}}">{!!$payment["name"]!!}
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="col-md-3">
|
|
|
+ Origine
|
|
|
+ <select name="search_origin[]" class="form-select filterOrigins me-2" multiple="multiple" wire:model="filterOrigins">
|
|
|
+ @foreach($origins as $origin)
|
|
|
+ <option value="{{$origin["id"]}}">{!!$origin["name"]!!}
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="col-md-3">
|
|
|
+ Destinazione
|
|
|
+ <select name="search_destination[]" class="form-select filterDestinations me-2" multiple="multiple" wire:model="filterDestinations">
|
|
|
+ @foreach($destinations as $destination)
|
|
|
+ <option value="{{$destination["id"]}}">{!!$destination["name"]!!}
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="col">
|
|
|
<div class="prima--nota_buttons ms-auto" style="float:right; margin-top:25px;">
|
|
|
<button class="btn--ui primary" wire:click="applyFilters" style="margin-right:5px;" @if($isFiltering) disabled @endif>
|
|
|
@if($isFiltering)
|
|
|
@@ -347,7 +365,7 @@
|
|
|
<th scope="col">Stato</th>
|
|
|
<th scope="col" class="text-end">Entrata</th>
|
|
|
<th scope="col" class="text-end">Uscita</th>
|
|
|
- <th scope="col">Origine</th>
|
|
|
+ <th scope="col" style="padding-left: 20px;">Origine</th>
|
|
|
<th scope="col">Destinazione</th>
|
|
|
<th scope="col">Metodo di pagamento</th>
|
|
|
</tr>
|
|
|
@@ -371,12 +389,12 @@
|
|
|
<tr>
|
|
|
<td style="background-color: {{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{date("d/m/Y", strtotime($record->date))}}</td>
|
|
|
<td style="background-color: {{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{$record->commercial ? 'Commerciale' : 'Non commerciale'}}</td>
|
|
|
- <td style="background-color: {{$count % 2 == 0 ? 'white' : '#f2f4f7'}}; width: 20%;white-space: pre-line;">{{$record->causal_name}}</td>
|
|
|
- <td style="background-color: {{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{$record->type == 'IN' ? ($record->member->first_name . " " . $record->member->last_name) : @$record->supplier->name}}</td>
|
|
|
+ <td style="background-color: {{$count % 2 == 0 ? 'white' : '#f2f4f7'}}; width: 22%;white-space: pre-line;">{{$record->causal_name}}</td>
|
|
|
+ <td style="background-color: {{$count % 2 == 0 ? 'white' : '#f2f4f7'}}; width: 22%">{{$record->type == 'IN' ? ($record->member->first_name . " " . $record->member->last_name) : @$record->supplier->name}}</td>
|
|
|
<td style="background-color: {{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{$record->deleted ? 'Annullata' : ''}}</td>
|
|
|
<td style="background-color: {{$count % 2 == 0 ? 'white' : '#f2f4f7'}}; text-align: right; color: green">{{$record->type == 'IN' ? formatPrice($record->amount) : ''}}</td>
|
|
|
<td style="background-color: {{$count % 2 == 0 ? 'white' : '#f2f4f7'}}; text-align: right; color: red">{{$record->type == 'OUT' ? formatPrice($record->amount) : ''}}</td>
|
|
|
- <td style="background-color: {{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{$record->type == 'OUT' ? $record->origin : ''}}</td>
|
|
|
+ <td style="background-color: {{$count % 2 == 0 ? 'white' : '#f2f4f7'}}; padding-left: 20px;">{{$record->type == 'OUT' ? $record->origin : ''}}</td>
|
|
|
<td style="background-color: {{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{$record->type == 'IN' ? $record->destination : ''}}</td>
|
|
|
<td style="background-color: {{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{$record->payment_method->name}}</td>
|
|
|
</tr>
|
|
|
@@ -1349,6 +1367,16 @@
|
|
|
$(this).select2('close');
|
|
|
}
|
|
|
});
|
|
|
+ $('.filterOrigins').each(function() {
|
|
|
+ if ($(this).hasClass('select2-hidden-accessible')) {
|
|
|
+ $(this).select2('close');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('.filterDestinations').each(function() {
|
|
|
+ if ($(this).hasClass('select2-hidden-accessible')) {
|
|
|
+ $(this).select2('close');
|
|
|
+ }
|
|
|
+ });
|
|
|
$('.filterMember').each(function() {
|
|
|
if ($(this).hasClass('select2-hidden-accessible')) {
|
|
|
$(this).select2('close');
|
|
|
@@ -1432,6 +1460,80 @@
|
|
|
}, 100);
|
|
|
});
|
|
|
|
|
|
+ $(document).on("keypress", $('.filterOrigins'), function (e) {
|
|
|
+ setTimeout(() => {
|
|
|
+ $(".select2-results__option").each(function(){
|
|
|
+ var txt = $(this).html();
|
|
|
+ var count = (txt.match(/-/g) || []).length;
|
|
|
+ $(this).addClass('paddingLeftSelect' + count);
|
|
|
+ });
|
|
|
+ }, 100);
|
|
|
+ });
|
|
|
+
|
|
|
+ if (!$('.filterOrigins').hasClass('select2-hidden-accessible')) {
|
|
|
+ $('.filterOrigins').select2({
|
|
|
+ "language": {"noResults": function(){return "Nessun risultato";}},
|
|
|
+ "dropdownParent": $('body'),
|
|
|
+ "width": "100%"
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ $('.filterOrigins').off('change.customHandler').on('change.customHandler', function (e) {
|
|
|
+ var data = $('.filterOrigins').select2("val");
|
|
|
+ @this.set('filterOrigins', data);
|
|
|
+ });
|
|
|
+
|
|
|
+ $('.filterOrigins').off('select2:open.customHandler').on('select2:open.customHandler', function (e) {
|
|
|
+ if ($('#causalsModal').hasClass('show')) {
|
|
|
+ $('#causalsModal').modal('hide');
|
|
|
+ }
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ $(".select2-results__option").each(function(){
|
|
|
+ var txt = $(this).html();
|
|
|
+ var count = (txt.match(/-/g) || []).length;
|
|
|
+ $(this).addClass('paddingLeftSelect' + count);
|
|
|
+ });
|
|
|
+ }, 100);
|
|
|
+ });
|
|
|
+
|
|
|
+ $(document).on("keypress", $('.filterDestinations'), function (e) {
|
|
|
+ setTimeout(() => {
|
|
|
+ $(".select2-results__option").each(function(){
|
|
|
+ var txt = $(this).html();
|
|
|
+ var count = (txt.match(/-/g) || []).length;
|
|
|
+ $(this).addClass('paddingLeftSelect' + count);
|
|
|
+ });
|
|
|
+ }, 100);
|
|
|
+ });
|
|
|
+
|
|
|
+ if (!$('.filterDestinations').hasClass('select2-hidden-accessible')) {
|
|
|
+ $('.filterDestinations').select2({
|
|
|
+ "language": {"noResults": function(){return "Nessun risultato";}},
|
|
|
+ "dropdownParent": $('body'),
|
|
|
+ "width": "100%"
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ $('.filterDestinations').off('change.customHandler').on('change.customHandler', function (e) {
|
|
|
+ var data = $('.filterDestinations').select2("val");
|
|
|
+ @this.set('filterDestinations', data);
|
|
|
+ });
|
|
|
+
|
|
|
+ $('.filterDestinations').off('select2:open.customHandler').on('select2:open.customHandler', function (e) {
|
|
|
+ if ($('#causalsModal').hasClass('show')) {
|
|
|
+ $('#causalsModal').modal('hide');
|
|
|
+ }
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ $(".select2-results__option").each(function(){
|
|
|
+ var txt = $(this).html();
|
|
|
+ var count = (txt.match(/-/g) || []).length;
|
|
|
+ $(this).addClass('paddingLeftSelect' + count);
|
|
|
+ });
|
|
|
+ }, 100);
|
|
|
+ });
|
|
|
+
|
|
|
if (!$('.filterMember').hasClass('select2-hidden-accessible')) {
|
|
|
$('.filterMember').select2({
|
|
|
"language": {"noResults": function(){return "Nessun risultato";}},
|
|
|
@@ -1570,6 +1672,8 @@
|
|
|
$('.filterMember').val('').trigger('change');
|
|
|
$('.filterCausals').val('').trigger('change');
|
|
|
$('.filterPaymentMethods').val('').trigger('change');
|
|
|
+ $('.filterOrigins').val('').trigger('change');
|
|
|
+ $('.filterDestinations').val('').trigger('change');
|
|
|
load();
|
|
|
});
|
|
|
|
|
|
@@ -1899,6 +2003,8 @@
|
|
|
$('.filterMember').val('').trigger('change');
|
|
|
$('.filterCausals').val('').trigger('change');
|
|
|
$('.filterPaymentMethods').val('').trigger('change');
|
|
|
+ $('.filterOrigins').val('').trigger('change');
|
|
|
+ $('.filterDestinations').val('').trigger('change');
|
|
|
|
|
|
if (typeof @this !== 'undefined') {
|
|
|
@this.call('resetFilters');
|