Files
oficial/app/resources/views/ventas/promotions/show.blade.php
Juan Pablo Vial b191a01313 Promociones
2025-03-25 19:22:38 -03:00

85 lines
3.1 KiB
PHP

@extends('ventas.promotions.base')
@section('promotions_title')
{{ $promotion->description }}
@endsection
@section('promotions_header')
{{ $promotion->description }}
@endsection
@section('promotions_content')
<div class="ui card">
<div class="content">
<div class="description">
<p>
{{ ucwords($promotion->type->name()) }} {{ ($promotion->type === Incoviba\Model\Venta\Promotion\Type::FIXED) ? $format->ufs($promotion->amount) : $format->percent($promotion->amount, 2, true) }}
</p>
<p>
{{ $promotion->startDate->format('d-m-Y') }} -> {!! $promotion->endDate?->format('d-m-Y') ?? '&infin;' !!}
</p>
<p>Válido hasta: {!! $promotion->validUntil?->format('d-m-Y') ?? '&infin;' !!}</p>
</div>
</div>
</div>
<table class="ui table" id="contracts">
<thead>
<tr>
<th>Proyecto</th>
<th>Operador</th>
<th class="center aligned" colspan="2">Unidad</th>
<th class="right aligned">
<button class="ui tertiary green icon button" id="add_button">
<i class="plus icon"></i>
</button>
</th>
</tr>
<tr>
<th colspan="2"></th>
<th>Tipo</th>
<th></th>
</tr>
</thead>
<tbody>
@if (count($promotion->projects()) > 0)
@foreach ($promotion->projects() as $project)
<tr>
<td>{{ $project->descripcion }}</td>
<td>Todos los Operadores</td>
<td colspan="2">Todas las Unidades</td>
</tr>
@endforeach
@endif
@if (count($promotion->contracts()) > 0)
@foreach($promotion->contracts() as $contract)
<tr>
<td>{{ $contract->project->descripcion }}</td>
<td>{{ $contract->broker->name }}</td>
<td colspan="2">Todas las Unidades</td>
</tr>
@endforeach
@endif
@if (count($promotion->units()) > 0)
@foreach($promotion->units() as $unit)
<tr>
<td>{{ $unit->project->descripcion }}</td>
<td>Todos los Operadores</td>
<td>{{ $unit->proyectoTipoUnidad->tipoUnidad->descripcion }}</td>
<td>{{ $unit->descripcion }}</td>
</tr>
@endforeach
@endif
@if (count($promotion->contractUnits()) > 0)
@foreach($promotion->contractUnits() as $contractUnit)
<tr>
<td>{{ $contractUnit->contract->project->descripcion }}</td>
<td>{{ $contractUnit->contract->broker->name }}</td>
<td>{{ $contractUnit->unidad->proyectoTipoUnidad->tipoUnidad->descripcion }}</td>
<td>{{ $contractUnit->unidad->descripcion }}</td>
</tr>
@endforeach
@endif
</tbody>
</table>
@endsection