causal.blade.php 10 KB

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