<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <!-- CSRF Token -->
  <meta name="csrf-token" content="{{ csrf_token() }}">

  <title>Laporan Ringkasan Terkumpul</title>

  <link rel="icon" type="image/x-icon" href="{{ asset('img/icon_pkb.png') }}" />


  <link href="{{ asset('css/all.min.css') }}" rel="stylesheet">
  
  <!-- Scripts -->
  <script src="{{ asset('js/app.js') }}" defer></script>

  <!-- Fonts -->
  <link rel="dns-prefetch" href="//fonts.gstatic.com">
  <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">

  <!-- Styles -->
  <link href="{{ asset('css/app.css') }}" rel="stylesheet">

</head>

<style>
  #header {
    font-family: Arial, Helvetica, sans-serif;
    border-collapse: collapse;
    width: 100%;
  }
  
  #header td, #customers th {
   
    padding:4px;
    font-size:10px;
  }
  
  #header tr:nth-child(even){background-color: #ffffff;}
  
  #header tr:hover {background-color: #ddd;}
  
  #header th {
    padding-top: 12px;
    padding-bottom: 12px;
    text-align: left;
    padding:4px;
    color:black;
  }
  .box{
    border:1px solid black;
    padding:3px;
  }
  </style>
  {{-- <link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet">
  <script src="{{ asset('js/bootstrap.bundle.min.js') }}"></script>
   --}}
  {{-- <table id="header">
    <tr>
      <th rowspan="4"  style="width:50px"><br><img src="{{ asset('img/ARRAHN1.png') }}" style="width:70px"></img></th>
      <th colspan="1">KOPERASI PERMODALAN KELANTAN BERHAD</th>
    </tr>
    <tr>
      <td>{{ $cawangan_detail['namacaw'] }}</td>
      <td></td>
    </tr>
    <tr>
      <td>{{ $cawangan_detail['alamat1'] }}</td>
      <td></td>
    </tr>
    <tr>
      <td>{{ $cawangan_detail['alamat2'].' No Tel : '. $cawangan_detail['notel'].' No Faks : '. $cawangan_detail['nofaks'] }}</td>
      <td></td>
    </tr>
  </table> --}}
  
  <h5 class="mb-4 pl-2 font-weight-bold">LAPORAN RINGKASAN TRANSAKSI TERKUMPUL - {{ $cawangan_detail['namacaw'] }}</h5>
  
  <p style="font-weight: bold;margin-left: 10px;">Tarikh Mula: {{ $mula_date }}  <span style="margin-left:20px;">Tarikh Hingga : {{ $hingga_date }}</span> <span style="margin-left:20px;">Tarikh Cetak : {{ $tarikh_cetak }}</span></p>
  
  <div class="row pl-4 pr-4 pb-4">
    <div class="col-7 box">
      <div class="row form-group">
          <div class="col-12">
            <p><b>A) TRANSAKSI TERKUMPUL</b></p>
          </div>
  
          <div class="col-5">1. PEMBIAYAAN</div>
          <div class="col-4">RM {{ number_format($laporan_ringkasan['total_gadai'],2) }}</div>
          <div class="col-3 font-weight-bold">{{ $laporan_ringkasan['bilangan_gadai'] }}</div>
         
          <div class="col-12">2. Penyelesaian Pem.</div>
  
          <div class="col-5 pl-5">a. <span style="font-size:14px;">PEMBIAYAAN DIBAYAR</span></div>
          <div class="col-4">{{ 'RM '. number_format($laporan_ringkasan['total_tebus'],2) }}</div>
          <div class="col-3 font-weight-bold">{{ $laporan_ringkasan['bilangan_tebus'] + $laporan_ringkasan['bilangan_lelong'] }}</div>
  
          <div class="col-5 pl-5">b. <span style="font-size:14px;">KEUNTUNGAN DIBAYAR</span></div>
          <div class="col-4">{{ 'RM '. number_format($laporan_ringkasan['upahsimpankaunter'],2) }}</div>
          <div class="col-3 font-weight-bold"></div>
  
          <div class="col-12">3. ANSURAN PEMBIAYAAN</div>
  
          <div class="col-5 pl-5">a. <span style="font-size:14px;">PEMBIAYAAN DIBAYAR</span></div>
          <div class="col-4">{{ 'RM '. number_format($laporan_ringkasan['total_ansuran'],2) }}</div>
          <div class="col-3 font-weight-bold">{{ $laporan_ringkasan['bilangan_ansuran'] }}</div>
  
          <div class="col-5 pl-5">b. <span style="font-size:14px;">KEUNTUNGAN DIBAYAR</span></div>
          <div class="col-4">{{ 'RM '. number_format($laporan_ringkasan['keuntungansebenarkaunter'],2) }}</div>
          <div class="col-3 font-weight-bold"></div>
  
          <div class="col-12">4. BAYARAN ONLINE</div>
  
          <div class="col-5 pl-5">a. <span style="font-size:14px;">PEMBIAYAAN DIBAYAR</span></div>
          <div class="col-4">{{ 'RM '. number_format($laporan_ringkasan['total_ansuranonline'],2) }}</div>
          <div class="col-3 font-weight-bold">{{ $laporan_ringkasan['bilangan_ansuranonline'] }}</div>
  
          <div class="col-5 pl-5">b. <span style="font-size:14px;">KEUNTUNGAN DIBAYAR</span></div>
          <div class="col-4">{{ 'RM '. number_format($laporan_ringkasan['total_keuntungan_online'],2) }}</div>
          <div class="col-3 font-weight-bold"></div>
  
          <div class="col-5">5. PELANGGAN BARU</div>
          <div class="col-4"></div>
          <div class="col-3 font-weight-bold">{{ $laporan_ringkasan['bilangan_customer_baru'] }}</div>
        
      </div>
    </div>
    <div class="col-5 box">
      <div class="row form-group">
          <div class="col-12">
            <p><b>B) PENDAHULUAN/SERAHAN HQ</b></p>
          </div>
  
          <div class="col-6">1. PENDAHULUAN</div>
          <div class="col-6">{{ 'RM '. number_format($laporan_ringkasan['totalpendahuluan'],2) }}</div>
         
          <div class="col-6">2. SERAHAN</div>
          <div class="col-6">{{ 'RM '. number_format($laporan_ringkasan['totalserahan'],2) }}</div>
         
          <div class="col-6">3. SERAHAN ONLINE</div>
          <div class="col-6">{{ 'RM '. number_format($laporan_ringkasan['serahanbayaranOnline'],2) }}</div>
        
      </div>
    </div>
  </div>
  
  <div class="row pl-4 pr-4 pb-4">
    <div class="col-7 box">

      <div class="row form-group">
        <div class="col-6">
          <p><b>C) LELONG</b></p>
        </div>
        <div class="col-6">
          <p><b>D) BAYARAN LELONG</b></p>
        </div>
        <div class="col-4">1. LELONG HARI INI</div>
        <div class="col-4">RM  {{ number_format($laporan_ringkasan['jumlah_lelong'],2) }}</div>
        <div class="col-4"></div>
        <div class="col-4">2. BAKI</div>
        <div class="col-2">RM {{ number_format($laporan_ringkasan['baki_lelong'],2) }}</div>
        <div class="col-3">{{ 'RM '. number_format($laporan_ringkasan['bayar_baki_lelong'],2) }}</div>
        <div class="col-4">3. RUGI</div>
        <div class="col-2">RM {{ number_format($laporan_ringkasan['rugi_lelong'],2) }}</div>
        <div class="col-3">{{ 'RM '. number_format($laporan_ringkasan['bayar_rugi_lelong'],2) }}</div>
        <div class="col-4">4. CAJ LELONG</div>
        <div class="col-4">RM {{ number_format($laporan_ringkasan['cas_lelong'],2) }}</div>
        <div class="col-3"></div>
        <div class="col-4">5. BIL</div>
        <div class="col-4">{{ $laporan_ringkasan['bilangan_lelong'] }}</div>
        <div class="col-4"></div>
      </div>

    </div>
    <div class="col-5 box">
      <div class="row form-group">
        <div class="col-12">
          <p><b>E) PERBELANJAAN</b></p>
        </div>
        <div class="col-6">1. BELANJA AM</div>
        <div class="col-6">{{ 'RM '. number_format($laporan_ringkasan['belanjaam'],2) }}</div>
        <div class="col-6">2. BAIKI DAN SELENGGARA</div>
        <div class="col-6">{{ 'RM '. number_format($laporan_ringkasan['baikidanselenggara'],2) }}</div>
        <div class="col-6">3. KERAIAN & PROMOSI</div>
        <div class="col-6">{{ 'RM '. number_format($laporan_ringkasan['keraian'],2) }}</div>
        <div class="col-6 font-weight-bold">4. JUMLAH</div>
        <div class="col-6 font-weight-bold">@php $total = $laporan_ringkasan['belanjaam'] + $laporan_ringkasan['baikidanselenggara'] + $laporan_ringkasan['keraian']; echo 'RM '. number_format($total,2); @endphp</div>
      </div>
    </div>
  </div>
      
  <div class="row pl-4 pr-4 pb-4">
    <div class="col-12 box">
      <div class="row">
        <div class="col-12">
          <p><b>F) PERATUSAN PEMBIAYAAN</b></p>
        </div>
      </div>
      <div class="row">
        <div class="col-12">
          <table class="table">
            <thead>
              <tr>
                <th></th>
                <th>MARGIN</th>
                <th>70%</th>
                <th>75%</th>
                <th>80%</th>
                <th>JUMLAH</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td>1</td>
                <td>PEMBIAYAAN</td>
                <td>RM {{ number_format($laporan_ringkasan['gadai_70'],2) }}</td>
                <td>RM {{ number_format($laporan_ringkasan['gadai_75'],2) }}</td>
                <td>RM {{ number_format($laporan_ringkasan['gadai_80'],2) }}</td>
                <td>RM {{ number_format($laporan_ringkasan['total_gadaian'],2) }}</td>
              </tr>
              <tr>
                <td>2</td>
                <td>NILAI MARHUN</td>
                <td>RM {{ number_format($laporan_ringkasan['nilaimarhun_70'],2) }}</td>
                <td>RM {{ number_format($laporan_ringkasan['nilaimarhun_75'],2) }}</td>
                <td>RM {{ number_format($laporan_ringkasan['nilaimarhun_80'],2) }}</td>
                <td>RM {{ number_format($laporan_ringkasan['total_nm'],2) }}</td>
              </tr>
              <tr>
                <td>3</td>
                <td>BILANGAN</td>
                <td>{{ $laporan_ringkasan['bilangan_70'] }}</td>
                <td>{{ $laporan_ringkasan['bilangan_75'] }}</td>
                <td>{{ $laporan_ringkasan['bilangan_80'] }}</td>
                <td>{{ number_format($laporan_ringkasan['total_bilangan']) }}</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
  
  <div class="row p-4">
    <div class="col-6 text-center">
      <div class="row mb-5">
        <div class="col-12">DISEMAK</div>
      </div>
      <div class="row">
        <div class="col-12">................................................</div>
      </div>
    </div>
    <div class="col-6 text-center">
      <div class="row mb-5">
        <div class="col-12">DISAHKAN</div>
      </div>
      <div class="row">
        <div class="col-12">................................................</div>
      </div>
    </div>
  </div>