@paiements = @paiements.where("DATE(date) BETWEEN ? AND ?", params[:date_début], params[:date_fin])
end
+ unless params[:mode].blank?
+ @paiements = @paiements.where(mode: params[:mode])
+ end
+
unless params[:nom].blank?
- @paiements = @paiements.joins(:compte).where("UPPER(comptes.nom) like ?", "%#{params[:nom].upcase}%")
+ @paiements = @paiements.joins(:compte).where("UPPER(comptes.nom) like ? OR paiements.réf like ?", "%#{params[:nom].upcase}%", "%#{params[:nom].upcase}%")
end
@paiements = @paiements.paginate(page: params[:page])
<div class="col-sm-3"><%= f.select :structure_id, options_from_collection_for_select(@structures, 'id', 'nom', params[:structure_id]), { include_blank: true, label: "Structure" }, { class: "selectpicker", onchange: "this.form.submit()" } %></div>
<div class="col-sm-2"><%= f.date_field :date_début, value: params[:date_début], onchange: "this.form.submit()" %></div>
<div class="col-sm-2"><%= f.date_field :date_fin, value: params[:date_fin], onchange: "this.form.submit()" %></div>
- <div class="col"><%= f.text_field :nom, value: params[:nom], onchange: "this.form.submit()" %></div>
+ <div class="col-sm-2"><%= f.select :mode, options_for_select(Paiement.modes, params[:mode]), { include_blank: true}, onchange: "this.form.submit()" %></div>
+ <div class="col"><%= f.text_field :nom, value: params[:nom], label:"Nom du compte/Référence", onchange: "this.form.submit()" %></div>
</div>
<% end %>
<br>
<% if policy(Paiement).to_xls? %>
- <%= link_to "Export XLS", url_for(params.permit(:structure_id, :date_début, :date_fin, :search).merge(format: :xls)) %>
+ <%= link_to "Export XLS", url_for(params.permit(:structure_id, :date_début, :date_fin, :mode, :search).merge(format: :xls)) %>
<% end %>
\ No newline at end of file
<th>Prénom</th>
<th>Classe</th>
<th>Qté</th>
- <th colspan="1"></th>
+ <th colspan=2></th>
</tr>
</thead>
<tr>
<td><%= reservation.enfant.compte.structure.nom %></td>
<td><%= reservation.enfant.classroom.nom %></td>
- <td><%= reservation.enfant.nom %></td>
- <td><%= link_to reservation.enfant.prénom, reservation.enfant, class: "text-primary" %></td>
+ <td><%= link_to reservation.enfant.nom_et_prénom, reservation.enfant, class: "text-primary" %></td>
<td class="text-center"><i class="<%= reservation.enfant.menuSP ? "far fa-check-circle" : "" %>"></i></td>
<td class="text-center"><i class="<%= reservation.enfant.menuALL ? "far fa-check-circle" : "" %>"></i></td>
<td><%= reservation.prestation_type.nom %></td>
- <td><%= l reservation.début %></td>
- <td><%= l reservation.fin %></td>
<td class="text-center"><%= number_with_precision(reservation.lundi, locale: :fr, precision: 2, significant: true, strip_insignificant_zeros: true) if reservation.lundi > 0 %></td>
<td class="text-center"><%= number_with_precision(reservation.mardi, locale: :fr, precision: 2, significant: true, strip_insignificant_zeros: true) if reservation.mardi > 0 %></td>
<td class="text-center"><%= number_with_precision(reservation.mercredi, locale: :fr, precision: 2, significant: true, strip_insignificant_zeros: true) if reservation.mercredi > 0 %></td>
<tr>
<th>Structure</th>
<th>Classe</th>
- <th colspan=2>Enfant</th>
+ <th>Enfant</th>
<th>SP?</th>
<th>ALG?</th>
<th>Prestation</th>
- <th>Début</th>
- <th>Fin</th>
<th>Lun</th>
<th>Mar</th>
<th>Mer</th>
<th>Matin</th>
<th>Midi</th>
<th>Soir</th>
- <th>Hors Scolaire?</th>
+ <th>HScol?</th>
</tr>
</thead>