<style>
#header {
  /* font-family: Arial, Helvetica, sans-serif; */
  border-collapse: collapse;
  width: 100%;
}

#header td, #customers th {
 
  padding-left:4px;
  font-size:12px;
}

#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;
}
</style>




<style>
#scan {
  /* font-family: Arial, Helvetica, sans-serif; */
  border-collapse: collapse;
  width: 100%;
}

#scan td, #scan th {
 
  padding: 8px;
  font-size:11px;
}

#scan tr:nth-child(even){background-color: #ffffff;}

#scan tr:hover {background-color: #ddd;}

#scan th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  padding:4px;
  color:black;
}
</style>


<style>
#scan {
  /* font-family: Arial, Helvetica, sans-serif; */
  border-collapse: collapse;
  width: 100%;
}

#scan td, #scan th {
  border-collapse: collapse;
  padding: 8px;
  font-size:11px;
}

#scan tr:nth-child(even){background-color: #ffffff;}

#scan tr:hover {background-color: #ddd;}

#scan th {
  border-collapse: collapse;
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  padding:4px;
  color:black;
}
</style>



<style>
#details {
  /* font-family: Arial, Helvetica, sans-serif; */
  border-collapse: collapse;
  width: 100%;
}

#details td, #details th {
 
  padding: 8px;
  font-size:11px;
}

#details tr:nth-child(even){background-color: #ffffff;}

#details tr:hover {background-color: #ddd;}

#details th {
  padding-top: 12px;
 font-style:bold;
  padding-bottom: 12px;
  text-align: left;
  padding:4px;
  color:black;
}
.container{
  page-break-after:always;
  padding: 20px 20px 20px 20px;
}
.tablestyle{
  font-size:12px;
}
.tablestyle td, .tablestyle th{
  /* padding-top: 12px; */
  /* border:1px solid black; */

}
</style>

@foreach($lelong as $index=>$lel)
<div class="container">
  <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">{{ $cawangan_detail['namacaw'] }}</th>
    </tr>
    <tr>
      <td style="vertical-align:top;">{{ $cawangan_detail['alamat1'] }}</td>
      <td></td>
    </tr>
    <tr>
      <td style="vertical-align:top;">{{ $cawangan_detail['alamat2'] }}</td>
      <td></td>
    </tr>
    <tr>
      <td style="vertical-align:top;">{{ ' No Tel : '. $cawangan_detail['notel'] . ' No Faks : '. $cawangan_detail['nofaks'] }}</td>
      <td></td>
    </tr>
  </table>
  <br>


  <div>
    <table class="tablestyle">
      <tr>
        <td><br></td>
      </tr>
      <tr>
        <td>TARIKH CETAK</td>
        <td>:</td>
        <td>@php 
          $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak);
              $datez = $myDateTime->format('d-m-Y');
              echo($datez);
          @endphp</td>
        <td> </td>
        <td>NO TELEFON</td>
        <td width="1%">:</td>
        <td>{{ $lel['telefon1'] }}</td>
      </tr>
      <tr>
        <td style="vertical-align:top;">KEPADA</td>
        <td style="vertical-align:top;">:</td>
        <td style="vertical-align:top;">{{ $lel['nama'] }}<br> {{ strtoupper($lel['alamat']) }} <br> {{ ' ' . $lel['poskod'] . ' ' . strtoupper($lel['daerah']) . ' ' . strtoupper($lel['negeri'])}}</td>
        <td></td>
        <td style="vertical-align:top;">NO K/P</td>
        <td style="vertical-align:top;">:</td>
        <td style="vertical-align:top;"> {{ $lel['IC'] }}</td>
      </tr>
    </table>

    <p>Tuan/Puan,</p>
    <h4 style="text-decoration: underline;">LEBIHAN WANG LELONGAN BARANGAN</h4>
   
    <p>Dimaklumkan bahawa barang pembiayaan tuan/puan <b>{{ $lel['norujukan'] }}</b>telah dilelong pada @php 
      $myDateTime = DateTime::createFromFormat('Y-m-d', $lel['tarikhlelong']);
          $datez = $myDateTime->format('d-m-Y');
          echo($datez);

      @endphp</p>

    <p>Tuan/puan hendaklah datang untuk mengambil wang lebihan seperti di bawah:-</p>
    
    <table>
      <tr>
        <td>Harga Lelongan</td>
        <td>:</td>
        <td>{{ number_format($lel['hargajual'],2) }}</td>
      </tr>
      @if($taxation == true)
      <tr>
        <td>GST 6% (harga jual)</td>
        <td>:</td>
        <td>{{ ($lel['gst_hj']) ? $lel['gst_hj'] : number_format(0.00,2) }}</td>
      </tr>
      @endif
      <tr>
        <td><b>Tolak</b></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td>
          <table>
            @if($taxation == true)
            <tr>
              <td>GST 6% (harga jual)</td>
              <td>:</td>
              <td>{{ ($lel['gst_hj']) ? number_format($lel['gst_hj'],2) : number_format(0,2) }}</td>
            </tr>
            @endif
            <tr>
              <td>Baki Pembiayaan</td>
              <td>:</td>
              <td>{{ number_format($lel['bakipjm'],2) }}</td>
            </tr>
            <tr>
              <td>Baki Upah Simpan</td>
              <td>:</td>
              <td>{{ number_format($lel['bakiupah'],2) }}</td>
            </tr>
            <tr>
              <td>Caj Lelongan</td>
              <td>:</td>
              <td>{{ number_format($lel['cajlelong'],2) }}</td>
            </tr>
            @if($taxation == true)
            <tr>
              <td>GST 6% (caj lelong)</td>
              <td>:</td>
              <td>{{ ($lel['gst_cl']) ? number_format($lel['gst_cl'],2) : number_format(0,2) }}</td>
            </tr>
            <tr>
            @endif
              <td>Lain-Lain Caj</td>
              <td>:</td>
              <td>{{ ($lel['cajlain']) ? number_format($lel['cajlain'],2) : number_format(0,2) }}</td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td><b>Wang Lebihan (RM)</b></td>
        <td>:</td>
        <td>{{ number_format($lel['baki'],2) }}</td>
      </tr>
    </table>
    <br>


    <p align="justify">Jika tuan/puan gagal menuntut wang lebihan (sekiranya ada) dalam masa empat bulan dari tarikh surat ini, wang lebihan tersebut akan diserahkan kepada Akauntan
      Negara (Seksyen 25(1) Akta Pemegang Pajak Gadai 1992). Tuan/puan diminta membawa <b>Kad Pengenalan dan Surat Akuan Gadai</b> semasa membuat tuntutan wang tersebut.
    </p>
    <br>
    <p>Sekian, terima kasih.</p>

    <br>
    <i>*Surat ini adalah cetakan komputer dan tiada tandatangan diperlukan</i>

  </div>
</div>
@endforeach
