| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395 |
- <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">Prima nota</h2>
- </div>
- </header>
- <section id="subheader" class="">
- <!--
- <form action="" class="group--action d-flex align-items-center">
- <select class="form-select form-select-lg me-1" aria-label=".form-select-lg example">
- <option selected>Open this select menu</option>
- <option value="1">One</option>
- <option value="2">Two</option>
- <option value="3">Three</option>
- </select>
- <button type="submit" class="btn--ui">applica</button>
- </form>
- -->
- <div class="row g-3">
- <div class="col-md-2">
- Utente
- <select name="search_member_id" class="form-select filterMember" wire:model="filterMember">
- <option value="">--Seleziona--
- @foreach($members as $member)
- <option value="{{$member->id}}">{{$member->last_name}} {{$member->first_name}}
- @endforeach
- </select>
- </div>
- <div class="col-md-4">
- Causale
- <select name="search_causal_id[]" class="form-select filterCausals me-2" multiple="multiple" wire:model="filterCausals">
- @foreach($causals as $causal)
- <option value="{{$causal["id"]}}">{!!$causal["name"]!!}
- @endforeach
- </select>
- </div>
- <div class="col-md-2">
- <span class="date_span">Dal</span><input type="date" wire:model="fromDate" class="form-control">
- </div>
- <div class="col-md-2">
- <span class="date_span ms-2">al</span><input type="date" wire:model="toDate" class="form-control">
- </div>
- <div class="col-md-2">
- <div class="prima--nota_buttons ms-auto " style="float:right; margin-top:25px;">
- <button class="btn--ui_outline light reset" wire:click="export()" style="margin-left:5px;color:#10172A"><i class="fa-solid fa-download"></i></button>
- <button class="btn--ui_outline light reset" style="margin-left:5px;color:#10172A;" id="print"><i class="fa-solid fa-print"></i></button>
- </div>
- </div>
- </div>
- </section>
- <section id="resume-table">
- <!--
- <canvas id="recordChart"></canvas>
- -->
- <table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350" width="100%">
- <thead>
- <tr>
- <th scope="col">Data</th>
- <th scope="col" style="border-left:3px solid white;">Causale</th>
- <th scope="col" style="border-left:3px solid white;">Dettaglio Causale</th>
- <th scope="col" style="border-left:3px solid white;">Stato</th>
- <th scope="col" style="border-left:3px solid white;">Nominativo</th>
- @foreach($payments as $p)
- <th colspan="2" scope="col" style="text-align:center; border-left:3px solid white;">{{$p->name}}</th>
- @endforeach
- </tr>
- <tr>
- <th scope="col"></th>
- <th scope="col" style="border-left:3px solid white;"></th>
- <th scope="col" style="border-left:3px solid white;"></th>
- <th scope="col" style="border-left:3px solid white;"></th>
- <th scope="col" style="border-left:3px solid white;"></th>
- @foreach($payments as $p)
- <th scope="col" style="text-align:right; border-left:3px solid white;">Entrate</th>
- <th scope="col" style="text-align:right">Uscite</th>
- @endforeach
- </tr>
- </thead>
- <tbody id="checkall-target">
- @php
- $count = 0;
- @endphp
- @foreach($records as $causal => $record)
- <tr>
- @php
- $check = strpos($causal, "$") ? explode("$", $causal)[1] : $causal;
- list($d, $c, $n, $det, $del) = explode("§", $check);
- @endphp
- <td style="background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{date("d/m/Y", strtotime($d))}}</td>
- <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{$c}}</td>
- <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{$det}}</td>
- <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">
- @if($del == 'DELETED')
- <span style='color:red'>Annullata</span>
- @endif
- </td>
- <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{$n}}</td>
- @foreach($payments as $p)
- @if(isset($record[$p->name]))
- <td style="text-align:right; border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">
- @if(isset($record[$p->name]["IN"]))
- <span class="tablesaw-cell-content " style="color:green">{{formatPrice($record[$p->name]["IN"])}}</span>
- @endif
- </td>
- <td style="text-align:right;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">
- @if(isset($record[$p->name]["OUT"]))
- <span class="tablesaw-cell-content " style="color:red">{{formatPrice($record[$p->name]["OUT"])}}</span>
- @endif
- </td>
- @else
- <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}"></td>
- <td style="background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}"></td>
- @endif
- @endforeach
- </tr>
- @php
- $count++;
- @endphp
- @endforeach
- </tbody>
- <tfoot>
- <tr>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td><b>Totale</b></td>
- @foreach($payments as $p)
- @if(isset($totals[$p->name]))
- <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:green; font-size:18px;"><b>{{formatPrice($totals[$p->name]["IN"])}}</b></span></td>
- <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:red; font-size:18px;"><b>{{formatPrice($totals[$p->name]["OUT"])}}</b></span></td>
- @else
- <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:green; font-size:18px;"><b>{{formatPrice(0)}}</b></span></td>
- <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:red; font-size:18px;"><b>{{formatPrice(0)}}</b></span></td>
- @endif
- @endforeach
- </tr>
- <tr style="display:none">
- <td></td>
- <td><b>Differenza</b></td>
- @foreach($payments as $p)
- @if(isset($totals[$p->name]))
- @php
- $diff = $totals[$p->name]["IN"] - $totals[$p->name]["OUT"];
- @endphp
- @if($diff < 0)
- <td></td>
- @endif
- <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:{{$diff > 0 ? 'green' : 'red'}}; font-size:18px;"><b>{{formatPrice($diff)}}</b></span></td>
- @if($diff > 0)
- <td></td>
- @endif
- @else
- <td colspan="2" style="text-align:right"><b>{{formatPrice(0)}}</b></td>
- @endif
- @endforeach
- </tr>
- </tfoot>
- </table>
- <!--
- <div class="paginator d-flex justify-content-center">
- <nav aria-label="Page navigation example">
- <ul class="pagination">
- <li class="page-item">
- <a class="page-link" href="#" aria-label="Previous">
- <span aria-hidden="true"></span>
- </a>
- </li>
- <li class="page-item"><a class="page-link" href="#">1</a></li>
- <li class="page-item"><a class="page-link" href="#">2</a></li>
- <li class="page-item"><a class="page-link" href="#">3</a></li>
- <li class="page-item"><a class="page-link" href="#">3</a></li>
- <li class="page-item"><span class="more-page">...</span></li>
- <li class="page-item">
- <a class="page-link" href="#" aria-label="Next">
- <span aria-hidden="true"></span>
- </a>
- </li>
- </ul>
- </nav>
- </div>
- -->
- </section>
- </div>
- @push('scripts')
- <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
- @endpush
- @push('scripts')
- <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
- <style>
- table thead {
- /* Important */
- position: sticky;
- z-index: 100;
- top: 0;
- }
- .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);
- });
- $('.filterCausals').select2();
- $('.filterCausals').on('change', function (e) {
- var data = $('.filterCausals').select2("val");
- @this.set('filterCausals', 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);
- });
- $('.filterMember').select2();
- $('.filterMember').on('change', function (e) {
- var data = $('.filterMember').select2("val");
- @this.set('filterMember', data);
- });
- });
- }
- Livewire.on('load-select', () => {
- $('.filterCausals').select2();
- $('.filterCausals').on('change', function (e) {
- var data = $('.filterCausals').select2("val");
- @this.set('filterCausals', data);
- });
- $('.filterMember').select2();
- $('.filterMember').on('change', function (e) {
- var data = $('.filterMember').select2("val");
- @this.set('filterMember', data);
- });
- });
- load();
- </script>
- @endpush
- @push('scripts')
- <script>
- function printData()
- {
- var divToPrint=document.getElementById("tablesaw-350");
- newWin= window.open("");
- var htmlToPrint = '' +
- '<style type="text/css">' +
- 'table th, table td {' +
- 'border:1px solid #000;' +
- 'padding:0.5em;' +
- '}' +
- '</style>';
- htmlToPrint += divToPrint.outerHTML;
- newWin.document.write(htmlToPrint);
- newWin.document.close();
- newWin.print();
- newWin.close();
- }
- document.querySelector("#print").addEventListener("click", function(){
- printData();
- });
- /*
- const chart = new Chart(
- document.getElementById('recordChart'), {
- type: 'line',
- data: {
- labels: @json($labels),
- datasets: @json($recordDatas)
- },
- options: {
- height:200,
- plugins: {
- legend: {
- position: 'bottom'
- }
- },
- responsive: true,
- elements: {
- line: {
- tension : 0.4 // smooth lines
- },
- },
- }
- }
- );
- Livewire.on('updateChart', data => {
- chart.data = data;
- chart.update();
- });
- */
- </script>
- @endpush
|