upt-tahun.blade.php 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833
  1. <?php
  2. $getStatus = \App\Model\Privillage\Role::where('id',Auth::user()->role_id)->value('akses');
  3. $upt = \App\Model\Setting\UPT::select('office_name','office_id')->distinct()->get();
  4. ?>
  5. @include('templates.SPP.RT.export.export-search')
  6. @include('templates.SPP.RT.export.preview-search')
  7. @include('templates.SPP.RT.export.print-search')
  8. @include('templates.SPP.RT.dev.data')
  9. <style>
  10. #example_filter {width: 990px !important;}
  11. .dataTables_length{width: 560px !important;}
  12. </style>
  13. @if($getStatus == 'administrator')
  14. <div class="col text-left" style="margin-top: 10px;margin-bottom: -20px;">
  15. <a class="btn btn-sm btn-success" style="color: white;" id="getPreview" data-toggle="modal" data-target="#previewModal" data-status-pembayaran="paid" data-bi-type="8"><i class="ni ni-single-copy-04"></i>&nbsp;PRINT</a>
  16. <a class="btn btn-sm btn-info" style="color: white;" id="getPrint" data-toggle="modal" data-target="#printModal" data-status-pembayaran="paid" data-bi-type="8"><i class="ni ni-single-copy-04"></i>&nbsp;DOWNLOAD AS PDF</a>
  17. <a class="btn btn-sm btn-danger" style="color: white;" id="getDownload" data-toggle="modal" data-target="#downloadModal" data-status-pembayaran="paid" data-bi-type="8"><i class="ni ni-cloud-download-95"></i>&nbsp;DOWNLOAD AS XLS</a>
  18. </div>
  19. <div class="col-xl-12 mt-5">
  20. <div class="card shadow">
  21. <div class="card-header border-0" style="background-color: #5f5f5f;">
  22. <div class="row align-items-center">
  23. <div class="col">
  24. <h3 class="mb-0" style="color: #fff;">REKAP PENGIRIMAN LAPORAN</h3>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="table-responsive">
  29. <div class="">
  30. <table id="example" class="table table-dark table-striped align-items-center table-flush data-table">
  31. <thead class="thead-light">
  32. <tr>
  33. <th scope="col">UPT</th>
  34. <th scope="col">Jan</th>
  35. <th scope="col">Feb</th>
  36. <th scope="col">Mar</th>
  37. <th scope="col">Apr</th>
  38. <th scope="col">Mei</th>
  39. <th scope="col">Jun</th>
  40. <th scope="col">Jul</th>
  41. <th scope="col">Aug</th>
  42. <th scope="col">Sep</th>
  43. <th scope="col">Okt</th>
  44. <th scope="col">Nov</th>
  45. <th scope="col">Des</th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. @foreach($upt as $key => $value)
  50. <tr>
  51. <th scope="row">
  52. {{$value->office_name}}
  53. </th>
  54. <?php
  55. $fixYear = $year - 1;
  56. $januari = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',12)->whereYear('bi_begin',$fixYear)->where('upt', $value->office_name)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  57. $februari = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',1)->whereYear('bi_begin',$year)->where('upt', $value->office_name)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  58. $maret = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',2)->whereYear('bi_begin',$year)->where('upt', $value->office_name)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  59. $april = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',3)->whereYear('bi_begin',$year)->where('upt', $value->office_name)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  60. $mei = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',4)->whereYear('bi_begin',$year)->where('upt', $value->office_name)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  61. $juni = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',5)->whereYear('bi_begin',$year)->where('upt', $value->office_name)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  62. $juli = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',6)->whereYear('bi_begin',$year)->where('upt', $value->office_name)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  63. $agustus = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',7)->whereYear('bi_begin',$year)->where('upt', $value->office_name)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  64. $september = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',8)->whereYear('bi_begin',$year)->where('upt', $value->office_name)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  65. $oktober = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',9)->whereYear('bi_begin',$year)->where('upt', $value->office_name)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  66. $november = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',10)->whereYear('bi_begin',$year)->where('upt', $value->office_name)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  67. $desember = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',11)->whereYear('bi_begin',$year)->where('upt', $value->office_name)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  68. ?>
  69. <td>
  70. @if($januari != 0)
  71. <a class="btn btn-success btn-sm text-white">YA</a>
  72. @else
  73. <a class="btn btn-danger btn-sm text-white">BELUM</a>
  74. @endif
  75. </td>
  76. <td>
  77. @if($februari != 0)
  78. <a class="btn btn-success btn-sm text-white">YA</a>
  79. @else
  80. <a class="btn btn-danger btn-sm text-white">BELUM</a>
  81. @endif
  82. </td>
  83. <td>
  84. @if($maret != 0)
  85. <a class="btn btn-success btn-sm text-white">YA</a>
  86. @else
  87. <a class="btn btn-danger btn-sm text-white">BELUM</a>
  88. @endif
  89. </td>
  90. <td>
  91. @if($april != 0)
  92. <a class="btn btn-success btn-sm text-white">YA</a>
  93. @else
  94. <a class="btn btn-danger btn-sm text-white">BELUM</a>
  95. @endif
  96. </td>
  97. <td>
  98. @if($mei != 0)
  99. <a class="btn btn-success btn-sm text-white">YA</a>
  100. @else
  101. <a class="btn btn-danger btn-sm text-white">BELUM</a>
  102. @endif
  103. </td>
  104. <td>
  105. @if($juni != 0)
  106. <a class="btn btn-success btn-sm text-white">YA</a>
  107. @else
  108. <a class="btn btn-danger btn-sm text-white">BELUM</a>
  109. @endif
  110. </td>
  111. <td>
  112. @if($juli != 0)
  113. <a class="btn btn-success btn-sm text-white">YA</a>
  114. @else
  115. <a class="btn btn-danger btn-sm text-white">BELUM</a>
  116. @endif
  117. </td>
  118. <td>
  119. @if($agustus != 0)
  120. <a class="btn btn-success btn-sm text-white">YA</a>
  121. @else
  122. <a class="btn btn-danger btn-sm text-white">BELUM</a>
  123. @endif
  124. </td>
  125. <td>
  126. @if($september != 0)
  127. <a class="btn btn-success btn-sm text-white">YA</a>
  128. @else
  129. <a class="btn btn-danger btn-sm text-white">BELUM</a>
  130. @endif
  131. </td>
  132. <td>
  133. @if($oktober != 0)
  134. <a class="btn btn-success btn-sm text-white">YA</a>
  135. @else
  136. <a class="btn btn-danger btn-sm text-white">BELUM</a>
  137. @endif
  138. </td>
  139. <td>
  140. @if($november != 0)
  141. <a class="btn btn-success btn-sm text-white">YA</a>
  142. @else
  143. <a class="btn btn-danger btn-sm text-white">BELUM</a>
  144. @endif
  145. </td>
  146. <td>
  147. @if($desember != 0)
  148. <a class="btn btn-success btn-sm text-white">YA</a>
  149. @else
  150. <a class="btn btn-danger btn-sm text-white">BELUM</a>
  151. @endif
  152. </td>
  153. </tr>
  154. @endforeach
  155. </tbody>
  156. </table>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. @endif
  162. <br>
  163. @if($getStatus == 'administrator')
  164. <div class="col text-left" style="margin-top: 10px;margin-bottom: -20px;">
  165. <a class="btn btn-sm btn-success" style="color: white;" id="getPreview" data-toggle="modal" data-target="#previewModal" data-status-pembayaran="not_paid" data-bi-type="0"><i class="ni ni-single-copy-04"></i>&nbsp;PRINT</a>
  166. <a class="btn btn-sm btn-info" style="color: white;" id="getPrint" data-toggle="modal" data-target="#printModal" data-status-pembayaran="not_paid" data-bi-type="0"><i class="ni ni-single-copy-04"></i>&nbsp;DOWNLOAD AS PDF</a>
  167. <a class="btn btn-sm btn-danger" style="color: white;" id="getDownload" data-toggle="modal" data-target="#downloadModal" data-status-pembayaran="not_paid" data-bi-type="0"><i class="ni ni-cloud-download-95"></i>&nbsp;DOWNLOAD AS XLS</a>
  168. </div>
  169. <div class="col-xl-12 mt-5">
  170. <div class="card shadow">
  171. <div class="card-header border-0">
  172. <div class="row align-items-center">
  173. <div class="col">
  174. <h3 class="mb-0" style="color: #ffff;">REKAPITULASI DAN PERSENTASE AKSI PENCEGAHAN PIUTANG</h3>
  175. </div>
  176. </div>
  177. </div>
  178. <div class="table-responsive">
  179. <table id="example" class="table table-dark table-striped align-items-center table-flush data-table">
  180. <thead class="thead-light">
  181. <tr>
  182. <th class="tg-0pky" colspan="3"></th>
  183. <th class="tg-0lax" colspan="4" style="background-color: #63a53a; color: #fff; text-align: center;">RT BELUM TERBAYAR (H-30 s.d H)</th>
  184. <th class="tg-0lax" colspan="3" style="background-color: #ff1228; color: #fff;">RT TIDAK TERBAYAR (MENJADI REMINDER)</th>
  185. </tr>
  186. <tr>
  187. <td class="tg-0lax">BULAN</td>
  188. <td class="tg-0lax">TOTAL RT TERBIT</td>
  189. <td class="tg-0lax">RT TERBAYAR</td>
  190. <td class="tg-0lax">SUDAH DI-TL UPT</td>
  191. <td class="tg-0lax">%</td>
  192. <td class="tg-0lax">BELUM DI-TL UPT</td>
  193. <td class="tg-0lax">%</td>
  194. <td class="tg-0lax">JUMLAH RT</td>
  195. <td class="tg-0lax">%</td>
  196. <td class="tg-0lax">Tanggal Upload</td>
  197. </tr>
  198. </thead>
  199. <?php
  200. $fixYear = $year - 1;
  201. if($getStatus == 'administrator'){
  202. //Januari
  203. $paid_rts_januari = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',12)->whereYear('bi_begin',$fixYear)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  204. $nopaid_rts_januari = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',12)->whereYear('bi_begin',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  205. $total_rts_januari = $paid_rts_januari + $nopaid_rts_januari;
  206. $sudah_tl_januari = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',12)->whereYear('bi_begin',$fixYear)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  207. $belum_tl_januari = $total_rts_januari - $sudah_tl_januari;
  208. $percent_sudah_tl_januari = $sudah_tl_januari / $total_rts_januari * 100;
  209. $percent_belum_tl_januari = $belum_tl_januari / $total_rts_januari * 100;
  210. $jumlah_rt_januari = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',12)->whereYear('bi_begin',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  211. if ($jumlah_rt_januari != 0) {
  212. $percent_jumlah_rt_januari = $jumlah_rt_januari / $total_rts_januari * 100;
  213. }else{
  214. $percent_jumlah_rt_januari = 0;
  215. }
  216. $tanggal_upload_januari = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',12)->whereYear('bi_begin',$fixYear)->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->select('updated_at')->distinct()->value('updated_at');
  217. //Februari
  218. $paid_rts_februari = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',1)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  219. $nopaid_rts_februari = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',1)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  220. $total_rts_februari = $paid_rts_februari + $nopaid_rts_februari;
  221. $sudah_tl_februari = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',1)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  222. $belum_tl_februari = $total_rts_februari - $sudah_tl_februari;
  223. $percent_sudah_tl_februari = $sudah_tl_februari / $total_rts_februari * 100;
  224. $percent_belum_tl_februari = $belum_tl_februari / $total_rts_februari * 100;
  225. $jumlah_rt_februari = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',1)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  226. if ($jumlah_rt_februari != 0) {
  227. $percent_jumlah_rt_februari = $jumlah_rt_februari / $total_rts_februari * 100;
  228. }else{
  229. $percent_jumlah_rt_februari = 0;
  230. }
  231. $tanggal_upload_februari = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',1)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->select('updated_at')->distinct()->value('updated_at');
  232. //Maret
  233. $paid_rts_maret = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',2)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  234. $nopaid_rts_maret = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',2)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  235. $total_rts_maret = $paid_rts_maret + $nopaid_rts_maret;
  236. $sudah_tl_maret = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',2)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  237. $belum_tl_maret = $total_rts_maret - $sudah_tl_maret;
  238. $percent_sudah_tl_maret = $sudah_tl_maret / $total_rts_maret * 100;
  239. $percent_belum_tl_maret = $belum_tl_maret / $total_rts_maret * 100;
  240. $jumlah_rt_maret = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',2)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  241. if ($jumlah_rt_maret != 0) {
  242. $percent_jumlah_rt_maret = $jumlah_rt_maret / $total_rts_maret * 100;
  243. }else{
  244. $percent_jumlah_rt_maret = 0;
  245. }
  246. $tanggal_upload_maret = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',2)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  247. //April
  248. $paid_rts_april = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',3)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  249. $nopaid_rts_april = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',3)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  250. $total_rts_april = $paid_rts_april + $nopaid_rts_april;
  251. $sudah_tl_april = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',3)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  252. $belum_tl_april = $total_rts_april - $sudah_tl_april;
  253. $percent_sudah_tl_april = $sudah_tl_april / $total_rts_april * 100;
  254. $percent_belum_tl_april = $belum_tl_april / $total_rts_april * 100;
  255. $jumlah_rt_april = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',3)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  256. if ($jumlah_rt_april != 0) {
  257. $percent_jumlah_rt_april = $jumlah_rt_april/ $total_rts_april * 100;
  258. }else{
  259. $percent_jumlah_rt_april = 0;
  260. }
  261. $tanggal_upload_april = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',3)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  262. //Mei
  263. $paid_rts_mei = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',4)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  264. $nopaid_rts_mei = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',4)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  265. $total_rts_mei = $paid_rts_mei + $nopaid_rts_mei;
  266. $sudah_tl_mei = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',4)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  267. $belum_tl_mei = $total_rts_mei - $sudah_tl_mei;
  268. $percent_sudah_tl_mei = $sudah_tl_mei / $total_rts_mei * 100;
  269. $percent_belum_tl_mei = $belum_tl_mei / $total_rts_mei * 100;
  270. $jumlah_rt_mei = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',4)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  271. if ($jumlah_rt_mei != 0) {
  272. $percent_jumlah_rt_mei = $jumlah_rt_mei / $total_rts_mei * 100;
  273. }else{
  274. $percent_jumlah_rt_mei = 0;
  275. }
  276. $tanggal_upload_mei = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',4)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  277. //Juni
  278. $paid_rts_juni = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',5)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  279. $nopaid_rts_juni = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',5)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  280. $total_rts_juni = $paid_rts_juni + $nopaid_rts_juni;
  281. $sudah_tl_juni = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',5)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  282. $belum_tl_juni = $total_rts_juni - $sudah_tl_juni;
  283. $percent_sudah_tl_juni = $sudah_tl_juni / $total_rts_juni * 100;
  284. $percent_belum_tl_juni = $belum_tl_juni / $total_rts_juni * 100;
  285. $jumlah_rt_juni = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',5)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  286. if ($jumlah_rt_juni != 0) {
  287. $percent_jumlah_rt_juni = $jumlah_rt_juni / $total_rts_juni * 100;
  288. }else{
  289. $percent_jumlah_rt_juni = 0;
  290. }
  291. $tanggal_upload_juni = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',5)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  292. //Juli
  293. $paid_rts_juli = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',6)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  294. $nopaid_rts_juli = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',6)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  295. $total_rts_juli = $paid_rts_juli + $nopaid_rts_juli;
  296. $sudah_tl_juli = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',6)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('status',1)->count();
  297. $belum_tl_juli = $total_rts_juli - $sudah_tl_juli;
  298. $percent_sudah_tl_juli = $sudah_tl_juli / $total_rts_juli * 100;
  299. $percent_belum_tl_juli = $belum_tl_juli / $total_rts_juli * 100;
  300. $jumlah_rt_juli = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',6)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  301. if ($jumlah_rt_juli != 0) {
  302. $percent_jumlah_rt_juli = $jumlah_rt_juli / $total_rts_juli * 100;
  303. }else{
  304. $percent_jumlah_rt_juli = 0;
  305. }
  306. $tanggal_upload_juli = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',6)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  307. //Agustus
  308. $paid_rts_agustus = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',7)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  309. $nopaid_rts_agustus = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',7)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  310. $total_rts_agustus = $paid_rts_agustus + $nopaid_rts_agustus;
  311. $sudah_tl_agustus = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',7)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  312. $belum_tl_agustus = $total_rts_agustus - $sudah_tl_agustus;
  313. $percent_sudah_tl_agustus = $sudah_tl_agustus / $total_rts_agustus * 100;
  314. $percent_belum_tl_agustus = $belum_tl_agustus / $total_rts_agustus * 100;
  315. $jumlah_rt_agustus = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',7)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  316. if ($jumlah_rt_agustus != 0) {
  317. $percent_jumlah_rt_agustus = $jumlah_rt_agustus / $total_rts_agustus * 100;
  318. }else{
  319. $percent_jumlah_rt_agustus = 0;
  320. }
  321. $tanggal_upload_agustus = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',7)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  322. //September
  323. $paid_rts_september = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',8)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  324. $nopaid_rts_september = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',8)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  325. $total_rts_september = $paid_rts_september + $nopaid_rts_september;
  326. $sudah_tl_september = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',8)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  327. $belum_tl_september = $total_rts_september - $sudah_tl_september;
  328. $percent_sudah_tl_september = $sudah_tl_september / $total_rts_september * 100;
  329. $percent_belum_tl_september = $belum_tl_september / $total_rts_september * 100;
  330. $jumlah_rt_september = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',8)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  331. if ($jumlah_rt_september != 0) {
  332. $percent_jumlah_rt_september = $jumlah_rt_september / $total_rts_september * 100;
  333. }else{
  334. $percent_jumlah_rt_september = 0;
  335. }
  336. $tanggal_upload_september = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',8)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  337. //Oktober
  338. $paid_rts_oktober = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',9)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  339. $nopaid_rts_oktober = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',9)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  340. $total_rts_oktober = $paid_rts_oktober + $nopaid_rts_oktober;
  341. $sudah_tl_oktober = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',9)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  342. $belum_tl_oktober = $total_rts_oktober - $sudah_tl_oktober;
  343. $percent_sudah_tl_oktober = $sudah_tl_oktober / $total_rts_oktober * 100;
  344. $percent_belum_tl_oktober = $belum_tl_oktober / $total_rts_oktober * 100;
  345. $jumlah_rt_oktober = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',9)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  346. if ($jumlah_rt_oktober != 0) {
  347. $percent_jumlah_rt_oktober = $jumlah_rt_oktober / $total_rts_oktober * 100;
  348. }else{
  349. $percent_jumlah_rt_oktober = 0;
  350. }
  351. $tanggal_upload_oktober = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',9)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  352. //November
  353. $paid_rts_november = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',10)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  354. $nopaid_rts_november = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',10)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  355. $total_rts_november = $paid_rts_november + $nopaid_rts_november;
  356. $sudah_tl_november = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',10)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  357. $belum_tl_november = $total_rts_november - $sudah_tl_november;
  358. $percent_sudah_tl_november = $sudah_tl_november / $total_rts_november * 100;
  359. $percent_belum_tl_november = $belum_tl_november / $total_rts_november * 100;
  360. $jumlah_rt_november = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',10)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  361. if ($jumlah_rt_november != 0) {
  362. $percent_jumlah_rt_november = $jumlah_rt_november / $total_rts_november * 100;
  363. }else{
  364. $percent_jumlah_rt_november = 0;
  365. }
  366. $tanggal_upload_november = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',10)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  367. //Desember
  368. $paid_rts_desember = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',11)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  369. $nopaid_rts_desember = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',11)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  370. $total_rts_desember = $paid_rts_desember + $nopaid_rts_desember;
  371. $sudah_tl_desember = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',11)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  372. $belum_tl_desember = $total_rts_desember - $sudah_tl_desember;
  373. $percent_sudah_tl_desember = $sudah_tl_desember / $total_rts_desember * 100;
  374. $percent_belum_tl_desember = $belum_tl_desember / $total_rts_desember * 100;
  375. $jumlah_rt_desember = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',11)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  376. if ($jumlah_rt_desember != 0) {
  377. $percent_jumlah_rt_desember = $jumlah_rt_desember / $total_rts_desember * 100;
  378. }else{
  379. $percent_jumlah_rt_desember = 0;
  380. }
  381. $tanggal_upload_desember = \App\Model\SPP\RincianTagihan::whereMonth('bi_begin',11)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  382. }else{
  383. //Januari
  384. $paid_rts_januari = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',12)->whereYear('bi_begin',$fixYear)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  385. $nopaid_rts_januari = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',12)->whereYear('bi_begin',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  386. $total_rts_januari = $paid_rts_januari + $nopaid_rts_januari;
  387. $sudah_tl_januari = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',12)->whereYear('bi_begin',$fixYear)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  388. $belum_tl_januari = $total_rts_januari - $sudah_tl_januari;
  389. $percent_sudah_tl_januari = $sudah_tl_januari / $total_rts_januari * 100;
  390. $percent_belum_tl_januari = $belum_tl_januari / $total_rts_januari * 100;
  391. $jumlah_rt_januari = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',12)->whereYear('bi_begin',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  392. if ($jumlah_rt_januari != 0) {
  393. $percent_jumlah_rt_januari = $jumlah_rt_januari / $total_rts_januari * 100;
  394. }else{
  395. $percent_jumlah_rt_januari = 0;
  396. }
  397. $tanggal_upload_januari = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',12)->whereYear('bi_begin',$fixYear)->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->select('updated_at')->distinct()->value('updated_at');
  398. //Februari
  399. $paid_rts_februari = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',1)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  400. $nopaid_rts_februari = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',1)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  401. $total_rts_februari = $paid_rts_februari + $nopaid_rts_februari;
  402. $sudah_tl_februari = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',1)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  403. $belum_tl_februari = $total_rts_februari - $sudah_tl_februari;
  404. $percent_sudah_tl_februari = $sudah_tl_februari / $total_rts_februari * 100;
  405. $percent_belum_tl_februari = $belum_tl_februari / $total_rts_februari * 100;
  406. $jumlah_rt_februari = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',1)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  407. if ($jumlah_rt_februari != 0) {
  408. $percent_jumlah_rt_februari = $jumlah_rt_februari / $total_rts_februari * 100;
  409. }else{
  410. $percent_jumlah_rt_februari = 0;
  411. }
  412. $tanggal_upload_februari = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',1)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->select('updated_at')->distinct()->value('updated_at');
  413. //Maret
  414. $paid_rts_maret = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',2)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  415. $nopaid_rts_maret = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',2)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  416. $total_rts_maret = $paid_rts_maret + $nopaid_rts_maret;
  417. $sudah_tl_maret = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',2)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  418. $belum_tl_maret = $total_rts_maret - $sudah_tl_maret;
  419. $percent_sudah_tl_maret = $sudah_tl_maret / $total_rts_maret * 100;
  420. $percent_belum_tl_maret = $belum_tl_maret / $total_rts_maret * 100;
  421. $jumlah_rt_maret = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',2)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  422. if ($jumlah_rt_maret != 0) {
  423. $percent_jumlah_rt_maret = $jumlah_rt_maret / $total_rts_maret * 100;
  424. }else{
  425. $percent_jumlah_rt_maret = 0;
  426. }
  427. $tanggal_upload_maret = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',2)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  428. //April
  429. $paid_rts_april = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',3)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  430. $nopaid_rts_april = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',3)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  431. $total_rts_april = $paid_rts_april + $nopaid_rts_april;
  432. $sudah_tl_april = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',3)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  433. $belum_tl_april = $total_rts_april - $sudah_tl_april;
  434. $percent_sudah_tl_april = $sudah_tl_april / $total_rts_april * 100;
  435. $percent_belum_tl_april = $belum_tl_april / $total_rts_april * 100;
  436. $jumlah_rt_april = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',3)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  437. if ($jumlah_rt_april != 0) {
  438. $percent_jumlah_rt_april = $jumlah_rt_april/ $total_rts_april * 100;
  439. }else{
  440. $percent_jumlah_rt_april = 0;
  441. }
  442. $tanggal_upload_april = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',3)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  443. //Mei
  444. $paid_rts_mei = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',4)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  445. $nopaid_rts_mei = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',4)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  446. $total_rts_mei = $paid_rts_mei + $nopaid_rts_mei;
  447. $sudah_tl_mei = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',4)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  448. $belum_tl_mei = $total_rts_mei - $sudah_tl_mei;
  449. $percent_sudah_tl_mei = $sudah_tl_mei / $total_rts_mei * 100;
  450. $percent_belum_tl_mei = $belum_tl_mei / $total_rts_mei * 100;
  451. $jumlah_rt_mei = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',4)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  452. if ($jumlah_rt_mei != 0) {
  453. $percent_jumlah_rt_mei = $jumlah_rt_mei / $total_rts_mei * 100;
  454. }else{
  455. $percent_jumlah_rt_mei = 0;
  456. }
  457. $tanggal_upload_mei = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',4)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  458. //Juni
  459. $paid_rts_juni = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',5)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  460. $nopaid_rts_juni = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',5)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  461. $total_rts_juni = $paid_rts_juni + $nopaid_rts_juni;
  462. $sudah_tl_juni = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',5)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  463. $belum_tl_juni = $total_rts_juni - $sudah_tl_juni;
  464. $percent_sudah_tl_juni = $sudah_tl_juni / $total_rts_juni * 100;
  465. $percent_belum_tl_juni = $belum_tl_juni / $total_rts_juni * 100;
  466. $jumlah_rt_juni = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',5)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  467. if ($jumlah_rt_juni != 0) {
  468. $percent_jumlah_rt_juni = $jumlah_rt_juni / $total_rts_juni * 100;
  469. }else{
  470. $percent_jumlah_rt_juni = 0;
  471. }
  472. $tanggal_upload_juni = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',5)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  473. //Juli
  474. $paid_rts_juli = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',6)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  475. $nopaid_rts_juli = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',6)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  476. $total_rts_juli = $paid_rts_juli + $nopaid_rts_juli;
  477. $sudah_tl_juli = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',6)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('status',1)->count();
  478. $belum_tl_juli = $total_rts_juli - $sudah_tl_juli;
  479. $percent_sudah_tl_juli = $sudah_tl_juli / $total_rts_juli * 100;
  480. $percent_belum_tl_juli = $belum_tl_juli / $total_rts_juli * 100;
  481. $jumlah_rt_juli = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',6)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  482. if ($jumlah_rt_juli != 0) {
  483. $percent_jumlah_rt_juli = $jumlah_rt_juli / $total_rts_juli * 100;
  484. }else{
  485. $percent_jumlah_rt_juli = 0;
  486. }
  487. $tanggal_upload_juli = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',6)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  488. //Agustus
  489. $paid_rts_agustus = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',7)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  490. $nopaid_rts_agustus = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',7)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  491. $total_rts_agustus = $paid_rts_agustus + $nopaid_rts_agustus;
  492. $sudah_tl_agustus = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',7)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  493. $belum_tl_agustus = $total_rts_agustus - $sudah_tl_agustus;
  494. $percent_sudah_tl_agustus = $sudah_tl_agustus / $total_rts_agustus * 100;
  495. $percent_belum_tl_agustus = $belum_tl_agustus / $total_rts_agustus * 100;
  496. $jumlah_rt_agustus = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',7)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  497. if ($jumlah_rt_agustus != 0) {
  498. $percent_jumlah_rt_agustus = $jumlah_rt_agustus / $total_rts_agustus * 100;
  499. }else{
  500. $percent_jumlah_rt_agustus = 0;
  501. }
  502. $tanggal_upload_agustus = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',7)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  503. //September
  504. $paid_rts_september = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',8)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  505. $nopaid_rts_september = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',8)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  506. $total_rts_september = $paid_rts_september + $nopaid_rts_september;
  507. $sudah_tl_september = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',8)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  508. $belum_tl_september = $total_rts_september - $sudah_tl_september;
  509. $percent_sudah_tl_september = $sudah_tl_september / $total_rts_september * 100;
  510. $percent_belum_tl_september = $belum_tl_september / $total_rts_september * 100;
  511. $jumlah_rt_september = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',8)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  512. if ($jumlah_rt_september != 0) {
  513. $percent_jumlah_rt_september = $jumlah_rt_september / $total_rts_september * 100;
  514. }else{
  515. $percent_jumlah_rt_september = 0;
  516. }
  517. $tanggal_upload_september = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',8)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  518. //Oktober
  519. $paid_rts_oktober = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',9)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  520. $nopaid_rts_oktober = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',9)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  521. $total_rts_oktober = $paid_rts_oktober + $nopaid_rts_oktober;
  522. $sudah_tl_oktober = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',9)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  523. $belum_tl_oktober = $total_rts_oktober - $sudah_tl_oktober;
  524. $percent_sudah_tl_oktober = $sudah_tl_oktober / $total_rts_oktober * 100;
  525. $percent_belum_tl_oktober = $belum_tl_oktober / $total_rts_oktober * 100;
  526. $jumlah_rt_oktober = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',9)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  527. if ($jumlah_rt_oktober != 0) {
  528. $percent_jumlah_rt_oktober = $jumlah_rt_oktober / $total_rts_oktober * 100;
  529. }else{
  530. $percent_jumlah_rt_oktober = 0;
  531. }
  532. $tanggal_upload_oktober = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',9)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  533. //November
  534. $paid_rts_november = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',10)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  535. $nopaid_rts_november = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',10)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  536. $total_rts_november = $paid_rts_november + $nopaid_rts_november;
  537. $sudah_tl_november = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',10)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  538. $belum_tl_november = $total_rts_november - $sudah_tl_november;
  539. $percent_sudah_tl_november = $sudah_tl_november / $total_rts_november * 100;
  540. $percent_belum_tl_november = $belum_tl_november / $total_rts_november * 100;
  541. $jumlah_rt_november = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',10)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  542. if ($jumlah_rt_november != 0) {
  543. $percent_jumlah_rt_november = $jumlah_rt_november / $total_rts_november * 100;
  544. }else{
  545. $percent_jumlah_rt_november = 0;
  546. }
  547. $tanggal_upload_november = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',10)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  548. //Desember
  549. $paid_rts_desember = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',11)->whereYear('bi_begin',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  550. $nopaid_rts_desember = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',11)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  551. $total_rts_desember = $paid_rts_desember + $nopaid_rts_desember;
  552. $sudah_tl_desember = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',11)->whereYear('bi_begin',$year)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->where('active',1)->count();
  553. $belum_tl_desember = $total_rts_desember - $sudah_tl_desember;
  554. $percent_sudah_tl_desember = $sudah_tl_desember / $total_rts_desember * 100;
  555. $percent_belum_tl_desember = $belum_tl_desember / $total_rts_desember * 100;
  556. $jumlah_rt_desember = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',11)->whereYear('bi_begin',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->count();
  557. if ($jumlah_rt_desember != 0) {
  558. $percent_jumlah_rt_desember = $jumlah_rt_desember / $total_rts_desember * 100;
  559. }else{
  560. $percent_jumlah_rt_desember = 0;
  561. }
  562. $tanggal_upload_desember = \App\Model\SPP\RincianTagihan::where('upt', Auth::user()->upt)->whereMonth('bi_begin',11)->whereYear('bi_begin',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('katagori_spp','Pokok')->distinct()->value('updated_at');
  563. }
  564. ?>
  565. <tr>
  566. <td class="tg-0lax">JAN</td>
  567. <td>{{$total_rts_januari}}</td>
  568. <td>{{$paid_rts_januari}}</td>
  569. <td>{{$sudah_tl_januari}}</td>
  570. <td>{!! substr(strip_tags($percent_sudah_tl_januari), 0, 5) !!} %</td>
  571. <td>{{$belum_tl_januari}}</td>
  572. <td>{!! substr(strip_tags($percent_belum_tl_januari), 0, 5) !!} %</td>
  573. <td>{{$jumlah_rt_januari}}</td>
  574. <td>{!! substr(strip_tags($percent_jumlah_rt_januari), 0, 5) !!} %</td>
  575. <td>
  576. @if($tanggal_upload_januari)
  577. {{\Carbon\Carbon::parse($tanggal_upload_januari)
  578. ->format('d, M Y')}}
  579. @else
  580. Belum Mengirim
  581. @endif
  582. </td>
  583. </tr>
  584. <tr>
  585. <td class="tg-0lax">FEB</td>
  586. <td>{{$total_rts_februari}}</td>
  587. <td>{{$paid_rts_februari}}</td>
  588. <td>{{$sudah_tl_februari}}</td>
  589. <td>{!! substr(strip_tags($percent_sudah_tl_februari), 0, 5) !!} %</td>
  590. <td>{{$belum_tl_februari}}</td>
  591. <td>{!! substr(strip_tags($percent_belum_tl_februari), 0, 5) !!} %</td>
  592. <td>{{$jumlah_rt_februari}}</td>
  593. <td>{!! substr(strip_tags($percent_jumlah_rt_februari), 0, 5) !!} %</td>
  594. <td>
  595. @if($tanggal_upload_februari)
  596. {{\Carbon\Carbon::parse($tanggal_upload_februari)
  597. ->format('d, M Y')}}
  598. @else
  599. Belum Mengirim
  600. @endif
  601. </td>
  602. </tr>
  603. <tr>
  604. <td class="tg-0lax">MAR</td>
  605. <td>{{$total_rts_maret}}</td>
  606. <td>{{$paid_rts_maret}}</td>
  607. <td>{{$sudah_tl_maret}}</td>
  608. <td>{!! substr(strip_tags($percent_sudah_tl_maret), 0, 5) !!} %</td>
  609. <td>{{$belum_tl_maret}}</td>
  610. <td>{!! substr(strip_tags($percent_belum_tl_maret), 0, 5) !!} %</td>
  611. <td>{{$jumlah_rt_maret}}</td>
  612. <td>{!! substr(strip_tags($percent_jumlah_rt_maret), 0, 5) !!} %</td>
  613. <td>
  614. @if($tanggal_upload_maret)
  615. {{\Carbon\Carbon::parse($tanggal_upload_maret)
  616. ->format('d, M Y')}}
  617. @else
  618. Belum Mengirim
  619. @endif
  620. </td>
  621. </tr>
  622. <tr>
  623. <td class="tg-0lax">APR</td>
  624. <td>{{$total_rts_april}}</td>
  625. <td>{{$paid_rts_april}}</td>
  626. <td>{{$sudah_tl_april}}</td>
  627. <td>{!! substr(strip_tags($percent_sudah_tl_april), 0, 5) !!} %</td>
  628. <td>{{$belum_tl_april}}</td>
  629. <td>{!! substr(strip_tags($percent_belum_tl_april), 0, 5) !!} %</td>
  630. <td>{{$jumlah_rt_april}}</td>
  631. <td>{!! substr(strip_tags($percent_jumlah_rt_april), 0, 5) !!} %</td>
  632. <td>
  633. @if($tanggal_upload_april)
  634. {{\Carbon\Carbon::parse($tanggal_upload_april)
  635. ->format('d, M Y')}}
  636. @else
  637. Belum Mengirim
  638. @endif
  639. </td>
  640. </tr>
  641. <tr>
  642. <td class="tg-0lax">MEI</td>
  643. <td>{{$total_rts_mei}}</td>
  644. <td>{{$paid_rts_mei}}</td>
  645. <td>{{$sudah_tl_mei}}</td>
  646. <td>{!! substr(strip_tags($percent_sudah_tl_mei), 0, 5) !!} %</td>
  647. <td>{{$belum_tl_mei}}</td>
  648. <td>{!! substr(strip_tags($percent_belum_tl_mei), 0, 5) !!} %</td>
  649. <td>{{$jumlah_rt_mei}}</td>
  650. <td>{!! substr(strip_tags($percent_jumlah_rt_mei), 0, 5) !!} %</td>
  651. <td>
  652. @if($tanggal_upload_mei)
  653. {{\Carbon\Carbon::parse($tanggal_upload_mei)
  654. ->format('d, M Y')}}
  655. @else
  656. Belum Mengirim
  657. @endif
  658. </td>
  659. </tr>
  660. <tr>
  661. <td class="tg-0lax">JUN</td>
  662. <td>{{$total_rts_juni}}</td>
  663. <td>{{$paid_rts_juni}}</td>
  664. <td>{{$sudah_tl_juni}}</td>
  665. <td>{!! substr(strip_tags($percent_sudah_tl_juni), 0, 5) !!} %</td>
  666. <td>{{$belum_tl_juni}}</td>
  667. <td>{!! substr(strip_tags($percent_belum_tl_juni), 0, 5) !!} %</td>
  668. <td>{{$jumlah_rt_juni}}</td>
  669. <td>{!! substr(strip_tags($percent_jumlah_rt_juni), 0, 5) !!} %</td>
  670. <td>
  671. @if($tanggal_upload_juni)
  672. {{\Carbon\Carbon::parse($tanggal_upload_juni)
  673. ->format('d, M Y')}}
  674. @else
  675. Belum Mengirim
  676. @endif
  677. </td>
  678. </tr>
  679. <tr>
  680. <td class="tg-0lax">JUL</td>
  681. <td>{{$total_rts_juli}}</td>
  682. <td>{{$paid_rts_juli}}</td>
  683. <td>{{$sudah_tl_juli}}</td>
  684. <td>{!! substr(strip_tags($percent_sudah_tl_juli), 0, 5) !!} %</td>
  685. <td>{{$belum_tl_juli}}</td>
  686. <td>{!! substr(strip_tags($percent_belum_tl_juli), 0, 5) !!} %</td>
  687. <td>{{$jumlah_rt_juli}}</td>
  688. <td>{!! substr(strip_tags($percent_jumlah_rt_juli), 0, 5) !!} %</td>
  689. <td>
  690. @if($tanggal_upload_juli)
  691. {{\Carbon\Carbon::parse($tanggal_upload_juli)
  692. ->format('d, M Y')}}
  693. @else
  694. Belum Mengirim
  695. @endif
  696. </td>
  697. </tr>
  698. <tr>
  699. <td class="tg-0lax">AUG</td>
  700. <td>{{$total_rts_agustus}}</td>
  701. <td>{{$paid_rts_agustus}}</td>
  702. <td>{{$sudah_tl_agustus}}</td>
  703. <td>{!! substr(strip_tags($percent_sudah_tl_agustus), 0, 5) !!} %</td>
  704. <td>{{$belum_tl_agustus}}</td>
  705. <td>{!! substr(strip_tags($percent_belum_tl_agustus), 0, 5) !!} %</td>
  706. <td>{{$jumlah_rt_agustus}}</td>
  707. <td>{!! substr(strip_tags($percent_jumlah_rt_agustus), 0, 5) !!} %</td>
  708. <td>
  709. @if($tanggal_upload_agustus)
  710. {{\Carbon\Carbon::parse($tanggal_upload_agustus)
  711. ->format('d, M Y')}}
  712. @else
  713. Belum Mengirim
  714. @endif
  715. </td>
  716. </tr>
  717. <tr>
  718. <td class="tg-0lax">SEP</td>
  719. <td>{{$total_rts_september}}</td>
  720. <td>{{$paid_rts_september}}</td>
  721. <td>{{$sudah_tl_september}}</td>
  722. <td>{!! substr(strip_tags($percent_sudah_tl_september), 0, 5) !!} %</td>
  723. <td>{{$belum_tl_september}}</td>
  724. <td>{!! substr(strip_tags($percent_belum_tl_september), 0, 5) !!} %</td>
  725. <td>{{$jumlah_rt_september}}</td>
  726. <td>{!! substr(strip_tags($percent_jumlah_rt_september), 0, 5) !!} %</td>
  727. <td>
  728. @if($tanggal_upload_september)
  729. {{\Carbon\Carbon::parse($tanggal_upload_september)
  730. ->format('d, M Y')}}
  731. @else
  732. Belum Mengirim
  733. @endif
  734. </td>
  735. </tr>
  736. <tr>
  737. <td class="tg-0lax">OKT</td>
  738. <td>{{$total_rts_oktober}}</td>
  739. <td>{{$paid_rts_oktober}}</td>
  740. <td>{{$sudah_tl_oktober}}</td>
  741. <td>{!! substr(strip_tags($percent_sudah_tl_oktober), 0, 5) !!} %</td>
  742. <td>{{$belum_tl_oktober}}</td>
  743. <td>{!! substr(strip_tags($percent_belum_tl_oktober), 0, 5) !!} %</td>
  744. <td>{{$jumlah_rt_oktober}}</td>
  745. <td>{!! substr(strip_tags($percent_jumlah_rt_oktober), 0, 5) !!} %</td>
  746. <td>
  747. @if($tanggal_upload_oktober)
  748. {{\Carbon\Carbon::parse($tanggal_upload_oktober)
  749. ->format('d, M Y')}}
  750. @else
  751. Belum Mengirim
  752. @endif
  753. </td>
  754. </tr>
  755. <tr>
  756. <td class="tg-0lax">NOV</td>
  757. <td>{{$total_rts_november}}</td>
  758. <td>{{$paid_rts_november}}</td>
  759. <td>{{$sudah_tl_november}}</td>
  760. <td>{!! substr(strip_tags($percent_sudah_tl_november), 0, 5) !!} %</td>
  761. <td>{{$belum_tl_november}}</td>
  762. <td>{!! substr(strip_tags($percent_belum_tl_november), 0, 5) !!} %</td>
  763. <td>{{$jumlah_rt_november}}</td>
  764. <td>{!! substr(strip_tags($percent_jumlah_rt_november), 0, 5) !!} %</td>
  765. <td>
  766. @if($tanggal_upload_november)
  767. {{\Carbon\Carbon::parse($tanggal_upload_november)
  768. ->format('d, M Y')}}
  769. @else
  770. Belum Mengirim
  771. @endif
  772. </td>
  773. </tr>
  774. <tr>
  775. <td class="tg-0lax">DES</td>
  776. <td>{{$total_rts_desember}}</td>
  777. <td>{{$paid_rts_desember}}</td>
  778. <td>{{$sudah_tl_desember}}</td>
  779. <td>{!! substr(strip_tags($percent_sudah_tl_desember), 0, 5) !!} %</td>
  780. <td>{{$belum_tl_desember}}</td>
  781. <td>{!! substr(strip_tags($percent_belum_tl_desember), 0, 5) !!} %</td>
  782. <td>{{$jumlah_rt_desember}}</td>
  783. <td>{!! substr(strip_tags($percent_jumlah_rt_desember), 0, 5) !!} %</td>
  784. <td>
  785. @if($tanggal_upload_desember)
  786. {{\Carbon\Carbon::parse($tanggal_upload_desember)
  787. ->format('d, M Y')}}
  788. @else
  789. Belum Mengirim
  790. @endif
  791. </td>
  792. </tr>
  793. </table>
  794. </div>
  795. </div>
  796. @endif