<form action="{{ route('Taux.store') }}" method="post">
    @csrf
    <div id="full-width-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="fullWidthModalLabel"
        aria-hidden="true">
        <div class="modal-dialog modal-full-width">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="fullWidthModalLabel">Taux Rapport :</h4>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-hidden="true"></button>
                </div>
                <div class="modal-body">
                    <input type="hidden" name="rapport_id" value="{{ $rapport->id }}" id="">
                    <div class="row">
                        <div class="col-12">
                            <div class="card">
                                <div class="card-body">
                                    <div class="row">
                                        <h5 class="text-primary">Taux Main d'oeuvre</h5>
                                        <hr>
                                        @if ($dossier->mode_id != 7 && $dossier->type_expertise_id != 14)
                                            <div class="col-6">
                                                <div class="mb-3">
                                                    <label class="form-label">Taux 1 :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->taux_1 ?? null }}" step="0.01"
                                                            class="form-control" name="taux_1">
                                                        <span
                                                            class="input-group-text">{{ $dossier->currency->symbole ?? null }}/h
                                                        </span>

                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Heure :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number" value="{{ $rapport->taux->t1 ?? null }}"
                                                            step="0.01" min="1" class="form-control"
                                                            name="t1">
                                                        <span class="input-group-text">h</span>

                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Taux 2 :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->taux_2 ?? null }}" step="0.01"
                                                            class="form-control" name="taux_2">
                                                        <span
                                                            class="input-group-text">{{ $dossier->currency->symbole ?? null }}/h
                                                        </span>

                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Heure :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number" value="{{ $rapport->taux->t2 ?? null }}"
                                                            step="0.01" min="1" class="form-control"
                                                            name="t2">
                                                        <span class="input-group-text">h</span>

                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Taux 3 :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->taux_3 ?? null }}" step="0.01"
                                                            class="form-control" name="taux_3">
                                                        <span
                                                            class="input-group-text">{{ $dossier->currency->symbole ?? null }}/h
                                                        </span>
                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Heure :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number" value="{{ $rapport->taux->t3 ?? null }}"
                                                            step="0.01" min="1" class="form-control"
                                                            name="t3">
                                                        <span class="input-group-text">h</span>

                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-6">
                                                <div class="mb-3">
                                                    <label class="form-label">Taux Électricité :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->taux_electricite ?? null }}"
                                                            step="0.01" class="form-control" name="taux_electricite">
                                                        <span class="input-group-text">MAD/h </span>

                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Heure :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number" value="{{ $rapport->taux->te ?? null }}"
                                                            step="0.01" min="1" class="form-control"
                                                            name="te">
                                                        <span class="input-group-text">h</span>

                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Taux Mécanique :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->taux_mecanique ?? null }}"
                                                            step="0.01" class="form-control"
                                                            name="taux_mecanique">
                                                        <span class="input-group-text">MAD/h </span>

                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Heure :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->tm ?? null }}" step="0.01"
                                                            min="1" class="form-control" name="tm">
                                                        <span class="input-group-text">h</span>

                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Taux Contrôle :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->taux_controle ?? null }}"
                                                            step="0.01" class="form-control" name="taux_controle">
                                                        <span class="input-group-text">MAD/h </span>
                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Heure :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->tc ?? null }}" step="0.01"
                                                            min="1" class="form-control" name="tc">
                                                        <span class="input-group-text">h</span>

                                                    </div>
                                                </div>

                                            </div>
                                        @else
                                            <div class="col-6">
                                                <div class="mb-3">
                                                    <label class="form-label">Forfait MO 1 :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->forfait_mo_1 ?? null }}"  min="1"
                                                            step="0.01" class="form-control" name="forfait_mo_1">
                                                        <span
                                                            class="input-group-text">{{ $dossier->currency->symbole ?? null }}
                                                        </span>

                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Forfait MO 2 :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number" step="0.01"
                                                            value="{{ $rapport->taux->forfait_mo_2 ?? null }}"  min="1"
                                                            class="form-control" name="forfait_mo_2">
                                                        <span
                                                            class="input-group-text">{{ $dossier->currency->symbole ?? null }}
                                                        </span>

                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Forfait MO 3 :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->forfait_mo_3 ?? null }}"  min="1"
                                                            step="0.01" class="form-control" name="forfait_mo_3">
                                                        <span
                                                            class="input-group-text">{{ $dossier->currency->symbole ?? null }}
                                                        </span>
                                                    </div>
                                                </div>

                                            </div>

                                            <div class="col-6">
                                                <div class="mb-3">
                                                    <label class="form-label">Forfait Électricité :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->forfait_electricite ?? null }}"
                                                            step="0.01" class="form-control"  min="1"
                                                            name="forfait_electricite">
                                                        <span class="input-group-text">MAD </span>
                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Forfait Mécanique :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number" step="0.01"  min="1"
                                                            value="{{ $rapport->taux->forfait_mecanique ?? null }}"
                                                            class="form-control" name="forfait_mecanique">
                                                        <span class="input-group-text">MAD </span>
                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Forfait Contrôle :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"  min="1"
                                                            value="{{ $rapport->taux->forfait_controle ?? null }}"
                                                            step="0.01" class="form-control"
                                                            name="forfait_controle">
                                                        <span class="input-group-text">MAD </span>
                                                    </div>
                                                </div>

                                            </div>
                                        @endif
                                    </div>
                                    <div class="row">

                                        <h5 class="text-primary">Taux Peinture</h5>
                                        <hr>
                                        @if ($dossier->mode_id != 7 && $dossier->type_expertise_id != 14)
                                            <div class="col-6">
                                                <div class="mb-3">
                                                    <label class="form-label">Taux MO Peinture :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number" step="0.01" class="form-control"  min="1"
                                                            value="{{ $rapport->taux->taux_mo_peinture ?? null }}"
                                                            name="taux_mo_peinture">
                                                        <span
                                                            class="input-group-text">{{ $dossier->currency->symbole ?? null }}/h
                                                        </span>
                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Heure :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->tp ?? null }}" step="0.01"
                                                            min="1" class="form-control" name="tp">
                                                        <span class="input-group-text">h</span>

                                                    </div>
                                                </div>

                                            </div>
                                            <div class="row">
                                                <h5 class="text-primary">MO TVA</h5>
                                                <div class="col-6">
                                                    <h6>MO TVA :</h6>
                                                </div>
                                                <hr>

                                                <div class="col-6">
                                                    <div class="mb-3">
                                                        <select class="form-select" name="taux_tva"
                                                            id="example-select">
                                                            @if ($rapport->taux)
                                                                @if ($rapport->taux->taux_tva)
                                                                    <option selected value="1"> OUI </option>
                                                                    <option value="0"> NON </option>
                                                                @else
                                                                    <option selected value="0"> NON </option>
                                                                    <option value="1"> OUI </option>
                                                                @endif
                                                            @else
                                                                <option value="0"> NON </option>
                                                                <option value="1"> OUI </option>
                                                            @endif

                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                        @else
                                            <div class="col-6">
                                                <div class="mb-3">
                                                    <label class="form-label">Forfait Peinture :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number" step="0.01" class="form-control"  min="1"
                                                            value="{{ $rapport->taux->forfait_peinture ?? null }}"
                                                            name="forfait_peinture">
                                                        <span
                                                            class="input-group-text">{{ $dossier->currency->symbole ?? null }}
                                                        </span>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <h5 class="text-primary">MO TVA</h5>
                                                <div class="col-6">
                                                    <h6>MO TVA :</h6>
                                                </div>
                                                <hr>
                                                <div class="col-6">
                                                    <div class="mb-3">
                                                        <select class="form-select" name="taux_tva"
                                                            id="example-select">

                                                            <option selected value="0"> NON </option>

                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                        @endif
                                    </div>
                                    <div class="row">

                                        <h5 class="text-primary">Ingrédients Peinture</h5>
                                        <hr>
                                        {{-- @if ($dossier->mode_id != 7 && $dossier->type_expertise_id != 14)

                                            <div class="col-6">
                                                <div class="mb-3">
                                                    <label for="example-select" class="form-label"> Type Ingrédient :
                                                    </label>
                                                    <select
                                                        class="form-select @error('type_ingredient') is-invalid @enderror"
                                                        name="type_ingredient" id="example-select">
                                                        @if ($rapport->taux)
                                                            @if ($rapport->taux->typeingredient)
                                                                <option selected
                                                                    value="{{ $rapport->taux->typeingredient->id }}">
                                                                    {{ $rapport->taux->typeingredient->type }}</option>

                                                                @foreach ($typeingredients as $type)
                                                                    @if ($rapport->taux->typeingredient->id != $type->id)
                                                                        <option value="{{ $type->id }}">
                                                                            {{ $type->type }}</option>
                                                                    @endif
                                                                @endforeach
                                                            @else
                                                                <option value="">Selectionner un type</option>
                                                                @foreach ($typeingredients as $type)
                                                                    <option value="{{ $type->id }}">
                                                                        {{ $type->type }}
                                                                    </option>
                                                                @endforeach
                                                            @endif
                                                        @endif

                                                    </select>
                                                    @error('type_ingredient')
                                                        <span class="invalid-feedback" role="alert">
                                                            <strong>{{ $message }}</strong>
                                                        </span>
                                                    @enderror

                                                </div>

                                        @endif --}}



                                        <div class="col-6">
                                            @if ($dossier->mode_id != 7 && $dossier->type_expertise_id != 14)
                                                <div class="mb-3">
                                                    <label class="form-label">Taux Ingr.opague :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->taux_ing_opaque ?? null }}"
                                                            step="0.01" class="form-control"  min="1"
                                                            name="taux_ing_opaque">
                                                        <span
                                                            class="input-group-text">{{ $dossier->currency->symbole ?? null }}
                                                        </span>
                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label"> Taux Ingr.opaque vernis :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->taux_ing_opaque_vernis ?? null }}"
                                                            step="0.01" class="form-control"  min="1"
                                                            name="taux_ing_opaque_vernis">
                                                        <span
                                                            class="input-group-text">{{ $dossier->currency->symbole ?? null }}
                                                        </span>
                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Taux Ingr.métal :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->taux_ing_metal ?? null }}"
                                                            step="0.01" class="form-control"  min="1"
                                                            name="taux_ing_metal">
                                                        <span
                                                            class="input-group-text">{{ $dossier->currency->symbole ?? null }}
                                                        </span>
                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Taux Ingr.métal vernis :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->taux_ing_metal_vernis ?? null }}"
                                                            step="0.01" class="form-control"  min="1"
                                                            name="taux_ing_metal_vernis">
                                                        <span
                                                            class="input-group-text">{{ $dossier->currency->symbole ?? null }}
                                                        </span>
                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Taux Ingr.nacré vernis :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->taux_ing_nacre_vernis ?? null }}"
                                                            step="0.01" class="form-control"  min="1"
                                                            name="taux_ing_nacre_vernis">
                                                        <span
                                                            class="input-group-text">{{ $dossier->currency->symbole ?? null }}
                                                        </span>
                                                    </div>
                                                </div>
                                                <div class="row">
                                                    <h5 class="text-primary">TVA Ingr</h5>
                                                    <div class="col-6">
                                                        <h6>TVA Ingr :</h6>
                                                    </div>
                                                    <hr>

                                                    <div class="col-6">
                                                        <div class="mb-3">
                                                            <select class="form-select" name="taux_ing"
                                                                id="example-select">
                                                                @if ($rapport->taux)
                                                                    @if ($rapport->taux->taux_ing)
                                                                        <option selected value="1"> OUI </option>
                                                                        <option value="0"> NON </option>
                                                                    @else
                                                                        <option selected value="0"> NON </option>
                                                                        <option value="1"> OUI </option>
                                                                    @endif
                                                                @else
                                                                    <option value="0"> NON </option>
                                                                    <option value="1"> OUI </option>
                                                                @endif

                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>
                                            @else
                                                <div class="mb-3">
                                                    <label class="form-label">Forfait Ingr.piéces (sauf caisse)
                                                        :</label>
                                                    <div class="input-group flex-nowrap">
                                                        <input type="number"
                                                            value="{{ $rapport->taux->forfait_ing_pieces ?? null }}"
                                                            step="0.01" class="form-control" min="1"
                                                            name="forfait_ing_pieces">
                                                        <span
                                                            class="input-group-text">{{ $dossier->currency->symbole ?? null }}
                                                        </span>
                                                    </div>
                                                </div>

                                                <div class="row">
                                                    <h5 class="text-primary">TVA Ingr</h5>
                                                    <div class="col-6">
                                                        <h6>TVA Ingr :</h6>
                                                    </div>
                                                    <hr>

                                                    <div class="col-6">
                                                        <div class="mb-3">
                                                            <select class="form-select" name="taux_ing"
                                                                id="example-select">

                                                                <option selected value="0"> NON </option>


                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>

                                            @endif
                                        </div>

                                    </div>
                                    <div class="row">
                                        <h5 class="text-primary">Remise</h5>
                                        <hr>
                                        <div class="col-6">
                                            <div class="mb-3">
                                                <label class="form-label">Remise Facture :</label>
                                                <div class="input-group flex-nowrap">
                                                    <input type="number"
                                                        value="{{ $rapport->taux->remise_facture1 ?? null }}"
                                                        class="form-control" name="remise_facture1">
                                                    <span class="input-group-text">% </span>
                                                </div>
                                            </div>
                                            {{-- <div class="mb-3">
                                                <label class="form-label">Remise Piéce :</label>
                                                <div class="input-group flex-nowrap">
                                                    <input type="number"
                                                        value="{{ $rapport->taux->remise_piece ?? null }}"
                                                        class="form-control" name="remise_piece">
                                                    <span class="input-group-text">% </span>
                                                </div>
                                            </div> --}}
                                            <div class="mb-3">
                                                <label class="form-label">Remise sur Total MO (Hors Peinture) :</label>
                                                <div class="input-group flex-nowrap">
                                                    <input type="number"
                                                        value="{{ $rapport->taux->remise_sur_total_mo ?? null }}"
                                                        class="form-control" name="remise_sur_total_mo">
                                                    <span class="input-group-text">%</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-6">
                                            <div class="mb-3">
                                                <label class="form-label">Remise Facture :</label>
                                                <div class="input-group flex-nowrap">
                                                    <input type="number"
                                                        value="{{ $rapport->taux->remise_facture ?? null }}"
                                                        step="0.01" class="form-control" name="remise_facture">
                                                    <span
                                                        class="input-group-text">{{ $dossier->currency->symbole ?? null }}</span>
                                                </div>
                                            </div>
                                            <div class="mb-3">
                                                <label class="form-label">Remise sur Total MO peinture :</label>
                                                <div class="input-group flex-nowrap">
                                                    <input type="number"
                                                        value="{{ $rapport->taux->remise_sur_total_mo_peinture ?? null }}"
                                                        class="form-control" name="remise_sur_total_mo_peinture">
                                                    <span class="input-group-text">%</span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <h5 class="text-primary">Franchise</h5>
                                        <hr>
                                        <div class="col-6">
                                            <div class="mb-3">
                                                <label class="form-label">Franchise :</label>
                                                <div class="input-group flex-nowrap">
                                                    <input type="number"
                                                        value="{{ $rapport->taux->franchise ?? null }}"
                                                        class="form-control" name="franchise">
                                                    <span
                                                        class="input-group-text">{{ $dossier->currency->symbole ?? null }}
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-6">
                                            <div class="mb-3">
                                                <label class="form-label">Franchise % :</label>
                                                <div class="input-group flex-nowrap">
                                                    <input type="number"
                                                        value="{{ $rapport->taux->franchise_fix ?? null }}"
                                                        class="form-control" name="franchise_fix">
                                                    <span class="input-group-text">%</span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    {{-- <div class="row">
                                        <h5 class="text-primary">Frais Supplémentaire</h5>
                                        <hr>
                                        <div class="col-6">
                                            <div class="mb-3">
                                                <label class="form-label">Frais additionel calcule sur le totale HT
                                                    :</label>
                                                <div class="input-group flex-nowrap">
                                                    <input type="number"
                                                        value="{{ $rapport->taux->frais_additionel_calcule_sur_le_total_ht ?? null }}"
                                                        class="form-control"
                                                        name="frais_additionel_calcule_sur_le_total_ht">
                                                    <span class="input-group-text">% </span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-6">
                                            <div class="mb-3">
                                                <label class="form-label">Majoration des frais additionels :</label>
                                                <div class="input-group flex-nowrap">
                                                    <input type="number"
                                                        value="{{ $rapport->taux->majoration_des_frais_additionels ?? null }}"
                                                        class="form-control" name="majoration_des_frais_additionels">
                                                    <span class="input-group-text">%</span>
                                                </div>
                                            </div>
                                        </div>
                                    </div> --}}
                                    <div class="row">
                                        <h5 class="text-primary">TVA déductible</h5>
                                        <div class="col-6">
                                            <h6>TVA deductible :</h6>
                                        </div>
                                        <div class="col-6">
                                            <div class="mb-3">
                                                <select class="form-select" name="tva_deductible"
                                                    id="example-select">
                                                    @if ($rapport->taux)
                                                        @if ($rapport->taux->tva_deductible)
                                                            <option selected value="1"> OUI </option>
                                                        @else
                                                            <option selected value="0"> NON </option>
                                                        @endif
                                                    @endif
                                                    <option value="0"> NON </option>
                                                    <option value="1"> OUI </option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <h5 class="text-primary">Vetusté</h5>
                                        <div class="col-6">
                                            <h6> Vetusté :</h6>
                                        </div>
                                        <div class="col-6">
                                            <div class="mb-3">
                                                <select class="form-select" name="vetuste"
                                                    id="example-select">
                                                    @if ($rapport->taux)
                                                        @if ($rapport->taux->vetuste)
                                                            <option selected value="1"> Compagnie </option>
                                                            <option value="0"> Client </option>
                                                        @else
                                                            <option selected value="0"> Client </option>
                                                            <option value="1"> Compagnie </option>

                                                        @endif
                                                    @else
                                                        <option value="0"> Client </option>
                                                        <option value="1"> Compagnie </option>
                                                    @endif

                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-light"
                                        data-bs-dismiss="modal">Close</button>
                                    @if ($dossier->dossier_status_id != 3 && $dossier->update != 1)

                                        @if ($rapport->rapport_status_id != 2 && $rapport->rapport_status_id != 3)
                                            <button type="submit" class="btn btn-primary">Enregistrer</button>
                                        @endif

                                    @endif
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
    </div>
</form>
