<!DOCTYPE html>
<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>Quarterly Sales Report</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-14-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">
					<p class="primary-font-color px-24-font line-height-1">QUARTERLY SALES SUMMARY</p>
					<div class="clearfix" style="height: 15px;"></div>

						<div class="clearfix" style="height: 15px;"></div>
						<table width="100%" class="receipt-content px-14-font line-height-1">
							<tr style="background-color: #525252!important;color: #ffffff;">
								<td width="12%" class="text-center">QUARTER</td>
								<td width="15%" class="text-center">YEAR</td>
								<td width="15%">MONTH</td>
								<td width="20%" class="text-center">GROSS SALES</td>
								<td width="20%" class="text-center">NET SALES</td>
							</tr>
							    {{$ttl_amt1 = 0}}
							    {{$net_amt1 = 0}}
							@foreach($qtr1 as $q1)
							    {{$ttl_amt1 += $q1->ttl_amt }}
							    {{$net_amt1 += $q1->net_amt }}
								<tr>
                                    <td class="text-center">{{ $q1->quarter }}</td>
                                    <td class="text-center">{{ $q1->year }}</td>
                                    <td>{{ $q1->month }}</td>
									<td class="text-right">{{ number_format($q1->ttl_amt,2) }}</td>
									<td class="text-right">{{ number_format($q1->net_amt,2) }}</td>
								</tr>
							@endforeach
							    <tr>
							    <div style="border-bottom: dotted #555555!important; width: 100%;"></div>
							        <td></td>
							        <td>1ST QUARTER TOTAL</td>
							        <td class="text-right">{{number_format($ttl_amt1, 2)}}</td>
							        <td class="text-right">{{number_format($net_amt1, 2)}}</td>
							    </tr>
						</table>

						<div class="clearfix" style="height: 15px;"></div>
                        <table width="100%" class="receipt-content px-14-font line-height-1">
                            <tr style="background-color: #525252!important;color: #ffffff;">
                                <td width="12%" class="text-center">QUARTER</td>
                                <td width="15%" class="text-center">YEAR</td>
                                <td width="15%">MONTH</td>
                                <td width="20%" class="text-center">GROSS SALES</td>
                                <td width="20%" class="text-center">NET SALES</td>
                            </tr>
                                {{$ttl_amt2 = 0}}
                                {{$net_amt2 = 0}}
                            @foreach($qtr2 as $q2)
                                {{$ttl_amt2 += $q2->ttl_amt }}
                                {{$net_amt2 += $q2->net_amt }}
                                <tr>
                                    <td class="text-center">{{ $q2->quarter }}</td>
                                    <td class="text-center">{{ $q2->year }}</td>
                                    <td>{{ $q2->month }}</td>
                                    <td class="text-right">{{ number_format($q2->ttl_amt,2) }}</td>
                                    <td class="text-right">{{ number_format($q2->net_amt,2) }}</td>
                                </tr>
                            @endforeach
                                <tr>
                                <div style="border-bottom: dotted #555555!important; width: 100%;"></div>
                                    <td></td>
                                    <td>2ND QUARTER TOTAL</td>
                                    <td class="text-right">{{number_format($ttl_amt2, 2)}}</td>
                                    <td class="text-right">{{number_format($net_amt2, 2)}}</td>
                                </tr>
                        </table>

                        <div class="clearfix" style="height: 15px;"></div>
                        <table width="100%" class="receipt-content px-14-font line-height-1">
                            <tr style="background-color: #525252!important;color: #ffffff;">
                                <td width="12%" class="text-center">QUARTER</td>
                                <td width="15%" class="text-center">YEAR</td>
                                <td width="15%">MONTH</td>
                                <td width="20%" class="text-center">GROSS SALES</td>
                                <td width="20%" class="text-center">NET SALES</td>
                            </tr>
                                {{$ttl_amt3 = 0}}
                                {{$net_amt3 = 0}}
                            @foreach($qtr3 as $q3)
                                {{$ttl_amt3 += $q3->ttl_amt }}
                                {{$net_amt3 += $q3->net_amt }}
                                <tr>
                                    <td class="text-center">{{ $q3->quarter }}</td>
                                    <td class="text-center">{{ $q3->year }}</td>
                                    <td>{{ $q3->month }}</td>
                                    <td class="text-right">{{ number_format($q3->ttl_amt,2) }}</td>
                                    <td class="text-right">{{ number_format($q3->net_amt,2) }}</td>
                                </tr>
                            @endforeach
                                <tr>
                                <div style="border-bottom: dotted #555555!important; width: 100%;"></div>
                                    <td></td>
                                    <td>3RD QUARTER TOTAL</td>
                                    <td class="text-right">{{number_format($ttl_amt3, 2)}}</td>
                                    <td class="text-right">{{number_format($net_amt3, 2)}}</td>
                                </tr>
                        </table>

                        <div class="clearfix" style="height: 15px;"></div>
                        <table width="100%" class="receipt-content px-14-font line-height-1">
                            <tr style="background-color: #525252!important;color: #ffffff;">
                                <td width="12%" class="text-center">QUARTER</td>
                                <td width="15%" class="text-center">YEAR</td>
                                <td width="15%">MONTH</td>
                                <td width="20%" class="text-center">GROSS SALES</td>
                                <td width="20%" class="text-center">NET SALES</td>
                            </tr>
                                {{$ttl_amt4 = 0}}
                                {{$net_amt4 = 0}}
                            @foreach($qtr4 as $q4)
                                {{$ttl_amt4 += $q4->ttl_amt }}
                                {{$net_amt4 += $q4->net_amt }}
                                <tr>
                                    <td class="text-center">{{ $q4->quarter }}</td>
                                    <td class="text-center">{{ $q4->year }}</td>
                                    <td>{{ $q4->month }}</td>
                                    <td class="text-right">{{ number_format($q4->ttl_amt,2) }}</td>
                                    <td class="text-right">{{ number_format($q4->net_amt,2) }}</td>
                                </tr>
                            @endforeach
                                <tr>
                                <div style="border-bottom: dotted #555555!important; width: 100%;"></div>
                                    <td></td>
                                    <td>4TH QUARTER TOTAL</td>
                                    <td class="text-right">{{number_format($ttl_amt4, 2)}}</td>
                                    <td class="text-right">{{number_format($net_amt4, 2)}}</td>
                                </tr>
                        </table>


						<div class="clearfix" style="height: 20px;"></div>
						{{--<div style="border-bottom: dotted #555555!important; width: 100%;"></div>--}}
						<table width="100%" class="total-payment px-14-font line-height-1">
							<tr>
								<td width="30%"></td>

								<td width="100%" valign="top">
									<table width="100%" class="total-payment px-14-font europa-bold" style="padding: 5px;">
										<tr>
                                            {{--@foreach($qtrr as $qt)
                                            {{$qt->net_amt}}--}}
                                            <td>ANNUAL TOTAL SALES</td>
											<td class="text-right">{{number_format($qtrr[0]->ttl_amt, 2)}}</td>
											<td class="text-right">{{number_format($qtrr[0]->net_amt, 2)}}</td>
											{{--@endforeach}--}}
											{{--<td class="text-right"> {{ $data->currency }} {{ number_format($sum_pays,2) }}</td>--}}
										</tr>
									</table>
								</td>
							</tr>
						</table>
				</div>
			</div>
			<div class="pdf-footer">
					<!-- This is footer section	 -->
			</div>
		</div>
	</div>
</body>
<!-- End Page 1 of 1 -->
</html>