print-upt-bulan-tahun-not-paid.blade.php 34 KB

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