records_in.blade.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <div>
  2. @if(!$add && !$update)
  3. <header id="title--section" 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)Elenco Entrate @else Inserimento/modifica entrata @endif</h2>
  7. </div>
  8. @if(!$add && !$update)
  9. <div class="title--section_addButton">
  10. <div class="card--ui card--ui_btnAddHeaderUser entrata d-flex justify-items-between">
  11. <header class="d-flex justify-content-between"><div class="card-title d-flex align-items-start"><h2><small>Registra</small><br>Nuova Entrata</h2></div><a href="#" wire:click="add()"><i class="ico--ui big add primary"></i></a></header>
  12. </div>
  13. </div>
  14. @endif
  15. </header>
  16. <section id="subheader" class="d-flex align-items-center justify-content-between">
  17. <!--
  18. <form action="" class="group--action d-flex align-items-center">
  19. <select class="form-select form-select-lg me-1" aria-label=".form-select-lg example">
  20. <option selected>Open this select menu</option>
  21. <option value="1">One</option>
  22. <option value="2">Two</option>
  23. <option value="3">Three</option>
  24. </select>
  25. <button type="submit" class="btn--ui">applica</button>
  26. </form>
  27. -->
  28. <form action="" class="compare--form d-flex align-items-center">
  29. <select class="form-select form-select-lg me-1" aria-label=".form-select-lg example" wire:model="selectedFilter">
  30. <option value="0">Oggi</option>
  31. <option value="1">Questo mese: <span class="date-range">{{date("01/m/Y")}} - {{date("t/m/Y")}}</span></option>
  32. <option value="2">Questo anno: <span class="date-range">{{date("01/01/Y")}} - {{date("31/12/Y")}}</span></option>
  33. <option value="3">Tutte</option>
  34. </select>
  35. </form>
  36. </section>
  37. <section id="resume-table">
  38. <div class="compare--chart_wrapper d-none"></div>
  39. <table class="table tablesaw tablesaw-stack" data-tablesaw="" id="tablesaw-350">
  40. <thead>
  41. <tr>
  42. <th scope="col">Data</th>
  43. <th scope="col">Importo</th>
  44. <th scope="col">Persona</th>
  45. <th scope="col">Causale</th>
  46. <th scope="col">Pagamento</th>
  47. <th scope="col">...</th>
  48. </tr>
  49. </thead>
  50. <tbody id="checkall-target">
  51. @foreach($records as $record)
  52. <tr>
  53. <td>{{date("d/m/Y", strtotime($record->date))}}</td>
  54. <td><span class="tablesaw-cell-content primary">€ {{$record->amount}}</span></td>
  55. <td>{{$record->member->first_name}}</td>
  56. <td>{{$record->causal->getTree()}}</td>
  57. <td>{{$record->payment_method->name}}</td>
  58. <td>
  59. <button type="button" class="btn btn-outline-primary btn-sm" wire:click="edit({{ $record->id }})">Modifica</button>
  60. <button type="button" class="btn btn-outline-danger btn-sm" onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()" wire:click="delete({{ $record->id }})">Elimina</button>
  61. </td>
  62. </tr>
  63. @endforeach
  64. </tbody>
  65. </table>
  66. <!--
  67. <div class="paginator d-flex justify-content-center">
  68. <nav aria-label="Page navigation example">
  69. <ul class="pagination">
  70. <li class="page-item">
  71. <a class="page-link" href="#" aria-label="Previous">
  72. <span aria-hidden="true"></span>
  73. </a>
  74. </li>
  75. <li class="page-item"><a class="page-link" href="#">1</a></li>
  76. <li class="page-item"><a class="page-link" href="#">2</a></li>
  77. <li class="page-item"><a class="page-link" href="#">3</a></li>
  78. <li class="page-item"><a class="page-link" href="#">3</a></li>
  79. <li class="page-item"><span class="more-page">...</span></li>
  80. <li class="page-item">
  81. <a class="page-link" href="#" aria-label="Next">
  82. <span aria-hidden="true"></span>
  83. </a>
  84. </li>
  85. </ul>
  86. </nav>
  87. </div>
  88. -->
  89. </section>
  90. @else
  91. <header id="title--section" class="d-flex align-items-center justify-content-between">
  92. <div class="title--section_name d-flex align-items-center justify-content-between">
  93. <i class="ico--ui title_section entrate me-2"></i>
  94. <h2 class="primary">{{$add ? 'Nuova' : 'Modifica'}} Entrata</h2>
  95. </div>
  96. <div class="title--section_invoice d-flex align-items-center">
  97. <span class="tipology me-2">Tipologia:</span>
  98. <div class="check--invoice d-flex align-items-center">
  99. <div class="form-check me-3">
  100. <input class="form-check-input" type="radio" value="1" id="commercial" wire:model="commercial">
  101. <label class="form-check-label" for="flexCheckChecked">
  102. Commerciale
  103. </label>
  104. </div>
  105. <div class="form-check">
  106. <input class="form-check-input" type="radio" value="0" id="commercial" wire:model="commercial">
  107. <label class="form-check-label" for="flexCheck">
  108. Non Commerciale
  109. </label>
  110. </div>
  111. </div>
  112. </div>
  113. </header>
  114. <section id="accountingEntry" class="d-flex">
  115. <div class="accountingEntry_data">
  116. <form class="form--accounting">
  117. <div class="row gx-2">
  118. <div class="col-md-6">
  119. <span class="title-form d-block w-100">Data</span>
  120. <div class="input-group mb-3">
  121. <input id="date" type="date" class="form-control" wire:model="date">
  122. </div>
  123. </div>
  124. <div class="col-md-6">
  125. </div>
  126. <div class="col-md-6">
  127. <span class="title-form d-block w-100">Persona</span>
  128. <select name="member_id" class="form-select @error('member_id') is-invalid @enderror" aria-label="Seleziona una persona" wire:model="member_id">
  129. <option value="">--Seleziona--
  130. @foreach($members as $member)
  131. <option value="{{$member->id}}">{{$member->first_name}} {{$member->last_name}}
  132. @endforeach
  133. </select>
  134. </div>
  135. <div class="col-md-6">
  136. </div>
  137. </div>
  138. <div class="row gx-2 mt-5">
  139. <span class="title-form d-block w-100">Casuale</span>
  140. <div class="col-md-12">
  141. <select name="causal_id" class="form-select @error('causal_id') is-invalid @enderror" aria-label="Seleziona una causale" wire:model="causal_id">
  142. <option value="">--Seleziona--
  143. @foreach($causals as $causal)
  144. <option value="{{$causal["id"]}}">{{$causal["name"]}}
  145. @endforeach
  146. </select>
  147. </div>
  148. </div>
  149. <div class="row gx-2 mt-5 align-items-center">
  150. <div class="col-md-6">
  151. <span class="total primary">Importo</span>
  152. </div>
  153. <div class="col-md-6">
  154. @if($add)
  155. <input type="number" class="form-control totalInput text-end @error('amount') is-invalid @enderror" id="amount" placeholder="€ 0,00" wire:model="amount" wire:keydown.enter="save()">
  156. @endif
  157. @if($update)
  158. <input type="number" class="form-control totalInput text-end @error('amount') is-invalid @enderror" id="amount" placeholder="€ 0,00" wire:model="amount" wire:keydown.enter="update()">
  159. @endif
  160. @error('amount')
  161. <div class="invalid-feedback">{{ $message }}</div>
  162. @enderror
  163. </div>
  164. </div>
  165. <div class="row gx-2 mt-5">
  166. <span class="title-form d-block w-100">Pagamento</span>
  167. <div class="col-md-12">
  168. <label for="payment_method_id" class="form-label">Modalità di Pagamento</label>
  169. <select name="payment_method_id" class="form-select @error('payment_method_id') is-invalid @enderror" aria-label="Seleziona un metodo di pagamento" wire:model="payment_method_id">
  170. <option value="">--Seleziona--
  171. @foreach($payments as $payment)
  172. <option value="{{$payment->id}}">{{$payment->name}}
  173. @endforeach
  174. </select>
  175. </div>
  176. </div>
  177. <div class="accountingEntry--btn d-flex align-items-center justify-content-between">
  178. <button class="btn--ui lightGrey" type="submit" wire:click.prevent="cancel()">annulla</button>
  179. @if($add)
  180. <button class="btn--ui primary" type="submit" wire:click.prevent="store()">inserisci</button>
  181. @endif
  182. @if($update)
  183. <button class="btn--ui primary" type="submit" wire:click.prevent="update()">salva</button>
  184. @endif
  185. </div>
  186. </form>
  187. </div>
  188. <div class="accountingEntry_resume card--ui">
  189. <header>
  190. <div class="username d-flex align-items-start">
  191. <i class="ico--ui accountingResume me-2"></i>
  192. <div class="user--resume_name d-flex flex-column"><span class="primary">Ricevuta</span></div></div>
  193. </header>
  194. <div class="resume--body d-flex justify-content-between flex-column">
  195. <header>
  196. @if($this->member)
  197. <ul class="resume-item mb-4 p-0">
  198. <li><span class="evidence_name">{{$this->member->first_name}}</span></li>
  199. <li><span>Nato/a il {{$this->member->birth_date ? date("d/m/Y", strtotime($this->member->birth_date)) : ''}}</span></li>
  200. </ul>
  201. @endif
  202. <ul class="resume-item date p-0">
  203. <li><strong>Data di Pagamento</strong></li>
  204. <li>{{ date("d/m/Y", strtotime($date)) }}</li>
  205. </ul>
  206. @if($this->causal)
  207. <ul class="resume-item date p-0">
  208. <li><strong>Casuale</strong></li>
  209. <li>{{$this->causal->getTree()}}</li>
  210. </ul>
  211. @endif
  212. </header>
  213. <footer>
  214. <div class="total--wrapper">
  215. <div class="total--wrapper_amount d-flex align-items-center justify-content-between w-100 mb-3">
  216. <span class="amount_p"><strong>Importo</strong></span><span class="amount_data"><strong>€ {{$amount}}</strong></span>
  217. </div>
  218. <!--<div class="total--wrapper_tax d-flex align-items-center justify-content-between w-100 mb-2 pb-3">
  219. <span class="taxt_p">Ritenuta d’acconto (20%):</span><span class="tax_data">€ 20,00</span>
  220. </div>-->
  221. <div class="total--wrapper_netprice d-flex align-items-center justify-content-between w-100">
  222. <span class="netprice_p"><strong>Totale Netto</strong></span><span class="netprice_data"><strong>€ {{$amount}}</strong></span>
  223. </div>
  224. </div>
  225. <button class="btn--ui primary sendInvoice mt-5 d-flex ms-auto"><i class="ico--ui sendingBtn"></i>invia ricevuta</button>
  226. </footer>
  227. </div>
  228. </div>
  229. </section>
  230. @endif
  231. </div>