@extends('layouts.app') @section('title', __('lang_v1.bounce_log')) @section('content')

@lang('lang_v1.bounce_log') @lang('lang_v1.bounce_log_desc')

@include('layouts.partials.error')
{!! Form::open(['route' => 'bounce-rate.log', 'method' => 'get', 'class' => 'form-inline']) !!}
{!! Form::label('start_date', __('report.start_date') . ':') !!} {!! Form::date('start_date', $filters['start_date'] ?? null, ['class' => 'form-control', 'style' => 'width:160px;']) !!}
{!! Form::label('end_date', __('report.end_date') . ':') !!} {!! Form::date('end_date', $filters['end_date'] ?? null, ['class' => 'form-control', 'style' => 'width:160px;']) !!}
{!! Form::label('state', __('business.state') . ':') !!} {!! Form::select('state', ['' => __('lang_v1.all_states')] + $states->mapWithKeys(fn($s) => [$s => $s])->all(), $filters['state'] ?? null, ['class' => 'form-control']) !!}
{!! Form::label('business_id', __('lang_v1.store') . ':') !!} {!! Form::select('business_id', ['' => __('lang_v1.all_stores')] + $businesses->all(), $filters['business_id'] ?? null, ['class' => 'form-control select2', 'style' => 'width:220px;']) !!}
{!! Form::label('bounce_type', __('lang_v1.bounce_reason') . ':') !!} {!! Form::select('bounce_type', [ '' => __('lang_v1.all'), 'out_of_stock' => __('lang_v1.bounce_out_of_stock'), 'not_listed' => __('lang_v1.bounce_not_listed'), ], $filters['bounce_type'] ?? null, ['class' => 'form-control']) !!}
@lang('lang_v1.back_to_board') {!! Form::close() !!}
@component('components.widget', ['class' => 'box-primary', 'title' => __('lang_v1.bounce_log')])

@lang('lang_v1.bounce_log_help')

@foreach($rows as $r) {{-- Date and time in separate columns so the log can be sorted or exported by either on its own. --}} @endforeach
@lang('lang_v1.store') @lang('business.location') @lang('business.state') @lang('sale.product') @lang('lang_v1.searched_for') @lang('lang_v1.bounce_reason') @lang('messages.date') @lang('lang_v1.time') @lang('lang_v1.bounce_count') @lang('lang_v1.qty_at_the_time') @lang('lang_v1.estimated_lost_sales')
{{ $r->business_name }} {{ $r->location_name }} {{ $r->state }} {{ $r->product_name }} {{ $r->search_term }} @if($r->bounce_type === 'out_of_stock') @lang('lang_v1.bounce_out_of_stock') @else @lang('lang_v1.bounce_not_listed') @endif {{ \Carbon::parse($r->bounced_at)->format('d M Y') }} {{ \Carbon::parse($r->bounced_at)->format('H:i') }} {{ $r->bounce_count }} {{ @format_quantity($r->qty_available) }} @format_currency($r->bounce_count * $r->unit_price)
@endcomponent
@endsection @section('javascript') @endsection