records_old.blade.php 77 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974
  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">Prima nota</h2>
  6. </div>
  7. </header>
  8. <section id="subheader" class="">
  9. <div class="row g-3">
  10. <div class="col-md-3">
  11. Utente
  12. <select name="search_member_id" class="form-select filterMember" wire:model="filterMember">
  13. <option value="">--Seleziona--
  14. @foreach($members as $member)
  15. <option value="{{$member->id}}">{{$member->last_name}} {{$member->first_name}}
  16. @endforeach
  17. </select>
  18. </div>
  19. <div class="col-md-4">
  20. Causale
  21. <select name="search_causal_id[]" class="form-select filterCausals me-2" multiple="multiple" wire:model="filterCausals">
  22. @foreach($causals as $causal)
  23. <option value="{{$causal["id"]}}">{!!$causal["name"]!!}
  24. @endforeach
  25. </select>
  26. </div>
  27. <div class="col-md-3">
  28. Periodo
  29. <div class="col-12 mb-3">
  30. <select wire:model="selectedPeriod" class="form-select" @if($isFiltering) disabled @endif style="height: 43px!important;">
  31. <option value="OGGI">Oggi</option>
  32. <option value="IERI">Ieri</option>
  33. <option value="GIORNO_PERSONALIZZATO">Giorno Personalizzato</option>
  34. <option value="MESE CORRENTE">Mese Corrente</option>
  35. <option value="MESE PRECEDENTE">Mese Precedente</option>
  36. <option value="MESE_PERSONALIZZATO">Mese Personalizzato</option>
  37. <option value="ULTIMO TRIMESTRE">Ultimo Trimestre</option>
  38. <option value="ULTIMO QUADRIMESTRE">Ultimo Quadrimestre</option>
  39. </select>
  40. </div>
  41. @if($selectedPeriod === 'GIORNO_PERSONALIZZATO')
  42. <div class="col-12 mb-2" wire:transition>
  43. <div class="day-picker-container position-relative">
  44. <div class="input-group">
  45. <input type="date"
  46. wire:model="selectedDay"
  47. class="form-control"
  48. style="height: 43px!important;"
  49. @if($isFiltering) disabled @endif>
  50. </div>
  51. @if($showDayPicker)
  52. <div class="day-picker-dropdown position-absolute bg-white border rounded shadow-lg p-3 mt-1"
  53. style="z-index: 1060; width: 100%; max-width: 350px;">
  54. <div class="d-flex justify-content-between align-items-center mb-3">
  55. <h6 class="mb-0 text-primary">
  56. <i class="fa-regular fa-calendar me-2"></i>
  57. Seleziona Giorno
  58. </h6>
  59. <button type="button"
  60. class="btn-close btn-sm"
  61. wire:click="toggleDayPicker"></button>
  62. </div>
  63. <div class="row g-2 mb-3">
  64. <div class="col-6">
  65. <button type="button"
  66. class="btn btn-sm btn-outline-primary w-100"
  67. wire:click="selectToday">
  68. <i class="fas fa-calendar-day me-1"></i>
  69. Oggi
  70. </button>
  71. </div>
  72. <div class="col-6">
  73. <button type="button"
  74. class="btn btn-sm btn-outline-secondary w-100"
  75. wire:click="selectYesterday">
  76. <i class="fas fa-step-backward me-1"></i>
  77. Ieri
  78. </button>
  79. </div>
  80. </div>
  81. <div class="mb-3">
  82. <label class="form-label small">Anno</label>
  83. <select wire:model="selectedYear" class="form-select form-select-sm">
  84. @php
  85. $currentYear = date('Y');
  86. $selectedDayYear = $selectedDay ? substr($selectedDay, 0, 4) : $currentYear;
  87. @endphp
  88. @for($year = $currentYear - 3; $year <= $currentYear + 1; $year++)
  89. <option value="{{ $year }}" {{ $year == $selectedDayYear ? 'selected' : '' }}>
  90. {{ $year }}
  91. </option>
  92. @endfor
  93. </select>
  94. </div>
  95. <div class="mb-3">
  96. <label class="form-label small">Mese</label>
  97. <div class="row g-1">
  98. @php
  99. $months = [
  100. '01' => 'Gen', '02' => 'Feb', '03' => 'Mar', '04' => 'Apr',
  101. '05' => 'Mag', '06' => 'Giu', '07' => 'Lug', '08' => 'Ago',
  102. '09' => 'Set', '10' => 'Ott', '11' => 'Nov', '12' => 'Dic'
  103. ];
  104. $currentMonth = $selectedDay ? substr($selectedDay, 5, 2) : date('m');
  105. $currentYear = $selectedDay ? substr($selectedDay, 0, 4) : date('Y');
  106. @endphp
  107. @foreach($months as $monthNum => $monthName)
  108. <div class="col-3">
  109. <button type="button"
  110. class="btn btn-sm w-100 month-selector {{ $monthNum === $currentMonth ? 'btn-primary' : 'btn-outline-secondary' }}"
  111. data-month="{{ $monthNum }}">
  112. {{ $monthName }}
  113. </button>
  114. </div>
  115. @endforeach
  116. </div>
  117. </div>
  118. <div class="mb-3">
  119. <label class="form-label small">Giorno</label>
  120. <div class="day-grid" id="dayGrid">
  121. </div>
  122. </div>
  123. <div class="row g-2">
  124. <div class="col-6">
  125. <button type="button"
  126. class="btn btn-sm btn-success w-100"
  127. id="confirmDaySelection">
  128. <i class="fas fa-check me-1"></i>
  129. Conferma
  130. </button>
  131. </div>
  132. <div class="col-6">
  133. <button type="button"
  134. class="btn btn-sm btn-outline-secondary w-100"
  135. wire:click="toggleDayPicker">
  136. <i class="fas fa-times me-1"></i>
  137. Annulla
  138. </button>
  139. </div>
  140. </div>
  141. </div>
  142. @endif
  143. </div>
  144. </div>
  145. @if($selectedDay && $selectedPeriod === 'GIORNO_PERSONALIZZATO')
  146. <div class="col-12 mb-2">
  147. <div class="alert alert-info py-2 px-3 mb-0" style="font-size: 0.875rem;">
  148. <i class="fas fa-info-circle me-1"></i>
  149. <strong>Giorno selezionato:</strong><br>
  150. {{ \Carbon\Carbon::createFromFormat('Y-m-d', $selectedDay)->locale('it')->isoFormat('dddd, D MMMM YYYY') }}
  151. </div>
  152. </div>
  153. @endif
  154. @endif
  155. @if($selectedPeriod === 'MESE_PERSONALIZZATO')
  156. <div class="col-12 mb-2" wire:transition>
  157. <div class="month-picker-container position-relative">
  158. <div class="input-group">
  159. <input type="month"
  160. wire:model="selectedMonth"
  161. class="form-control"
  162. style="height: 43px!important;"
  163. @if($isFiltering) disabled @endif>
  164. </div>
  165. @if($showMonthPicker)
  166. <div class="month-picker-dropdown position-absolute bg-white border rounded shadow-lg p-3 mt-1"
  167. style="z-index: 1060; width: 100%; max-width: 300px;">
  168. <div class="d-flex justify-content-between align-items-center mb-3">
  169. <h6 class="mb-0 text-primary">
  170. <i class="fa-regular fa-calendar me-2"></i>
  171. Seleziona Mese
  172. </h6>
  173. <button type="button"
  174. class="btn-close btn-sm"
  175. wire:click="toggleMonthPicker"></button>
  176. </div>
  177. <div class="mb-3">
  178. <label class="form-label small">Anno</label>
  179. <select wire:model="selectedYear" class="form-select form-select-sm">
  180. @php
  181. $currentYear = date('Y');
  182. $selectedYear = $selectedMonth ? substr($selectedMonth, 0, 4) : $currentYear;
  183. @endphp
  184. @for($year = $currentYear - 3; $year <= $currentYear + 1; $year++)
  185. <option value="{{ $year }}" {{ $year == $selectedYear ? 'selected' : '' }}>
  186. {{ $year }}
  187. </option>
  188. @endfor
  189. </select>
  190. </div>
  191. <div class="row g-1 mb-3">
  192. @php
  193. $months = [
  194. '01' => 'Gen', '02' => 'Feb', '03' => 'Mar', '04' => 'Apr',
  195. '05' => 'Mag', '06' => 'Giu', '07' => 'Lug', '08' => 'Ago',
  196. '09' => 'Set', '10' => 'Ott', '11' => 'Nov', '12' => 'Dic'
  197. ];
  198. $currentMonth = $selectedMonth ?: date('Y-m');
  199. @endphp
  200. @foreach($months as $monthNum => $monthName)
  201. <div class="col-3">
  202. <button type="button"
  203. class="btn btn-sm w-100 {{ ($selectedYear . '-' . $monthNum) === $currentMonth ? 'btn-primary' : 'btn-outline-secondary' }}"
  204. wire:click="selectMonth('{{ $selectedYear }}-{{ $monthNum }}')">
  205. {{ $monthName }}
  206. </button>
  207. </div>
  208. @endforeach
  209. </div>
  210. <div class="row g-1">
  211. <div class="col-6">
  212. <button type="button"
  213. class="btn btn-sm btn-outline-primary w-100"
  214. wire:click="selectMonth('{{ date('Y-m') }}')">
  215. <i class="fas fa-calendar-day me-1"></i>
  216. Questo Mese
  217. </button>
  218. </div>
  219. <div class="col-6">
  220. <button type="button"
  221. class="btn btn-sm btn-outline-secondary w-100"
  222. wire:click="selectMonth('{{ date('Y-m', strtotime('-1 month')) }}')">
  223. <i class="fas fa-step-backward me-1"></i>
  224. Mese Scorso
  225. </button>
  226. </div>
  227. </div>
  228. </div>
  229. @endif
  230. </div>
  231. </div>
  232. @if($selectedMonth && $selectedPeriod === 'MESE_PERSONALIZZATO')
  233. <div class="col-12 mb-2">
  234. <div class="alert alert-info py-2 px-3 mb-0" style="font-size: 0.875rem;">
  235. <i class="fas fa-info-circle me-1"></i>
  236. <strong>Periodo selezionato:</strong><br>
  237. {{ \Carbon\Carbon::createFromFormat('Y-m', $selectedMonth)->locale('it')->isoFormat('MMMM YYYY') }}
  238. </div>
  239. </div>
  240. @endif
  241. @endif
  242. </div>
  243. <div class="col-md-2">
  244. <div class="prima--nota_buttons ms-auto" style="float:right; margin-top:25px;">
  245. <button class="btn--ui primary" wire:click="applyFilters" style="margin-right:5px;" @if($isFiltering) disabled @endif>
  246. @if($isFiltering)
  247. <i class="fas fa-spinner fa-spin"></i> CARICAMENTO...
  248. @else
  249. FILTRA
  250. @endif
  251. </button>
  252. <button class="btn--ui lightGrey reset reset" style="margin-left:5px;color:#10172A;" wire:click="resetFilters" @if($isFiltering) disabled @endif>RESET</button>
  253. </div>
  254. </div>
  255. </div>
  256. {{-- Custom loader --}}
  257. <div wire:loading>
  258. <div class="custom_loader">
  259. <i class="fas fa-spinner fa-spin"></i>
  260. </div>
  261. </div>
  262. <style>
  263. .custom_loader {
  264. position: fixed;
  265. top: 0;
  266. left: 0;
  267. right: 0;
  268. bottom: 0;
  269. display: flex;
  270. flex-direction: column;
  271. flex-wrap: nowrap;
  272. align-content: center;
  273. justify-content: center;
  274. align-items: center;
  275. padding: 10px;
  276. background: #ffffff80;
  277. z-index: 1000;
  278. }
  279. .custom_loader i {
  280. font-size: 50px;
  281. color: #0c6197;
  282. }
  283. </style>
  284. {{-- END Custom loader --}}
  285. <div style="float:left; margin-top:10px; margin-bottom:10px;">
  286. <div class="dropdown">
  287. <button class="btn--ui_outline light dropdown-toggle" type="button" id="exportDropdown" data-bs-toggle="dropdown" aria-expanded="false"
  288. style="color:#10172A;" @if($isFiltering) disabled @endif>
  289. ESPORTA
  290. </button>
  291. <ul class="dropdown-menu" aria-labelledby="exportDropdown">
  292. <li><a class="dropdown-item" href="#" wire:click="openExportModal">Excel</a></li>
  293. <li><a class="dropdown-item" href="#" id="print">Stampa</a></li>
  294. </ul>
  295. </div>
  296. </div>
  297. </section>
  298. <section id="resume-table" class="scrollTable records-table" style="position: relative;">
  299. @if($isFiltering)
  300. <div class="loading-overlay">
  301. <div class="loading-content">
  302. <i class="fas fa-spinner fa-spin fa-3x"></i>
  303. <p>Caricamento dati in corso...</p>
  304. </div>
  305. </div>
  306. @endif
  307. <table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350" width="100%">
  308. <thead>
  309. <tr>
  310. <th scope="col">Data</th>
  311. <th scope="col" style="border-left:3px solid white;">Causale</th>
  312. <th scope="col" style="border-left:3px solid white;">Dettaglio Causale</th>
  313. <th scope="col" style="border-left:3px solid white;">Stato</th>
  314. <th scope="col" style="border-left:3px solid white;">Nominativo</th>
  315. @foreach($payments as $p)
  316. <th colspan="2" scope="col" style="text-align:center; border-left:3px solid white;">{{$p->name}}</th>
  317. @endforeach
  318. </tr>
  319. <tr>
  320. <th scope="col"></th>
  321. <th scope="col" style="border-left:3px solid white;"></th>
  322. <th scope="col" style="border-left:3px solid white;"></th>
  323. <th scope="col" style="border-left:3px solid white;"></th>
  324. <th scope="col" style="border-left:3px solid white;"></th>
  325. @foreach($payments as $p)
  326. @if($p->type == 'ALL')
  327. <th scope="col" style="text-align:center; border-left:3px solid white;">Entrate</th>
  328. <th scope="col" style="text-align:center">Uscite</th>
  329. @elseif($p->type == 'IN')
  330. <th scope="col" style="text-align:center; border-left:3px solid white;">Entrate</th>
  331. <th scope="col" style="text-align:center;"></th>
  332. @elseif($p->type == 'OUT')
  333. <th style="border-left:3px solid white;"></th>
  334. <th scope="col" style="text-align:center;">Uscite</th>
  335. @endif
  336. @endforeach
  337. </tr>
  338. </thead>
  339. <tbody id="checkall-target">
  340. @php $count = 0; @endphp
  341. @foreach($records as $causal => $record)
  342. <tr>
  343. @php
  344. $parts = explode("§", $causal);
  345. $d = $parts[0] ?? '';
  346. $c = $parts[1] ?? '';
  347. $n = $parts[2] ?? '';
  348. $det = $parts[3] ?? '';
  349. $del = $parts[4] ?? '';
  350. $detailParts = explode('|', $det);
  351. $isMultiple = count($detailParts) > 1;
  352. $displayDetail = $isMultiple ? 'Varie' : $det;
  353. @endphp
  354. <td style="background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{date("d/m/Y", strtotime($d))}}</td>
  355. <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{$c}}</td>
  356. <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">
  357. @if($isMultiple)
  358. <span class="varie-link" data-causals="{{implode('|', array_slice($detailParts, 1))}}" style="color: #0C6197; cursor: pointer; text-decoration: underline;">
  359. {{$displayDetail}}
  360. </span>
  361. @else
  362. {{$displayDetail}}
  363. @endif
  364. </td>
  365. <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">
  366. @if($del == 'DELETED')
  367. <span style='color:red'>Annullata</span>
  368. @endif
  369. </td>
  370. <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">{{$n}}</td>
  371. @foreach($payments as $p)
  372. @if(isset($record[$p->name]))
  373. <td style="text-align:right; border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">
  374. @if(isset($record[$p->name]["IN"]))
  375. <span class="tablesaw-cell-content " style="color:green">{{formatPrice($record[$p->name]["IN"])}}</span>
  376. @endif
  377. </td>
  378. <td style="text-align:right;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}">
  379. @if(isset($record[$p->name]["OUT"]))
  380. <span class="tablesaw-cell-content " style="color:red">{{formatPrice($record[$p->name]["OUT"])}}</span>
  381. @endif
  382. </td>
  383. @else
  384. <td style="border-left:3px solid white !important;background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}"></td>
  385. <td style="background-color:{{$count % 2 == 0 ? 'white' : '#f2f4f7'}}"></td>
  386. @endif
  387. @endforeach
  388. </tr>
  389. @php $count++; @endphp
  390. @endforeach
  391. </tbody>
  392. <tfoot>
  393. <tr>
  394. <td></td>
  395. <td></td>
  396. <td></td>
  397. <td></td>
  398. <td><b>Totale</b></td>
  399. @foreach($payments as $p)
  400. @if(isset($totals[$p->name]))
  401. @if($p->type == 'ALL')
  402. <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:green; font-size:18px;"><b>{{formatPrice(isset($totals[$p->name]) ? $totals[$p->name]["IN"] : 0)}}</b></span></td>
  403. <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:red; font-size:18px;"><b>{{formatPrice(isset($totals[$p->name]) ? $totals[$p->name]["OUT"] : 0)}}</b></span></td>
  404. @elseif($p->type == 'IN')
  405. <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:green; font-size:18px;"><b>{{formatPrice(isset($totals[$p->name]) ? $totals[$p->name]["IN"] : 0)}}</b></span></td>
  406. <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:red; font-size:18px;"><b>&nbsp;</b></span></td>
  407. @elseif($p->type == 'OUT')
  408. <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:green; font-size:18px;"><b>&nbsp;</b></span></td>
  409. <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:red; font-size:18px;"><b>{{formatPrice(isset($totals[$p->name]) ? $totals[$p->name]["OUT"] : 0)}}</b></span></td>
  410. @endif
  411. @else
  412. @if($p->type == 'ALL')
  413. <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:green; font-size:18px;"><b>{{formatPrice(isset($totals[$p->name]) ? $totals[$p->name]["IN"] : 0)}}</b></span></td>
  414. <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:red; font-size:18px;"><b>{{formatPrice(isset($totals[$p->name]) ? $totals[$p->name]["OUT"] : 0)}}</b></span></td>
  415. @elseif($p->type == 'IN')
  416. <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:green; font-size:18px;"><b>{{formatPrice(isset($totals[$p->name]) ? $totals[$p->name]["IN"] : 0)}}</b></span></td>
  417. <td style="text-align:center"><span class="tablesaw-cell-content primary" style="color:red; font-size:18px;"><b>&nbsp;</b></span></td>
  418. @elseif($p->type == 'OUT')
  419. <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:green; font-size:18px;"><b>&nbsp;</b></span></td>
  420. <td style="text-align:center"><span class="tablesaw-cell-content primary" style="color:red; font-size:18px;"><b>{{formatPrice(isset($totals[$p->name]) ? $totals[$p->name]["OUT"] : 0)}}</b></span></td>
  421. @endif
  422. @endif
  423. @endforeach
  424. </tr>
  425. <tr style="display:none">
  426. <td></td>
  427. <td><b>Differenza</b></td>
  428. @foreach($payments as $p)
  429. @if(isset($totals[$p->name]))
  430. @php
  431. $diff = $totals[$p->name]["IN"] - $totals[$p->name]["OUT"];
  432. @endphp
  433. @if($diff < 0)
  434. <td></td>
  435. @endif
  436. <td style="text-align:right"><span class="tablesaw-cell-content primary" style="color:{{$diff > 0 ? 'green' : 'red'}}; font-size:18px;"><b>{{formatPrice($diff)}}</b></span></td>
  437. @if($diff > 0)
  438. <td></td>
  439. @endif
  440. @else
  441. <td colspan="2" style="text-align:right"><b>{{formatPrice(0)}}</b></td>
  442. @endif
  443. @endforeach
  444. </tr>
  445. </tfoot>
  446. </table>
  447. <button type="button" class="btn btn-floating btn-lg" id="btn-back-to-bottom"><i class="fas fa-arrow-down"></i></button>
  448. <button type="button" class="btn btn-floating btn-lg" id="btn-back-to-top"><i class="fas fa-arrow-up"></i></button>
  449. </section>
  450. <div class="modal fade" id="causalsModal" tabindex="-1" aria-labelledby="causalsModalLabel" aria-hidden="true">
  451. <div class="modal-dialog modal-lg">
  452. <div class="modal-content">
  453. <div class="modal-header" style="background-color: #0C6197!important;">
  454. <h5 class="modal-title" id="causalsModalLabel">
  455. <i class="me-2"></i>
  456. Dettaglio Causali
  457. </h5>
  458. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="CHIUDI"></button>
  459. </div>
  460. <div class="modal-body">
  461. <div class="row">
  462. <div class="col-12">
  463. <div class="d-flex justify-content-between align-items-center mb-3">
  464. <h6 class="mb-0">
  465. <i class="me-2 text-primary"></i>
  466. Causali incluse:
  467. </h6>
  468. </div>
  469. <div class="border rounded" style="max-height: 400px; overflow-y: auto;">
  470. <ul id="causalsList" class="list-group list-group-flush mb-0">
  471. <!-- Causals will be populated here by JavaScript -->
  472. </ul>
  473. </div>
  474. </div>
  475. </div>
  476. </div>
  477. <div class="modal-footer" style="background-color: #FFF!important;">
  478. <button type="button" class="btn--ui lightGrey me-2" data-bs-dismiss="modal">
  479. <i class="fas fa-times me-1"></i>
  480. CHIUDI
  481. </button>
  482. </div>
  483. </div>
  484. </div>
  485. </div>
  486. <div class="modal fade" id="exportModal" tabindex="-1" aria-labelledby="exportModalLabel" aria-hidden="true">
  487. <div class="modal-dialog">
  488. <div class="modal-content">
  489. <div class="modal-header" style="background-color: #0C6197!important;">
  490. <h5 class="modal-title" id="exportModalLabel">Seleziona Periodo per Export</h5>
  491. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="CHIUDI"></button>
  492. </div>
  493. <div class="modal-body">
  494. <div class="row g-3">
  495. <div class="col-md-6">
  496. <label for="exportFromDate" class="form-label">Data Inizio</label>
  497. <input type="date" class="form-control" id="exportFromDate" wire:model.defer="exportFromDate">
  498. </div>
  499. <div class="col-md-6">
  500. <label for="exportToDate" class="form-label">Data Fine</label>
  501. <input type="date" class="form-control" id="exportToDate" wire:model.defer="exportToDate">
  502. </div>
  503. </div>
  504. @if(false)
  505. <div class="row mt-4">
  506. <div class="col-12">
  507. <div class="form-check export-method-check">
  508. <input class="form-check-input" type="checkbox" id="sendViaEmail" wire:model.defer="sendViaEmail">
  509. <label class="form-check-label" for="sendViaEmail">
  510. <i class="fas fa-envelope me-2"></i>Invia via Email
  511. <small class="d-block text-muted mt-1">L'export verrà elaborato in background e inviato alla tua email</small>
  512. </label>
  513. </div>
  514. </div>
  515. </div>
  516. @endif
  517. <div class="row mt-3" style="display: none;" id="emailAddressRow">
  518. <div class="col-12">
  519. <label for="exportEmailAddress" class="form-label">
  520. <i class="fas fa-envelope me-1"></i>Indirizzo Email
  521. </label>
  522. <input type="email" class="form-control" id="exportEmailAddress"
  523. wire:model.defer="exportEmailAddress"
  524. placeholder="inserisci@email.com">
  525. <div class="invalid-feedback" id="emailValidationFeedback">
  526. Inserisci un indirizzo email valido
  527. </div>
  528. <small class="form-text text-muted">
  529. Il file Excel verrà inviato a questo indirizzo
  530. </small>
  531. </div>
  532. </div>
  533. <div class="row mt-3" style="display: none;" id="emailSubjectRow">
  534. <div class="col-12">
  535. <label for="exportEmailSubject" class="form-label">
  536. <i class="fas fa-tag me-1"></i>Oggetto Email
  537. </label>
  538. <input type="text" class="form-control" id="exportEmailSubject"
  539. wire:model.defer="exportEmailSubject"
  540. placeholder="Prima Nota - Export">
  541. <small class="form-text text-muted">
  542. Personalizza l'oggetto dell'email
  543. </small>
  544. </div>
  545. </div>
  546. <div class="row mt-3">
  547. <div class="col-12">
  548. <div class="alert alert-info d-flex align-items-start">
  549. <i class="fas fa-info-circle me-2 mt-1"></i>
  550. <div>
  551. <strong>Informazioni Export:</strong>
  552. <ul class="mb-0 mt-1">
  553. <li>L'export includerà tutti i record nel periodo selezionato</li>
  554. <li>Verranno applicati i filtri attualmente attivi</li>
  555. <li id="emailProcessingInfo" style="display: none;">L'elaborazione avverrà in background, potrai continuare a usare l'applicazione</li>
  556. </ul>
  557. </div>
  558. </div>
  559. </div>
  560. </div>
  561. </div>
  562. <div class="modal-footer" style="background-color: #FFF!important;">
  563. <button type="button" class="btn--ui lightGrey me-2" data-bs-dismiss="modal">ANNULLA</button>
  564. <button type="button" class="btn--ui primary" onclick="handleExportClick()" id="exportButton">
  565. <span id="loadingState" style="display: none;">
  566. <div class="spinner-border spinner-border-sm me-2" role="status">
  567. <span class="visually-hidden">Loading...</span>
  568. </div>
  569. ELABORAZIONE...
  570. </span>
  571. <span id="normalState">
  572. <i class="fas fa-download me-1"></i>
  573. ESPORTA
  574. </span>
  575. </button>
  576. </div>
  577. </div>
  578. </div>
  579. </div>
  580. <div class="toast-container position-fixed top-0 end-0 p-3" style="z-index: 11000;">
  581. <!-- Toasts will be dynamically added here -->
  582. </div>
  583. </div>
  584. @push('scripts')
  585. <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
  586. @endpush
  587. @push('scripts')
  588. <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
  589. <style>
  590. .loading-overlay {
  591. position: absolute;
  592. top: 0;
  593. left: 0;
  594. right: 0;
  595. bottom: 0;
  596. background-color: rgba(255, 255, 255, 0.9);
  597. display: flex;
  598. justify-content: center;
  599. align-items: center;
  600. z-index: 1000;
  601. border-radius: 4px;
  602. }
  603. .loading-content {
  604. text-align: center;
  605. color: #0C6197;
  606. }
  607. .loading-content i {
  608. margin-bottom: 15px;
  609. color: #0C6197;
  610. }
  611. .loading-content p {
  612. margin: 0;
  613. font-size: 16px;
  614. font-weight: 500;
  615. color: #10172A;
  616. }
  617. .modal {
  618. z-index: 9999 !important;
  619. }
  620. .modal-backdrop {
  621. z-index: 9998 !important;
  622. background-color: rgba(0, 0, 0, 0.6) !important;
  623. }
  624. .modal-content {
  625. border-radius: 8px;
  626. border: none;
  627. box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  628. z-index: 10000 !important;
  629. }
  630. .modal-header {
  631. color: white;
  632. border-bottom: none;
  633. border-radius: 8px 8px 0 0;
  634. }
  635. .modal-header .btn-close {
  636. filter: invert(1);
  637. }
  638. .modal-title {
  639. font-weight: 600;
  640. }
  641. .varie-link:hover {
  642. color: #084c6b !important;
  643. text-decoration: underline !important;
  644. }
  645. #btn-back-to-top {
  646. background-color: #0C6197;
  647. color: white;
  648. position: fixed;
  649. display: none;
  650. }
  651. #btn-back-to-bottom {
  652. background-color: #0C6197;
  653. color: white;
  654. position: fixed;
  655. z-index: 9999;
  656. display: none;
  657. }
  658. button[disabled] {
  659. opacity: 0.7;
  660. cursor: not-allowed;
  661. }
  662. .btn--ui .fa-spinner {
  663. margin-right: 5px;
  664. }
  665. .scrollTable {
  666. margin-left: 0px;
  667. margin-right: 0px;
  668. padding: 15px;
  669. overflow-x: auto;
  670. overflow-y: auto;
  671. white-space: nowrap;
  672. border: 1px solid #ddd;
  673. }
  674. ::-webkit-scrollbar-thumb {
  675. background: #e4e4e4;
  676. border-radius: 10px;
  677. }
  678. table thead {
  679. position: sticky;
  680. z-index: 100;
  681. top: 0;
  682. }
  683. .select2-container--default .select2-selection--single {
  684. background-color: #E9F0F5;
  685. border: 0.0625rem solid #DFE5EB;
  686. font-size: 0.75rem;
  687. height: 38px !important;
  688. }
  689. .select2-selection__rendered {
  690. padding-top: 3px;
  691. }
  692. .select2 {
  693. width: 100% !important;
  694. }
  695. .select2-selection--multiple {
  696. overflow: hidden !important;
  697. height: auto !important;
  698. }
  699. .select2-container {
  700. box-sizing: border-box;
  701. display: inline-block;
  702. margin: 0;
  703. position: relative;
  704. vertical-align: middle;
  705. z-index: 999 !important;
  706. }
  707. .select2-dropdown {
  708. z-index: 999 !important;
  709. }
  710. .select2-container .select2-selection--single {
  711. box-sizing: border-box;
  712. cursor: pointer;
  713. display: block;
  714. height: 38px;
  715. user-select: none;
  716. -webkit-user-select: none;
  717. }
  718. .select2-container .select2-selection--single .select2-selection__rendered {
  719. display: block;
  720. padding-left: 8px;
  721. padding-right: 20px;
  722. overflow: hidden;
  723. text-overflow: ellipsis;
  724. white-space: nowrap;
  725. }
  726. button#exportDropdown.btn--ui_outline.light {
  727. font-weight: normal !important;
  728. }
  729. .btn--ui_outline.light.dropdown-toggle:active,
  730. .btn--ui_outline.light.dropdown-toggle:focus,
  731. .btn--ui_outline.light.dropdown-toggle.show {
  732. background-color: transparent !important;
  733. color: #10172A !important;
  734. box-shadow: none !important;
  735. }
  736. .btn--ui_outline.light.dropdown-toggle:hover {
  737. background-color: transparent !important;
  738. color: #10172A !important;
  739. }
  740. .form-select {
  741. height: 38px !important;
  742. }
  743. .form-control {
  744. height: 43px !important;
  745. }
  746. #exportModal .modal-body {
  747. padding: 1.5rem;
  748. }
  749. #exportModal .form-label {
  750. font-weight: 600;
  751. color: #10172A;
  752. margin-bottom: 0.5rem;
  753. }
  754. #exportModal .text-muted {
  755. font-size: 0.875rem;
  756. }
  757. .btn--ui[disabled] .fa-spinner {
  758. margin-right: 0.5rem;
  759. }
  760. body.modal-open {
  761. overflow: hidden;
  762. }
  763. .modal-dialog {
  764. z-index: 10001 !important;
  765. margin: 1.75rem auto;
  766. }
  767. .list-group-item {
  768. border-left: none;
  769. border-right: none;
  770. border-top: 1px solid #dee2e6;
  771. padding: 12px 15px;
  772. }
  773. .list-group-item:first-child {
  774. border-top: none;
  775. }
  776. .list-group-item:last-child {
  777. border-bottom: none;
  778. }
  779. @media (max-width: 768px) {
  780. .col-md-2, .col-md-3, .col-md-4 {
  781. margin-bottom: 10px;
  782. }
  783. .prima--nota_buttons {
  784. float: none !important;
  785. margin-top: 10px !important;
  786. text-align: center;
  787. }
  788. }
  789. .export-method-check {
  790. padding: 16px 16px 16px 50px;
  791. background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  792. border-radius: 8px;
  793. border: 2px solid #e9ecef;
  794. transition: all 0.3s ease;
  795. cursor: pointer;
  796. position: relative;
  797. }
  798. .export-method-check:hover {
  799. border-color: #0C6197;
  800. background: linear-gradient(135deg, #e8f4f8 0%, #d1ecf1 100%);
  801. }
  802. .export-method-check .form-check-input {
  803. position: absolute;
  804. left: 16px;
  805. top: 50%;
  806. transform: translateY(-50%);
  807. margin: 0;
  808. width: 20px;
  809. height: 20px;
  810. background-color: #fff;
  811. border: 2px solid #dee2e6;
  812. border-radius: 4px;
  813. cursor: pointer;
  814. }
  815. .export-method-check .form-check-input:checked {
  816. background-color: #0C6197;
  817. border-color: #0C6197;
  818. }
  819. .export-method-check .form-check-input:checked ~ .form-check-label {
  820. color: #0C6197;
  821. font-weight: 600;
  822. }
  823. .export-method-check .form-check-label {
  824. font-weight: 500;
  825. color: #495057;
  826. cursor: pointer;
  827. margin-left: 0;
  828. display: block;
  829. }
  830. .form-check-input:focus {
  831. border-color: #0C6197;
  832. outline: 0;
  833. box-shadow: 0 0 0 0.2rem rgba(12, 97, 151, 0.25);
  834. }
  835. #emailAddressRow.show, #emailSubjectRow.show {
  836. display: block !important;
  837. animation: slideDown 0.3s ease-out;
  838. }
  839. @keyframes slideDown {
  840. from {
  841. opacity: 0;
  842. transform: translateY(-10px);
  843. }
  844. to {
  845. opacity: 1;
  846. transform: translateY(0);
  847. }
  848. }
  849. .invalid-feedback {
  850. display: none;
  851. }
  852. .is-invalid ~ .invalid-feedback {
  853. display: block;
  854. }
  855. .alert-info {
  856. background-color: rgba(12, 97, 151, 0.1);
  857. border-color: rgba(12, 97, 151, 0.2);
  858. color: #0C6197;
  859. }
  860. .spinner-border-sm {
  861. width: 1rem;
  862. height: 1rem;
  863. }
  864. .toast {
  865. min-width: 300px;
  866. }
  867. .toast-body {
  868. font-weight: 500;
  869. }
  870. .btn--ui:disabled {
  871. opacity: 0.7;
  872. cursor: not-allowed;
  873. }
  874. .list-group-item {
  875. border-left: none;
  876. border-right: none;
  877. border-top: 1px solid #dee2e6;
  878. padding: 12px 15px;
  879. }
  880. .list-group-item:first-child {
  881. border-top: none;
  882. }
  883. .list-group-item:last-child {
  884. border-bottom: none;
  885. }
  886. .list-group-item.d-flex {
  887. display: flex !important;
  888. justify-content: space-between !important;
  889. align-items: center !important;
  890. }
  891. .list-group-item .badge {
  892. font-size: 0.875rem;
  893. font-weight: 600;
  894. }
  895. .list-group-item:hover {
  896. background-color: rgba(12, 97, 151, 0.05);
  897. transition: background-color 0.2s ease;
  898. }
  899. #causalsModal .modal-body {
  900. padding: 1rem 0;
  901. }
  902. .loading-overlay {
  903. position: absolute;
  904. top: 0;
  905. left: 0;
  906. right: 0;
  907. bottom: 0;
  908. background-color: rgba(255, 255, 255, 0.9);
  909. display: flex;
  910. justify-content: center;
  911. align-items: center;
  912. z-index: 1000;
  913. border-radius: 4px;
  914. }
  915. /* New styles for Custom Day Picker */
  916. .day-picker-container {
  917. position: relative;
  918. }
  919. .day-picker-dropdown {
  920. max-height: 600px;
  921. overflow-y: auto;
  922. border: 1px solid #dee2e6;
  923. background: white;
  924. border-radius: 8px;
  925. box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  926. z-index: 1060;
  927. animation: slideDown 0.2s ease-out;
  928. transform-origin: top;
  929. }
  930. .day-grid {
  931. display: grid;
  932. grid-template-columns: repeat(7, 1fr);
  933. gap: 2px;
  934. margin-bottom: 1rem;
  935. }
  936. .day-grid .day-header {
  937. text-align: center;
  938. font-weight: bold;
  939. font-size: 0.75rem;
  940. padding: 0.25rem;
  941. background-color: #f8f9fa;
  942. border-radius: 3px;
  943. color: #6c757d;
  944. }
  945. .day-grid .day-button {
  946. padding: 0.375rem 0.25rem;
  947. font-size: 0.75rem;
  948. border: 1px solid #dee2e6;
  949. background: white;
  950. border-radius: 4px;
  951. cursor: pointer;
  952. transition: all 0.15s ease-in-out;
  953. text-align: center;
  954. min-height: 32px;
  955. display: flex;
  956. align-items: center;
  957. justify-content: center;
  958. }
  959. .day-grid .day-button:hover:not(.disabled) {
  960. background-color: #e9ecef;
  961. border-color: #0C6197;
  962. }
  963. .day-grid .day-button.selected {
  964. background-color: #0C6197;
  965. border-color: #0C6197;
  966. color: white;
  967. }
  968. .day-grid .day-button.today {
  969. border-color: #28a745;
  970. font-weight: bold;
  971. }
  972. .day-grid .day-button.disabled {
  973. color: #6c757d;
  974. background-color: #f8f9fa;
  975. cursor: not-allowed;
  976. opacity: 0.5;
  977. }
  978. .day-grid .day-button.other-month {
  979. color: #adb5bd;
  980. background-color: #f8f9fa;
  981. }
  982. .month-selector.btn-primary {
  983. background-color: #0C6197;
  984. border-color: #0C6197;
  985. }
  986. .month-selector.btn-outline-secondary:hover {
  987. background-color: #6c757d;
  988. border-color: #6c757d;
  989. color: white;
  990. }
  991. input[type="date"] {
  992. background-color: #E9F0F5;
  993. border: 0.0625rem solid #DFE5EB;
  994. font-size: 0.75rem;
  995. }
  996. input[type="date"]:focus {
  997. border-color: #0C6197;
  998. box-shadow: 0 0 0 0.2rem rgba(12, 97, 151, 0.25);
  999. }
  1000. input[type="date"]::-webkit-calendar-picker-indicator {
  1001. cursor: pointer;
  1002. opacity: 0.7;
  1003. transition: opacity 0.15s ease-in-out;
  1004. }
  1005. input[type="date"]::-webkit-calendar-picker-indicator:hover {
  1006. opacity: 1;
  1007. }
  1008. @media (max-width: 768px) {
  1009. .day-picker-dropdown {
  1010. width: 100% !important;
  1011. max-width: none !important;
  1012. }
  1013. .day-grid .day-button {
  1014. font-size: 0.7rem;
  1015. padding: 0.25rem;
  1016. min-height: 28px;
  1017. }
  1018. }
  1019. .month-picker-container {
  1020. position: relative;
  1021. }
  1022. .month-picker-dropdown {
  1023. max-height: 500px;
  1024. overflow-y: auto;
  1025. border: 1px solid #dee2e6;
  1026. background: white;
  1027. border-radius: 8px;
  1028. box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  1029. z-index: 1060;
  1030. }
  1031. .month-picker-dropdown .btn {
  1032. font-size: 0.75rem;
  1033. padding: 0.375rem 0.5rem;
  1034. border-radius: 4px;
  1035. transition: all 0.15s ease-in-out;
  1036. }
  1037. .month-picker-dropdown .btn-sm {
  1038. font-size: 0.875rem;
  1039. padding: 0.25rem 0.5rem;
  1040. }
  1041. .month-picker-dropdown .btn-close {
  1042. padding: 0.25rem;
  1043. font-size: 0.75rem;
  1044. }
  1045. .month-picker-dropdown .btn-primary {
  1046. background-color: #0C6197;
  1047. border-color: #0C6197;
  1048. }
  1049. .month-picker-dropdown .btn-outline-primary {
  1050. color: #0C6197;
  1051. border-color: #0C6197;
  1052. }
  1053. .month-picker-dropdown .btn-outline-primary:hover {
  1054. background-color: #0C6197;
  1055. border-color: #0C6197;
  1056. }
  1057. .month-picker-dropdown .btn-outline-secondary:hover {
  1058. background-color: #6c757d;
  1059. border-color: #6c757d;
  1060. }
  1061. input[type="month"] {
  1062. background-color: #E9F0F5;
  1063. border: 0.0625rem solid #DFE5EB;
  1064. font-size: 0.75rem;
  1065. }
  1066. input[type="month"]:focus {
  1067. border-color: #0C6197;
  1068. box-shadow: 0 0 0 0.2rem rgba(12, 97, 151, 0.25);
  1069. }
  1070. input[type="month"]::-webkit-calendar-picker-indicator {
  1071. cursor: pointer;
  1072. opacity: 0.7;
  1073. transition: opacity 0.15s ease-in-out;
  1074. }
  1075. input[type="month"]::-webkit-calendar-picker-indicator:hover {
  1076. opacity: 1;
  1077. }
  1078. .alert-info {
  1079. background-color: rgba(12, 97, 151, 0.1);
  1080. border-color: rgba(12, 97, 151, 0.2);
  1081. color: #0C6197;
  1082. border-radius: 6px;
  1083. }
  1084. .month-picker-dropdown {
  1085. animation: slideDown 0.2s ease-out;
  1086. transform-origin: top;
  1087. }
  1088. @keyframes slideDown {
  1089. from {
  1090. opacity: 0;
  1091. transform: translateY(-10px) scaleY(0.8);
  1092. }
  1093. to {
  1094. opacity: 1;
  1095. transform: translateY(0) scaleY(1);
  1096. }
  1097. }
  1098. @media (max-width: 768px) {
  1099. .month-picker-dropdown {
  1100. width: 100% !important;
  1101. max-width: none !important;
  1102. }
  1103. .month-picker-dropdown .row.g-1 .col-3 {
  1104. flex: 0 0 25%;
  1105. max-width: 25%;
  1106. }
  1107. }
  1108. [wire\:transition] {
  1109. transition: all 0.3s ease-in-out;
  1110. }
  1111. .select2-container {
  1112. z-index: 999 !important;
  1113. }
  1114. .select2-dropdown {
  1115. z-index: 999 !important;
  1116. }
  1117. .month-picker-dropdown {
  1118. z-index: 1060 !important;
  1119. }
  1120. .month-picker-dropdown .btn-group-sm .btn {
  1121. padding: 0.25rem 0.5rem;
  1122. font-size: 0.75rem;
  1123. }
  1124. .month-picker-container .form-label {
  1125. font-weight: 600;
  1126. color: #10172A;
  1127. margin-bottom: 0.5rem;
  1128. }
  1129. .month-picker-container .input-group .btn {
  1130. border-left: 0;
  1131. background-color: #f8f9fa;
  1132. border-color: #DFE5EB;
  1133. color: #6c757d;
  1134. }
  1135. .month-picker-container .input-group .btn:hover {
  1136. background-color: #e9ecef;
  1137. color: #0C6197;
  1138. }
  1139. </style>
  1140. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  1141. <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
  1142. <script src="/assets/js/aCollapTable.js"></script>
  1143. @endpush
  1144. @push('scripts')
  1145. <script>
  1146. let selectedDayValue = '';
  1147. let currentDisplayMonth = '';
  1148. let currentDisplayYear = '';
  1149. function initializeDayPicker() {
  1150. const today = new Date();
  1151. const selectedDay = @this.get('selectedDay');
  1152. if (selectedDay) {
  1153. selectedDayValue = selectedDay;
  1154. const selectedDate = new Date(selectedDay);
  1155. currentDisplayMonth = String(selectedDate.getMonth() + 1).padStart(2, '0');
  1156. currentDisplayYear = String(selectedDate.getFullYear());
  1157. } else {
  1158. currentDisplayMonth = String(today.getMonth() + 1).padStart(2, '0');
  1159. currentDisplayYear = String(today.getFullYear());
  1160. }
  1161. updateDayGrid();
  1162. }
  1163. function updateDayGrid() {
  1164. const dayGrid = document.getElementById('dayGrid');
  1165. if (!dayGrid) return;
  1166. const year = parseInt(currentDisplayYear);
  1167. const month = parseInt(currentDisplayMonth);
  1168. const today = new Date();
  1169. const selectedDate = selectedDayValue ? new Date(selectedDayValue) : null;
  1170. dayGrid.innerHTML = '';
  1171. const dayHeaders = ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'];
  1172. dayHeaders.forEach(header => {
  1173. const headerDiv = document.createElement('div');
  1174. headerDiv.className = 'day-header';
  1175. headerDiv.textContent = header;
  1176. dayGrid.appendChild(headerDiv);
  1177. });
  1178. const firstDay = new Date(year, month - 1, 1);
  1179. const lastDay = new Date(year, month, 0);
  1180. const startDate = new Date(firstDay);
  1181. startDate.setDate(startDate.getDate() - firstDay.getDay());
  1182. for (let i = 0; i < 42; i++) {
  1183. const currentDate = new Date(startDate);
  1184. currentDate.setDate(startDate.getDate() + i);
  1185. const dayButton = document.createElement('button');
  1186. dayButton.type = 'button';
  1187. dayButton.className = 'day-button';
  1188. dayButton.textContent = currentDate.getDate();
  1189. const isCurrentMonth = currentDate.getMonth() === month - 1;
  1190. const isToday = currentDate.toDateString() === today.toDateString();
  1191. const isSelected = selectedDate && currentDate.toDateString() === selectedDate.toDateString();
  1192. if (!isCurrentMonth) {
  1193. dayButton.classList.add('other-month');
  1194. }
  1195. if (isToday) {
  1196. dayButton.classList.add('today');
  1197. }
  1198. if (isSelected) {
  1199. dayButton.classList.add('selected');
  1200. }
  1201. const dateString = currentDate.getFullYear() + '-' +
  1202. String(currentDate.getMonth() + 1).padStart(2, '0') + '-' +
  1203. String(currentDate.getDate()).padStart(2, '0');
  1204. dayButton.addEventListener('click', function() {
  1205. document.querySelectorAll('.day-button.selected').forEach(btn => {
  1206. btn.classList.remove('selected');
  1207. });
  1208. this.classList.add('selected');
  1209. selectedDayValue = dateString;
  1210. });
  1211. dayGrid.appendChild(dayButton);
  1212. }
  1213. }
  1214. document.addEventListener('click', function(event) {
  1215. if (event.target.classList.contains('month-selector')) {
  1216. const month = event.target.getAttribute('data-month');
  1217. currentDisplayMonth = month;
  1218. document.querySelectorAll('.month-selector').forEach(btn => {
  1219. btn.classList.remove('btn-primary');
  1220. btn.classList.add('btn-outline-secondary');
  1221. });
  1222. event.target.classList.remove('btn-outline-secondary');
  1223. event.target.classList.add('btn-primary');
  1224. updateDayGrid();
  1225. }
  1226. });
  1227. document.addEventListener('click', function(event) {
  1228. if (event.target.id === 'confirmDaySelection') {
  1229. if (selectedDayValue) {
  1230. @this.call('selectDay', selectedDayValue);
  1231. }
  1232. }
  1233. });
  1234. document.addEventListener('click', function(event) {
  1235. const dayPicker = document.querySelector('.day-picker-dropdown');
  1236. const dayPickerContainer = document.querySelector('.day-picker-container');
  1237. if (dayPicker && dayPickerContainer && !dayPickerContainer.contains(event.target)) {
  1238. @this.set('showDayPicker', false);
  1239. }
  1240. });
  1241. document.addEventListener('livewire:updated', function() {
  1242. const dayPicker = document.querySelector('.day-picker-dropdown');
  1243. if (dayPicker) {
  1244. initializeDayPicker();
  1245. }
  1246. });
  1247. function closeSelect2Dropdowns() {
  1248. $('.filterCausals').each(function() {
  1249. if ($(this).hasClass('select2-hidden-accessible')) {
  1250. $(this).select2('close');
  1251. }
  1252. });
  1253. $('.filterMember').each(function() {
  1254. if ($(this).hasClass('select2-hidden-accessible')) {
  1255. $(this).select2('close');
  1256. }
  1257. });
  1258. }
  1259. function load() {
  1260. $(document).ready(function(){
  1261. $(document).on("keypress", $('.filterCausals'), function (e) {
  1262. setTimeout(() => {
  1263. $(".select2-results__option").each(function(){
  1264. var txt = $(this).html();
  1265. var count = (txt.match(/-/g) || []).length;
  1266. $(this).addClass('paddingLeftSelect' + count);
  1267. });
  1268. }, 100);
  1269. });
  1270. if (!$('.filterCausals').hasClass('select2-hidden-accessible')) {
  1271. $('.filterCausals').select2({
  1272. "language": {"noResults": function(){return "Nessun risultato";}},
  1273. "dropdownParent": $('body'),
  1274. "width": "100%"
  1275. });
  1276. }
  1277. $('.filterCausals').off('change.customHandler').on('change.customHandler', function (e) {
  1278. var data = $('.filterCausals').select2("val");
  1279. @this.set('filterCausals', data);
  1280. });
  1281. $('.filterCausals').off('select2:open.customHandler').on('select2:open.customHandler', function (e) {
  1282. if ($('#causalsModal').hasClass('show')) {
  1283. $('#causalsModal').modal('hide');
  1284. }
  1285. setTimeout(() => {
  1286. $(".select2-results__option").each(function(){
  1287. var txt = $(this).html();
  1288. var count = (txt.match(/-/g) || []).length;
  1289. $(this).addClass('paddingLeftSelect' + count);
  1290. });
  1291. }, 100);
  1292. });
  1293. if (!$('.filterMember').hasClass('select2-hidden-accessible')) {
  1294. $('.filterMember').select2({
  1295. "language": {"noResults": function(){return "Nessun risultato";}},
  1296. "dropdownParent": $('body'),
  1297. "width": "100%"
  1298. });
  1299. }
  1300. $('.filterMember').off('change.customHandler').on('change.customHandler', function (e) {
  1301. var data = $('.filterMember').select2("val");
  1302. @this.set('filterMember', data);
  1303. });
  1304. $('.filterMember').off('select2:open.customHandler').on('select2:open.customHandler', function (e) {
  1305. if ($('#causalsModal').hasClass('show')) {
  1306. $('#causalsModal').modal('hide');
  1307. }
  1308. });
  1309. });
  1310. }
  1311. function printData() {
  1312. var divToPrint = document.getElementById("tablesaw-350");
  1313. newWin = window.open("");
  1314. var htmlToPrint = '' +
  1315. '<style type="text/css">' +
  1316. 'table th, table td {' +
  1317. 'border:1px solid #000;' +
  1318. 'padding:0.5em;' +
  1319. '}' +
  1320. '</style>';
  1321. htmlToPrint += divToPrint.outerHTML;
  1322. newWin.document.write(htmlToPrint);
  1323. newWin.document.close();
  1324. newWin.print();
  1325. newWin.close();
  1326. }
  1327. function scrollFunction() {
  1328. const element = document.getElementById('resume-table');
  1329. const mybuttonBottom = document.getElementById("btn-back-to-bottom");
  1330. const mybutton = document.getElementById("btn-back-to-top");
  1331. if (element.scrollTop > 20) {
  1332. mybutton.style.display = "block";
  1333. mybuttonBottom.style.display = "block";
  1334. } else {
  1335. mybutton.style.display = "none";
  1336. mybuttonBottom.style.display = "none";
  1337. }
  1338. }
  1339. function backToTop() {
  1340. $('#resume-table').scrollTop(0);
  1341. }
  1342. function backToBottom() {
  1343. $('#resume-table').scrollTop($('#resume-table')[0].scrollHeight);
  1344. }
  1345. $(document).ready(function() {
  1346. load();
  1347. document.querySelector("#print").addEventListener("click", function(){
  1348. printData();
  1349. });
  1350. const element = document.getElementById('resume-table');
  1351. element.onscroll = scrollFunction;
  1352. const mybuttonBottom = document.getElementById("btn-back-to-bottom");
  1353. const mybutton = document.getElementById("btn-back-to-top");
  1354. mybutton.addEventListener("click", backToTop);
  1355. mybuttonBottom.addEventListener("click", backToBottom);
  1356. $(document).on('click', '.varie-link', function(e) {
  1357. e.preventDefault();
  1358. e.stopPropagation();
  1359. closeSelect2Dropdowns();
  1360. const causalsData = $(this).data('causals');
  1361. if (causalsData) {
  1362. const causals = causalsData.split('|');
  1363. $('#causalsList').empty();
  1364. causals.forEach(function(causal) {
  1365. if (causal.trim()) {
  1366. if (causal.includes(':::')) {
  1367. const parts = causal.split(':::');
  1368. const causalName = parts[0].trim();
  1369. const amount = parts[1].trim();
  1370. $('#causalsList').append(
  1371. '<li class="list-group-item d-flex justify-content-between align-items-center">' +
  1372. '<div>' +
  1373. '<i class="fas fa-tags me-2" style="color: #0C6197;"></i>' +
  1374. causalName +
  1375. '</div>' +
  1376. '<span class="badge bg-primary rounded-pill" style="background-color: #0C6197 !important;">' +
  1377. amount +
  1378. '</span>' +
  1379. '</li>'
  1380. );
  1381. } else {
  1382. $('#causalsList').append(
  1383. '<li class="list-group-item">' +
  1384. '<i class="fas fa-tags me-2" style="color: #0C6197;"></i>' +
  1385. causal.trim() +
  1386. '</li>'
  1387. );
  1388. }
  1389. }
  1390. });
  1391. $('#causalsModal').modal('show');
  1392. $('#causalsModal').on('shown.bs.modal', function () {
  1393. $(this).find('.btn-close').focus();
  1394. });
  1395. }
  1396. });
  1397. });
  1398. Livewire.on('load-table', () => {
  1399. load();
  1400. });
  1401. Livewire.on('load-select', () => {
  1402. load();
  1403. });
  1404. Livewire.on('filters-reset', () => {
  1405. $('.filterMember').val('').trigger('change');
  1406. $('.filterCausals').val('').trigger('change');
  1407. load();
  1408. });
  1409. Livewire.on('show-export-modal', () => {
  1410. $('#exportModal').modal('show');
  1411. });
  1412. Livewire.on('hide-export-modal', () => {
  1413. $('#exportModal').modal('hide');
  1414. });
  1415. function showToast(type, message, duration = 5000) {
  1416. const toastContainer = document.querySelector('.toast-container');
  1417. if (!toastContainer) {
  1418. console.error('Toast container not found');
  1419. return;
  1420. }
  1421. const toastId = 'toast-' + Date.now();
  1422. const toastColors = {
  1423. success: 'bg-success',
  1424. error: 'bg-danger',
  1425. warning: 'bg-warning',
  1426. info: 'bg-info'
  1427. };
  1428. const toastIcons = {
  1429. success: 'fa-check-circle',
  1430. error: 'fa-exclamation-circle',
  1431. warning: 'fa-exclamation-triangle',
  1432. info: 'fa-info-circle'
  1433. };
  1434. const toast = document.createElement('div');
  1435. toast.id = toastId;
  1436. toast.className = `toast align-items-center text-white ${toastColors[type]} border-0`;
  1437. toast.setAttribute('role', 'alert');
  1438. toast.innerHTML = `
  1439. <div class="d-flex">
  1440. <div class="toast-body">
  1441. <i class="fas ${toastIcons[type]} me-2"></i>
  1442. ${message}
  1443. </div>
  1444. <button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast"></button>
  1445. </div>
  1446. `;
  1447. toastContainer.appendChild(toast);
  1448. if (typeof bootstrap !== 'undefined') {
  1449. const bsToast = new bootstrap.Toast(toast, { delay: duration });
  1450. bsToast.show();
  1451. toast.addEventListener('hidden.bs.toast', function() {
  1452. if (toastContainer.contains(toast)) {
  1453. toastContainer.removeChild(toast);
  1454. }
  1455. });
  1456. return bsToast;
  1457. } else {
  1458. toast.style.display = 'block';
  1459. setTimeout(() => {
  1460. if (toastContainer.contains(toast)) {
  1461. toastContainer.removeChild(toast);
  1462. }
  1463. }, duration);
  1464. }
  1465. }
  1466. document.addEventListener('DOMContentLoaded', function() {
  1467. const sendViaEmailCheckbox = document.getElementById('sendViaEmail');
  1468. const emailAddressRow = document.getElementById('emailAddressRow');
  1469. const emailSubjectRow = document.getElementById('emailSubjectRow');
  1470. const emailProcessingInfo = document.getElementById('emailProcessingInfo');
  1471. const exportIcon = document.getElementById('exportIcon');
  1472. const exportButtonText = document.getElementById('exportButtonText');
  1473. const emailInput = document.getElementById('exportEmailAddress');
  1474. function toggleEmailFields() {
  1475. if (sendViaEmailCheckbox && sendViaEmailCheckbox.checked) {
  1476. if (emailAddressRow) {
  1477. emailAddressRow.style.display = 'block';
  1478. emailAddressRow.classList.add('show');
  1479. }
  1480. if (emailSubjectRow) {
  1481. emailSubjectRow.style.display = 'block';
  1482. emailSubjectRow.classList.add('show');
  1483. }
  1484. if (emailProcessingInfo) {
  1485. emailProcessingInfo.style.display = 'list-item';
  1486. }
  1487. if (exportIcon) exportIcon.className = 'fas fa-paper-plane me-1';
  1488. if (exportButtonText) exportButtonText.textContent = 'INVIA EMAIL';
  1489. } else {
  1490. if (emailAddressRow) {
  1491. emailAddressRow.style.display = 'none';
  1492. emailAddressRow.classList.remove('show');
  1493. }
  1494. if (emailSubjectRow) {
  1495. emailSubjectRow.style.display = 'none';
  1496. emailSubjectRow.classList.remove('show');
  1497. }
  1498. if (emailProcessingInfo) {
  1499. emailProcessingInfo.style.display = 'none';
  1500. }
  1501. if (exportIcon) exportIcon.className = 'fas fa-download me-1';
  1502. if (exportButtonText) exportButtonText.textContent = 'ESPORTA';
  1503. }
  1504. }
  1505. function validateEmail(email) {
  1506. const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
  1507. return emailRegex.test(email);
  1508. }
  1509. if (sendViaEmailCheckbox) {
  1510. sendViaEmailCheckbox.addEventListener('change', toggleEmailFields);
  1511. }
  1512. if (emailInput) {
  1513. emailInput.addEventListener('blur', function() {
  1514. if (sendViaEmailCheckbox && sendViaEmailCheckbox.checked && this.value) {
  1515. if (validateEmail(this.value)) {
  1516. this.classList.remove('is-invalid');
  1517. this.classList.add('is-valid');
  1518. } else {
  1519. this.classList.remove('is-valid');
  1520. this.classList.add('is-invalid');
  1521. }
  1522. }
  1523. });
  1524. emailInput.addEventListener('input', function() {
  1525. this.classList.remove('is-invalid', 'is-valid');
  1526. });
  1527. }
  1528. if (typeof $ !== 'undefined') {
  1529. $('#exportModal').on('shown.bs.modal', function() {
  1530. toggleEmailFields();
  1531. });
  1532. }
  1533. });
  1534. document.addEventListener('livewire:load', function () {
  1535. console.log('Livewire loaded, setting up export event listeners');
  1536. Livewire.on('export-email-queued', function() {
  1537. console.log('Export email queued event received');
  1538. showToast('info',
  1539. '<strong>Export avviato!</strong><br>' +
  1540. 'L\'elaborazione è in corso in background. Riceverai l\'email a breve.',
  1541. 8000
  1542. );
  1543. });
  1544. Livewire.on('export-email-sent', function() {
  1545. console.log('Export email sent event received');
  1546. showToast('success',
  1547. '<strong>Email inviata!</strong><br>' +
  1548. 'L\'export è stato completato e inviato alla tua email.',
  1549. 6000
  1550. );
  1551. });
  1552. Livewire.on('export-email-error', function(message) {
  1553. console.log('Export email error event received:', message);
  1554. showToast('error',
  1555. '<strong>Errore nell\'export:</strong><br>' +
  1556. (message || 'Si è verificato un errore durante l\'elaborazione.'),
  1557. 10000
  1558. );
  1559. });
  1560. Livewire.on('show-export-modal', function() {
  1561. console.log('Show export modal event received');
  1562. if (typeof $ !== 'undefined') {
  1563. $('#exportModal').modal('show');
  1564. }
  1565. });
  1566. Livewire.on('hide-export-modal', function() {
  1567. console.log('Hide export modal event received');
  1568. if (typeof $ !== 'undefined') {
  1569. $('#exportModal').modal('hide');
  1570. }
  1571. });
  1572. });
  1573. if (typeof Livewire !== 'undefined') {
  1574. document.addEventListener('livewire:initialized', function () {
  1575. console.log('Livewire initialized, setting up export event listeners');
  1576. Livewire.on('export-email-queued', function() {
  1577. showToast('info',
  1578. '<strong>Export avviato!</strong><br>' +
  1579. 'L\'elaborazione è in corso in background. Riceverai l\'email a breve.',
  1580. 8000
  1581. );
  1582. });
  1583. Livewire.on('export-email-sent', function() {
  1584. showToast('success',
  1585. '<strong>Email inviata!</strong><br>' +
  1586. 'L\'export è stato completato e inviato alla tua email.',
  1587. 6000
  1588. );
  1589. });
  1590. Livewire.on('export-email-error', function(message) {
  1591. showToast('error',
  1592. '<strong>Errore nell\'export:</strong><br>' +
  1593. (message || 'Si è verificato un errore durante l\'elaborazione.'),
  1594. 10000
  1595. );
  1596. });
  1597. Livewire.on('show-export-modal', function() {
  1598. if (typeof $ !== 'undefined') {
  1599. $('#exportModal').modal('show');
  1600. }
  1601. });
  1602. Livewire.on('hide-export-modal', function() {
  1603. if (typeof $ !== 'undefined') {
  1604. $('#exportModal').modal('hide');
  1605. }
  1606. });
  1607. });
  1608. }
  1609. window.addEventListener('load', function() {
  1610. if (typeof showToast === 'function') {
  1611. console.log('showToast function is available globally');
  1612. } else {
  1613. console.error('showToast function is not available globally');
  1614. }
  1615. });
  1616. function handleExportClick() {
  1617. showExportLoading();
  1618. @this.call('exportWithDateRange');
  1619. }
  1620. function showExportLoading() {
  1621. document.getElementById('normalState').style.display = 'none';
  1622. document.getElementById('loadingState').style.display = 'inline-flex';
  1623. document.getElementById('exportButton').disabled = true;
  1624. }
  1625. function hideExportLoading() {
  1626. document.getElementById('normalState').style.display = 'inline-flex';
  1627. document.getElementById('loadingState').style.display = 'none';
  1628. document.getElementById('exportButton').disabled = false;
  1629. }
  1630. Livewire.on('export-complete', function() {
  1631. hideExportLoading();
  1632. });
  1633. Livewire.on('hide-export-modal', function() {
  1634. hideExportLoading();
  1635. });
  1636. function setupSimpleExportListeners() {
  1637. if (typeof Livewire !== 'undefined') {
  1638. Livewire.on('export-email-queued', function() {
  1639. setTimeout(() => {
  1640. hideExportLoading();
  1641. $('#exportModal').modal('hide');
  1642. showToast('success',
  1643. '<i class="fas fa-paper-plane me-2"></i>' +
  1644. '<strong>Export avviato!</strong><br>' +
  1645. 'Riceverai l\'email a breve.',
  1646. 6000
  1647. );
  1648. }, 1500);
  1649. });
  1650. Livewire.on('export-complete', function() {
  1651. hideExportLoading();
  1652. });
  1653. Livewire.on('hide-export-modal', function() {
  1654. hideExportLoading();
  1655. $('#exportModal').modal('hide');
  1656. });
  1657. }
  1658. }
  1659. document.addEventListener('DOMContentLoaded', function() {
  1660. document.addEventListener('click', function(event) {
  1661. const monthPicker = document.querySelector('.month-picker-dropdown');
  1662. const monthPickerContainer = document.querySelector('.month-picker-container');
  1663. if (monthPicker && monthPickerContainer && !monthPickerContainer.contains(event.target)) {
  1664. if (typeof @this !== 'undefined') {
  1665. @this.set('showMonthPicker', false);
  1666. }
  1667. }
  1668. });
  1669. document.addEventListener('keydown', function(event) {
  1670. if (event.key === 'Escape') {
  1671. if (typeof @this !== 'undefined') {
  1672. @this.set('showMonthPicker', false);
  1673. }
  1674. }
  1675. });
  1676. document.addEventListener('click', function(event) {
  1677. const monthPickerDropdown = event.target.closest('.month-picker-dropdown');
  1678. if (monthPickerDropdown) {
  1679. event.stopPropagation();
  1680. }
  1681. });
  1682. });
  1683. function resetFiltersWithMonthPicker() {
  1684. $('.filterMember').val('').trigger('change');
  1685. $('.filterCausals').val('').trigger('change');
  1686. if (typeof @this !== 'undefined') {
  1687. @this.call('resetFilters');
  1688. }
  1689. load();
  1690. }
  1691. if (typeof Livewire !== 'undefined') {
  1692. Livewire.on('filters-applied', function() {
  1693. console.log('Filters applied with month picker');
  1694. });
  1695. Livewire.on('filters-reset', function() {
  1696. console.log('Filters reset including month picker');
  1697. load();
  1698. });
  1699. }
  1700. function initializeMonthPicker() {
  1701. const monthPickerDropdown = document.querySelector('.month-picker-dropdown');
  1702. if (monthPickerDropdown) {
  1703. monthPickerDropdown.style.opacity = '0';
  1704. monthPickerDropdown.style.transform = 'translateY(-10px)';
  1705. setTimeout(() => {
  1706. monthPickerDropdown.style.transition = 'all 0.2s ease-out';
  1707. monthPickerDropdown.style.opacity = '1';
  1708. monthPickerDropdown.style.transform = 'translateY(0)';
  1709. }, 10);
  1710. }
  1711. }
  1712. document.addEventListener('livewire:updated', function() {
  1713. initializeMonthPicker();
  1714. });
  1715. </script>
  1716. @endpush