Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat (afup#1110): TF Administration - Trésorerie #1324

Merged
merged 4 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions db/seeds/Compta.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

use Phinx\Seed\AbstractSeed;

class Compta extends AbstractSeed
{
public function run()
{
$dir = 'htdocs/uploads/202310/';
if (!is_dir($dir)) {
if (!mkdir($dir) && !is_dir($dir)) {
throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
}
}

copy('tests/behat/files/test_file1.pdf', $dir.'test_file1.pdf');

$data = [
[
'idoperation' => 2,
'idcategorie' => 34,
'montant' => 1000,
'idmode_regl' => 2,
'date_regl' => '2023-10-16',
'date_ecriture' => '2023-10-17',
'description' => 'Une recette qui rapporte',
'attachment_filename' => '202310/test_file1.pdf',
'idevenement' => 5,
'idcompte' => 1
],
[
'idoperation' => 1,
'idcategorie' => 34,
'montant' => 500,
'idmode_regl' => 2,
'date_regl' => '2023-10-17',
'date_ecriture' => '2023-10-18',
'description' => 'Une dépense très utile',
'idevenement' => 5,
'idcompte' => 1
],
];

$table = $this->table('compta');
$table->truncate();

$table
->insert($data)
->save();
}
}
1 change: 1 addition & 0 deletions htdocs/templates/administration/compta_synthese.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ <h2>Synthese des évènements</h2>
<option value="{$listsEvenement.id}" {if $idevnt == $listsEvenement.id} selected{/if}> {$listsEvenement.evenement}</option>
{/foreach}
</select>
<button type="submit" name="evt_submit" style="visibility: hidden">Valider</button>
</div>
</div>
</div>
Expand Down
11 changes: 11 additions & 0 deletions tests/behat/features/Admin/Tresorerie/BalanceComptable.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Feature: Administration - Trésorerie - Balance comptable

@reloadDbWithTestData
Scenario: Balance comptable afficher
Given I am logged in as admin and on the Administration
When I follow "Balance comptable"
Then the ".content h2" element should contain "Balance comptable"
And I should see "AG 500,00 1 000,00"
And I follow the button of tooltip "Voir sur la page courante"
And I should see "17/10/2023 Assurances Une recette qui rapporte 0,00 1 000,00"
And I should see "18/10/2023 Assurances Une dépense très utile 500,00 0,00"
12 changes: 12 additions & 0 deletions tests/behat/features/Admin/Tresorerie/Bilan.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Feature: Administration - Trésorerie - Bilan

@reloadDbWithTestData
Scenario: Bilan afficher
Given I am logged in as admin and on the Administration
When I follow "Bilan"
Then the ".content h2" element should contain "Bilan"
And I should see "AG 500,00"
And I should see "AG 1 000,00"
And I follow the button of tooltip "Déplier les écritures de débit/crédit pour AG"
And I should see "18/10/2023 Une dépense très utile 500,00"
And I should see "17/10/2023 Une recette qui rapporte 1 000,00"
26 changes: 26 additions & 0 deletions tests/behat/features/Admin/Tresorerie/CompteBanques.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Feature: Administration - Trésorerie - Compte banques

@reloadDbWithTestData
Scenario: Compte banques voir le journal de banque
Given I am logged in as admin and on the Administration
When I follow "Compte banques"
Then the ".content h2" element should contain "Journal de banque"
Then I should see "16/10/2023 Carte Bleue Une recette qui rapporte 1 000,00"
Then I should see "17/10/2023 Carte Bleue Une dépense très utile 500,00"
Then I should see "500,00 Total débit"
Then I should see "1 000,00 Total crédit"
Then I should see "500,00 solde"

@reloadDbWithTestData
Scenario: Compte banques Export Excel
Given I am logged in as admin and on the Administration
When I follow "Compte banques"
And I follow "Export XLSX"
Then the response header "Content-disposition" should match '#filename="compta_afup_(.*).xlsx"#'

@reloadDbWithTestData
Scenario: Compte banques Télécharger les justificatifs triés par mois
Given I am logged in as admin and on the Administration
When I follow "Compte banques"
And I follow "Télécharger les justificatifs triés par mois"
Then the response header "Content-disposition" should match '#filename="afup_justificatifs-(.*).zip"#'
62 changes: 62 additions & 0 deletions tests/behat/features/Admin/Tresorerie/Configuration.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
Feature: Administration - Trésorerie - Configuration

Scenario: Création/liste des évènements
stakovicz marked this conversation as resolved.
Show resolved Hide resolved
Given I am logged in as admin and on the Administration
When I follow "Configuration"
Then the ".content h2" element should contain "Configuration"
When I follow "Évènements"
When I follow "Ajouter"
Then the ".content h2" element should contain "Ajouter une ligne configuration 'Evenement'"
When I fill in "evenement" with "Un super évènement"
And I press "soumettre"
Then the ".content .message" element should contain "L'écriture a été ajoutée"
And I should see "Un super évènement"

Scenario: Création/liste des catégories
Given I am logged in as admin and on the Administration
When I follow "Configuration"
Then the ".content h2" element should contain "Configuration"
When I follow "Catégories"
When I follow "Ajouter"
Then the ".content h2" element should contain "Ajouter une categorie"
When I fill in "categorie" with "Une super catégorie"
And I press "soumettre"
Then the ".content .message" element should contain "L'écriture a été ajoutée"
And I should see "Une super catégorie"

Scenario: Création/liste des opérations
Given I am logged in as admin and on the Administration
When I follow "Configuration"
Then the ".content h2" element should contain "Configuration"
When I follow "Opérations"
When I follow "Ajouter"
Then the ".content h2" element should contain "Ajouter une opération"
When I fill in "operation" with "Une super opération"
And I press "soumettre"
Then the ".content .message" element should contain "L'écriture a été ajoutée"
And I should see "Une super opération"

Scenario: Création/liste des opérations
Given I am logged in as admin and on the Administration
When I follow "Configuration"
Then the ".content h2" element should contain "Configuration"
When I follow "Modes de réglements"
When I follow "Ajouter"
Then the ".content h2" element should contain "Ajouter un type de reglement"
When I fill in "reglement" with "Un super règlement"
And I press "soumettre"
Then the ".content .message" element should contain "L'écriture a été ajoutée"
And I should see "Un super règlement"

Scenario: Création/liste des comptes
Given I am logged in as admin and on the Administration
When I follow "Configuration"
Then the ".content h2" element should contain "Configuration"
When I follow "Comptes"
When I follow "Ajouter"
Then the ".content h2" element should contain "Ajouter un compte"
When I fill in "nom_compte" with "Un super compte"
And I press "soumettre"
Then the ".content .message" element should contain "L'écriture a été ajoutée"
And I should see "Un super compte"

10 changes: 10 additions & 0 deletions tests/behat/features/Admin/Tresorerie/RechercheComptable.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Feature: Administration - Trésorerie - Recherche comptable

@reloadDbWithTestData
Scenario: Recherche Comptable pour raoul
Given I am logged in as admin and on the Administration
When I follow "Recherche comptable"
Then the ".content h2" element should contain "Recherche comptable"
When I fill in "q" with "raoul"
And I press "Rechercher"
And I should see "Jul 13, 2018 > Jul 8, 2019 150.00 Dupont Raoul <[email protected]>"
15 changes: 15 additions & 0 deletions tests/behat/features/Admin/Tresorerie/SyntheseEvenements.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Feature: Administration - Synthese des évènements

@reloadDbWithTestData
Scenario: Synthese des évènements de l'AG
Given I am logged in as admin and on the Administration
When I follow "Synthese évènement"
Then the ".content h2" element should contain "Synthese des évènements"
Then I select "5" from "idevnt"
And I press "evt_submit"
Then I should see "Assurances Une dépense très utile 500,00"
Then I should see "Assurances Une recette qui rapporte 1 000,00"
Then I should see "500,00 Total dépenses"
Then I should see "1 000,00 Total recettes"
Then I should see "500,00 Différence"

12 changes: 12 additions & 0 deletions tests/behat/features/PublicSite/Rss.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Feature: Site Public - Flux RSS

@reloadDbWithTestData
Scenario: On accède au flux RSS via le lien dans le footer
stakovicz marked this conversation as resolved.
Show resolved Hide resolved
Given I am on the homepage
And I follow "Accédez au flux RSS de l'AFUP"
Then the response header "Content-type" should match '#^text/xml; charset=UTF-8$#'
And the response should contain "Le flux RSS de l'AFUP"
And the response should contain "<rss version=\"2.0\">"
And the response should contain "<title><![CDATA[Les vidéos des talks du Forum PHP 2018 sont disponibles]]></title>"
And the response should contain "<guid>https://apachephptest:80/news/1-les-videos-du-forum-2018-en-ligne</guid>"
And the response should contain "</rss>"
Loading