<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<link type="text/css" href="{{public_path()}}/dompdf-assets/receipts.css" rel="stylesheet" />
	<title>Release Voucher</title>
	<style type="text/css">
		table.receipt-content tr td{padding: 3px 10px;}
		.line-height-1 {line-height: 10px!important;}
		.line-height-12{line-height: 12px!important;}
		.margin-right-10{margin-right: 10px!important;}
	</style>
</head>
<!-- Page 1 of 1 -->
<body class="exo2-regular position-relative">
	<div id="page-background" class="overlay">
        <!-- <img src="images/progress-report-bg.jpg" height="100%" width="100%" style="position: absolute; width: 100%;z-index: -1;"> -->
     </div> 
	<div>
		<div class="col-xs-12 no-padding position-relative">
			<div class="clearfix" style="height: 20px;"></div>
			<div class="pdf-wrapper proximanova-regular">
				<div class="pdf-header" style="border: 0!important;">
                    <div>
						<table width="100%">
							<tr>
								<td width="50%" valign="top">
									<div class="eti-logo">
										<img src="{{public_path()}}/dompdf-assets/images/dps_logo.png" alt="" style="width: 260px;">
									</div>
								</td>
								<td width="50%" valign="top">
									<p class="primary-font-color px-12-font line-height-1 europa-bold">DAVAO PROPERTY SOLUTIONS</p>
									<p class=" px-12-font line-height-1">2F, LDI Bulding, #20 Road 1 corner Surveyor St.,</p>
									<p class=" px-12-font line-height-1">Dona Vicenta Village Bajada Davao City</p>
									<p class=" px-12-font line-height-1">(082) 327-3608</p>
									<p class=" px-12-font line-height-1">www.davaopropertysolutions.com</p>
								</td>
							</tr>
						</table>
				    </div>
				</div>
				<div class="pdf-wrapper pdf-body">
				    <div class="clearfix" style="height: 15px;"></div>
					{{--<p class="primary-font-color px-24-font line-height-1">AGENT COMMISSION VOUCHERS</p>--}}
					<p class="primary-font-color px-12-font line-height-1 europa-bold">RELEASE VOUCHER</p>
					<table width="100%" class="receipt-content px-11-font line-height-1">
                        <tr>
                            <td  style="width:25%">
                                <span id="">Client Name : <span class="label label-warning">{{$rcvd[0]->client_name?? '' }}</span></span><br>
                                <span id="">Developer   : {{$rcvd[0]->dev_name ?? ''}}</span><br>
                                <span id="">Project     : {{$rcvd[0]->prj_name ?? ''}}</span><br>
                                <span id="">Blk {{$rcvd[0]->blk ?? '' }} / Lot {{$rcvd[0]->lot ?? '' }}</span>
                            </td>
                            <td  style="width:25%">
                                <span id="">Selling Price : {{number_format($rcvd[0]->net_selling_price, 2) ?? 0 }}</span><br>
                                <span id="">Agent : <span class="label label-success">{{$rcvd[0]->agent_name ?? ''}}</span></span><br>
                                <span id="">Created By : {{$rcvd[0]->user_name ?? '' }}</span><br>
                                <span id="">Created At    : {{date("d-M-Y", strtotime($rcvd[0]->created_at))}}</span><br>
                            </td>
                            <td  style="width:25%">
                                <span>Manager Total Receivables : {{  number_format($sale_comm->um_com_rate,2) ?? 0 }}</span><br>
                                <span>Manager Total Released : {{ number_format((float) $ttl_rls[0]->ttl_release_mgr, 2) ?? 0  }}</span><br>
                                <span>Manager Comm Rate:  {{ number_format($sale_comm->um_pcg_rate,0) ?? 0 }}%</span><br>
                                <span>Remaining Receivables : {{  number_format($u_rem_rcvd,2) ?? 0 }}</span><br>
                            </td>
                            <td  style="width:25%">
                                <span>Agent Total Receivables : {{ number_format($sale_comm->agent_com_rate,2) ?? 0 }}</span><br>
                                <span>Agent Total Released : {{ number_format((float) $ttl_rls[0]->ttl_release, 2) ?? 0  }}</span><br>
                                <span>Agent Comm Rate:  {{ number_format($sale_comm->agent_pcg_rate,0) ?? 0 }}%</span><br>
                                <span>Remaining Receivables :{{ number_format($a_rem_rcvd,2) ?? 0 }}</span><br>
                            </td>
                        </tr>
                    </table>
					<div class="clearfix" style="height: 15px;"></div>
						<div class="clearfix"></div>
						<div class="clearfix" style="height: 15px;"></div>
                        <table width="100%" class="receipt-content px-10-font line-height-1">
							<tr style="background-color: #525252!important;color: #ffffff;">
								{{--<td width="12%">DATE</td>
								<td width="18%">PROJECT <br> (BLK / LOT)</td>
								<td width="15%">CLIENT NAME</td>
								<td width="18%">PARTICULARS</td>
								<td width="10%" class="text-center">RATE</td>
								<td width="12%" class="text-center">GROSS</td>
								<td width="12%" class="text-center">TAX AMT</td>
								<td width="12%" class="text-center">C/A PAYMENT</td>
								<td width="15%" class="text-center">NET COMM</td>--}}
								<td width="12%">Received Date</td>
                                <td width="10%">Remarks</td>
                                <td width="10%">Received Amount</td>
                                <td style="text-align: center">Agent %</td>
                                <td style="text-align: center">Agent Comm</td>
                                <td style="text-align: center">Manager %</td>
                                <td style="text-align: center">Manager Comm</td>
                                <td style="text-align: center">Broker %</td>
                                <td style="text-align: center">Broker Comm</td>
							</tr>
							{{--@foreach($rpts as $rpt)
								<tr>
								    <td>{{ date("d-M-Y H:i:s", strtotime($rpt->created_at)) ?? '' }}</td>
								    <td>{{$rpt->prj_name ?? ''}} <br> ({{$rpt->blk ?? ''}} | {{$rpt->lot ?? ''}})</td>
								    <td>{{$rpt->client_name ?? ''}}</td>
								    <td>{{$rpt->remarks ?? ''}}</td>
								    <td class="text-center">{{ number_format($rpt->agent_pcg_rate, 0) ?? 0 }}%</td>
								    <td class="text-right">{{ number_format($rpt->agent_com_rate,2) ?? 0 }}</td>
								    <td class="text-right">{{ number_format($rpt->taxx,2) ?? 0 }}</td>
								    <td class="text-right">{{ number_format($rpt->payment_adv,2) ?? 0 }}</td>
								    <td class="text-right">{{ number_format($rpt->net_comm,2) ?? 0 }}</td>
								</tr>
							@endforeach--}}
							@foreach($rdtls as $dtl)
                                <tr>
                                    {{--<td>{{$release->rcvd_id}}</td>--}}
                                    <td>{{date("d-M-Y", strtotime($dtl->created_at))}}</td>
                                    <td>{{$dtl->remarks}}</td>
                                    <td style="text-align: right">{{number_format($dtl->comm_amount,2)}}</td>
                                    <td style="text-align: right">{{number_format($dtl->agent_pcg_rate,2)}}</td>
                                    <td style="text-align: right">{{number_format($dtl->agent_com_rate,2)}}</td>
                                    <td style="text-align: right">{{number_format($dtl->um_pcg_rate,2)}}</td>
                                    <td style="text-align: right">{{number_format($dtl->um_com_rate,2)}}</td>
                                    <td style="text-align: right">{{number_format($dtl->broker_pcg_rate,2)}}</td>
                                    <td style="text-align: right">{{number_format($dtl->broker_com_rate,2)}}</td>
                                </tr>
                            @endforeach
						</table>
						<div class="clearfix" style="height: 10px;"></div>
						<div style="border-bottom: dotted #555555!important; width: 100%;"></div>
						<table width="100%" class="total-payment px-10-font line-height-1">
							<tr>
								{{--<td width="50%" valign="top">
									<table width="100%" class="total-payment px-14-font line-height-1">
										<tr>
											<td width="50%" class="text-justify px-10-font" style="padding-right: 10px;">
												{{--<span class="europa-bold">Note:</span>
												 {{--INSTALLMENT PAID FOR <span>{{ $data['id'] }} {{ strtoupper($data['email']) }}</span>
											</td>
										</tr>
									</table>
								</td>--}}
								{{--<td width="100%"></td>
								<td width="100%"></td>
                                <td width="50%"></td>--}}
								<td width="100%" valign="top">
									<table width="100%" class="total-payment px-10-font europa-bold" style="padding: 5px;">
									    {{$agent_comm = 0}}
                                        {{$manager_comm = 0}}
                                        {{$broker_com = 0}}
                                        {{$amt_rel = 0}}
                                        @foreach($rdtls as $rpt)
                                            {{ $agent_comm += $rpt->agent_com_rate }}
                                            {{ $manager_comm += $rpt->um_com_rate }}
                                            {{ $broker_com += $rpt->broker_com_rate }}
                                            {{ $amt_rel += $rpt->comm_amount }}
                                        @endforeach
										{{--<tr>
										    <td></td>
										</tr>--}}
										<tr>
										    <td width="7%"></td>
										    <td></td>
                                            <td class="text-right">{{number_format($amt_rel, 2) ?? 0}}</td>
                                            <td></td>
                                            <td class="text-right">{{number_format($agent_comm, 2) ?? 0}}</td>
                                            <td></td>
                                            <td class="text-right">{{number_format($manager_comm, 2) ?? 0}}</td>
                                            <td></td>
                                            <td class="text-right">{{number_format($broker_com, 2) ?? 0}}</td>
                                        </tr>
									</table>
								</td>
							</tr>
						</table>
				</div>
			</div>
			<div class="pdf-footer">
					<!-- This is footer section	 -->
					{{--<div style="margin-left:60px;margin-top:40px;">
					Receive By: _______________________
					</div>--}}
			</div>
		</div>
	</div>
</body>
<!-- End Page 1 of 1 -->
</html>