<h2 class="text-dark"> Taux :</h2>
<form action="{{ route('Taux.store') }}" method="post">
    @csrf
    <input type="hidden" name="rapport_id" value="{{ $rapport->id ?? null }}" 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>
                        <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="{{ $taux->taux_1 ?? null }}" step="0.01"
                                        class="form-control" name="taux_1">
                                    <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="{{ $taux->t1 ?? null }}" 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="{{ $taux->taux_2 ?? null }}" step="0.01"
                                        class="form-control" name="taux_2">
                                    <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="{{ $taux->t2 ?? null }}" 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="{{ $taux->taux_3 ?? null }}" step="0.01"
                                        class="form-control" name="taux_3">
                                    <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="{{ $taux->t3 ?? null }}" 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">Forfait MO 1 :</label>
                                <div class="input-group flex-nowrap">
                                    <input type="number" value="{{ $taux->forfait_mo_1 ?? null }}" step="0.01"
                                        class="form-control" name="forfait_mo_1">
                                    <span class="input-group-text">MAD </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="{{ $taux->forfait_mo_2 ?? null }}"
                                        class="form-control" name="forfait_mo_2">
                                    <span class="input-group-text">MAD </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="{{ $taux->forfait_mo_3 ?? null }}" step="0.01"
                                        class="form-control" name="forfait_mo_3">
                                    <span class="input-group-text">MAD </span>
                                </div>
                            </div>

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

                        <h5 class="text-primary">Taux Peinture</h5>
                        <hr>
                        <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"
                                        value="{{ $taux->taux_mo_peinture ?? null }}" name="taux_mo_peinture">
                                    <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="{{ $taux->tp ?? null }}" class="form-control"
                                        name="tp">
                                    <span class="input-group-text">h</span>

                                </div>
                            </div>
                        </div>
                        <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"
                                        value="{{ $taux->forfait_peinture ?? null }}" name="forfait_peinture">
                                    <span class="input-group-text">MAD/h </span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">

                        <h5 class="text-primary">Ingrédients Peinture</h5>
                        <hr>
                        <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 ($taux)
                                        <option selected value="{{ $taux->typeingredient->id }}">
                                            {{ $taux->typeingredient->type }}</option>

                                        @foreach ($typeingredients as $type)
                                            @if ($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


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

                            </div>
                            <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="{{ $taux->forfait_ing_pieces ?? null }}"
                                        step="0.01" class="form-control" name="forfait_ing_pieces">
                                    <span class="input-group-text">MAD </span>
                                </div>
                            </div>
                        </div>
                        <div class="col-6">
                            <div class="mb-3">
                                <label class="form-label">Taux Ingr.opague :</label>
                                <div class="input-group flex-nowrap">
                                    <input type="number" value="{{ $taux->taux_ing_opaque ?? null }}"
                                        step="0.01" class="form-control" name="taux_ing_opaque">
                                    <span class="input-group-text">MAD/h </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="{{ $taux->taux_ing_opaque_vernis ?? null }}"
                                        step="0.01" class="form-control" name="taux_ing_opaque_vernis">
                                    <span class="input-group-text">MAD/h </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="{{ $taux->taux_ing_metal ?? null }}" step="0.01"
                                        class="form-control" name="taux_ing_metal">
                                    <span class="input-group-text">MAD/h </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="{{ $taux->taux_ing_metal_vernis ?? null }}"
                                        step="0.01" class="form-control" name="taux_ing_metal_vernis">
                                    <span class="input-group-text">MAD/h </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="{{ $taux->taux_ing_nacre_vernis ?? null }}"
                                        step="0.01" class="form-control" name="taux_ing_nacre_vernis">
                                    <span class="input-group-text">MAD/h </span>
                                </div>
                            </div>
                        </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="{{ $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="{{ $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="{{ $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="{{ $taux->remise_facture ?? null }}" step="0.01"
                                        class="form-control" name="remise_facture">
                                    <span class="input-group-text">MAD</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="{{ $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="{{ $taux->franchise ?? null }}"
                                        class="form-control" name="franchise">
                                    <span class="input-group-text">MAD </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="{{ $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="{{ $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="{{ $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 ($taux)
                                        @if ($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>
                    <input type="hidden" value="{{ $rapport->id }}" name="rapport_id" />
                    @if ($dossier->dossier_status_id != 3)
                        @if ($rapport->rapport_status_id != 2 && $rapport->rapport_status_id != 3)
                            <button class="btn btn-success">Sauvegarder</button>
                        @endif
                    @endif
                </div>
            </div>
        </div>
    </div>
</form>