causal.blade.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <div class="col card--ui" id="card--dashboard">
  2. <header id="title--section" class="d-flex align-items-center justify-content-between">
  3. <div class="title--section_name d-flex align-items-center justify-content-between" style="display:none !important" >
  4. <i class="ico--ui title_section utenti me-2"></i>
  5. <h2 class="primary">@if(!$add && !$update)causali @else Inserimento/modifica causale @endif</h2>
  6. </div>
  7. @if(!$add && !$update)
  8. <div class="title--section_addButton" wire:click="add()" style="cursor: pointer;">
  9. <div class="btn--ui entrata d-flex justify-items-between">
  10. <a href="#" wire:click="add()" style="color:white">AGGIUNGI</a>
  11. </div>
  12. </div>
  13. <a class="btn--ui lightGrey" href="/settings?type=contabilita"><i class="fa-solid fa-arrow-left"></i></a><br>
  14. @endif
  15. </header>
  16. @if(!$add && !$update)
  17. <section id="resume-table">
  18. <div class="compare--chart_wrapper d-none"></div>
  19. <h1>Entrata</h1>
  20. <table class="table tablesaw tablesaw-stack" id="tablesaw-350" width="100%">
  21. <thead>
  22. <tr>
  23. <th scope="col" width="50%">Nome</th>
  24. <th scope="col" width="10%">Tipologia</th>
  25. <th scope="col" width="10%">Abilitato</th>
  26. <th scope="col" width="30%">...</th>
  27. </tr>
  28. </thead>
  29. <tbody id="checkall-target" wire:sortable="reorder" wire:sortable.options="{ animation: 100 }" wire:sortable-group="reorderGroup">
  30. @foreach($recordsIn as $record)
  31. <tr wire:sortable.item="{{ $record->id }}" wire:sortable.triggers="reorder">
  32. <td>{{$record->name}}</td>
  33. <td>{{$record->type == 'IN' ? 'Entrata' : 'Uscita'}}</td>
  34. <td> <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->enabled ? 'active' : 'suspended'}}">{{$record->enabled ? 'attivo' : 'disattivo'}}</span></span></td>
  35. <td>
  36. <button type="button" class="btn btn-outline-success btn-sm" wire:click="addLevel({{ $record->id }})">Aggiungi livello</button>
  37. <button type="button" class="btn btn-outline-success btn-sm" wire:click="duplicate({{ $record->id }})">Duplica</button>
  38. <button type="button" class="btn" wire:click="edit({{ $record->id }})" data-bs-toggle="popover" onclick="hidePop(this)" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Modifica"><i class="fa-regular fa-pen-to-square"></i></button>
  39. <button type="button" class="btn" onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()" wire:click="delete({{ $record->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Elimina"><i class="fa-regular fa-trash-can"></i></button>
  40. </td>
  41. </tr>
  42. @if(count($record->childs))
  43. @include('livewire/causal_child',['records' => $record->childs, 'indentation' => 1])
  44. @endif
  45. @endforeach
  46. </tbody>
  47. </table>
  48. <br>
  49. <h1>Uscita</h1>
  50. <table class="table tablesaw tablesaw-stack" id="tablesaw-350" width="100%">
  51. <thead>
  52. <tr>
  53. <th scope="col" width="50%">Nome</th>
  54. <th scope="col" width="10%">Tipologia</th>
  55. <th scope="col" width="10%">Abilitato</th>
  56. <th scope="col" width="30%">...</th>
  57. </tr>
  58. </thead>
  59. <tbody id="checkall-target" wire:sortable="reorder" wire:sortable.options="{ animation: 100 }" wire:sortable-group="reorderGroup">
  60. @foreach($recordsOut as $record)
  61. <tr wire:sortable.item="{{ $record->id }}" wire:sortable.triggers="reorder">
  62. <td>{{$record->name}}</td>
  63. <td>{{$record->type == 'IN' ? 'Entrata' : 'Uscita'}}</td>
  64. <td> <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->enabled ? 'active' : 'suspended'}}">{{$record->enabled ? 'attivo' : 'disattivo'}}</span></span></td>
  65. <td>
  66. <button type="button" class="btn btn-outline-success btn-sm" wire:click="addLevel({{ $record->id }})">Aggiungi livello</button>
  67. <button type="button" class="btn btn-outline-success btn-sm" wire:click="duplicate({{ $record->id }})">Duplica</button>
  68. <button type="button" class="btn" wire:click="edit({{ $record->id }})" data-bs-toggle="popover" onclick="hidePop(this)" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Modifica"><i class="fa-regular fa-pen-to-square"></i></button>
  69. <button type="button" class="btn" onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()" wire:click="delete({{ $record->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Elimina"><i class="fa-regular fa-trash-can"></i></button>
  70. </td>
  71. </tr>
  72. @if(count($record->childs))
  73. @include('livewire/causal_child',['records' => $record->childs, 'indentation' => 1])
  74. @endif
  75. @endforeach
  76. </tbody>
  77. </table>
  78. </section>
  79. @else
  80. <div class="container">
  81. @if (session()->has('error'))
  82. <div class="alert alert-danger" role="alert">
  83. {{ session()->get('error') }}
  84. </div>
  85. @endif
  86. <div class="row">
  87. <div class="col">
  88. <form action="">
  89. @if($parent != '')
  90. <h3>Aggiungi livello a {{$parent}}</h3>
  91. @endif
  92. <div class="row mb-3">
  93. <div class="col">
  94. <div class="form--item">
  95. <label for="inputName" class="form-label">Nome</label>
  96. <input class="form-control js-keyupTitle @error('name') is-invalid @enderror" type="text" id="name" placeholder="Nome" wire:model="name">
  97. @error('name')
  98. <div class="invalid-feedback">{{ $message }}</div>
  99. @enderror
  100. </div>
  101. </div>
  102. </div>
  103. <div class="row mb-3">
  104. <div class="col">
  105. <label for="next_month_expire" class="form-label">Tipologia</label>
  106. <select name="type" class="form-select @error('type') is-invalid @enderror" aria-label="Seleziona una tipologia" wire:model="type">
  107. <option value="">--Seleziona--
  108. <option value="IN">Entrata
  109. <option value="OUT">Uscita
  110. </select>
  111. </div>
  112. </div>
  113. <div class="form--item mb-3">
  114. <div class="form-check form-check-inline" style="padding-left:0px !important;">
  115. <input class="form-check-input form-control" style="width:30px; height:30px;" type="checkbox" id="enabled" wire:model="enabled">
  116. <label class="form-check-label" for="enabled">Abilitato</label>
  117. </div>
  118. </div>
  119. <div class="form--item mb-3">
  120. <div class="form-check form-check-inline" style="padding-left:28px !important;">
  121. <input class="form-check-input form-control" style="width:30px; height:30px;" type="checkbox" id="money" wire:model="money">
  122. <label class="form-check-label" for="money">Incrementa borsellino virtuale</label>
  123. </div>
  124. </div>
  125. <div class="form--item mb-3">
  126. <div class="form-check form-check-inline" style="padding-left:28px !important;">
  127. <input class="form-check-input form-control" style="width:30px; height:30px;" type="checkbox" id="no_receipt" wire:model="no_receipt">
  128. <label class="form-check-label" for="no_receipt">Non generare ricevuta</label>
  129. </div>
  130. </div>
  131. <div class="form--item mb-3">
  132. <div class="form-check form-check-inline" style="padding-left:28px !important;">
  133. <input class="form-check-input form-control" style="width:30px; height:30px;" type="checkbox" id="user_status" wire:model="user_status">
  134. <label class="form-check-label" for="user_status">Impatta stato utente</label>
  135. </div>
  136. </div>
  137. <div class="form--item mb-3">
  138. <div class="form-check form-check-inline" style="padding-left:28px !important;">
  139. <input class="form-check-input form-control" style="width:30px; height:30px;" type="checkbox" id="no_first" wire:model="no_first">
  140. <label class="form-check-label" for="no_first">Escludi dalla prima nota</label>
  141. </div>
  142. </div>
  143. <div class="form--item mb-3">
  144. <div class="form-check form-check-inline" style="padding-left:28px !important;">
  145. <input class="form-check-input form-control" style="width:30px; height:30px;" type="checkbox" id="no_records" wire:model="no_records">
  146. <label class="form-check-label" for="no_records">Escludi da entrate/uscite gestionale</label>
  147. </div>
  148. </div>
  149. <div class="form--item mb-3">
  150. <div class="form-check form-check-inline" style="padding-left:28px !important;">
  151. @if($corrispettivo_causal_id == 0 || $corrispettivo_causal_id == $dataId)
  152. <input class="form-check-input form-control" style="width:30px; height:30px;" type="checkbox" id="corrispettivo_fiscale" wire:model="corrispettivo_fiscale">
  153. @else
  154. <input class="form-check-input form-control" style="width:30px; height:30px;" type="checkbox" id="corrispettivo_fiscale" wire:model="corrispettivo_fiscale" disabled="disabled">
  155. @endif
  156. <label class="form-check-label" for="corrispettivo_fiscale">Utilizza per corrispettivo fiscale</label>
  157. </div>
  158. </div>
  159. <!-- // inline input field -->
  160. <div class="form--item">
  161. @if($add)
  162. <button type="submit" class="btn--ui" wire:click.prevent="store()">Salva</button>
  163. @endif
  164. @if($update)
  165. <button type="submit" class="btn--ui" wire:click.prevent="update()">Salva</button>
  166. @endif
  167. <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
  168. </div>
  169. </form>
  170. </div>
  171. </div>
  172. </div>
  173. @endif
  174. </div>
  175. @push('scripts')
  176. <!--
  177. <script src="https://cdn.jsdelivr.net/gh/livewire/sortable@v0.x.x/dist/livewire-sortable.js"></script>
  178. -->
  179. @endpush