

<?php $__env->startSection('title'); ?>
	@parent
	Заявки на расход по группе Зарплата
<?php $__env->stopSection(); ?>

<?php $__env->startSection('breadcrumbs'); ?>
	<?php /* Breadcrumbs::render('budget.salary.stat', $workProject) */ ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('css'); ?>
  <link rel="stylesheet" href="<?php echo asset('css/jquery.fileupload.css'); ?>">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="row">
	<?php 
		$projectAmount = $workProject->getCurrentBudgetMonthPlan(); // бюджет проекта
		$userType = '';
		$signRequest = 0;
		if( Auth::user()->hasRole(Role::ROLE_BUDGET_OUTCOMING_REQUEST) ){
			$userType = 1;
		}else if( Auth::user()->hasRole(Role::ROLE_BUDGET_CFO) ){
			$userType = 2;
		}else if( Auth::user()->hasAnyRole(array(Role::ROLE_BUDGET_ACCOUNTANT, Role::ROLE_BUDGET_ACC_SECRETARY)) ){
			$userType = 3;
		}
		
		if( Auth::user()->hasRole(Role::ROLE_BUDGET_SIGN_COST_REQUEST) ){
			$signRequest = 1;
		}
		$statusType = Session::get('statusType');
		Session::put('userType', $userType);
		Session::put('signRequest', $signRequest);
	?>
  <div class="col-md-12 col-lg-12 col-sm-12">
		<div class="panel panel-default">
		<?php echo $__env->make('budget/menu', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
			<div class="panel-body">
				<?php echo $__env->make('budget/salary/btns', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
				<div class="clearfix"></div>
				<div class="table-responsive">
					<table class="table table-condensed table-hover">
						<thead>
							<tr>
								<th>#</th>
								<th>Дата</th>
								<th>Статья расходов</th>
								<?php if( $userType != 3 ): ?>
								  <th class="text-center">Бюджет</th>
								<?php else: ?>
								<th class="text-right" title="Номер платежного поручения при безналичной оплате">№ п/п</th>
								<?php endif; ?>
								<th>Файлы</th>
								<th class="text-right">Сумма</th>
								<th class="table-comment">Комментарий</th>
							</tr>
						</thead>
						<tbody id='budgetCostsRequestContainer'>
							<?php foreach($costsRequests as $costsRequest): ?>
							  <?php echo $__env->make('budget/costsrequests/searchoperation', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
							<?php endforeach; ?>
						</tbody> 
					</table>
				</div>
				<dl class="dl-horizontal">
					<dt>Заявок на сумму: </dt>
					<dd><span id="totalRequestsSum" class="to-humanize"> </span> <i class="fa fa-rub"></i></dd>
					<dt>Кол-во: </dt>
					<dd><span id="totalRequestsCount" class="to-humanize"> </span></dd>
				</dl>
			</div>
		</div>
	</div>
</div>
<?php $__env->startSection('modals'); ?>
	<?php echo $__env->make('budget/costsrequests/modal', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js'); ?>
  <script src="<?php echo asset('js/jquery.fileupload.js'); ?>"></script>
	<script src="<?php echo asset('js/jquery.iframe-transport.js'); ?>"></script>
	<script src="<?php echo asset('js/plugin/x-editable/x-editable.min.js'); ?>"></script>
	<script src="<?php echo asset('js/costsRequests.js'); ?>"></script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.default', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>