print-seluruh-upt-bulan-tahun-not-paid.blade.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style>
  5. .table-bordered {
  6. border-collapse: collapse;
  7. width: 100%;
  8. }
  9. .table-bordered td, .table-bordered th {
  10. border: 1px solid black;
  11. padding: 8px;
  12. }
  13. .thead-light{
  14. background-color: #E9ECEF;
  15. }
  16. .table-bordered th {
  17. padding-top: 12px;
  18. padding-bottom: 12px;
  19. text-align: left;
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <?php
  25. $getStatus = \App\Model\Privillage\Role::where('id',Auth::user()->role_id)->value('akses');
  26. ?>
  27. @if($getStatus == 'administrator')
  28. <?php
  29. $listUpt = \App\Model\Setting\UPT::select('office_id','office_name','province_name')->distinct()->get();
  30. if($month == 1){
  31. $fixMonth = 12;
  32. $fixYear = $year - 1;
  33. } else{
  34. $fixMonth = $month - 1;
  35. $fixYear = $year;
  36. }
  37. ?>
  38. @endif
  39. <center>
  40. <div>
  41. <hr>
  42. <h2 class="font-weight-bolder">Data Status Tagihan {{date('d F Y')}}</h2>
  43. <hr>
  44. <table id="example" class="table table-bordered align-items-center">
  45. <thead class="thead-light">
  46. <tr>
  47. <th class="tg-0pky" colspan="3"></th>
  48. <th class="tg-0lax" colspan="4" style="background-color: #63a53a; color: #fff; text-align: center;">ST BELUM TERBAYAR (H-30 s.d H)</th>
  49. <th class="tg-0lax" colspan="3" style="background-color: #ff1228; color: #fff;">ST TIDAK TERBAYAR (MENJADI REMINDER)</th>
  50. </tr>
  51. <tr>
  52. <td class="tg-0lax">UPT</td>
  53. <td class="tg-0lax">TOTAL ST TERBIT</td>
  54. <td class="tg-0lax">ST TERBAYAR</td>
  55. <td class="tg-0lax">SUDAH DI-TL UPT</td>
  56. <td class="tg-0lax">%</td>
  57. <td class="tg-0lax">BELUM DI-TL UPT</td>
  58. <td class="tg-0lax">%</td>
  59. <td class="tg-0lax">JUMLAH ST</td>
  60. <td class="tg-0lax">%</td>
  61. <td class="tg-0lax">Tanggal Upload</td>
  62. </tr>
  63. </thead>
  64. <tbody>
  65. @foreach($listUpt as $key => $value)
  66. <tr>
  67. <td class="tg-0lax">{{$value->office_name}}</td>
  68. <?php
  69. $paid_rts = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',$fixMonth)->whereYear('bi_create_date',$fixYear)->where('status','paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('upt',$value->office_name)->count();
  70. $nopaid_rts = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',$fixMonth)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('upt',$value->office_name)->count();
  71. $total_rts = $paid_rts + $nopaid_rts;
  72. $sudah_tl = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',$fixMonth)->whereYear('bi_create_date',$fixYear)->where('upt',$value->office_name)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('active',1)->count();
  73. $belum_tl = $total_rts - $sudah_tl;
  74. $tanggal_upload = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',$fixMonth)->whereYear('bi_create_date',$fixYear)->where('upt',$value->office_name)->where('active',1)->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->select('updated_at')->distinct()->value('updated_at');
  75. $jumlah_rt = \App\Model\SPP\RincianTagihan::whereMonth('bi_create_date',$fixMonth)->whereYear('bi_create_date',$fixYear)->where('status','not paid')->where('status_izin','Perpanjangan')->where('bi_type',$bi_type)->where('upt',$value->office_name)->count();
  76. ?>
  77. <td>{{$total_rts}}</td>
  78. <td>{{$paid_rts}}</td>
  79. <td>{{$sudah_tl}}</td>
  80. <td>0 %</td>
  81. <td>{{$belum_tl}}</td>
  82. <td>0 %</td>
  83. <td>{{$jumlah_rt}}</td>
  84. <td>0 %</td>
  85. <td>
  86. @if($tanggal_upload)
  87. {{\Carbon\Carbon::parse($tanggal_upload)
  88. ->format('d, M Y')}}
  89. @else
  90. Belum Mengirim
  91. @endif
  92. </td>
  93. </tr>
  94. @endforeach
  95. </tbody>
  96. </table>
  97. <hr>
  98. </div>
  99. </center>
  100. </body>
  101. </html>