causal.blade.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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. <button type="button" class="btn btn-outline-success btn-sm" wire:click="addLevel({{ $record->id }})">Aggiungi livello</button>
  46. <button type="button" class="btn btn-outline-success btn-sm" wire:click="duplicate({{ $record->id }})">Duplica</button>
  47. <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>
  48. @if($record->hidden)
  49. <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 class="fa-regular fa-eye"></i></button>
  50. @else
  51. <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 class="fa-regular fa-eye-slash"></i></button>
  52. @endif
  53. </td>
  54. </tr>
  55. @if(count($record->childs))
  56. @include('livewire/causal_child',['records' => $record->childs, 'indentation' => 1])
  57. @endif
  58. @endforeach
  59. </tbody>
  60. </table>
  61. <br>
  62. <h1>Uscita</h1>
  63. <div class="mb-3">
  64. <button type="button" class="btn btn-outline-secondary btn-sm" wire:click="toggleHidden()">
  65. @if($showHidden)
  66. <i class="fa-regular fa-eye-slash"></i> Nascondi elementi nascosti
  67. @else
  68. <i class="fa-regular fa-eye"></i> Mostra elementi nascosti
  69. @endif
  70. </button>
  71. </div>
  72. <table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350" width="100%">
  73. <thead>
  74. <tr>
  75. <th scope="col" width="50%">Nome</th>
  76. <th scope="col" width="10%">Tipologia</th>
  77. <th scope="col" width="10%">Abilitato</th>
  78. <th scope="col" width="30%">...</th>
  79. </tr>
  80. </thead>
  81. <tbody id="checkall-target" wire:sortable="reorder" wire:sortable.options="{ animation: 100 }" wire:sortable-group="reorderGroup">
  82. @foreach($recordsOut as $record)
  83. <tr wire:sortable.item="{{ $record->id }}" wire:sortable.triggers="reorder" class="record-level-0">
  84. <td>
  85. <span class="level-indicator level-0">{{$record->name}}</span>
  86. </td>
  87. <td>{{$record->type == 'IN' ? 'Entrata' : 'Uscita'}}</td>
  88. <td>
  89. <span class="tablesaw-cell-content">
  90. <span class="badge tessera-badge {{$record->enabled ? 'active' : 'suspended'}}">
  91. {{$record->enabled ? 'attivo' : 'disattivo'}}
  92. </span>
  93. </span>
  94. </td>
  95. <td>
  96. <button type="button" class="btn btn-outline-success btn-sm" wire:click="addLevel({{ $record->id }})">Aggiungi livello</button>
  97. <button type="button" class="btn btn-outline-success btn-sm" wire:click="duplicate({{ $record->id }})">Duplica</button>
  98. <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>
  99. @if($record->hidden)
  100. <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 class="fa-regular fa-eye"></i></button>
  101. @else
  102. <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 class="fa-regular fa-eye-slash"></i></button>
  103. @endif
  104. </td>
  105. </tr>
  106. @if(count($record->childs))
  107. @include('livewire/causal_child',['records' => $record->childs, 'indentation' => 1])
  108. @endif
  109. @endforeach
  110. </tbody>
  111. </table>
  112. </section>
  113. @else
  114. <div class="container">
  115. <a class="btn--ui lightGrey" href="/causals"><i class="fa-solid fa-arrow-left"></i></a><br><br>
  116. @if (session()->has('error'))
  117. <div class="alert alert-danger" role="alert">
  118. {{ session()->get('error') }}
  119. </div>
  120. @endif
  121. <div class="row">
  122. <div class="col">
  123. <form action="">
  124. @if($parent != '')
  125. <h3>Aggiungi livello a {{$parent}}</h3><br>
  126. @endif
  127. <div class="row mb-3">
  128. <div class="col">
  129. <div class="form--item">
  130. <label for="inputName" class="form-label">Nome</label>
  131. <input class="form-control js-keyupTitle @error('name') is-invalid @enderror" type="text" id="name" placeholder="Nome" wire:model="name">
  132. @error('name')
  133. <div class="invalid-feedback">{{ $message }}</div>
  134. @enderror
  135. </div>
  136. </div>
  137. </div>
  138. <div class="row mb-3">
  139. <div class="col">
  140. <label for="next_month_expire" class="form-label">Tipologia</label>
  141. <select name="type" class="form-select @error('type') is-invalid @enderror" aria-label="Seleziona una tipologia" wire:model="type">
  142. <option value="">--Seleziona--
  143. <option value="IN">Entrata
  144. <option value="OUT">Uscita
  145. </select>
  146. </div>
  147. </div>
  148. <div class="form--item mb-3">
  149. <div class="form-check form-check-inline" style="padding-left:0px !important;">
  150. <input class="form-check-input form-control" style="width:22px; height:22px;" type="checkbox" id="enabled" wire:model="enabled">
  151. <label class="form-check-label" for="enabled">Abilitato</label>
  152. </div>
  153. </div>
  154. <div class="form--item mb-3">
  155. <div class="form-check form-check-inline" style="padding-left:28px !important;">
  156. <input class="form-check-input form-control" style="width:22px; height:22px;" type="checkbox" id="money" wire:model="money">
  157. <label class="form-check-label" for="money">Incrementa borsellino virtuale</label>
  158. </div>
  159. </div>
  160. <div class="form--item mb-3">
  161. <div class="form-check form-check-inline" style="padding-left:28px !important;">
  162. <input class="form-check-input form-control" style="width:22px; height:22px;" type="checkbox" id="no_receipt" wire:model="no_receipt">
  163. <label class="form-check-label" for="no_receipt">Non generare ricevuta</label>
  164. </div>
  165. </div>
  166. <div class="form--item mb-3">
  167. <div class="form-check form-check-inline" style="padding-left:28px !important;">
  168. <input class="form-check-input form-control" style="width:22px; height:22px;" type="checkbox" id="user_status" wire:model="user_status">
  169. <label class="form-check-label" for="user_status">Impatta stato utente</label>
  170. </div>
  171. </div>
  172. <div class="form--item mb-3">
  173. <div class="form-check form-check-inline" style="padding-left:28px !important;">
  174. <input class="form-check-input form-control" style="width:22px; height:22px;" type="checkbox" id="no_first" wire:model="no_first">
  175. <label class="form-check-label" for="no_first">Escludi dalla prima nota</label>
  176. </div>
  177. </div>
  178. <div class="form--item mb-3">
  179. <div class="form-check form-check-inline" style="padding-left:28px !important;">
  180. <input class="form-check-input form-control" style="width:22px; height:22px;" type="checkbox" id="no_records" wire:model="no_records">
  181. <label class="form-check-label" for="no_records">Escludi da entrate/uscite gestionale</label>
  182. </div>
  183. </div>
  184. <div class="form--item mb-3">
  185. <div class="form-check form-check-inline" style="padding-left:28px !important;">
  186. @if($corrispettivo_causal_id == 0 || $corrispettivo_causal_id == $dataId)
  187. <input class="form-check-input form-control" style="width:22px; height:22px;" type="checkbox" id="corrispettivo_fiscale" wire:model="corrispettivo_fiscale">
  188. @else
  189. <input class="form-check-input form-control" style="width:22px; height:22px;" type="checkbox" id="corrispettivo_fiscale" wire:model="corrispettivo_fiscale" disabled="disabled">
  190. @endif
  191. <label class="form-check-label" for="corrispettivo_fiscale">Utilizza per corrispettivo fiscale</label>
  192. </div>
  193. </div>
  194. <div class="form--item mb-3">
  195. <div class="form-check form-check-inline" style="padding-left:28px !important;">
  196. <input class="form-check-input form-control" style="width:22px; height:22px;" type="checkbox" id="no_reports" wire:model="no_reports">
  197. <label class="form-check-label" for="no_reports">Escludi da reports</label>
  198. </div>
  199. </div>
  200. <!-- // inline input field -->
  201. <div class="form--item">
  202. <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
  203. @if($add)
  204. <button type="submit" class="btn--ui" wire:click.prevent="store()">Salva</button>
  205. @endif
  206. @if($update)
  207. <button type="submit" class="btn--ui" wire:click.prevent="update()">Salva</button>
  208. @endif
  209. </div>
  210. </form>
  211. </div>
  212. </div>
  213. </div>
  214. @endif
  215. <br>
  216. </div>
  217. @push('scripts')
  218. <!--
  219. <script src="https://cdn.jsdelivr.net/gh/livewire/sortable@v0.x.x/dist/livewire-sortable.js"></script>
  220. -->
  221. @endpush