@extends('layouts.print')

<head>
    <style>
        tr, td {font-size:1.75rem; }
    
        @page {
            size: A4;
            margin-top: 12mm ;
            margin-bottom: 15mm ;
            margin-left: 5mm;
            margin-right: 5mm;    

            @bottom-center {
                content: counter(page);
            }
        }
        
        @page :left: header {
            content: "Page " decimal(pageno), , first(chapter);
            font-variant: small-caps
        }
        @page :right :header {
            content: last(section), , "Page " decimal(pageno);
            font-variant: small-caps
        }    
    
        table.report-container {
            page-break-after:always;
        }
        thead.report-header {
            display:table-header-group;
        }
        tfoot.report-footer {
            display:table-footer-group;
        }    
    
        #tblisi th,td, tr { border-bottom:1px black solid; font-size:15px; padding-top:6px;padding-bottom:5px; }
        #tbl__2 th,td { border-bottom:none; font-size:18px; }
        
    </style>    
</head>

<body>
        
    <script type="text/javascript">
         //window.onload = addPageNumbers;

        function addPageNumbers() {
            var totalPages = Math.ceil(document.body.scrollHeight / 600);  //842px A4 pageheight for 72dpi, 1123px A4 pageheight for 96dpi, 
            for (var i = 1; i <= totalPages; i++) {
              var pageNumberDiv = document.createElement("div");
              var pageNumber = document.createTextNode("Page " + i + " of " + totalPages);
              pageNumberDiv.style.position = "absolute";
              pageNumberDiv.style.marginTop = "calc((" + i + " * (297mm )) - 400mm - 0.5px)"; //297mm A4 pageheight; 0,5px unknown needed necessary correction value; additional wanted 40px margin from bottom(own element height included)
              pageNumberDiv.style.marginTop = 1000px;
              pageNumberDiv.style.marginRight = 50px;
              pageNumberDiv.style.height = "16px";
              pageNumberDiv.appendChild(pageNumber);
              document.body.insertBefore(pageNumberDiv, document.getElementById("content"));
              pageNumberDiv.style.left = "calc(100% - (" + pageNumberDiv.offsetWidth + "px + 20px))";
            }
          }
    </script>


@section('title')
    Rekap Biaya &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

  	<!--a onclick="window.location='{{ route('home') }}'" class="btn btn-primary"><i class="fa fa-home"></i> Home </a-->
	<a onclick="window.history.go(-1)" class="btn btn-warning"><i class="fa fa-undo"></i> Back </a> 
	<a onclick="myFunction()" class="btn btn-success"><i class="fa fa-print"></i>Print Report</a>
    <!--a onclick="printmatrix()" class="btn btn-success"><i class="fa fa-print"></i>Print Faktur</a-->

    <script>
        function myFunction() {
          window.print();
        }
    </script>
@endsection

@section('breadcrumb')
   @parent
     <li>rekap biaya</li>
@endsection

@section('content')

<h4>REPORT KAS</h4>
<h4 style="margin-top:-25px;" class="text-right">Periode Kas : {{ $kas->periode }}</h5>
<h4 style="margin-top:-10px;">{{ $kas->deskripsi }}</h5>

<table class="report-container" cellspacing="5" cellpadding="5"  style="width:100%;" id="tblisi">
<!--table class="table table-responsive" style="width:auto; margin:auto" id="tblisi"-->   
    <thead class="report-header">  
    
        <tr border="1">
         	<th width="80" class="text-center">Tanggal</th>
        	<th width="75" class="text-center">No.Acct</th>
        	<th width="35" class="text-left">PRJ</th>
        	<th width="200" class="text-left">Keterangan</th>
        	<th width="90" class="text-right">DEBET</th>
        	<th width="90" class="text-right">KREDIT</th>
        	<th width="90" class="text-right">SALDO</th>
        </tr>
    </thead>
    
	<tbody>
		@foreach($data as $row)    
			<tr>
				@foreach($row as $col=>$value)
				    @if( $col==0 || $col==1 )
				        <td class="text-center" style="margin-top:4px; margin-bottom:4px; font-size:15px;">{{ $value }}</td>
				    @endif
				    
				    @if( $col==2 || $col==3)
				        <td class="text-left" style="margin-top:4px; margin-bottom:4px; font-size:15px;">{{ $value }}</td>
				    @endif
				    
					@if( $col==4 || $col==5 || $col==6)
						<td class="text-right" style="margin-top:4px; margin-bottom:4px;font-size:15px;">{{ $value }}</td>
					@endif
		
				@endforeach
			</tr>
		@endforeach 
		
	</tbody>

    <tr><td>&nbsp;</td></tr>    
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td>Total</td>
        <td class="text-right" style="font-size:15px;font-weight:bold">{{ format_uang($awal+$tldb) }}</td>
        <td class="text-right" style="font-size:15px;font-weight:bold">{{ format_uang($tlcr) }}</td>
        <td class="text-right" style="font-size:15px;font-weight:bold">{{ format_uang($awal+$tldb-$tlcr) }}</td>
    </tr>
    
<!--    
    <tr>
        <td colspan="1">&nbsp;</td>
        <td>Kasir</td>
        <td>&nbsp;</td>
		<td>Pemeriksa</td>
	</tr>    
	<tr>
	    <td></td>
		<td>&nbsp;</td>
	    <td>&nbsp;</td>
	    <td></td>
	</tr>
	<tr>
	    <td></td>
		<td>&nbsp;</td>
	    <td>&nbsp;</td>
	    <td></td>
	</tr>
	<tr>
	    <td colspan="2">&nbsp;</td>
        <td>__________________</td>
        <td>&nbsp;</td>
		<td>__________________</td>		
    </tr>	
-->
	
<tfoot class="report-footer">
    
</tfoot>


</table>


@endsection

