@extends('layouts.print')

@section('content')
	<div class="main-content-wrapper">
		<div class="main-box">
			<div class="main-content">
				<div class="container">
					<div class="page">
						<div class="row">
							<div class="report-capital layout-print">
								<div class="header">
									<div class="logo">
										<img src="{{asset('assets/images/resize')}}/{{$branch->branch_img}}" alt="" width="150px">
									</div>
									<div class="title">
										<h2>{{$branch->branch_kh}}</h2>
										<h2>{{$branch->branch_en}}</h2>
										<h3>របាយការណ៍អតិថិជនបង់​ប្រាក់យឺត</h3>
									</div>
									<div class="clear"></div>
									<div class="border-bottom"></div>
									<div class="table">
										<table>
											<thead>
											<tr>
												<th>No</th>
												<th>Date Payment</th>
												<th>Project Name</th>
												<th>Item Name</th>
												<th>Client Name</th>
												<th>Phone</th>
												<th>Disbursement Date</th>
												<th>Days Late</th>
												<th>Principle OS</th>
												<th>Principle Arrear</th>
												<th>Interest Arrear</th>
											</tr>
											</thead>
											<tbody>
											@foreach($payment_arrear as $key => $value)
												<tr>
													<td>{{$key+1}}</td>
													<td>{{date('d-m-Y',strtotime($value->loanprocess_datepayment))}}</td>
													<td>{{$value->project_name}}</td>
													<td>{{$value->item_name}}</td>
													<td>{{$value->client_fullname}}</td>
													<td>{{$value->client_phone1}}</td>
													<td>{{date('d-m-Y',strtotime($value->loan_disbursement))}}</td>
													<td>{{$value->day_late}}</td>
													<td>${{number_format($value->loan_amountos,2)}}</td>
													<td>${{number_format($value->loanprocess_principle,2)}}</td>
													<td>${{number_format($value->loanprocess_interest,2)}}</td>
												</tr>
											@endforeach()
												<tr>
													<th colspan="8" style="text-align: right !important;">Total</th>
													<th>${{number_format($total_payment,2)}}</th>
													<th>${{number_format($total_principle,2)}}</th>
													<th>${{number_format($total_interest,2)}}</th>
												</tr>
											</tbody>
										</table>
										<div class="make-date">
											<p>ធ្វើនៅ​ <strong>ភ្នំពេញ</strong> ថ្ងៃទី <strong>{{\Globals::date_khmers(date('Y-m-d'))}}</strong></p>
										</div>
										<div class="sign">
											<h3>ហត្ថលេខា</h3>
											<p>_________________</p>
										</div>
									</div>
								</div>
							</div>


						</div>


					</div>
				</div>
			</div>
		</div>
	</div>

@endsection


