causal.blade.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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">Indietro</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" 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" 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. <div class="row mb-3">
  90. <div class="col">
  91. <div class="form--item">
  92. <label for="inputName" class="form-label">Nome</label>
  93. <input class="form-control js-keyupTitle @error('name') is-invalid @enderror" type="text" id="name" placeholder="Nome" wire:model="name">
  94. @error('name')
  95. <div class="invalid-feedback">{{ $message }}</div>
  96. @enderror
  97. </div>
  98. </div>
  99. </div>
  100. <div class="row mb-3">
  101. <div class="col">
  102. <label for="next_month_expire" class="form-label">Tipologia</label>
  103. <select name="type" class="form-select @error('type') is-invalid @enderror" aria-label="Seleziona una tipologia" wire:model="type">
  104. <option value="">--Seleziona--
  105. <option value="IN">Entrata
  106. <option value="OUT">Uscita
  107. </select>
  108. </div>
  109. </div>
  110. <div class="form--item mb-3">
  111. <div class="form-check form-check-inline">
  112. <input class="form-check-input" type="checkbox" id="enabled" wire:model="enabled">
  113. <label class="form-check-label" for="enabled">Abilitato</label>
  114. </div>
  115. </div>
  116. <div class="form--item mb-3">
  117. <div class="form-check form-check-inline">
  118. <input class="form-check-input" type="checkbox" id="money" wire:model="money">
  119. <label class="form-check-label" for="money">Incrementa borsellino virtuale</label>
  120. </div>
  121. </div>
  122. <div class="form--item mb-3">
  123. <div class="form-check form-check-inline">
  124. <input class="form-check-input" type="checkbox" id="no_receipt" wire:model="no_receipt">
  125. <label class="form-check-label" for="no_receipt">Non generare ricevuta</label>
  126. </div>
  127. </div>
  128. <div class="form--item mb-3">
  129. <div class="form-check form-check-inline">
  130. <input class="form-check-input" type="checkbox" id="user_status" wire:model="user_status">
  131. <label class="form-check-label" for="user_status">Impatta stato utente</label>
  132. </div>
  133. </div>
  134. <div class="form--item mb-3">
  135. <div class="form-check form-check-inline">
  136. <input class="form-check-input" type="checkbox" id="no_first" wire:model="no_first">
  137. <label class="form-check-label" for="no_first">Escludi dalla prima nota</label>
  138. </div>
  139. </div>
  140. <div class="form--item mb-3">
  141. <div class="form-check form-check-inline">
  142. <input class="form-check-input" type="checkbox" id="no_records" wire:model="no_records">
  143. <label class="form-check-label" for="no_records">Escludi da entrate/uscite gestionale</label>
  144. </div>
  145. </div>
  146. <div class="form--item mb-3">
  147. <div class="form-check form-check-inline">
  148. @if($corrispettivo_causal_id == 0 || $corrispettivo_causal_id == $dataId)
  149. <input class="form-check-input" type="checkbox" id="corrispettivo_fiscale" wire:model="corrispettivo_fiscale">
  150. @else
  151. <input class="form-check-input" type="checkbox" id="corrispettivo_fiscale" wire:model="corrispettivo_fiscale" disabled="disabled">
  152. @endif
  153. <label class="form-check-label" for="corrispettivo_fiscale">Utilizza per corrispettivo fiscale</label>
  154. </div>
  155. </div>
  156. <!-- // inline input field -->
  157. <div class="form--item">
  158. @if($add)
  159. <button type="submit" class="btn--ui" wire:click.prevent="store()">Salva</button>
  160. @endif
  161. @if($update)
  162. <button type="submit" class="btn--ui" wire:click.prevent="update()">Salva</button>
  163. @endif
  164. <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
  165. </div>
  166. </form>
  167. </div>
  168. </div>
  169. </div>
  170. @endif
  171. </div>
  172. @push('scripts')
  173. <!--
  174. <script src="https://cdn.jsdelivr.net/gh/livewire/sortable@v0.x.x/dist/livewire-sortable.js"></script>
  175. -->
  176. @endpush