causal.blade.php 15 KB

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