payment_method.blade.php 13 KB

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