| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478 |
- <div class="col card--ui" id="card--dashboard">
- <header id="title--section" style="display:none !important" class="d-flex align-items-center justify-content-between">
- <div class="title--section_name d-flex align-items-center justify-content-between">
- <i class="ico--ui title_section utenti me-2"></i>
- <h2 class="primary">Gestionale</h2>
- </div>
- </header>
- <section id="subheader" class="d-flex align-items-center ">
- <form action="" class=" d-flex align-items-center ">
- <select class="form-select form-select-lg me-1 " id="month" style="width:150px !important;">
- <option value="x" {{$month == "x" ? 'selected' : ""}}>Anno completo</option>
- <option value="1" {{$month == "1" ? 'selected' : ""}}>Gennaio</option>
- <option value="2" {{$month == "2" ? 'selected' : ""}}>Febbraio</option>
- <option value="3" {{$month == "3" ? 'selected' : ""}}>Marzo</option>
- <option value="4" {{$month == "4" ? 'selected' : ""}}>Aprile</option>
- <option value="5" {{$month == "5" ? 'selected' : ""}}>Maggio</option>
- <option value="6" {{$month == "6" ? 'selected' : ""}}>Giugno</option>
- <option value="7" {{$month == "7" ? 'selected' : ""}}>Luglio</option>
- <option value="8" {{$month == "8" ? 'selected' : ""}}>Agosto</option>
- <option value="9" {{$month == "9" ? 'selected' : ""}}>Settembre</option>
- <option value="10" {{$month == "10" ? 'selected' : ""}}>Ottobre</option>
- <option value="11" {{$month == "11" ? 'selected' : ""}}>Novembre</option>
- <option value="12" {{$month == "12" ? 'selected' : ""}}>Dicembre</option>
- </select>
- <select class="form-select " style="width:100px !important;" id="year">
- @for($y=date("Y") + 5; $y>date("Y") - 2; $y--)
- <option value="{{$y}}" {{$y == date("Y") ? 'selected' : ''}}>{{$y}}</option>
- @endfor
- </select>
- </form>
- @if(sizeof($columns) < 6)
- <button class="btn--ui show" style="margin-left:5px;">aggiungi</button>
- @endif
- <button class="btn--ui lightGrey reset reset" onClick="window.location.reload();" style="margin-left:5px;">reset</button>
- @if($showData)
- <div class="export--button ms-auto">
- <button class="btn--ui lightGrey reset" wire:click="export()"><i class="fa-solid fa-download me-2"></i>esporta selezione</button>
- <button class="btn--ui lightGrey reset exportYear" style="margin-left:5px;">esporta anno fiscale</button>
- </div>
- @endif
- </section>
- <section id="resume-table">
- <div class="compare--chart_wrapper d-none"></div>
- <div class="row ">
- <div class="col-md-12">
- <h1>Entrate</h1>
- <div class="row ">
- <div class="col-md-2">
- Filtra per causale
- </div>
- <div class="col-md-12 m-1">
- <select name="search_causal_id[]" class="form-select filterCausalsIn filterCausals" multiple="multiple" wire:model="filterCausalsIn">
- @foreach($causalsIn as $causal)
- <option value="{{$causal["id"]}}">{!!$causal["name"]!!}
- @endforeach
- </select>
- </div>
- </div>
- <table class="table tablesaw tableHead tablesaw-stack collaptableIN" >
- <thead>
- <tr>
- <th scope="col" style="width:20%;text-align:left"></th>
- @foreach($columns as $idx => $column)
- <th scope="col cellBorder" style="width:13%;text-align:center">{{$this->getMonth($column)}} <br><a href="#" wire:click="remove({{$idx}})"><i class="fa fa-trash" aria-hidden="true" style="color:red"></i></a></th>
- @endforeach
- @for($j=sizeof($columns);$j<6;$j++)
- <th scope="col cellBorder" style="width:13%;text-align:center"> </th>
- @endfor
- </tr>
- </thead>
- <tbody id="checkall-target">
- @php
- $aScritto = array();
- @endphp
- @foreach($rows_in as $in)
- @if($filterCausalsIn == null || (sizeof($filterCausalsIn) == 0 || in_array($in["id"], $filterCausalsIn) || in_array($in["parent_id"], $filterCausalsIn) || in_array($in["first_parent_id"], $filterCausalsIn)))
- @if($in["first_parent_name"] != "" && $filterCausalsIn != null && !in_array($in["first_parent_id"], $filterCausalsIn) && !in_array($in["first_parent_id"] . "_" . $in["parent_id"], $aScritto))
- @php
- $aScritto[] = $in["first_parent_id"] . "_" . $in["parent_id"];
- @endphp
- <tr>
- <td>
- <b>{{$in["first_parent_name"]}} - {{$in["parent_name"]}}</b>
- </td>
- @foreach($columns as $column)
- <td class="cellBorder" style="text-align:right">
- @if(isset($records_in[$column][$in["parent_id"]]))
- <span class="tablesaw-cell-content {{$in["level"] == 0 ? 'primary' : ''}}" {{$in["level"] == 0 ? 'style="font-weight:bold;' : ''}}>
- {{formatPrice($records_in[$column][$in["parent_id"]])}}
- </span>
- @else
-
- @endif
- </td>
- @endforeach
- </tr>
- @endif
- <tr data-id="{{$in["id"]}}" data-parent="{{$filterCausalsIn == null || in_array($in["parent_id"], $filterCausalsIn) ? $in["parent_id"] : ''}}">
- <td>
- <span class="spaces">{!!str_repeat(" ", $in["level"])!!}</span>
- @if($filterCausalsIn != null && !in_array($in["first_parent_id"], $filterCausalsIn))
- <span style="padding-left:20px">{!!str_repeat(" ", 5)!!}</span>
- @endif
- {{$in["name"]}}
- </td>
- @foreach($columns as $column)
- <td class="cellBorder" style="text-align:right">
- @if(isset($records_in[$column][$in["id"]]))
- <span class="tablesaw-cell-content {{$in["level"] == 0 ? 'primary' : ''}}" {{$in["level"] == 0 ? 'style="font-weight:bold;' : ''}}>
- {{formatPrice($records_in[$column][$in["id"]])}}
- </span>
- @else
-
- @endif
- </td>
- @endforeach
- @for($j=sizeof($columns);$j<6;$j++)
- <td class="cellBorder"> </th>
- @endfor
- </tr>
- @endif
- @endforeach
- <tr>
- <td><b>Totale entrate mensili</b></td>
- @foreach($columns as $column)
- <td class="cellBorder" style="text-align:right">
- @php
- $total = 0;
- $existIn = [];
- @endphp
- @foreach($rows_in as $in)
- @if($filterCausalsIn == null || (sizeof($filterCausalsIn) == 0 || in_array($in["id"], $filterCausalsIn)))
- @if(isset($records_in[$column][$in["id"]]))
- @php
- if($in["level"] == 0)
- {
- $total += $records_in[$column][$in["id"]];
- $existIn[] = $in["id"];
- }
- else
- {
- if (!in_array($in["parent_id"], $existIn))
- {
- $total += $records_in[$column][$in["id"]];
- }
- $existIn[] = $in["id"];
- }
- @endphp
- @endif
- @endif
- @endforeach
- <span class="tablesaw-cell-content primary" style="color:green; font-size:18px;"><b>{{formatPrice($total)}}</b></span>
- </td>
- @endforeach
- @for($j=sizeof($columns);$j<6;$j++)
- <td class="cellBorder"> </th>
- @endfor
- </tr>
- </tbody>
- <tfoot>
- </tfoot>
- </table>
- </div>
- </div>
- <div class="row ">
- <div class="col-md-12">
- <h1>Uscite</h1>
- <div class="row ">
- <div class="col-md-2">
- <label class="form-label">Filtra per causale</label>
- </div>
- <div class="col-md-12 m-1">
- <select name="search_causal_id_x[]" class="form-select filterCausalsOut filterCausals" multiple="multiple" wire:model="filterCausalsOut">
- @foreach($causalsOut as $causal)
- <option value="{{$causal["id"]}}">{!!$causal["name"]!!}
- @endforeach
- </select>
- </div>
- </div>
- <table class="table tablesaw tableHead tablesaw-stack collaptableOUT">
- <thead>
- <tr>
- <th scope="col" style="width:20%;text-align:left"></th>
- @foreach($columns as $idx => $column)
- <th scope="col cellBorder" style="width:13%;text-align:center">{{$this->getMonth($column)}} <br><a href="#" wire:click="remove({{$idx}})"><i class="fa fa-trash" aria-hidden="true" style="color:red"></i></a></th>
- @endforeach
- @for($j=sizeof($columns);$j<6;$j++)
- <th scope="col cellBorder" style="width:13%;text-align:center"> </th>
- @endfor
- </tr>
- </thead>
- <tbody id="checkall-target">
- @php
- $aScrittoX = array();
- @endphp
- @foreach($rows_out as $out)
- @if($filterCausalsOut == null || (sizeof($filterCausalsOut) == 0 || in_array($out["id"], $filterCausalsOut) || in_array($out["parent_id"], $filterCausalsOut) || in_array($out["first_parent_id"], $filterCausalsOut)))
- @if($filterCausalsOut != null && !in_array($out["first_parent_id"], $filterCausalsOut) && !in_array($out["first_parent_id"] . "_" . $out["parent_id"], $aScrittoX))
- @php
- $aScrittoX[] = $out["first_parent_id"] . "_" . $out["parent_id"];
- @endphp
- <tr>
- <td colspan="20">
- <b>{{$out["first_parent_name"]}} - {{$out["parent_name"]}}</b>
- </td>
- </tr>
- @endif
- <tr data-id="{{$out["id"] + 1000}}" data-parent="{{$out["parent_id"] != null ? ($out["parent_id"] + 1000) : 0}}">
- <td>{!!str_repeat(" ", $out["level"])!!}{{$out["name"]}}</td>
- @foreach($columns as $column)
- <td class="cellBorder" style="text-align:right">
- @if(isset($records_out[$column][$out["id"]]))
- <span class="tablesaw-cell-content {{$out["level"] == 0 ? 'primary' : ''}}" {{$out["level"] == 0 ? 'style="font-weight:bold;' : ''}}>
- {{formatPrice($records_out[$column][$out["id"]])}}
- </span>
- @else
-
- @endif
- </td>
- @endforeach
- @for($j=sizeof($columns);$j<6;$j++)
- <td class="cellBorder"> </th>
- @endfor
- </tr>
- @endif
- @endforeach
- <tr>
- <td><b>Totale uscite mensili</b></td>
- @foreach($columns as $column)
- <td class="cellBorder" style="text-align:right">
- @php
- $total = 0;
- $existOut = [];
- @endphp
- @foreach($rows_out as $out)
- @if($filterCausalsOut == null || (sizeof($filterCausalsOut) == 0 || in_array($out["id"], $filterCausalsOut)))
- @if(isset($records_out[$column][$out["id"]]))
- @php
- if($out["level"] == 0)
- {
- $total += $records_out[$column][$out["id"]];
- $existOut[] = $out["id"];
- }
- else
- {
- if (!in_array($out["parent_id"], $existOut))
- {
- $total += $records_out[$column][$out["id"]];
- }
- $existOut[] = $out["id"];
- }
- @endphp
- @endif
- @endif
- @endforeach
- <span class="tablesaw-cell-content primary" style="color:red; font-size:18px;"><b>{{formatPrice($total)}}</b></span>
- </td>
- @endforeach
- @for($j=sizeof($columns);$j<6;$j++)
- <td class="cellBorder"> </th>
- @endfor
- </tr>
- </tbody>
- <tfoot>
- </tfoot>
- </table>
- </div>
- </div>
- </section>
- <a style="display:none" href="javascript:void(0);" id="collapseAll" class="act-button-collapse-all">Collapse All</a>
- </div>
- @push('scripts')
- <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
- <style>
- .select2-container--default .select2-selection--single{
- background-color: #E9F0F5;
- border: 0.0625rem solid #DFE5EB;
- font-size: 0.75rem;
- }
- .select2-selection
- {
- height: 38px !important;
- }
- .select2-selection__rendered
- {
- padding-top:3px;
- }
- .select2 {
- width:100% !important;
- }
- .i{
- font-size:16px;
- font-weight:bold;
- }
- .cellBorder
- {
- 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>
- <script src="/assets/js/aCollapTable.js"></script>
- @endpush
- @push('scripts')
- <script>
- Livewire.on('load-table', () => {
- load();
- });
- function load()
- {
- $(document).ready(function(){
- $(document).on("keypress", $('.filterCausals'), function (e) {
- setTimeout(() => {
- $(".select2-results__option").each(function(){
- var txt = $(this).html();
- var count = (txt.match(/-/g) || []).length;
- $(this).addClass('paddingLeftSelect' + count);
- });
- }, 100);
- });
- $('.filterCausalsIn').select2();
- $('.filterCausalsIn').on('change', function (e) {
- var data = $('.filterCausalsIn').select2("val");
- setTimeout(function() {createCollapse();}, 1000);
- @this.set('filterCausalsIn', data);
- });
- $('.filterCausalsOut').select2();
- $('.filterCausalsOut').on('change', function (e) {
- var data = $('.filterCausalsOut').select2("val");
- setTimeout(function() {createCollapse();}, 1000);
- @this.set('filterCausalsOut', data);
- });
- $('.filterCausals').on('select2:open', function (e) {
- setTimeout(() => {
- $(".select2-results__option").each(function(){
- var txt = $(this).html();
- var count = (txt.match(/-/g) || []).length;
- $(this).addClass('paddingLeftSelect' + count);
- });
- }, 100);
- });
- createCollapse();
- });
- }
- function createCollapse()
- {
- $(".act-more").remove();
- $(".spaces").remove();
- //$("#checkall-target > tr").removeAttr("data-level");
- //$("#checkall-target > tr").removeAttr("class");
- $('.collaptableIN').aCollapTable({
- startCollapsed: true,
- addColumn: false,
- plusButton: '<span class="i"> + </span>',
- minusButton: '<span class="i"> - </span>'
- });
- $('.collaptableOUT').aCollapTable({
- startCollapsed: true,
- addColumn: false,
- plusButton: '<span class="i"> + </span>',
- minusButton: '<span class="i"> - </span>'
- });
- $("#collapseAll").trigger("click");
- }
- Livewire.on('reset-collapse', () => {
- createCollapse();
- });
- Livewire.on('load-select', () => {
- $('.filterCausalsIn').select2();
- $('.filterCausalsIn').on('change', function (e) {
- var data = $('.filterCausalsIn').select2("val");
- setTimeout(function() {createCollapse();}, 1000);
- @this.set('filterCausalsIn', data);
- });
- $('.filterCausalsOut').select2();
- $('.filterCausalsOut').on('change', function (e) {
- var data = $('.filterCausalsOut').select2("val");
- setTimeout(function() {createCollapse();}, 1000);
- @this.set('filterCausalsOut', data);
- });
- });
- load();
- $(document).on("click", ".show", function () {
- var m = $('#month').val();
- var y = $('#year').val();
- @this.show(m, y);
- });
- $(document).on("click", ".exportYear", function () {
- var y = $('#year').val();
- @this.exportYear(y);
- });
- </script>
- @endpush
|