Skip to content
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
6 changes: 6 additions & 0 deletions db/seeds/ComptaPeriode.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ public function run(): void
'date_fin' => '2024-12-31',
'verouiller' => 0,
],
[
'id' => 16,
'date_debut' => '2025-01-01',
'date_fin' => '2025-12-31',
'verouiller' => 0,
],
];

$table = $this->table('compta_periode');
Expand Down
33 changes: 33 additions & 0 deletions db/seeds/Facture.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,31 @@ public function run(): void
'ref_clt3' => '',
'tel' => '',
],
// on a besoin d'une facture avant 2024 pour tester les exports sans TVA
[
'id' => '5',
'date_devis' => "2023-06-10",
'numero_devis' => "2023-01",
'date_facture' => "2023-06-11",
'numero_facture' => "2023-01",
'societe' => 'Krampouz',
'adresse' => '3, rue du port',
'code_postal' => '29000',
'ville' => 'Quimper',
'id_pays' => 'FR',
'email' => 'mail@testmail.fr',
'tva_intra' => null,
'nom' => 'Le kellen',
'prenom' => 'Yan',
'etat_paiement' => 1,
'devise_facture' => 'EUR',
'ref_clt1' => "Forum PHP 2023",
'service' => '',
'observation' => '',
'ref_clt2' => '',
'ref_clt3' => '',
'tel' => '',
],
];

$table = $this->table('afup_compta_facture');
Expand Down Expand Up @@ -145,6 +170,14 @@ public function run(): void
'pu' => '1000',
'tva' => '20',
],
[
'idafup_compta_facture' => '5',
'ref' => "forum_php_2023",
'designation' => "Forum PHP 2023 - Sponsoring Bronze",
'quantite' => '1',
'pu' => '1000',
'tva' => '20',
],
];

$table = $this->table('afup_compta_facture_details');
Expand Down
32 changes: 16 additions & 16 deletions tests/behat/features/Admin/Tresorerie/DevisFactures.feature
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Feature: Administration - Trésorerie - Devis/Facture
And I should see "Paris Cedex 7"
And I should see "Payé"
# Envoi de la facture par email
Then I follow the button of tooltip "Envoyer la facture 2025-3 par mail"
Then I follow the button of tooltip "Envoyer la facture 2026-3 par mail"
And I should only receive the following emails:
| from | to | subject |
| <bonjour@afup.org> | <martine@ens-en-folie.biz> | Facture AFUP |
Expand All @@ -100,7 +100,7 @@ Feature: Administration - Trésorerie - Devis/Facture
# Téléchargement de la facture
When I go to "/admin/"
And I follow "Factures"
And I follow the button of tooltip "Télécharger la facture 2025-3"
And I follow the button of tooltip "Télécharger la facture 2026-3"
Then the response header "Content-disposition" should match '#attachment; filename="Facture - ESN dev en folie - (.*).pdf"#'
When I parse the pdf downloaded content
Then The page "1" of the PDF should contain "N° TVA Intracommunautaire : FR7612345"
Expand All @@ -110,7 +110,7 @@ Feature: Administration - Trésorerie - Devis/Facture
Scenario: Vérification de la devise par défaut (Euro)
# Téléchargement du devis
Given I am logged in as admin and on the Administration
When I go to "/admin/accounting/quotations/list?periodId=15"
When I go to "/admin/accounting/quotations/list?periodId=16"
Then the ".content h2" element should contain "Liste des devis"
And I should see "My company Ltd"
And I follow the button of tooltip "Télécharger le devis My company Ltd"
Expand Down Expand Up @@ -145,20 +145,20 @@ Feature: Administration - Trésorerie - Devis/Facture
@vat
Scenario: Test du PDF de facture après 2024
Given I am logged in as admin and on the Administration
When I go to "/admin/accounting/invoices/list?periodId=15"
When I go to "/admin/accounting/invoices/list?periodId=16"
Then the ".content h2" element should contain "Factures"
And I should see "Il n'est pas possible de créer directement une facture"
When I follow the button of tooltip "Télécharger la facture 2024-02"
Then the response header "Content-disposition" should equal 'attachment; filename="Facture - Krampouz - 2024-01-04.pdf"'
When I follow the button of tooltip "Télécharger la facture 2025-02"
Then the response header "Content-disposition" should equal 'attachment; filename="Facture - Krampouz - 2025-01-04.pdf"'
Given I parse the pdf downloaded content
Then The page "1" of the PDF should contain "Le 04/01/2024"
Then The page "1" of the PDF should contain "Le 04/01/2025"
Then The page "1" of the PDF should contain "Krampouz"
Then The page "1" of the PDF should contain "3, rue du port"
Then The page "1" of the PDF should contain "Facture n° 2024-02"
Then The page "1" of the PDF should contain "Repère(s) : Forum PHP 2024"
Then The page "1" of the PDF should contain "Facture n° 2025-02"
Then The page "1" of the PDF should contain "Repère(s) : Forum PHP 2025"
Then The page "1" of the PDF should contain "Comme convenu, nous vous prions de trouver votre facture"
Then The page "1" of the PDF should contain "Type Description Quantite TVA Prix HT Total TTC"
Then The page "1" of the PDF should contain "forum_php_2024 Forum PHP 2024 - Sponsoring"
Then The page "1" of the PDF should contain "forum_php_2025 Forum PHP 2025 - Sponsoring"
Then The page "1" of the PDF should contain "Bronze 1.00 20.00% 1 000,00 € 1 200,00 €"
Then The page "1" of the PDF should contain "TOTAL HT 1 000,00 €"
Then The page "1" of the PDF should contain "Total TVA 20.00% 200,00 €"
Expand Down Expand Up @@ -191,19 +191,19 @@ Feature: Administration - Trésorerie - Devis/Facture
@vat
Scenario: Test du PDF de devis après 2024
Given I am logged in as admin and on the Administration
When I go to "/admin/accounting/quotations/list?periodId=15"
When I go to "/admin/accounting/quotations/list?periodId=16"
Then the ".content h2" element should contain "Liste des devis"
When I follow the button of tooltip "Télécharger le devis Krampouz"
Then the response header "Content-disposition" should equal 'attachment; filename="Devis - Krampouz - 2024-01-03.pdf"'
Then the response header "Content-disposition" should equal 'attachment; filename="Devis - Krampouz - 2025-01-03.pdf"'
Given I parse the pdf downloaded content
Then The page "1" of the PDF should contain "Le 03/01/2024"
Then The page "1" of the PDF should contain "Le 03/01/2025"
Then The page "1" of the PDF should contain "Krampouz"
Then The page "1" of the PDF should contain "3, rue du port"
Then The page "1" of the PDF should contain "Devis n° 2024-02"
Then The page "1" of the PDF should contain "Repère(s) : Forum PHP 2024"
Then The page "1" of the PDF should contain "Devis n° 2025-02"
Then The page "1" of the PDF should contain "Repère(s) : Forum PHP 2025"
Then The page "1" of the PDF should contain "Comme convenu, nous vous prions de trouver votre devis"
Then The page "1" of the PDF should contain "Type Description Quantite TVA Prix HT Total TTC"
Then The page "1" of the PDF should contain "forum_php_2024 Forum PHP 2024 - Sponsoring"
Then The page "1" of the PDF should contain "forum_php_2025 Forum PHP 2025 - Sponsoring"
Then The page "1" of the PDF should contain "Bronze 1.00 20.00% 1 000,00 € 1 200,00 €"
Then The page "1" of the PDF should contain "TOTAL HT 1 000,00 €"
Then The page "1" of the PDF should contain "Total TVA 20.00% 200,00 €"
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/EventPages/Ticketing.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Feature: Event pages - Ticketing
And I submit the form with name "PAYBOX"
When I fill in "NUMERO_CARTE" with "1111222233334444"
And I select "12" from "MOIS_VALIDITE"
And I select "25" from "AN_VALIDITE"
And I select "26" from "AN_VALIDITE"
And I fill in "CVVX" with "123"
And I press "Valider"
Then I should see "PAIEMENT ACCEPTÉ"
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/MembersArea/Index.feature
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Feature: Espace membre, accueil
When I follow "Consulter"
Then I should see "Payer ma cotisation"
When I follow "Télécharger la facture"
Then the response header "Content-disposition" should equal 'attachment; filename=MyCorp_COTIS-2025-200_13072018.pdf'
Then the response header "Content-disposition" should equal 'attachment; filename=MyCorp_COTIS-2026-200_13072018.pdf'

@reloadDbWithTestData
@clearEmails
Expand Down
4 changes: 2 additions & 2 deletions tests/behat/features/PublicSite/Register.feature
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Feature: Site Public - Register
And I submit the form with name "PAYBOX"
When I fill in "NUMERO_CARTE" with "1111222233334444"
And I select "12" from "MOIS_VALIDITE"
And I select "25" from "AN_VALIDITE"
And I select "26" from "AN_VALIDITE"
And I fill in "CVVX" with "123"
And I press "Valider"
Then I should see "PAIEMENT ACCEPTÉ"
Expand Down Expand Up @@ -87,7 +87,7 @@ Feature: Site Public - Register
And I submit the form with name "PAYBOX"
When I fill in "NUMERO_CARTE" with "1111222233334444"
And I select "12" from "MOIS_VALIDITE"
And I select "25" from "AN_VALIDITE"
And I select "26" from "AN_VALIDITE"
And I fill in "CVVX" with "123"
And I press "Valider"
Then I should see "PAIEMENT ACCEPTÉ"
Expand Down