@if($pro && $pro->pro_type === 'ADMIN')
    <div class="mb-2 min-width-300px">
        <label for="" class="text-secondary text-sm">Company Pro</label>
        <div class="p-2 border bg-light rounded">
            @if(@$genericCompanyPro)
                {{$genericCompanyPro->pro->displayName()}} / {{$genericCompanyPro->company->name}}
            @else
                <span class="text-danger">(not set)</span>
            @endif
        </div>
    </div>
@endif
<input type="hidden" name="genericProUid" value="{{$genericPro->uid}}">
@if(@$genericCompanyPro)
    <input type="hidden" name="genericCompanyProUid" value="{{$genericCompanyPro->uid}}">
@endif
@if(@$note)
    <input type="hidden" name="optionalNoteUid" value="{{$note->uid}}">
@endif
@if(@$patient)
    <input type="hidden" name="optionalClientUid" value="{{$patient->uid}}">
@endif
@if(@$entityType)
    <input type="hidden" name="genericTargetEntityType" value="{{$entityType}}">
@endif
@if(@$entityUid)
    <input type="hidden" name="genericTargetEntityUid" value="{{$entityUid}}">
@endif
@if(count($genericRates) === 1)
    <input type="hidden" name="code"
           data-entity-type="{{$entityType}}"
           data-amount="{{ $genericRates[0]->amount }}"
           data-rate-type="{{ $genericRates[0]->is_hourly ? 'hourly' : 'flat' }}"
           value="{{$genericRates[0]->code}}">
    <p class="mb-2">Service: <br><b>{{ $genericRates[0]->code }} (${{ $genericRates[0]->amount }}{{$genericRates[0]->is_hourly ? '/hr' : ''}})</b></p>
@else
    <div class="mb-2">
        <label for="" class="text-secondary text-sm mb-1">Service</label>
        <select autofocus class="form-control" name="code"
                data-entity-type="{{$entityType}}"
                onchange="switchGenericRate(this)">
            <option value="">-- Select Code --</option>
            @foreach($genericPro->genericRates() as $genericRate)
                <option data-amount="{{ $genericRate->amount }}" data-rate-type="{{ $genericRate->is_hourly ? 'hourly' : 'flat' }}" value="{{ $genericRate->code }}">
                    {{ $genericRate->code }} (${{ $genericRate->amount }})
                </option>
            @endforeach
        </select>
    </div>
@endif
<div class="mb-2">
    <?php
    if (!@$maxMinutes) {
        $maxMinutes = 30;
    }
    ?>
    <div class="minutesSelectContainer d-none">
        <label for="" class="text-secondary text-sm mb-1">Minutes</label>
        <div class="mb-2">
            <select name="numMinutes" class="form-control form-control-sm"
                    onchange="minutesToUnits(this)">
                <option value=""> -- select --</option>
                <?php for ($i = 5; $i <= $maxMinutes; $i += 5) { ?>
                <option value="{{ $i/60 }}">{{ $i }} minutes</option>
                <?php } ?>
            </select>
        </div>
    </div>
    <input type="hidden" name="numberOfUnits" value="1">
    <div class="mb-2" calculated-generic-amount></div>
</div>
@if($entityType !== 'Note')
    <div class="mb-2">
        <label for="" class="text-secondary text-sm mb-1">Description</label>
        <input type="text" name="genericDescription" class="form-control form-control-sm" value="">
    </div>
@endif
<div class="mb-2">
    <label for="" class="text-secondary text-sm mb-1">Effective Date</label>
    <input type="date" name="effectiveDate" class="form-control form-control-sm" value="{{date('Y-m-d')}}" required>
</div>
