print-upt-tahun-not-paid.blade.php 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. <!DOCTYPE html>
  2. <?php
  3. $getStatus = \App\Model\Privillage\Role::where('id',Auth::user()->role_id)->value('akses');
  4. ?>
  5. <html>
  6. <head>
  7. <style>
  8. .table-bordered {
  9. border-collapse: collapse;
  10. width: 100%;
  11. }
  12. .table-bordered td, .table-bordered th {
  13. border: 1px solid black;
  14. padding: 8px;
  15. }
  16. .thead-light{
  17. background-color: #E9ECEF;
  18. }
  19. .table-bordered th {
  20. padding-top: 12px;
  21. padding-bottom: 12px;
  22. text-align: left;
  23. }
  24. </style>
  25. </head>
  26. <body>
  27. <?php
  28. $getStatus = \App\Model\Privillage\Role::where('id',Auth::user()->role_id)->value('akses');
  29. $upt = \App\Model\Setting\UPT::select('office_name','office_id')->distinct()->get();
  30. ?>
  31. <center>
  32. <div>
  33. <hr>
  34. <h2 class="font-weight-bolder">DATA @if($jenis_st == 'First Reminder') ST-1 @elseif($jenis_st == 'Second Reminder') ST-2 @elseif($jenis_st == 'Third Reminder') ST-3 @elseif($jenis_st == 'Last Reminder') STT @endif REKAPITULASI DAN PERSENTASE AKSI PENCEGAHAN PIUTANG</h2>
  35. <hr>
  36. <table id="example" class="table table-bordered align-items-center">
  37. <thead class="thead-light">
  38. <tr>
  39. <th class="tg-0pky" colspan="3"></th>
  40. <th class="tg-0lax" colspan="4" style="background-color: #63a53a; color: #fff; text-align: center;">RT BELUM TERBAYAR (H-30 s.d H)</th>
  41. <th class="tg-0lax" colspan="3" style="background-color: #ff1228; color: #fff;">RT TIDAK TERBAYAR (MENJADI REMINDER)</th>
  42. </tr>
  43. <tr>
  44. <td class="tg-0lax">BULAN</td>
  45. <td class="tg-0lax">TOTAL RT TERBIT</td>
  46. <td class="tg-0lax">RT TERBAYAR</td>
  47. <td class="tg-0lax">SUDAH DI-TL UPT</td>
  48. <td class="tg-0lax">%</td>
  49. <td class="tg-0lax">BELUM DI-TL UPT</td>
  50. <td class="tg-0lax">%</td>
  51. <td class="tg-0lax">JUMLAH RT</td>
  52. <td class="tg-0lax">%</td>
  53. <td class="tg-0lax">Tanggal Upload</td>
  54. </tr>
  55. </thead>
  56. <?php
  57. $fixYear = $year - 1;
  58. //Januari
  59. $paid_rts_januari = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',12)->whereYear('bi_create_date',$fixYear)->where('status','paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  60. $nopaid_rts_januari = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',12)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  61. $total_rts_januari = $paid_rts_januari + $nopaid_rts_januari;
  62. $sudah_tl_januari = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',12)->whereYear('bi_create_date',$fixYear)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('active',1)->count();
  63. $belum_tl_januari = $total_rts_januari - $sudah_tl_januari;
  64. if ($total_rts_januari != 0) {
  65. $percent_sudah_tl_januari = $sudah_tl_januari / $total_rts_januari * 100;
  66. $percent_belum_tl_januari = $belum_tl_januari / $total_rts_januari * 100;
  67. }else{
  68. $percent_belum_tl_januari = 0;
  69. $percent_sudah_tl_januari = 0;
  70. }
  71. if (\App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',12)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count()) {
  72. $jumlah_rt_januari = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',12)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  73. }else{
  74. $jumlah_rt_januari = 0;
  75. }
  76. if ($jumlah_rt_januari != 0) {
  77. $percent_jumlah_rt_januari = $jumlah_rt_januari / $total_rts_januari * 100;
  78. }else{
  79. $percent_jumlah_rt_januari = 0;
  80. }
  81. $tanggal_upload_januari = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',12)->whereYear('bi_create_date',$fixYear)->where('active',1)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->select('updated_at')->distinct()->value('updated_at');
  82. //Februari
  83. $paid_rts_februari = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',1)->whereYear('bi_create_date',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  84. $nopaid_rts_februari = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',1)->whereYear('bi_create_date',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  85. $total_rts_februari = $paid_rts_februari + $nopaid_rts_februari;
  86. $sudah_tl_februari = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',1)->whereYear('bi_create_date',$year)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('active',1)->count();
  87. $belum_tl_februari = $total_rts_februari - $sudah_tl_februari;
  88. if ($total_rts_februari != 0) {
  89. $percent_sudah_tl_februari = $sudah_tl_februari / $total_rts_februari * 100;
  90. $percent_belum_tl_februari = $belum_tl_februari / $total_rts_februari * 100;
  91. }else{
  92. $percent_belum_tl_februari = 0;
  93. $percent_sudah_tl_februari = 0;
  94. }
  95. if (\App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',1)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count()) {
  96. $jumlah_rt_februari = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',12)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  97. }else{
  98. $jumlah_rt_februari = 0;
  99. }
  100. if ($jumlah_rt_februari != 0) {
  101. $percent_jumlah_rt_februari = $jumlah_rt_februari / $total_rts_februari * 100;
  102. }else{
  103. $percent_jumlah_rt_februari = 0;
  104. }
  105. $tanggal_upload_februari = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',1)->whereYear('bi_create_date',$year)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('active',1)->select('updated_at')->distinct()->value('updated_at');
  106. //Maret
  107. $paid_rts_maret = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',2)->whereYear('bi_create_date',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  108. $nopaid_rts_maret = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',2)->whereYear('bi_create_date',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  109. $total_rts_maret = $paid_rts_maret + $nopaid_rts_maret;
  110. $sudah_tl_maret = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',2)->whereYear('bi_create_date',$year)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('active',1)->count();
  111. $belum_tl_maret = $total_rts_maret - $sudah_tl_maret;
  112. if ($total_rts_maret != 0) {
  113. $percent_sudah_tl_maret = $sudah_tl_maret / $total_rts_maret * 100;
  114. $percent_belum_tl_maret = $belum_tl_maret / $total_rts_maret * 100;
  115. }else{
  116. $percent_belum_tl_maret = 0;
  117. $percent_sudah_tl_maret = 0;
  118. }
  119. if (\App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',2)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count()) {
  120. $jumlah_rt_maret = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',2)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  121. }else{
  122. $jumlah_rt_maret = 0;
  123. }
  124. if ($jumlah_rt_maret != 0) {
  125. $percent_jumlah_rt_maret = $jumlah_rt_maret / $total_rts_maret * 100;
  126. }else{
  127. $percent_jumlah_rt_maret = 0;
  128. }
  129. $tanggal_upload_maret = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',2)->whereYear('bi_create_date',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->distinct()->value('updated_at');
  130. //April
  131. $paid_rts_april = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',3)->whereYear('bi_create_date',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  132. $nopaid_rts_april = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',3)->whereYear('bi_create_date',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  133. $total_rts_april = $paid_rts_april + $nopaid_rts_april;
  134. $sudah_tl_april = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',3)->whereYear('bi_create_date',$year)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('active',1)->count();
  135. $belum_tl_april = $total_rts_april - $sudah_tl_april;
  136. if ($total_rts_april != 0) {
  137. $percent_sudah_tl_april = $sudah_tl_april / $total_rts_april * 100;
  138. $percent_belum_tl_april = $belum_tl_april / $total_rts_april * 100;
  139. }else{
  140. $percent_belum_tl_april = 0;
  141. $percent_sudah_tl_april = 0;
  142. }
  143. if (\App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',3)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count()) {
  144. $jumlah_rt_april = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',3)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  145. }else{
  146. $jumlah_rt_april = 0;
  147. }
  148. if ($jumlah_rt_april != 0) {
  149. $percent_jumlah_rt_april = $jumlah_rt_april / $total_rts_april * 100;
  150. }else{
  151. $percent_jumlah_rt_april = 0;
  152. }
  153. $tanggal_upload_april = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',3)->whereYear('bi_create_date',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->distinct()->value('updated_at');
  154. //Mei
  155. $paid_rts_mei = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',4)->whereYear('bi_create_date',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  156. $nopaid_rts_mei = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',4)->whereYear('bi_create_date',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  157. $total_rts_mei = $paid_rts_mei + $nopaid_rts_mei;
  158. $sudah_tl_mei = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',4)->whereYear('bi_create_date',$year)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('active',1)->count();
  159. $belum_tl_mei = $total_rts_mei - $sudah_tl_mei;
  160. if ($total_rts_mei != 0) {
  161. $percent_sudah_tl_mei = $sudah_tl_mei / $total_rts_mei * 100;
  162. $percent_belum_tl_mei = $belum_tl_mei / $total_rts_mei * 100;
  163. }else{
  164. $percent_belum_tl_mei = 0;
  165. $percent_sudah_tl_mei = 0;
  166. }
  167. if (\App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',4)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count()) {
  168. $jumlah_rt_mei = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',4)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  169. }else{
  170. $jumlah_rt_mei = 0;
  171. }
  172. if ($jumlah_rt_mei != 0) {
  173. $percent_jumlah_rt_mei = $jumlah_rt_mei / $total_rts_mei * 100;
  174. }else{
  175. $percent_jumlah_rt_mei = 0;
  176. }
  177. $tanggal_upload_mei = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',4)->whereYear('bi_create_date',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->distinct()->value('updated_at');
  178. //Juni
  179. $paid_rts_juni = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',5)->whereYear('bi_create_date',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  180. $nopaid_rts_juni = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',5)->whereYear('bi_create_date',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  181. $total_rts_juni = $paid_rts_juni + $nopaid_rts_juni;
  182. $sudah_tl_juni = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',5)->whereYear('bi_create_date',$year)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('active',1)->count();
  183. $belum_tl_juni = $total_rts_juni - $sudah_tl_juni;
  184. if ($total_rts_juni != 0) {
  185. $percent_sudah_tl_juni = $sudah_tl_juni / $total_rts_juni * 100;
  186. $percent_belum_tl_juni = $belum_tl_juni / $total_rts_juni * 100;
  187. }else{
  188. $percent_belum_tl_juni = 0;
  189. $percent_sudah_tl_juni = 0;
  190. }
  191. if (\App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',5)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count()) {
  192. $jumlah_rt_juni = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',5)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  193. }else{
  194. $jumlah_rt_juni = 0;
  195. }
  196. if ($jumlah_rt_juni != 0) {
  197. $percent_jumlah_rt_juni = $jumlah_rt_juni / $total_rts_juni * 100;
  198. }else{
  199. $percent_jumlah_rt_juni = 0;
  200. }
  201. $tanggal_upload_juni = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',5)->whereYear('bi_create_date',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->distinct()->value('updated_at');
  202. //Juli
  203. $paid_rts_juli = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',6)->whereYear('bi_create_date',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  204. $nopaid_rts_juli = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',6)->whereYear('bi_create_date',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  205. $total_rts_juli = $paid_rts_juli + $nopaid_rts_juli;
  206. $sudah_tl_juli = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',6)->whereYear('bi_create_date',$year)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('status',1)->count();
  207. $belum_tl_juli = $total_rts_juli - $sudah_tl_juli;
  208. if ($total_rts_juli != 0) {
  209. $percent_sudah_tl_juli = $sudah_tl_juli / $total_rts_juli * 100;
  210. $percent_belum_tl_juli = $belum_tl_juli / $total_rts_juli * 100;
  211. }else{
  212. $percent_belum_tl_juli = 0;
  213. $percent_sudah_tl_juli = 0;
  214. }
  215. if (\App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',6)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count()) {
  216. $jumlah_rt_juli = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',6)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  217. }else{
  218. $jumlah_rt_juli = 0;
  219. }
  220. if ($jumlah_rt_juli != 0) {
  221. $percent_jumlah_rt_juli = $jumlah_rt_juli / $total_rts_juli * 100;
  222. }else{
  223. $percent_jumlah_rt_juli = 0;
  224. }
  225. $tanggal_upload_juli = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',6)->whereYear('bi_create_date',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->distinct()->value('updated_at');
  226. //Agustus
  227. $paid_rts_agustus = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',7)->whereYear('bi_create_date',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  228. $nopaid_rts_agustus = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',7)->whereYear('bi_create_date',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  229. $total_rts_agustus = $paid_rts_agustus + $nopaid_rts_agustus;
  230. $sudah_tl_agustus = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',7)->whereYear('bi_create_date',$year)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('active',1)->count();
  231. $belum_tl_agustus = $total_rts_agustus - $sudah_tl_agustus;
  232. if ($total_rts_agustus != 0) {
  233. $percent_sudah_tl_agustus = $sudah_tl_agustus / $total_rts_agustus * 100;
  234. $percent_belum_tl_agustus = $belum_tl_agustus / $total_rts_agustus * 100;
  235. }else{
  236. $percent_belum_tl_agustus = 0;
  237. $percent_sudah_tl_agustus = 0;
  238. }
  239. if (\App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',7)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count()) {
  240. $jumlah_rt_agustus = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',7)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  241. }else{
  242. $jumlah_rt_agustus = 0;
  243. }
  244. if ($jumlah_rt_agustus != 0) {
  245. $percent_jumlah_rt_agustus = $jumlah_rt_agustus / $total_rts_agustus * 100;
  246. }else{
  247. $percent_jumlah_rt_agustus = 0;
  248. }
  249. $tanggal_upload_agustus = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',7)->whereYear('bi_create_date',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->distinct()->value('updated_at');
  250. //September
  251. $paid_rts_september = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',8)->whereYear('bi_create_date',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  252. $nopaid_rts_september = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',8)->whereYear('bi_create_date',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  253. $total_rts_september = $paid_rts_september + $nopaid_rts_september;
  254. $sudah_tl_september = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',8)->whereYear('bi_create_date',$year)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('active',1)->count();
  255. $belum_tl_september = $total_rts_september - $sudah_tl_september;
  256. if ($total_rts_september != 0) {
  257. $percent_sudah_tl_september = $sudah_tl_september / $total_rts_september * 100;
  258. $percent_belum_tl_september = $belum_tl_september / $total_rts_september * 100;
  259. }else{
  260. $percent_belum_tl_september = 0;
  261. $percent_sudah_tl_september = 0;
  262. }
  263. if (\App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',8)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count()) {
  264. $jumlah_rt_september = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',8)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  265. }else{
  266. $jumlah_rt_september = 0;
  267. }
  268. if ($jumlah_rt_september != 0) {
  269. $percent_jumlah_rt_september = $jumlah_rt_september / $total_rts_september * 100;
  270. }else{
  271. $percent_jumlah_rt_september = 0;
  272. }
  273. $tanggal_upload_september = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',8)->whereYear('bi_create_date',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->distinct()->value('updated_at');
  274. //Oktober
  275. $paid_rts_oktober = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',9)->whereYear('bi_create_date',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  276. $nopaid_rts_oktober = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',9)->whereYear('bi_create_date',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  277. $total_rts_oktober = $paid_rts_oktober + $nopaid_rts_oktober;
  278. $sudah_tl_oktober = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',9)->whereYear('bi_create_date',$year)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('active',1)->count();
  279. $belum_tl_oktober = $total_rts_oktober - $sudah_tl_oktober;
  280. if ($total_rts_oktober != 0) {
  281. $percent_sudah_tl_oktober = $sudah_tl_oktober / $total_rts_oktober * 100;
  282. $percent_belum_tl_oktober = $belum_tl_oktober / $total_rts_oktober * 100;
  283. }else{
  284. $percent_belum_tl_oktober = 0;
  285. $percent_sudah_tl_oktober = 0;
  286. }
  287. if (\App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',9)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count()) {
  288. $jumlah_rt_oktober = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',9)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  289. }else{
  290. $jumlah_rt_oktober = 0;
  291. }
  292. if ($jumlah_rt_oktober != 0) {
  293. $percent_jumlah_rt_oktober = $jumlah_rt_oktober / $total_rts_oktober * 100;
  294. }else{
  295. $percent_jumlah_rt_oktober = 0;
  296. }
  297. $tanggal_upload_oktober = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',9)->whereYear('bi_create_date',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->distinct()->value('updated_at');
  298. //November
  299. $paid_rts_november = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',10)->whereYear('bi_create_date',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  300. $nopaid_rts_november = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',10)->whereYear('bi_create_date',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  301. $total_rts_november = $paid_rts_november + $nopaid_rts_november;
  302. $sudah_tl_november = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',10)->whereYear('bi_create_date',$year)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('active',1)->count();
  303. $belum_tl_november = $total_rts_november - $sudah_tl_november;
  304. if ($total_rts_november != 0) {
  305. $percent_sudah_tl_november = $sudah_tl_november / $total_rts_november * 100;
  306. $percent_belum_tl_november = $belum_tl_november / $total_rts_november * 100;
  307. }else{
  308. $percent_belum_tl_november = 0;
  309. $percent_sudah_tl_november = 0;
  310. }
  311. if (\App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',10)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count()) {
  312. $jumlah_rt_november = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',10)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  313. }else{
  314. $jumlah_rt_november = 0;
  315. }
  316. if ($jumlah_rt_november != 0) {
  317. $percent_jumlah_rt_november = $jumlah_rt_november / $total_rts_november * 100;
  318. }else{
  319. $percent_jumlah_rt_november = 0;
  320. }
  321. $tanggal_upload_november = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',10)->whereYear('bi_create_date',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->distinct()->value('updated_at');
  322. //Desember
  323. $paid_rts_desember = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',11)->whereYear('bi_create_date',$year)->where('status','paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  324. $nopaid_rts_desember = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',11)->whereYear('bi_create_date',$year)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  325. $total_rts_desember = $paid_rts_desember + $nopaid_rts_desember;
  326. $sudah_tl_desember = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',11)->whereYear('bi_create_date',$year)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('active',1)->count();
  327. $belum_tl_desember = $total_rts_desember - $sudah_tl_desember;
  328. if ($total_rts_desember != 0) {
  329. $percent_sudah_tl_desember = $sudah_tl_desember / $total_rts_desember * 100;
  330. $percent_belum_tl_desember = $belum_tl_desember / $total_rts_desember * 100;
  331. }else{
  332. $percent_belum_tl_desember = 0;
  333. $percent_sudah_tl_desember = 0;
  334. }
  335. if (\App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',11)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count()) {
  336. $jumlah_rt_desember = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',11)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->count();
  337. }else{
  338. $jumlah_rt_desember = 0;
  339. }
  340. if ($jumlah_rt_desember != 0) {
  341. $percent_jumlah_rt_desember = $jumlah_rt_desember / $total_rts_desember * 100;
  342. }else{
  343. $percent_jumlah_rt_desember = 0;
  344. }
  345. $tanggal_upload_desember = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',11)->whereYear('bi_create_date',$year)->select('updated_at')->where('active',1)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->distinct()->value('updated_at');
  346. ?>
  347. <tr>
  348. <td class="tg-0lax">JAN</td>
  349. <td>{{$total_rts_januari}}</td>
  350. <td>{{$paid_rts_januari}}</td>
  351. <td>{{$sudah_tl_januari}}</td>
  352. <td>{!! substr(strip_tags($percent_sudah_tl_januari), 0, 5) !!} %</td>
  353. <td>{{$belum_tl_januari}}</td>
  354. <td>{!! substr(strip_tags($percent_belum_tl_januari), 0, 5) !!} %</td>
  355. <td>{{$jumlah_rt_januari}}</td>
  356. <td>{!! substr(strip_tags($percent_jumlah_rt_januari), 0, 5) !!} %</td>
  357. <td>
  358. @if($tanggal_upload_januari)
  359. {{\Carbon\Carbon::parse($tanggal_upload_januari)
  360. ->format('d, M Y')}}
  361. @else
  362. Belum Mengirim
  363. @endif
  364. </td>
  365. </tr>
  366. <tr>
  367. <td class="tg-0lax">FEB</td>
  368. <td>{{$total_rts_februari}}</td>
  369. <td>{{$paid_rts_februari}}</td>
  370. <td>{{$sudah_tl_februari}}</td>
  371. <td>{!! substr(strip_tags($percent_sudah_tl_februari), 0, 5) !!} %</td>
  372. <td>{{$belum_tl_februari}}</td>
  373. <td>{!! substr(strip_tags($percent_belum_tl_februari), 0, 5) !!} %</td>
  374. <td>{{$jumlah_rt_februari}}</td>
  375. <td>{!! substr(strip_tags($percent_jumlah_rt_februari), 0, 5) !!} %</td>
  376. <td>
  377. @if($tanggal_upload_februari)
  378. {{\Carbon\Carbon::parse($tanggal_upload_februari)
  379. ->format('d, M Y')}}
  380. @else
  381. Belum Mengirim
  382. @endif
  383. </td>
  384. </tr>
  385. <tr>
  386. <td class="tg-0lax">MAR</td>
  387. <td>{{$total_rts_maret}}</td>
  388. <td>{{$paid_rts_maret}}</td>
  389. <td>{{$sudah_tl_maret}}</td>
  390. <td>{!! substr(strip_tags($percent_sudah_tl_maret), 0, 5) !!} %</td>
  391. <td>{{$belum_tl_maret}}</td>
  392. <td>{!! substr(strip_tags($percent_belum_tl_maret), 0, 5) !!} %</td>
  393. <td>{{$jumlah_rt_maret}}</td>
  394. <td>{!! substr(strip_tags($percent_jumlah_rt_maret), 0, 5) !!} %</td>
  395. <td>
  396. @if($tanggal_upload_maret)
  397. {{\Carbon\Carbon::parse($tanggal_upload_maret)
  398. ->format('d, M Y')}}
  399. @else
  400. Belum Mengirim
  401. @endif
  402. </td>
  403. </tr>
  404. <tr>
  405. <td class="tg-0lax">APR</td>
  406. <td>{{$total_rts_april}}</td>
  407. <td>{{$paid_rts_april}}</td>
  408. <td>{{$sudah_tl_april}}</td>
  409. <td>{!! substr(strip_tags($percent_sudah_tl_april), 0, 5) !!} %</td>
  410. <td>{{$belum_tl_april}}</td>
  411. <td>{!! substr(strip_tags($percent_belum_tl_april), 0, 5) !!} %</td>
  412. <td>{{$jumlah_rt_april}}</td>
  413. <td>{!! substr(strip_tags($percent_jumlah_rt_april), 0, 5) !!} %</td>
  414. <td>
  415. @if($tanggal_upload_april)
  416. {{\Carbon\Carbon::parse($tanggal_upload_april)
  417. ->format('d, M Y')}}
  418. @else
  419. Belum Mengirim
  420. @endif
  421. </td>
  422. </tr>
  423. <tr>
  424. <td class="tg-0lax">MEI</td>
  425. <td>{{$total_rts_mei}}</td>
  426. <td>{{$paid_rts_mei}}</td>
  427. <td>{{$sudah_tl_mei}}</td>
  428. <td>{!! substr(strip_tags($percent_sudah_tl_mei), 0, 5) !!} %</td>
  429. <td>{{$belum_tl_mei}}</td>
  430. <td>{!! substr(strip_tags($percent_belum_tl_mei), 0, 5) !!} %</td>
  431. <td>{{$jumlah_rt_mei}}</td>
  432. <td>{!! substr(strip_tags($percent_jumlah_rt_mei), 0, 5) !!} %</td>
  433. <td>
  434. @if($tanggal_upload_mei)
  435. {{\Carbon\Carbon::parse($tanggal_upload_mei)
  436. ->format('d, M Y')}}
  437. @else
  438. Belum Mengirim
  439. @endif
  440. </td>
  441. </tr>
  442. <tr>
  443. <td class="tg-0lax">JUN</td>
  444. <td>{{$total_rts_juni}}</td>
  445. <td>{{$paid_rts_juni}}</td>
  446. <td>{{$sudah_tl_juni}}</td>
  447. <td>{!! substr(strip_tags($percent_sudah_tl_juni), 0, 5) !!} %</td>
  448. <td>{{$belum_tl_juni}}</td>
  449. <td>{!! substr(strip_tags($percent_belum_tl_juni), 0, 5) !!} %</td>
  450. <td>{{$jumlah_rt_juni}}</td>
  451. <td>{!! substr(strip_tags($percent_jumlah_rt_juni), 0, 5) !!} %</td>
  452. <td>
  453. @if($tanggal_upload_juni)
  454. {{\Carbon\Carbon::parse($tanggal_upload_juni)
  455. ->format('d, M Y')}}
  456. @else
  457. Belum Mengirim
  458. @endif
  459. </td>
  460. </tr>
  461. <tr>
  462. <td class="tg-0lax">JUL</td>
  463. <td>{{$total_rts_juli}}</td>
  464. <td>{{$paid_rts_juli}}</td>
  465. <td>{{$sudah_tl_juli}}</td>
  466. <td>{!! substr(strip_tags($percent_sudah_tl_juli), 0, 5) !!} %</td>
  467. <td>{{$belum_tl_juli}}</td>
  468. <td>{!! substr(strip_tags($percent_belum_tl_juli), 0, 5) !!} %</td>
  469. <td>{{$jumlah_rt_juli}}</td>
  470. <td>{!! substr(strip_tags($percent_jumlah_rt_juli), 0, 5) !!} %</td>
  471. <td>
  472. @if($tanggal_upload_juli)
  473. {{\Carbon\Carbon::parse($tanggal_upload_juli)
  474. ->format('d, M Y')}}
  475. @else
  476. Belum Mengirim
  477. @endif
  478. </td>
  479. </tr>
  480. <tr>
  481. <td class="tg-0lax">AUG</td>
  482. <td>{{$total_rts_agustus}}</td>
  483. <td>{{$paid_rts_agustus}}</td>
  484. <td>{{$sudah_tl_agustus}}</td>
  485. <td>{!! substr(strip_tags($percent_sudah_tl_agustus), 0, 5) !!} %</td>
  486. <td>{{$belum_tl_agustus}}</td>
  487. <td>{!! substr(strip_tags($percent_belum_tl_agustus), 0, 5) !!} %</td>
  488. <td>{{$jumlah_rt_agustus}}</td>
  489. <td>{!! substr(strip_tags($percent_jumlah_rt_agustus), 0, 5) !!} %</td>
  490. <td>
  491. @if($tanggal_upload_agustus)
  492. {{\Carbon\Carbon::parse($tanggal_upload_agustus)
  493. ->format('d, M Y')}}
  494. @else
  495. Belum Mengirim
  496. @endif
  497. </td>
  498. </tr>
  499. <tr>
  500. <td class="tg-0lax">SEP</td>
  501. <td>{{$total_rts_september}}</td>
  502. <td>{{$paid_rts_september}}</td>
  503. <td>{{$sudah_tl_september}}</td>
  504. <td>{!! substr(strip_tags($percent_sudah_tl_september), 0, 5) !!} %</td>
  505. <td>{{$belum_tl_september}}</td>
  506. <td>{!! substr(strip_tags($percent_belum_tl_september), 0, 5) !!} %</td>
  507. <td>{{$jumlah_rt_september}}</td>
  508. <td>{!! substr(strip_tags($percent_jumlah_rt_september), 0, 5) !!} %</td>
  509. <td>
  510. @if($tanggal_upload_september)
  511. {{\Carbon\Carbon::parse($tanggal_upload_september)
  512. ->format('d, M Y')}}
  513. @else
  514. Belum Mengirim
  515. @endif
  516. </td>
  517. </tr>
  518. <tr>
  519. <td class="tg-0lax">OKT</td>
  520. <td>{{$total_rts_oktober}}</td>
  521. <td>{{$paid_rts_oktober}}</td>
  522. <td>{{$sudah_tl_oktober}}</td>
  523. <td>{!! substr(strip_tags($percent_sudah_tl_oktober), 0, 5) !!} %</td>
  524. <td>{{$belum_tl_oktober}}</td>
  525. <td>{!! substr(strip_tags($percent_belum_tl_oktober), 0, 5) !!} %</td>
  526. <td>{{$jumlah_rt_oktober}}</td>
  527. <td>{!! substr(strip_tags($percent_jumlah_rt_oktober), 0, 5) !!} %</td>
  528. <td>
  529. @if($tanggal_upload_oktober)
  530. {{\Carbon\Carbon::parse($tanggal_upload_oktober)
  531. ->format('d, M Y')}}
  532. @else
  533. Belum Mengirim
  534. @endif
  535. </td>
  536. </tr>
  537. <tr>
  538. <td class="tg-0lax">NOV</td>
  539. <td>{{$total_rts_november}}</td>
  540. <td>{{$paid_rts_november}}</td>
  541. <td>{{$sudah_tl_november}}</td>
  542. <td>{!! substr(strip_tags($percent_sudah_tl_november), 0, 5) !!} %</td>
  543. <td>{{$belum_tl_november}}</td>
  544. <td>{!! substr(strip_tags($percent_belum_tl_november), 0, 5) !!} %</td>
  545. <td>{{$jumlah_rt_november}}</td>
  546. <td>{!! substr(strip_tags($percent_jumlah_rt_november), 0, 5) !!} %</td>
  547. <td>
  548. @if($tanggal_upload_november)
  549. {{\Carbon\Carbon::parse($tanggal_upload_november)
  550. ->format('d, M Y')}}
  551. @else
  552. Belum Mengirim
  553. @endif
  554. </td>
  555. </tr>
  556. <tr>
  557. <td class="tg-0lax">DES</td>
  558. <td>{{$total_rts_desember}}</td>
  559. <td>{{$paid_rts_desember}}</td>
  560. <td>{{$sudah_tl_desember}}</td>
  561. <td>{!! substr(strip_tags($percent_sudah_tl_desember), 0, 5) !!} %</td>
  562. <td>{{$belum_tl_desember}}</td>
  563. <td>{!! substr(strip_tags($percent_belum_tl_desember), 0, 5) !!} %</td>
  564. <td>{{$jumlah_rt_desember}}</td>
  565. <td>{!! substr(strip_tags($percent_jumlah_rt_desember), 0, 5) !!} %</td>
  566. <td>
  567. @if($tanggal_upload_desember)
  568. {{\Carbon\Carbon::parse($tanggal_upload_desember)
  569. ->format('d, M Y')}}
  570. @else
  571. Belum Mengirim
  572. @endif
  573. </td>
  574. </tr>
  575. </table>
  576. <hr>
  577. </div>
  578. </center>
  579. </body>
  580. </html>