@if (isset($packing1))
	<div class="row">
		<div class="col-md-6">
			<div class="panel panel-default panel-production">
				<div class="panel-heading">
					<h3>Упаковка: в ожидании</h3>
				</div>
				<div class="panel-body">
					<table class="table table-striped table-hover">
						<thead>
							<th>Номер</th>
							<th>Заказ</th>
						</thead>
						<tbody>
							@foreach ($packing1 as $pack1)
							<tr>
								<td>
									<h4>№{{ $pack1->id }}<br><br>
									{{ $pack1->getRawTransportTypeName() }}</h4>
								</td>
								<td class="project-name">
									@if ($pack1->getCart())
										@foreach ($pack1->productions()->get() as $partnerProduct)
											<h4>{{ $partnerProduct->name }} @if($partnerProduct->production_master_id === 0 || $partnerProduct->production_master_id === '0') <span class="label label-info">Взять со склада</span> @endif</h4>
										@endforeach
									@endif
									<button class="btn btn-lg btn-primary btn-packing-process" data-action="{{ action('ProductionController@packingProcess') }}" data-id="{{ $pack1->id }}"><span class="glyphicon glyphicon-play"></span> Комплект получен </button>
									<br/>
									{{ $pack1->name }}<br/>передана в производство <span class="date-to-humanize" data-date="{{ $pack1->datetime_of_agree }}">{{ $pack1->datetime_of_agree }}</span><br/>
								</td>
							</tr>
							@endforeach
						</tbody>
					</table>
				</div>
			</div>
		</div>

@endif

@if (isset($packing2))

		<div class="col-md-6">
			<div class="panel panel-default panel-production">
				<div class="panel-heading">
					<h3>Упаковка: в работе
					<button class="btn btn-lg btn-info btn-print-packed-today" data-print-url="{{ action('ProductionController@packedToday') }}"><span class="glyphicon glyphicon-print"></span> Упаковано сегодня </button>
					</h3>
				</div>
				<div class="panel-body">
					<table class="table table-striped table-hover">
						<thead>
							<th>Номер</th>
							<th>Заказ</th>
						</thead>
						<tbody>
							@foreach ($packing2 as $pack2)
							<tr>
								<td>
									<h4>№{{ $pack2->id }}<br><br>
									{{ $pack2->getRawTransportTypeName() }}</h4>
								</td>
								<td class="project-name">
									@if ($pack2->getCart())
										@foreach ($pack2->getCart() as $item)
											@foreach ($item as $item2)
												@if($item2['quant'] > 0)
													<h4>{{ $item2['name'] }} {{ $item2['quant'] }} компл.</h4>
												@endif
											@endforeach
										@endforeach
									@endif
									<button class="btn btn-lg btn-success btn-packing-success" data-action="{{ action('ProductionController@packingSuccess') }}" data-id="{{ $pack2->id }}"><span class="glyphicon glyphicon-ok"></span> Упаковано</button>
									<br/>
									{{ $pack2->name }}<br/>передана в производство <span class="date-to-humanize" data-date="{{ $pack2->datetime_of_agree }}">{{ $pack2->datetime_of_agree }}</span><br/>
								</td>
							</tr>
							@endforeach
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
@endif