ultimatepos/Modules/AdvancedPlanning/Resources/views/sop_cycles/index.blade.php

62 lines
2.8 KiB
PHP

@extends('layouts.app')
@section('title', __('advancedplanning::lang.sop_cycles'))
@section('content')
@include('advancedplanning::layouts.nav')
@php $util = app(\Modules\AdvancedPlanning\Utils\AdvancedPlanningUtil::class); @endphp
<section class="content-header">
<h1>@lang('advancedplanning::lang.sop_cycles')</h1>
</section>
<section class="content">
@if(session('status'))
<div class="alert alert-{{ session('status.success') ? 'success' : 'warning' }} alert-dismissible">
<button type="button" class="close" data-dismiss="alert">&times;</button>
{{ session('status.msg') }}
</div>
@endif
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">@lang('advancedplanning::lang.sop_cycles')</h3>
@can('ap.sop.manage')
<div class="box-tools">
<a href="{{ action([\Modules\AdvancedPlanning\Http\Controllers\SopCycleController::class, 'create']) }}" class="btn btn-primary btn-sm">
<i class="fa fa-plus"></i> @lang('advancedplanning::lang.new_sop_cycle')
</a>
</div>
@endcan
</div>
<div class="box-body table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>@lang('advancedplanning::lang.cycle_month')</th>
<th>@lang('advancedplanning::lang.status')</th>
<th>@lang('advancedplanning::lang.total_demand')</th>
<th>@lang('advancedplanning::lang.total_capacity')</th>
<th>@lang('advancedplanning::lang.actions')</th>
</tr>
</thead>
<tbody>
@forelse($cycles as $cycle)
<tr>
<td>{{ $cycle->cycle_month?->format('Y-m') }}</td>
<td><span class="label label-info">{{ $util->statusLabel($cycle->status) }}</span></td>
<td>{{ $cycle->demand_plan['total_demand_units'] ?? '—' }}</td>
<td>{{ $cycle->supply_plan['total_available_hours'] ?? '—' }}</td>
<td>
<a href="{{ action([\Modules\AdvancedPlanning\Http\Controllers\SopCycleController::class, 'show'], $cycle->id) }}" class="btn btn-xs btn-info">
@lang('advancedplanning::lang.view')
</a>
</td>
</tr>
@empty
<tr><td colspan="5" class="text-center">@lang('advancedplanning::lang.no_records')</td></tr>
@endforelse
</tbody>
</table>
{{ $cycles->links() }}
</div>
</div>
</section>
@endsection