ultimatepos/Modules/ManagementTools/Resources/views/executive_cockpit/partials/period_badge.blade.php

13 lines
672 B
PHP

@if(!empty($comparison))
<div class="mt-period-badge mt-period-badge--{{ !empty($comparison['favorable']) ? 'favorable' : 'unfavorable' }}">
@if(($comparison['direction'] ?? 'flat') === 'flat')
<i class="fas fa-minus"></i>
<span>@lang('managementtools::lang.no_change')</span>
@else
<i class="fas fa-arrow-{{ $comparison['direction'] === 'up' ? 'up' : 'down' }}"></i>
<span>{{ ($comparison['delta_pct'] ?? 0) > 0 ? '+' : '' }}{{ number_format((float) ($comparison['delta_pct'] ?? 0), 1) }}%</span>
@endif
<small>@lang('managementtools::lang.vs_previous_period')</small>
</div>
@endif