Skip to content

Commit

Permalink
Issue afup#1110 TF personnes morales
Browse files Browse the repository at this point in the history
  • Loading branch information
stakovicz committed Mar 6, 2022
1 parent 61a71e1 commit 64c6a61
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 12 deletions.
2 changes: 2 additions & 0 deletions htdocs/templates/administration/personnes_morales.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ <h2>Liste des personnes morales</h2>
<a href="index.php?page=personnes_morales&amp;action=modifier&amp;id={$personne.id}"
data-position="left center"
data-tooltip="Modifier la fiche de {$personne.raison_sociale}"
title="Modifier la fiche de {$personne.raison_sociale}"
class="compact ui icon button"
>
<i class="pencil alernate icon"></i>
Expand All @@ -79,6 +80,7 @@ <h2>Liste des personnes morales</h2>
<a href="index.php?page=personnes_morales&amp;action=supprimer&amp;id={$personne.id}"
data-position="left center"
data-tooltip="Supprimer la fiche de {$personne.raison_sociale}"
title="Supprimer la fiche de {$personne.raison_sociale}"
class="compact ui red icon button confirmable"
data-confirmable-label="Etes-vous sûr de vouloir supprimer la fiche de {$personne.raison_sociale} ?"
>
Expand Down
2 changes: 2 additions & 0 deletions sources/AppBundle/Association/Form/ContactDetailsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

use Afup\Site\Utils\Pays;
use AppBundle\Offices\OfficesCollection;
use AppBundle\Validator\Constraints\UniqueEntity;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
Expand Down Expand Up @@ -34,6 +35,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add('email', EmailType::class, [
'constraints' => [
new Email(),
new UniqueEntity()
]
])
->add('address', TextareaType::class, [
Expand Down
19 changes: 19 additions & 0 deletions tests/behat/features/Admin/AdminPersonnesMorales.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,22 @@ Feature: Administration - Partie Personnes morales
Then I should see "La personne morale a été ajoutée"
And I should see "Liste des personnes morales"
And I should see "My Corp"
# modifier la personne morale
And I follow "Modifier la fiche de My Corp"
Then the ".content h2" element should contain "Modifier une personne morale"
When I fill in "raison_sociale" with "My Corp modifié"
And I fill in "adresse" with "45 rue de la défense modifié"
And I fill in "code_postal" with "75002"
And I fill in "ville" with "Paris modifié"
And I fill in "nom" with "Nom contact modifié"
And I fill in "prenom" with "Prénom contact modifié"
And I fill in "email" with "emailcontact-modifie@mycorp.fr"
And I press "Modifier"
Then I should see "La personne morale a été modifiée"
And I should see "Liste des personnes morales"
And I should see "My Corp modifié"
# supprimer la personne morale
And I follow "Supprimer la fiche de My Corp"
And print last response
Then I should see "La personne morale a été supprimée"

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Feature: Administration - Partie Personnes morales - cotisations

@reloadDbWithTestData
Scenario: On test le nom du fichier PDF de cotisation récupéré depuis l'admin d'une personne morale
Given I am logged in as admin and on the Administration
And I follow "Personnes morales"
And I check "also_display_inactive"
And I press "Filtrer"
Then I should see "MyCorp"
When I follow the button of tooltip "Gérer les cotisations de MyCorp"
Then I should see "Cotisations de MyCorp"
When I follow the button of tooltip "Télécharger la facture"
Then the response header "Content-disposition" should equal 'attachment; filename="MyCorp_COTIS-2018-201_13072018.pdf"'

@reloadDbWithTestData
Scenario: On test la gestion des cotisations
Given I am logged in as admin and on the Administration
And I follow "Personnes morales"
And I check "also_display_inactive"
And I press "Filtrer"
Then I should see "MyCorp"
When I follow the button of tooltip "Gérer les cotisations de MyCorp"
Then I should see "Cotisations de MyCorp"
When I follow the button of tooltip "Modifier la cotisation"
Then I should see "Modifier une cotisation"
When I fill in "montant" with "152"
And I press "Modifier"
Then I should see "La cotisation pour MyCorp a bien été modifiée"
Then I should see "152.00"
# supprimer la cotisation
When I follow the button of tooltip "Supprimer la cotisation"
Then I should see "La cotisation a été supprimée"
# ajout d'une cotisation
When I follow "Ajouter"
Then I should see "Ajouter une cotisation"
When I fill in "montant" with "150"
And I select "0" from "type_reglement"
When I fill in "informations_reglement" with "notes du réglement"
When I fill in "reference_client" with "42"
And I select "05" from "date_debut[d]"
And I select "3" from "date_debut[F]"
And I select "2022" from "date_debut[Y]"
And I select "05" from "date_fin[d]"
And I select "3" from "date_fin[F]"
And I select "2023" from "date_fin[Y]"
And I press "Ajouter"
Then I should see "La cotisation jusqu'au 05 March 2023 pour MyCorp a bien été ajoutée"
Then I should see "05/03/22"
Then I should see "05/03/23"
Then I should see "150.00"
Then I should see "en espèces"
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ Feature: Administration - Partie Personnes physiques - cotisations
When I follow the button of tooltip "Télécharger la facture"
Then the response header "Content-disposition" should equal 'attachment; filename="Maurice_COTIS-2018-198_13072018.pdf"'

@reloadDbWithTestData
Scenario: On test le nom du fichier PDF de cotisation récupéré depuis l'admin d'une personne morale
Given I am logged in as admin and on the Administration
And I follow "Personnes morales"
And I check "also_display_inactive"
And I press "Filtrer"
Then I should see "MyCorp"
When I follow the button of tooltip "Gérer les cotisations de MyCorp"
Then I should see "Cotisations de MyCorp"
When I follow the button of tooltip "Télécharger la facture"
Then the response header "Content-disposition" should equal 'attachment; filename="MyCorp_COTIS-2018-201_13072018.pdf"'

@reloadDbWithTestData
Scenario: On test l'export CSV des "Personnes physiques en CSV"
Given I am logged in as admin and on the Administration
Expand Down

0 comments on commit 64c6a61

Please sign in to comment.