<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 rel="stylesheet" href="{{ asset('vendor/bootstrap/css/bootstrap.min.css') }}">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="{{ asset('vendor/bootstrap/js/bootstrap.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 HARIAN - {{ $cawangan_detail['namacaw'] }}</h5>

<p style="font-weight: bold;margin-left: 10px;">Tarikh : {{ $ringkasan_date }} <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 HARIAN</b></p>
        </div>

        <div class="col-5">1. PEMBIAYAAN</div>
        <div class="col-4">{{ 'RM '. number_format($laporan['total_gadai'],2) }}</div>
        <div class="col-3 font-weight-bold">{{ $laporan['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['total_tebus'],2) }}</div>
        <div class="col-3 font-weight-bold">{{ $laporan['bilangan_tebus'] + $laporan['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['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['total_ansuran'],2) }}</div>
        <div class="col-3 font-weight-bold">{{ $laporan['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['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['total_ansuranonline'],2) }}</div>
        <div class="col-3 font-weight-bold">{{ $laporan['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['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['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['totalpendahuluan'],2) }}</div>
       
        <div class="col-6">2. SERAHAN</div>
        <div class="col-6">{{ 'RM '. number_format($laporan['totalserahan'],2) }}</div>
       
        <div class="col-6">3. SERAHAN ONLINE</div>
        <div class="col-6">{{ 'RM '. number_format($laporan['serahanbayaranOnline'],2) }}</div>
      
    </div>
  </div>
</div>

<div class="row pl-4 pr-4 pb-4">
  <div class="col-6 box">
    <div class="row form-group">
      <div class="col-12">
        <p><b>C) WANG PETI BESI</b></p>
      </div>
      <div class="col-6">1. BAKI AKHIR</div>
      <div class="col-6">{{ 'RM '. number_format($laporan['petibesi_sistem'],2) }}</div>
      <div class="col-6">2. TUNAI DI TANGAN</div>
      <div class="col-6">{{ 'RM '. number_format($laporan['petibesiimbangduga'],2) }}</div>
      <div class="col-6 d-none">3. DENOMINASI</div>
      <div class="col-6 d-none">{{ 'RM '. number_format($laporan['petibesi_deno'],2) }}</div>
    </div>
  </div>
  <div class="col-6 box">
    <div class="row form-group">
      <div class="col-12">
        <p><b>D) PERBELANJAAN</b></p>
      </div>
      <div class="col-6">1. HARI INI</div>
      <div class="col-6">{{ 'RM '. number_format($laporan['panjar_harian'],2) }}</div>
      <div class="col-6">2. BULANAN</div>
      <div class="col-6">{{ 'RM '. number_format($laporan['panjar_bulanan'],2) }}</div>
      <div class="col-6">3. TAHUNAN</div>
      <div class="col-6">{{ 'RM '. number_format($laporan['panjar_tahunan'],2) }}</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>E) OUTSTANDING</b></p>
      </div>
    </div>
    <div class="row">
      <div class="col-12">
        <table class="table text-center" style="font-size:15px;">
          <thead>
            <tr>
              <th></th>
              <th></th>
              <th class="text-uppercase">Pembiayaan (RM)</th>
              <th class="text-uppercase">Pinjaman (RM)</th>
              <th class="text-uppercase">Ansuran Pemb. (RM)</th>
              <th class="text-uppercase">NM Pemb. (RM)</th>
              <th class="text-uppercase">Bil Pemb.</th>
              <th class="text-uppercase">Bil Pinj.</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>1</td>
              <td>IMBANG DUGA</td>
              <td>{{ number_format($laporan['rekodpemb'],2) }}</td>
              <td>{{ number_format($laporan['rekodpinj'],2) }} </td>
              <td>{{ number_format($laporan['bayaranpend'],2) }} </td>
              <td>{{ number_format(($laporan['rekodpembnm'] + $laporan['rekodpinjnm']),2) }}</td>
              <td>{{ number_format($laporan['rekodpembbil'],0) }}</td>
              <td>{{ number_format($laporan['rekodpinjbil'],0) }}</td>
            </tr>
            <tr {{ ($ringkasan_date == $tarikh_cetak) ? '' : 'class=d-none' }}>
              <td>2</td>
              <td>STOK AUDIT</td>
              <td>{{  number_format($laporan['stokauditpembiayaan'],2) }}</td>
              <td></td>
              <td></td>
              <td>{{ number_format($laporan['stokauditnilaimarhun'],2) }} </td>
              <td> </td>
              <td>{{ number_format($laporan['stokauditcount']) }}</td>
            </tr>
            <tr class="d-none">
              <td>3</td>
              <td>KAWALAN STOK</td>
              <td>{{ number_format($totalpinjkawalanstok,2) }}</td>
              <td> Not Applicable </td>
              <td>{{ number_format($totalbilkawalanstok,0) }}</td>
              <td> Not Applicable </td>
              <td> Not Applicable </td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div>

<div class="row pl-4 pr-4 pb-4">
  <div class="col-12 box">
    <div class="row form-group">
      <div class="col-6">
        <p><b>F) LELONG</b></p>
      </div>
      <div class="col-6">
        <p><b>G) BAYARAN LELONG</b></p>
      </div>
      <div class="col-4">1. LELONG HARI INI</div>
      <div class="col-4">{{ 'RM '. number_format($laporan['jumlah_lelong'],2) }}</div>
      <div class="col-4"></div>
      <div class="col-4">2. BAKI</div>
      <div class="col-2">{{ 'RM '. number_format($laporan['baki_lelong'],2) }}</div>
      <div class="col-3">{{ 'RM '. number_format($laporan['bayar_baki_lelong'],2) }}</div>
      <div class="col-4">3. RUGI</div>
      <div class="col-2">{{ 'RM '. number_format($laporan['rugi_lelong'],2) }}</div>
      <div class="col-3">{{ 'RM '. number_format($laporan['bayar_rugi_lelong'],2) }}</div>
      <div class="col-4">4. CAJ LELONG</div>
      <div class="col-4">{{ 'RM '. number_format($laporan['cas_lelong'],2) }}</div>
      <div class="col-3"></div>
      <div class="col-4">5. BIL</div>
      <div class="col-4">{{ $laporan['bilangan_lelong'] }}</div>
      <div class="col-4"></div>
    </div>
  </div>
  {{-- <div class="col-6 box">
    <div class="row form-group">
      <div class="col-12">
        <p><b>G) BAYAR BAKI LELONG</b></p>
      </div>
      <div class="col-6">1. BAKI LELONG</div>
      <div class="col-6">{{ 'RM '. number_format($laporan['bayar_baki_lelong'],2) }}</div>
      <div class="col-6">2. RUGI LELONG</div>
      <div class="col-6">{{ 'RM '. number_format($laporan['bayar_rugi_lelong'],2) }}</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>H) 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['gadai_70'],2) }}</td>
              <td>{{ 'RM '. number_format($laporan['gadai_75'],2) }}</td>
              <td>{{ 'RM '. number_format($laporan['gadai_80'],2) }}</td>
              <td>{{ 'RM '. number_format($laporan['total_gadaian'],2) }}</td>
            </tr>
            <tr>
              <td>2</td>
              <td>NILAI MARHUN</td>
              <td>{{ 'RM '. number_format($laporan['nilaimarhun_70'],2) }}</td>
              <td>{{ 'RM '. number_format($laporan['nilaimarhun_75'],2) }}</td>
              <td>{{ 'RM '. number_format($laporan['nilaimarhun_80'],2) }}</td>
              <td>{{ 'RM '. number_format($laporan['total_nm'],2) }}</td>
            </tr>
            <tr>
              <td>3</td>
              <td>BILANGAN</td>
              <td>{{ $laporan['bilangan_70'] }}</td>
              <td>{{ $laporan['bilangan_75'] }}</td>
              <td>{{ $laporan['bilangan_80'] }}</td>
              <td>{{ number_format($laporan['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>