{{ include('common/header.twig') }}
<div class="page-title">
	<div class="row align-items-center">
		<div class="col-sm-8">
			<h2 class="page-title-text d-inline-block">{{ page_title }}</h2>
			<div class="breadcrumbs d-inline-block">
				<ul>
					<li><a href="{{ common.info.url }}">Dashboard</a></li>
					<li><a href="{{ common.info.url_route }}managesalary">Manage Salary</a></li>
					<li>{{ page_title }}</li>
				</ul>
			</div>
		</div>
		<div class="col-sm-4 text-right">
			<a href="{{ common.info.url_route~'managesalary/history/pdf&id='~result.id }}" class="btn btn-danger btn-sm" target="_blank"><i class="las la-file-pdf mr-1"></i>PDF Preview</a>
		</div>
	</div>
</div>

<div class="row">
	<div class="col-md-4">
		<div class="panel panel-default">
			<div class="panel-body">
				<div class="user-avtar">
					{% if result.picture and result.picture is ondisk %}
						<img class="img-fluid img-thumbnail" src="public/uploads/{{ result.picture }}">
					{% else %}
						<span>{{ result.firstname|split('')[0] }}</span>
					{% endif %}
				</div>
				<div class="user-details pt-2  pb-2 text-center">
					<h2 class="font-20">{{ result.firstname~' '~result.lastname }}</h2>
				</div>
				<div class="table-responsive">
					<table class="table table-striped">
						<tbody>
							<tr>
								<td>Email Address</td>
								<td>{{ result.email }}</td>
							</tr>
							<tr>
								<td>Mobile No.</td>
								<td>{{ result.mobile }}</td>
							</tr>
							<tr>
								<td>Gender</td>
								<td>{{ result.gender }}</td>
							</tr>
							<tr>
								<td>Bloodgroup</td>
								<td>{{ result.bloodgroup }}</td>
							</tr>
							<tr>
								<td>DOB</td>
								<td> {% if result.dob %}{{ result.dob|date(common.info.date_format) }}{% endif %}</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
	<div class="col-md-8">
		<div class="panel panel-default"> 
			<div class="panel-head">
				<div class="panel-title">Salary</div>
			</div>
			<div class="panel-body">
				<div class="row align-items-center">
					<div class="col-4"><p class="font-12 text-dark">Salary Grades</p></div>
					<div class="col-8"><p class="font-12 text-primary">{{ result.salarytemplate.grade }}</p></div>
					<div class="col-4"><p class="font-12 text-dark">Basic Salary</p></div>
					<div class="col-8"><p class="font-12 text-dark">{{ result.salarytemplate.basic_salary }}</p></div>
					<div class="col-4"><p class="font-12 text-dark">Month</p></div>
					<div class="col-8"><p class="font-12 text-dark">{{ result.month_year|date(common.info.date_my_format) }}</p></div>
					<div class="col-4"><p class="font-12 text-dark">Date</p></div>
					<div class="col-8"><p class="font-12 text-dark">{{ result.date_of_joining|date(common.info.date_format) }}</p></div>
					<div class="col-4"><p class="font-12 text-dark">Payment Method</p></div>
					<div class="col-8"><p class="font-12 text-dark">{{ result.payment_method }}</p></div>
				</div>
				<div class="row align-items-start">
					<div class="col-md-6">
						<label class="col-form-label mt-1 mb-0">Allowances</label>
						<table class="table table-bordered table-striped">
							<tbody>
								{% for value in result.salarytemplate.allowance %}
									<tr>
										<td>{{ value.label }}</td>
										<td>{{ common.info.currency_abbr~value.value }}</td>
									</tr>
								{% endfor %}
							</tbody>
						</table>
					</div>
					<div class="col-md-6">
						<label class="col-form-label mt-1 mb-0">Deductions</label>
						<table class="table table-bordered table-striped">
							<tbody>
								{% for value in result.salarytemplate.deduction %}
									<tr>
										<td>{{ value.label }}</td>
										<td>{{ common.info.currency_abbr~value.value }}</td>
									</tr>
								{% endfor %}
							</tbody>
						</table>
					</div>
				</div>
				<label class="col-form-label mt-3 mb-0">Total Salary Details</label>
				<table class="table table-bordered table-striped">
					<tbody>
						<tr>
							<td>Gross Salary</td>
							<td>{{ common.info.currency_abbr~result.salarytemplate.gross_salary }}</td>
						</tr>
						<tr>
							<td>Total Deduction</td>
							<td>{{ common.info.currency_abbr~result.salarytemplate.total_deduction }}</td>
						</tr>
						<tr>
							<td>Net Salary</td>
							<td>{{ common.info.currency_abbr~result.salarytemplate.net_salary }}</td>
						</tr>
						<tr>
							<td>Advance</td>
							<td>{{ common.info.currency_abbr~result.advance }}</td>
						</tr>
						<tr>
							<td>Deduction</td>
							<td>{{ common.info.currency_abbr~result.deduction }}</td>
						</tr>
						<tr>
							<td class="text-dark font-500">Payment Amount</td>
							<td class="text-primary">{{ common.info.currency_abbr~result.amount }}</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>
{{ include('common/footer.twig') }}