Skip to content

Commit

Permalink
Rajout montant et penalité dans le rapport
Browse files Browse the repository at this point in the history
Menu code des résultats maha renommé
Admin a accès à visit
On affiche maintenant la valeur du resultat dans le rapport de visite
J'ai rajouté intervalle sur controle mais ce n'est pas encore pris en compte dans le résultat. Pour l'intant l'appli traite tous les controles actifs comme visuel.
  • Loading branch information
d.sissoko authored and d.sissoko committed Nov 28, 2019
1 parent cafb7b0 commit 1b658de
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 20 deletions.
7 changes: 6 additions & 1 deletion app/Resources/views/default/rapport.html.twig
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<div>
<span style="font-weight: bolder">MTS Bamako</span>
<span style="float:right">Montant visite : {{ quittance.montantvisite }}</span>
</div>
<div>
<span style="font-weight: bolder">Date de contr&ocirc;le : {% if visite.date %}{{ visite.date|date('Y-m-d H:i:s') }}{% endif %}</span>
<span style="float:right">Jours de retard : {{ quittance.retard }}</span>
</div>
<div>
<span style="font-weight: bolder">N&deg; de quittance : {{ quittance.numero }}</span>
<span style="float:right">Montant p&eacute;nalit&eacute; : {{ quittance.penalite }}</span>
</div>
<div>
<span style="font-weight: bolder">N&deg; Immatriculation : {{ visite.vehicule.immatriculation }}</span>
Expand All @@ -18,14 +21,16 @@
<tr>
<td>Bilan de la visite technique</td>
<td>D&eacute;tails</td>
<td>R&eacute;sultats</td>
<td>Valeur controle</td>
<td>R&eacute;sultat</td>
</tr>
{% if visite.resultats %}
{% for resultat in visite.resultats %}
<tr>
<td>{{ resultat.controle.libelle }}</td>
<td>{{ resultat.controle.detail }}</td>
<td>{{ resultat.commentaire }}</td>
<td>{% if resultat.succes %}SUCCES{% else %}ECHEC{% endif %}</td>
</tr>
{% endfor %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion app/Resources/views/parametres/menu.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</li>
<li class="nav-item {% block menu_codemaharesultat_open %}{% endblock %}">
<a class="nav-link {% block menu_codemaharesultat_actif %}{% endblock %}" href="{{ path('admin_parametres_codemaharesultat_index') }}">
<i class="nav-icon icon-list"></i> Codes des Résultats MAHA</a>
<i class="nav-icon icon-list"></i> Résultats MAHA</a>
</li>
<li class="nav-item {% block menu_vehiculemaha_open %}{% endblock %}">
<a class="nav-link {% block menu_vehiculemaha_actif %}{% endblock %}" href="#">
Expand Down
13 changes: 6 additions & 7 deletions app/Resources/views/visite/quittance.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% endblock %}
{% block pagetitle -%}LISTE DES QUITTANCES : {{ profil }}{% endblock %}
{% block actions %}
{% if is_granted('ROLE_CAISSIER') %}
{% if profil != 'ADMIN' and is_granted('ROLE_CAISSIER') %}
{% if centre.etat %}
{% if caisse.ouvert %}
<label class="btn btn-success">LA CAISSE EST OUVERTE</label>
Expand Down Expand Up @@ -66,15 +66,15 @@
width:700,
buttons: {
"Valider": function() {
$(location).attr('href', '{{ path('admin_parametres_caisse_ouvrir', { 'id': caisse.id }) }}')
$(location).attr('href', '{{ path('admin_parametres_caisse_ouvrir', { 'id': idCaisse }) }}')
},
Annuler: function() {
$( this ).dialog( "close" );
}
}
};
$('#ouverture-modal').html("<img src='{{ asset('images/loader.gif') }}' />");
$('#ouverture-modal').load('{{ path('caisse_ouverture_confirmer', { 'id': caisse.id }) }}').dialog(options).dialog('open');
$('#ouverture-modal').load('{{ path('caisse_ouverture_confirmer', { 'id': idCaisse }) }}').dialog(options).dialog('open');
}
function fermer(){
Expand All @@ -84,15 +84,15 @@
width:700,
buttons: {
"Valider": function() {
$(location).attr('href', '{{ path('admin_parametres_caisse_fermer', { 'id': caisse.id }) }}')
$(location).attr('href', '{{ path('admin_parametres_caisse_fermer', { 'id': idCaisse }) }}')
},
Annuler: function() {
$( this ).dialog( "close" );
}
}
};
$('#ouverture-modal').html("<img src='{{ asset('images/loader.gif') }}' />");
$('#ouverture-modal').load('{{ path('caisse_fermeture_confirmer', { 'id': caisse.id }) }}').dialog(options).dialog('open');
$('#ouverture-modal').load('{{ path('caisse_fermeture_confirmer', { 'id': idCaisse }) }}').dialog(options).dialog('open');
}
function loadDynamicContentModal(id){
Expand All @@ -116,8 +116,7 @@
$(document).ready(function() {
$('#liste_clients').DataTable({
"columnDefs": [
"columnDefs": [
{ "orderable": false, "targets": 3 }
],
"processing": true,
Expand Down
20 changes: 13 additions & 7 deletions src/AppBundle/Controller/VisiteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,20 @@ public function quittanceAction()
$affectation = $em->getRepository('AppBundle:Affectation')->derniereAffectation($user->getId());
$centre = $em->getRepository('AppBundle:Centre')->recuperer();
$admin = $this->get('security.authorization_checker')->isGranted('ROLE_SUPERVISEUR');
if(!$centre || !$affectation || $affectation === -1){
if(!$centre || (!$admin && (!$affectation || $affectation === -1))){
$this->get('session')->getFlashBag()->add('error', "Vous n'êtes affecté à aucune caisse. Contacter l'administrateur.");
return $this->redirectToRoute('homepage');
}

$caisse = $affectation->getCaisse();
$profil = $admin ? "ADMIN" : "CAISSE N° ".$caisse->getNumero();
return $this->render('visite/quittance.html.twig', array('profil'=>$profil, 'caisse'=>$caisse, 'centre'=>$centre,));
if(!$admin){
$caisse = $affectation->getCaisse();
$profil = "CAISSE N° ".$caisse->getNumero();
$idCaisse = $caisse->getId();
}else{
$profil = "ADMIN";
$caisse = null;
$idCaisse = 0;
}
return $this->render('visite/quittance.html.twig', array('profil'=>$profil, 'caisse'=>$caisse, 'centre'=>$centre, 'idCaisse'=>$idCaisse,));
}

/**
Expand Down Expand Up @@ -300,8 +306,8 @@ public function quittanceAjaxAction(Request $request)
}
if($admin){
$rResult = $em->getRepository('AppBundle:Visite')->findQuittancesAjax($start, $end, $aColumns[$sCol], $sdir, $searchTerm, 0);
$iTotal = $em->getRepository('AppBundle:Visite')->countQuittanceRows($affectation->getCaisse()->getId());
$iTotalFiltre = $em->getRepository('AppBundle:Visite')->countQuittanceRowsFiltre($affectation->getCaisse()->getId(), $searchTerm);
$iTotal = $em->getRepository('AppBundle:Visite')->countQuittanceRows(0);
$iTotalFiltre = $em->getRepository('AppBundle:Visite')->countQuittanceRowsFiltre(0, $searchTerm);
}else{
$rResult = $em->getRepository('AppBundle:Visite')->findQuittancesAjax($start, $end, $aColumns[$sCol], $sdir, $searchTerm, $affectation->getCaisse()->getId());
$iTotal = $em->getRepository('AppBundle:Visite')->countQuittanceRows($affectation->getCaisse()->getId());
Expand Down
50 changes: 50 additions & 0 deletions src/AppBundle/Entity/Controle.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,30 @@ class Controle
*/
private $type;

/**
* @var string $unite
*
* @ORM\Column(name="unite", type="string", length=255, nullable=false)
* @Assert\NotBlank
*/
private $unite;

/**
* @var integer $minimum
*
* @ORM\Column(name="minimum", type="integer", nullable=false)
* @Assert\NotBlank
*/
private $minimum;

/**
* @var integer $maximum
*
* @ORM\Column(name="maximum", type="integer", nullable=false)
* @Assert\NotBlank
*/
private $maximum;

/**
* @ORM\ManyToOne(targetEntity="CategorieControle", inversedBy="controles", cascade={"persist","refresh"})
* @ORM\JoinColumn(name="categorie_id", referencedColumnName="id")
Expand Down Expand Up @@ -219,6 +243,30 @@ function setType($type) {
$this->type = $type;
}

function getUnite() {
return $this->unite;
}

function getMinimum() {
return $this->minimum;
}

function getMaximum() {
return $this->maximum;
}

function setUnite($unite) {
$this->unite = $unite;
}

function setMinimum($minimum) {
$this->minimum = $minimum;
}

function setMaximum($maximum) {
$this->maximum = $maximum;
}

//BEHAVIOR
/**
* @var string $creePar
Expand Down Expand Up @@ -313,6 +361,8 @@ public function __toString(){
public function __construct()
{
$this->users = new ArrayCollection();
$this->minimum = 0;
$this->maximum = 0;
}

}
2 changes: 1 addition & 1 deletion src/AppBundle/Entity/Resultat.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public function __construct()
public function generer($visite, $resultatMaha){
$this->visite = $visite;
$this->controle = $resultatMaha->getControle();
$this->commentaire = $resultatMaha->getLibelle();
$this->commentaire = $resultatMaha->getCode();
$this->succes = $resultatMaha->getReussite();
}
}
2 changes: 1 addition & 1 deletion src/AppBundle/Entity/Vehicule.php
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ public function genererCrc($chaine){
}

private function getDateMiseCirculationFormatCrc(){
return date("dmY", strtotime($this->getDateMiseCirculation()));
return date("Ydm", strtotime($this->getDateMiseCirculation()));
}

}
2 changes: 1 addition & 1 deletion src/AppBundle/Form/CodeMahaResultatType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('libelle')
->add('code')
->add('code', 'text', array('label'=>'Valeur'))
->add('detail')
->add('actif')
->add('reussite')
Expand Down
5 changes: 4 additions & 1 deletion src/AppBundle/Form/ControleType.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$builder
->add('libelle')
->add('code')
->add('type', 'choice',['choices' => ['' => 'Choisir un type', 'MESURE' => 'MESURE', 'VISUEL' => 'VISUEL' ]])
->add('type', 'choice',['choices' => ['' => 'Choisir un type', 'VALEUR MAHA' => 'VALEUR MAHA', 'INTERVALE MAHA' => 'INTERVALE MAHA', 'VISUEL' => 'VISUEL' ]])
->add('unite')
->add('minimum')
->add('maximum')
->add('detail')
->add('actif')
->add('categorie');
Expand Down

0 comments on commit 1b658de

Please sign in to comment.