{% extends 'base.html.twig' %}
{% block title %}Détails | {{ parent() }}{% endblock %}
{% block body %}
<div class="breadcrumb">
<h1 class="mr-2">Inscrits</h1>
<ul>
<li><a href="{{ path('default') }}" onclick="$('.loader').addClass('is-active');">Accueil</a></li>
<li><a href="#">Elèves</a></li>
<li><a href="{{ path('registration_student_registration_index') }}" onclick="$('.loader').addClass('is-active');">Retour</a></li>
<li>Détails</li>
</ul>
</div>
<div class="separator-breadcrumb border-top"></div>
<div class="row mb-4">
<div class="col-md-12">
<a href="{{ path('registration_student_registration_print_access_card', {'id': registration_student_registration.id}) }}" target="_blank" class="btn btn-dark"><i class="fa fa-print"></i> Carte d'accès</a>
<a href="{{ path('registration_student_registration_print_card', {'id': registration_student_registration.id}) }}" target="_blank" class="btn btn-dark"><i class="fa fa-print"></i> Carte de sortie</a>
<a href="{{ path('registration_student_registration_print_attestation_of_attendance', {'id': registration_student_registration.id}) }}" class="btn btn-dark"><i class="fa fa-print"></i> Attestation de fréquentation</a>
<a href="{{ path('registration_student_registration_print_acknowledgment_receip', {'id': registration_student_registration.id}) }}" class="btn btn-dark"><i class="fa fa-print"></i> Accusé de réception</a>
<a href="{{ path('registration_student_registration_print', {'id': registration_student_registration.id}) }}" class="btn btn-dark"><i class="fa fa-print"></i> Fiche Inscription</a>
{% if registration_student_registration.hasTransportFee %}
<a href="{{ path('registration_student_registration_print_transpotantion_sheet', {'id': registration_student_registration.id}) }}" class="btn btn-dark"><i class="fa fa-print"></i> Fiche de transport </a>
{% endif %}
<a href="{{ path('registration_student_registration_print_fees_details', {'id': registration_student_registration.id}) }}" class="btn btn-dark"><i class="fa fa-print"></i> Détails Frais </a>
{% if registration_student_registration.registrationStudentAbandonments|length > 0 and not registration_student_registration.isAbandonne %}
{% if is_granted('ROLE_ADMIN') %}
<a href="#" class="btn btn-warning" onclick="javascript:actionByPathAndElts('{{path('registration_student_registration_abandon', {'id': registration_student_registration.id})}}')"><i class="fa fa-times"></i> Abandonner</a>
{% endif %}
{% endif %}
</div>
</div>
<div class="card user-profile o-hidden mb-4">
<div class="user-info mt-24">
{% if registration_student_registration.image %}
<img class="profile-picture avatar-lg mb-2" src="{{ vich_uploader_asset(registration_student_registration) }}" alt="" />
{% else %}
{% if registration_student_registration.student.image %}
<img class="profile-picture avatar-lg mb-2" src="{{ vich_uploader_asset(registration_student_registration.student) }}" alt="" />
{% endif %}
{% endif %}
<p class="m-0 text-24">{{ registration_student_registration.name }}</p>
<p class="text-muted m-0">Mle: {{ registration_student_registration.student.registrationNumber != 'AUCUN' ? registration_student_registration.student.registrationNumber : registration_student_registration.student.code }}</p>
<p class="text-muted m-0">Contact: {{ registration_student_registration.student.notificationPhoneNumber }}</p>
<p class="text-muted m-0">Classe: {{ registration_student_registration.classroom.label }}</p>
</div>
<div class="card-body">
<ul class="nav nav-tabs profile-nav mb-4" id="profileTab" role="tablist">
<li class="nav-item"><a class="nav-link active" id="fees-tab" data-toggle="tab" href="#fees" role="tab" aria-controls="fees" aria-selected="false">Frais</a></li>
<li class="nav-item"><a class="nav-link" id="shedul-tab" data-toggle="tab" href="#shedul" role="tab" aria-controls="shedul" aria-selected="true">Echéanciers</a></li>
<li class="nav-item"><a class="nav-link" id="payments-tab" data-toggle="tab" href="#payments" role="tab" aria-controls="payments" aria-selected="false">Réçus</a></li>
{% if registration_student_registration.accountingCredits|length > 0 %}
<li class="nav-item"><a class="nav-link" id="credit-tab" data-toggle="tab" href="#credit" role="tab" aria-controls="credit" aria-selected="false">Avoirs</a></li>
{% endif %}
<li class="nav-item"><a class="nav-link" id="reportCard-tab" data-toggle="tab" href="#reportCard" role="tab" aria-controls="reportCard" aria-selected="false">Bulletins</a></li>
{% if registration_student_registration.hasTransportFee %}
<li class="nav-item"><a class="nav-link" id="transport-tab" data-toggle="tab" href="#transport" role="tab" aria-controls="transport" aria-selected="false">Transport</a></li>
{% endif %}
</ul>
<div class="tab-content" id="profileTabContent">
<div class="tab-pane fade active show" id="fees" role="tabpanel" aria-labelledby="fees-tab">
<a href="#" class="btn btn-primary" data-toggle="modal" data-target="#addFeeModal">Ajouter</a>
{# <a href="#" class="btn btn-warning" data-toggle="modal" data-target="#addAnteriorBalanceModal">Ajouter Solde Anterieur</a> #}
{% if is_granted('ROLE_SUPPRESSION_FRAIS') %}
<a href="#" class="btn btn-danger" onclick="javascript:actionByPathAndElts('{{path('accounting_student_registration_fees_selected_delete')}}')" id="delete-selected-btn"><i class="fa fa-trash"></i> Supprimer</a>
{% endif %}
<br /><br />
{{ include('accounting/accounting_student_registration_fee/_table.html.twig') }}
</div>
<div class="tab-pane fade" id="shedul" role="tabpanel" aria-labelledby="shedul-tab">
<a href="{{ path('registration_student_registration_print_schedule', {'id': registration_student_registration.id}) }}" class="btn btn-dark mb-3"><i class="fa fa-print"></i> Imprimer l'échéancier</a>
<br />
{{ include('accounting/accounting_student_registration_fee_shedul/_table.html.twig') }}
</div>
<div class="tab-pane fade" id="payments" role="tabpanel" aria-labelledby="payments-tab">
{{ include('accounting/accounting_student_registration_payment/_table.html.twig') }}
</div>
{% if registration_student_registration.accountingCredits|length > 0 %}
<div class="tab-pane fade" id="credit" role="tabpanel" aria-labelledby="credit-tab">
<div class="table-responsive">
<table class="display table table-striped table-bordered">
<thead>
<tr>
<th>#</th>
<th>AVOIR N°</th>
<th>Date</th>
<th class="text-center">Montant</th>
<th class="text-center">Etat</th>
<th width="10%" class="text-center">Action</th>
</tr>
</thead>
<tbody>
{% for accounting_credit in registration_student_registration.accountingCredits %}
<tr>
<td>{{ loop.index }}</td>
<td>{{ accounting_credit.id }} [{{ accounting_credit.studentRegistration.student }}] [{{ accounting_credit.studentRegistration.classroom.label }}]</td>
<td>{{ accounting_credit.createDate ? accounting_credit.createDate|date('d/m/Y') : '' }}</td>
<td class="text-center">{{ accounting_credit.amount|number_format(0, ',', ' ') }}</td>
{% if accounting_credit.isValidated %}
<td class="text-center">VALIDE</td>
{% else %}
{% if accounting_credit.amount > 0 %}
<td class="text-center">EN ATTENTE DE VALIDATION</td>
{% else %}
<td class="text-center">BROUILLON</td>
{% endif %}
{% endif %}
<td class="text-center">
{% if accounting_credit.isValidated %}
<a href="{{ path('accounting_credit_print', {'id': accounting_credit.id})}}" class="btn-sm btn-dark"><i class="fa fa-print"></i></a>
{% else %}
<a href="{{ path('accounting_credit_student_add', {'id': accounting_credit.studentRegistration.id})}}" class="btn-sm btn-primary"><i class="fa fa-eye"></i></a>
{% endif %}
</td>
</tr>
{#% endif %#}
{% for accounting_credit_line in accounting_credit.accountingCreditLines %}
<tr>
<td class="text-right"></td>
<td class="text-right text-danger">Réçus N°{{ accounting_credit_line.paymentCode }}</td>
<td>{{ accounting_credit_line.paymentDate ? accounting_credit_line.paymentDate|date('d/m/Y') }}</td>
<td class="text-center">{{ accounting_credit_line.paymentAmount|number_format(0, ',', ' ') }}</td>
<td class="text-center">SUPPRIMER</td>
<td class="text-center">
<a href="{{ path('preview', {'file': 'RECU_N_' ~ registration_student_registration.student.code ~ '_' ~ accounting_credit_line.paymentCode ~ '.pdf', 'dir': 'cashRegister'})}}" class="btn-sm btn-dark"><i class="fa fa-print"></i></a>
</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
<div class="tab-pane fade" id="reportCard" role="tabpanel" aria-labelledby="reportCard-tab">
</div>
{% if registration_student_registration.hasTransportFee %}
<div class="tab-pane fade" id="transport" role="tabpanel" aria-labelledby="transport-tab">
{{ include('registration/registration_student_registration/_transport_checkpoint_table.html.twig') }}
</div>
{% endif %}
</div>
</div>
</div>
<div class="modal fade" id="addFeeModal" role="dialog" aria-labelledby="addFeeModal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addFeeModal_title">Ajouter frais</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
{{ form_start(accounting_student_registration_fee_form) }}
<div class="modal-body">
<div class="form-group">
<label class="col-form-label" for="accounting_student_registration_fee_fee">Frais:</label>
{{ form_widget(accounting_student_registration_fee_form.fee,{'attr': {'class': 'form-control select', 'style': 'width: 100%;'}}) }}
</div>
<div class="form-group">
<label class="col-form-label" for="accounting_student_registration_fee_quantity">Quantité:</label>
{{ form_widget(accounting_student_registration_fee_form.quantity,{'attr': {'class': 'form-control', 'style': 'width: 100%;'}}) }}
</div>
<div class="form-group duration">
<label class="col-form-label" for="accounting_student_registration_fee_start_at">Date debut:</label>
{{ form_widget(accounting_student_registration_fee_form.start_at,{'attr': {'class': 'form-control', 'style': 'width: 100%;'}}) }}
</div>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Annuler</button>
<button class="btn btn-primary" onclick="$('.loader').addClass('is-active');" type="submit">Ajouter</button>
</div>
{{ form_end(accounting_student_registration_fee_form) }}
</div>
</div>
</div>
{# <div class="modal fade" id="addAnteriorBalanceModal" tabindex="-1" role="dialog" aria-labelledby="addAnteriorBalanceModal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addAnteriorBalanceModal_title">Ajouter Solde Anterieur</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<form method="get">
<div class="modal-body">
<div class="form-group">
<label class="col-form-label" for="anterior_balance_amount">Montant:</label>
<input type="number" class="form-control" name="anterior_balance_amount" id="anterior_balance_amount">
<input type="hidden" name="__cd_token___" value="soldeAnterieur">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Annuler</button>
<button class="btn btn-primary" type="submit">Ajouter</button>
</div>
</form>
</div>
</div>
</div> #}
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script>
$(document).ready(function () {
$('.duration').hide();
$('#addCheckPointBtn').hide();
$('#registration_transport_checkpoint_transportZone').change(function(){
id = $('#registration_transport_checkpoint_transportZone').val();
getZoneInfo(id);
}).trigger("change");
$('#registration_transport_checkpoint_transportZoneCheckPoint').change(function(){
id2 = $('#registration_transport_checkpoint_transportZoneCheckPoint').val();
getSheduleInfo(id2);
});
$('#accounting_student_registration_fee_fee').change(function(){
idFee = $('#accounting_student_registration_fee_fee').val();
getFeeHasDuration(idFee);
}).trigger("change");
})
function getZoneInfo(sId) {
console.log('entity ' + sId);
path = '{{ path('api_transport_zone_info') }}';
$('#registration_transport_checkpoint_transportVehicle').html('');
$('#registration_transport_checkpoint_transportZoneCheckPoint').html('');
axios.get(path, {
params: {
id: sId,
}
}).then(function (response) {
console.log(response.data);
if(response.data.code == 200){
var checkPointOption = '';
var carOption = '';
for(var i = 0; i < response.data.checkpoints.length; i++){
checkPointOption = "<option value=" + response.data.checkpoints[i].id + ">" + response.data.checkpoints[i].name + "</option>";
$('#registration_transport_checkpoint_transportZoneCheckPoint').append(checkPointOption);
}
if(response.data.carId > 0){
carOption = "<option value=" + response.data.carId + ">" + response.data.carName + "</option>";
$('#registration_transport_checkpoint_transportVehicle').append(carOption);
}
getSheduleInfo($('#registration_transport_checkpoint_transportZoneCheckPoint').val());
$('#addCheckPointBtn').show();
}else{
console.log(response.data.message);
$('#addCheckPointBtn').hide();
}
console.log(response.data.message);
//$(".loader").removeClass("is-active");
});
}
function getFeeHasDuration(sId) {
console.log('entity ' + sId);
path = '{{ path('api_setting_fee_has_duration') }}';
axios.get(path, {
params: {
id: sId,
}
}).then(function (response) {
console.log(response.data);
if(response.data.code == 200){
$('.duration').show();
}else{
console.log(response.data.message);
$('.duration').hide();
}
console.log(response.data.message);
});
}
function getSheduleInfo(sId2) {
console.log('entity ' + sId2);
path = '{{ path('api_transport_zone_check_point_info') }}';
$('#registration_transport_checkpoint_morning_schedule').val('recherche...');
$('#registration_transport_checkpoint_evening_schedule').val('recherche...');
axios.get(path, {
params: {
id: sId2,
}
}).then(function (response) {
console.log(response.data);
if(response.data.code == 200){
$('#registration_transport_checkpoint_morning_schedule').val(response.data.morningSchedule);
$('#registration_transport_checkpoint_evening_schedule').val(response.data.eveningSchedule);
$('#addCheckPointBtn').show();
}else{
console.log(response.data.message);
$('#addCheckPointBtn').hide();
}
console.log(response.data.message);
//$(".loader").removeClass("is-active");
});
}
function cancelShedul(path, sid) {
$('#registration_transport_checkpoint_transportVehicle').html('');
$('#registration_transport_checkpoint_transportZoneCheckPoint').html('');
axios.get(path, {
params: {
id: sid,
amount: $('#registration_transport_checkpoint_transportZoneCheckPoint').html('')
}
}).then(function (response) {
console.log(response.data);
if(response.data.code == 200){
var checkPointOption = '';
var carOption = '';
for(var i = 0; i < response.data.checkpoints.length; i++){
checkPointOption = "<option value=" + response.data.checkpoints[i].id + ">" + response.data.checkpoints[i].name + "</option>";
$('#registration_transport_checkpoint_transportZoneCheckPoint').append(checkPointOption);
}
if(response.data.carId > 0){
carOption = "<option value=" + response.data.carId + ">" + response.data.carName + "</option>";
$('#registration_transport_checkpoint_transportVehicle').append(carOption);
}
getSheduleInfo($('#registration_transport_checkpoint_transportZoneCheckPoint').val());
$('#addCheckPointBtn').show();
}else{
console.log(response.data.message);
$('#addCheckPointBtn').hide();
}
console.log(response.data.message);
//$(".loader").removeClass("is-active");
});
}
function fee_shedul_update_date_due(obj, path) {
swalWithBootstrapButtons.fire({
title: 'Attention!',
text: "Etes vous sûr de vouloir effectuer cette action?",
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'OUI',
cancelButtonText: 'NON',
}).then((result) => {
if (result.isConfirmed) {
$(".loader").addClass("is-active");
axios.get(path, {
params: {
date_due: obj.val(),
}
}).then(function (response) {
console.log(response.data);
if(response.data.code == 200){
$(".loader").removeClass("is-active");
swalWithBootstrapButtons.fire({
title: 'Effectué!',
text: response.data.message,
icon: 'success',
showCancelButton: false,
confirmButtonText: 'OK'
}).then((result) => {
if (result.isConfirmed) {
location.reload();
}
});
}else{
console.log(response.data.message);
$(".loader").removeClass("is-active");
swalWithBootstrapButtons.fire({
title: 'Echèc!',
text: response.data.message,
icon: 'warning',
showCancelButton: false,
confirmButtonText: 'OK'
}).then((result) => {
if (result.isConfirmed) {
location.reload();
}
});
}
});
}
});
}
</script>
{% endblock %}