| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297 |
- <div class="col card--ui" id="card--dashboard">
- @if(!$add && !$update)
- <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">@if(!$add && !$update)metodi pagamento @else Inserimento/modifica metodo pagamento @endif</h2>
- </div>
- @if(!$add && !$update)
- <div class="title--section_addButton" wire:click="add()" style="cursor: pointer;">
- <div class="btn--ui entrata d-flex justify-items-between">
- <a href="#" wire:click="add()" style="color:white">Aggiungi</a>
- </div>
- </div>
- @endif
- </header>
- <a class="btn--ui lightGrey" href="/settings?type=contabilita"><i class="fa-solid fa-arrow-left"></i></a><br>
- <section id="resume-table">
- <div class="compare--chart_wrapper d-none"></div>
- <!-- Toggle button to show/hide hidden items -->
- <div class="mb-3 mt-3">
- <button type="button" class="btn btn-outline-secondary btn-sm" wire:click="toggleShowHidden">
- @if($showHidden)
- <i class="fa-regular fa-eye-slash"></i> Nascondi elementi nascosti
- @else
- <i class="fa-regular fa-eye"></i> Mostra elementi nascosti
- @endif
- </button>
- </div>
- <table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350" width="100%">
- <thead>
- <tr>
- <th scope="col">Banca</th>
- <th scope="col">Nome</th>
- <th scope="col">Tipo</th>
- <th scope="col">Abilitato</th>
- <th scope="col">...</th>
- </tr>
- </thead>
- <tbody id="checkall-target">
- @foreach($records as $record)
- <tr @if(isset($record->hidden) && $record->hidden) style="opacity: 0.6; font-style: italic;" @endif>
- <td>{{$record->bank ? $record->bank : ''}}</td>
- <td>
- {{$record->name}}
- @if(isset($record->hidden) && $record->hidden)
- <span class="text-muted">(nascosto)</span>
- @endif
- </td>
- <td>
- @php
- switch ($record->type) {
- case 'IN':
- echo "Entrate";
- break;
- case 'OUT':
- echo "Uscite";
- break;
- case 'ALL':
- echo "Entrate/Uscite";
- break;
- }
- @endphp
- </td>
- <td> <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->enabled ? 'active' : 'suspended'}}">{{$record->enabled ? 'attivo' : 'disattivo'}}</span></span></td>
- <td>
- <button type="button" class="btn" wire:click="edit({{ $record->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Modifica"><i class="fa-regular fa-pen-to-square"></i></button>
- @if(isset($record->hidden) && $record->hidden)
- <button type="button" class="btn btn-success" wire:click="show({{ $record->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Mostra"><i class="fa-regular fa-eye"></i></button>
- @else
- <button type="button" class="btn btn-secondary" onclick="confirm('Sei sicuro di voler nascondere questo metodo di pagamento?') || event.stopImmediatePropagation()" wire:click="hide({{ $record->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Nascondi"><i class="fa-regular fa-eye-slash"></i></button>
- @endif
- </td>
- </tr>
- @endforeach
- </tbody>
- </table>
- </section>
- @else
- <div class="container">
- <a class="btn--ui lightGrey" href="/payment_methods"><i class="fa-solid fa-arrow-left"></i></a><br><br>
- @if (session()->has('error'))
- <div class="alert alert-danger" role="alert">
- {{ session()->get('error') }}
- </div>
- @endif
- <div class="row">
- <div class="col">
- <form action="">
- <div class="row mb-3">
- <div class="col">
- <div class="form--item">
- <label for="name" class="form-label">Nome</label>
- <select class="form-control @error('name') is-invalid @enderror" id="name" wire:model="name">
- <option value="">Seleziona un metodo di pagamento</option>
- @foreach($paymentMethods as $method)
- <option value="{{ $method['name'] }}">{{ $method['name'] }} ({{ $method['code'] }})</option>
- @endforeach
- </select>
- @error('name')
- <div class="invalid-feedback">{{ $message }}</div>
- @enderror
- </div>
- </div>
- <div class="col">
- <label for="bank_id" class="form-label">Banca</label>
- <select name="bank_id" class="form-select" aria-label="Seleziona una banca" wire:model="bank_id">
- <option value="">--Seleziona--</option>
- @foreach($banks as $bank)
- <option value="{{$bank->id}}">{{$bank->name}}</option>
- @endforeach
- </select>
- </div>
- </div>
- <div class="row mb-3">
- <div class="col-md-6">
- <label for="type" class="form-label">Tipologia</label>
- <select name="type" class="form-select" aria-label="Seleziona una tipologia" wire:model="type">
- <option value="ALL">Entrate/Uscite</option>
- <option value="IN">Entrate</option>
- <option value="OUT">Uscite</option>
- </select>
- </div>
- </div>
- <div class="form--item mb-3">
- <div class="form--item">
- <label for="enabled" class="form-label">Abilitato</label>
- <input class="form-check-input form-control" style="width:22px; height:22px;" type="checkbox" id="enabled" wire:model="enabled">
- </div>
- </div>
- <div class="form--item mb-3">
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" id="money" wire:model="money">
- <label class="form-check-label" for="money">Decrementa borsellino virtuale</label>
- </div>
- </div>
- <div class="form--item mb-3">
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" id="corrispettivo_fiscale" wire:model="corrispettivo_fiscale">
- <label class="form-check-label" for="corrispettivo_fiscale">Utilizza per corrispettivo fiscale</label>
- </div>
- </div>
- <div class="form--item">
- <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
- @if($add)
- <button type="submit" class="btn--ui" wire:click.prevent="store()">Salva</button>
- @endif
- @if($update)
- <button type="submit" class="btn--ui" wire:click.prevent="update()">Salva</button>
- @endif
- </div>
- </form>
- </div>
- </div>
- </div>
- @endif
- </div>
- @if (session()->has('success'))
- <div class="alert alert-success alert-dismissible fade show mt-3" role="alert">
- {{ session()->get('success') }}
- <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
- </div>
- @endif
- @if (session()->has('error'))
- <div class="alert alert-danger alert-dismissible fade show mt-3" role="alert">
- {{ session()->get('error') }}
- <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
- </div>
- @endif
- @push('scripts')
- <link href="/css/datatables.css" rel="stylesheet" />
- <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
- <script src="/assets/js/datatables.js"></script>
- <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
- @endpush
- @push('scripts')
- <script>
- $(document).ready(function() {
- loadDataTable();
- });
- Livewire.on('load-data-table', () => {
- loadDataTable();
- });
- function loadDataTable(){
- let date = new Date();
- let date_export = `${date.getFullYear()}${date.getMonth()}${date.getDate()}_`;
- if ($.fn.DataTable.isDataTable('#tablesaw-350')) {
- $('#tablesaw-350').DataTable().destroy();
- }
- $('#tablesaw-350').DataTable({
- processing: true,
- thead: {
- 'th': {'background-color': 'blue'}
- },
- layout: {
- topStart : null,
- topEnd : null,
- top1A: {
- // buttons: [
- // {
- // extend: 'collection',
- // text: 'ESPORTA',
- buttons: [
- {
- extend: 'excelHtml5',
- text: '<i class="fa-solid fa-file-excel"></i>',
- action: newexportaction,
- title: date_export + 'Metodi di pagamento',
- exportOptions: {
- columns: ":not(':last')"
- }
- },
- {
- extend: 'pdfHtml5',
- text: '<i class="fa-solid fa-file-pdf"></i>',
- action: newexportaction,
- title: date_export + 'Metodi di pagamento',
- exportOptions: {
- columns: ":not(':last')"
- }
- },
- {
- extend: 'print',
- action: newexportaction,
- text: '<i class="fa-solid fa-print"></i>',
- title: date_export + 'Metodi di pagamento',
- exportOptions: {
- columns: ":not(':last')"
- }
- }
- ],
- // dropup: true
- // }
- // ]
- },
- top1B : {
- pageLength: {
- menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
- }
- },
- top1C :'search',
- },
- pagingType: 'numbers',
- "language": {
- "url": "/assets/js/Italian.json"
- },
- "fnInitComplete": function (oSettings, json) {
- var html = ' <a href="#" class="addData btn--ui"><i class="fa-solid fa-plus"></i></a>';
- $(".dt-search").append(html);
- }
- });
- $('#tablesaw-350 thead tr th').addClass('col');
- $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
- $(document).ready(function() {
- $(document).on("click",".addData",function() {
- $(".title--section_addButton").trigger("click")
- });
- });
- }
- </script>
- @endpush
|