payment_method.blade.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <div class="col card--ui" id="card--dashboard">
  2. @if(!$add && !$update)
  3. <header id="title--section" style="display:none !important" class="d-flex align-items-center justify-content-between">
  4. <div class="title--section_name d-flex align-items-center justify-content-between">
  5. <i class="ico--ui title_section utenti me-2"></i>
  6. <h2 class="primary">@if(!$add && !$update)metodi pagamento @else Inserimento/modifica metodo pagamento @endif</h2>
  7. </div>
  8. @if(!$add && !$update)
  9. <div class="title--section_addButton" wire:click="add()" style="cursor: pointer;">
  10. <div class="btn--ui entrata d-flex justify-items-between">
  11. <a href="#" wire:click="add()" style="color:white">Aggiungi</a>
  12. </div>
  13. </div>
  14. @endif
  15. </header>
  16. <a class="btn--ui lightGrey" href="/settings?type=contabilita"><i class="fa-solid fa-arrow-left"></i></a><br>
  17. <section id="resume-table">
  18. <div class="compare--chart_wrapper d-none"></div>
  19. <table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350" width="100%">
  20. <thead>
  21. <tr>
  22. <th scope="col">Origine</th>
  23. <th scope="col">Destinazione</th>
  24. <th scope="col">Nome</th>
  25. <th scope="col">Tipo</th>
  26. <th scope="col">Abilitato</th>
  27. <th scope="col">...</th>
  28. </tr>
  29. </thead>
  30. <tbody id="checkall-target">
  31. @foreach($records as $record)
  32. <tr>
  33. <td>{{$record->origin ? $record->origin : ''}}</td>
  34. <td>{{$record->destination ? $record->destination : ''}}</td>
  35. <td>{{$record->name}}</td>
  36. <td>
  37. @php
  38. switch ($record->type) {
  39. case 'IN':
  40. echo "Entrate";
  41. break;
  42. case 'OUT':
  43. echo "Uscite";
  44. break;
  45. case 'ALL':
  46. echo "Entrate/Uscite";
  47. break;
  48. }
  49. @endphp
  50. </td>
  51. <td> <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->enabled ? 'active' : 'suspended'}}">{{$record->enabled ? 'attivo' : 'disattivo'}}</span></span></td>
  52. <td>
  53. <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>
  54. <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>
  55. </td>
  56. </tr>
  57. @endforeach
  58. </tbody>
  59. </table>
  60. <!--
  61. <div class="paginator d-flex justify-content-center">
  62. <nav aria-label="Page navigation example">
  63. <ul class="pagination">
  64. <li class="page-item">
  65. <a class="page-link" href="#" aria-label="Previous">
  66. <span aria-hidden="true"></span>
  67. </a>
  68. </li>
  69. <li class="page-item"><a class="page-link" href="#">1</a></li>
  70. <li class="page-item"><a class="page-link" href="#">2</a></li>
  71. <li class="page-item"><a class="page-link" href="#">3</a></li>
  72. <li class="page-item"><a class="page-link" href="#">3</a></li>
  73. <li class="page-item"><span class="more-page">...</span></li>
  74. <li class="page-item">
  75. <a class="page-link" href="#" aria-label="Next">
  76. <span aria-hidden="true"></span>
  77. </a>
  78. </li>
  79. </ul>
  80. </nav>
  81. </div>
  82. -->
  83. </section>
  84. @else
  85. <div class="container">
  86. <a class="btn--ui lightGrey" href="/payment_methods"><i class="fa-solid fa-arrow-left"></i></a><br><br>
  87. @if (session()->has('error'))
  88. <div class="alert alert-danger" role="alert">
  89. {{ session()->get('error') }}
  90. </div>
  91. @endif
  92. <div class="row">
  93. <div class="col">
  94. <form action="">
  95. <div class="row mb-3">
  96. <div class="col">
  97. <div class="form--item">
  98. <label for="inputName" class="form-label">Nome</label>
  99. <input class="form-control js-keyupTitle @error('name') is-invalid @enderror" type="text" id="name" placeholder="Nome" wire:model="name">
  100. @error('name')
  101. <div class="invalid-feedback">{{ $message }}</div>
  102. @enderror
  103. </div>
  104. </div>
  105. <div class="col-md-6">
  106. <label for="type" class="form-label">Tipologia</label>
  107. <select name="type" class="form-select" aria-label="Seleziona una tipologia" wire:model="type">
  108. <option value="ALL">Entrate/Uscite
  109. <option value="IN">Entrate
  110. <option value="OUT">Uscite
  111. </select>
  112. </div>
  113. </div>
  114. <div class="row mb-3">
  115. <div class="col">
  116. <label for="origin_id" class="form-label">Origine</label>
  117. <select name="origin_id" class="form-select" aria-label="Seleziona un'origine" wire:model="origin_id">
  118. <option value="">--Seleziona--
  119. @foreach($origins as $origin)
  120. <option value="{{$origin->id}}">{{$origin->name}}
  121. @endforeach
  122. </select>
  123. </div>
  124. <div class="col">
  125. <label for="destination_id" class="form-label">Destinazione</label>
  126. <select name="destination_id" class="form-select" aria-label="Seleziona una destinazione" wire:model="destination_id">
  127. <option value="">--Seleziona--
  128. @foreach($destinations as $destination)
  129. <option value="{{$destination->id}}">{{$destination->name}}
  130. @endforeach
  131. </select>
  132. </div>
  133. </div>
  134. <div class="form--item mb-3">
  135. <div class="form--item">
  136. <label for="enabled" class="form-label">Abilitato</label>
  137. <input class="form-check-input form-control" style="width:22px; height:22px;" type="checkbox" id="enabled" wire:model="enabled">
  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="money" wire:model="money">
  143. <label class="form-check-label" for="money">Decrementa borsellino virtuale</label>
  144. </div>
  145. </div>
  146. <div class="form--item mb-3">
  147. <div class="form-check form-check-inline">
  148. <input class="form-check-input" type="checkbox" id="corrispettivo_fiscale" wire:model="corrispettivo_fiscale">
  149. <label class="form-check-label" for="corrispettivo_fiscale">Utilizza per corrispettivo fiscale</label>
  150. </div>
  151. </div>
  152. <!-- // inline input field -->
  153. <div class="form--item">
  154. <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
  155. @if($add)
  156. <button type="submit" class="btn--ui" wire:click.prevent="store()">Salva</button>
  157. @endif
  158. @if($update)
  159. <button type="submit" class="btn--ui" wire:click.prevent="update()">Salva</button>
  160. @endif
  161. </div>
  162. </form>
  163. </div>
  164. </div>
  165. </div>
  166. @endif
  167. </div>
  168. @push('scripts')
  169. <link href="/css/datatables.css" rel="stylesheet" />
  170. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  171. <script src="/assets/js/datatables.js"></script>
  172. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  173. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  174. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  175. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  176. @endpush
  177. @push('scripts')
  178. <script>
  179. $(document).ready(function() {
  180. loadDataTable();
  181. } );
  182. Livewire.on('load-data-table', () => {
  183. loadDataTable();
  184. });
  185. function loadDataTable(){
  186. if ( $.fn.DataTable.isDataTable('#tablesaw-350') ) {
  187. $('#tablesaw-350').DataTable().destroy();
  188. }
  189. $('#tablesaw-350').DataTable({
  190. thead: {
  191. 'th': {'background-color': 'blue'}
  192. },
  193. order: [
  194. [2, 'asc']
  195. ],
  196. layout: {
  197. topStart : null,
  198. topEnd : null,
  199. top1A: {
  200. buttons: [
  201. {
  202. extend: 'collection',
  203. text: 'ESPORTA',
  204. buttons: [
  205. {
  206. extend: 'excelHtml5',
  207. title: 'Metodi di pagamento',
  208. exportOptions: {
  209. columns: ":not(':last')"
  210. }
  211. },
  212. {
  213. extend: 'pdfHtml5',
  214. title: 'Metodi di pagamento',
  215. exportOptions: {
  216. columns: ":not(':last')"
  217. }
  218. },
  219. {
  220. extend: 'print',
  221. text: 'Stampa',
  222. title: 'Metodi di pagamento',
  223. exportOptions: {
  224. columns: ":not(':last')"
  225. }
  226. }
  227. ],
  228. dropup: true
  229. }
  230. ]
  231. },
  232. top1B : {
  233. pageLength: {
  234. menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
  235. }
  236. },
  237. top1C :'search',
  238. },
  239. pagingType: 'numbers',
  240. "language": {
  241. "url": "/assets/js/Italian.json"
  242. },
  243. "fnInitComplete": function (oSettings, json) {
  244. var html = '&nbsp;<a href="#" class="addData btn--ui"><i class="fa-solid fa-plus"></i></a>';
  245. $(".dt-search").append(html);
  246. }
  247. });
  248. $('#tablesaw-350 thead tr th').addClass('col');
  249. $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
  250. $(document).ready(function() {
  251. $(document).on("click",".addData",function() {
  252. $(".title--section_addButton").trigger("click")
  253. });
  254. } );
  255. }
  256. </script>
  257. @endpush