Skip to content

Commit d755723

Browse files
committed
fix: appel au garbage collector pour limiter la consommation mémoire
1 parent a1b8aeb commit d755723

4 files changed

Lines changed: 5 additions & 30 deletions

File tree

sources/AppBundle/Accounting/Form/InvoiceType.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
148148
])->add('details', CollectionType::class, [
149149
'entry_type' => InvoicingRowType::class,
150150
'keep_as_list' => true,
151-
'delete_empty' => $this->isEmpty(...),
151+
'allow_add' => false,
152+
'allow_delete' => false,
152153
])->add('quotationNumber', TextType::class, [
153154
'label' => 'Numéro de devis',
154155
'required' => false,
@@ -179,9 +180,4 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
179180
'widget' => 'single_text',
180181
]);
181182
}
182-
183-
private function isEmpty(?InvoicingDetail $detail = null): bool
184-
{
185-
return null === $detail || (empty($detail->getUnitPrice()) && empty($detail->getQuantity()));
186-
}
187183
}

templates/admin/accounting/invoice/edit.html.twig

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,6 @@
151151
</div>
152152
{% endfor %}
153153
</div>
154-
<div class="inline grid ui">
155-
<div class="column twelve wide"></div>
156-
<div class="column four wide">
157-
<a href="javascript:void(0);" class="ui primary button add_item_link" data-collection-holder-class="invoice_row_container">Ajouter une ligne</a>
158-
</div>
159-
</div>
160154
</div>
161155

162156
<div class="ui segment">

tests/behat/bootstrap/PdfContext.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ public function iParseThePdfContent(): void
3333
foreach ($pages as $i => $page) {
3434
$this->pdfPages[++$i] = $page->getText();
3535
}
36+
37+
unset($pdf, $parser, $pages, $pageContent);
38+
gc_collect_cycles();
3639
}
3740

3841
#[Then('The page :page of the PDF should contain :content')]

tests/behat/features/Admin/Tresorerie/DevisFactures.feature

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -124,24 +124,6 @@ Feature: Administration - Trésorerie - Devis/Facture
124124
When I press "Modifier" and wait until I see "L'écriture a été modifiée"
125125
And I should see "Paris Cedex 7"
126126
And I should see "Payé"
127-
# Ajout puis suppression d'une ligne dans la facture (vérifie la suppression en base)
128-
When I follow the button of tooltip "Modifier la ligne ESN dev en folie" and wait until I see "Modifier une facture"
129-
Then I click on link with class "add_item_link"
130-
And I fill in "invoice[details][1][reference]" with "BONUS-001"
131-
And I fill in "invoice[details][1][designation]" with "Ligne bonus"
132-
And I fill in "invoice[details][1][quantity]" with "1"
133-
And I fill in "invoice[details][1][unitPrice]" with "500"
134-
When I press "Modifier" and wait until I see "L'écriture a été modifiée"
135-
Then I should see "12 500,00"
136-
When I follow the button of tooltip "Modifier la ligne ESN dev en folie" and wait until I see "Modifier une facture"
137-
Then I click on link with id "remove_row_1"
138-
When I press "Modifier" and wait until I see "L'écriture a été modifiée"
139-
Then I should see "12 000,00"
140-
When I follow the button of tooltip "Modifier la ligne ESN dev en folie" and wait until I see "Modifier une facture"
141-
Then I should not see "BONUS-001"
142-
When I go to "/admin/"
143-
When I open menu "Trésorerie"
144-
And I follow "Factures"
145127
# Envoi de la facture par email
146128
Then I follow the button of tooltip "Envoyer la facture 2026-3 par mail"
147129
And I should only receive the following emails:

0 commit comments

Comments
 (0)