Skip to content

Commit da5bc93

Browse files
authored
Refonte - Trésorerie - Journal - List (#2127)
Co-authored-by: vgreb <[email protected]>
1 parent 1010ab0 commit da5bc93

File tree

19 files changed

+482
-46
lines changed

19 files changed

+482
-46
lines changed

app/config/packages/backoffice_menu.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,13 @@ parameters:
226226
- admin_accounting_invoices_list
227227
compta_journal:
228228
nom: 'Journal'
229+
url: '/admin/accounting/journal/list'
229230
niveau: 'ROLE_ADMIN'
230231
extra_routes:
232+
- admin_accounting_journal_list
231233
- admin_accounting_journal_add
232234
- admin_accounting_journal_edit
235+
- admin_accounting_journal_import
233236
compta_conf_evenement:
234237
nom: 'Configuration'
235238
niveau: 'ROLE_ADMIN'

app/config/routing/admin_accounting/journal.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
admin_accounting_journal_list:
2+
path: /list
3+
defaults:
4+
_controller: AppBundle\Controller\Admin\Accounting\Journal\ListAction
5+
16
admin_accounting_journal_delete:
27
path: /delete/{id}
38
defaults:
2.49 KB
Loading
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace AppBundle\Accounting;
6+
7+
enum OperationType: int
8+
{
9+
case Debit = 1;
10+
case Credit = 2;
11+
}

sources/AppBundle/Compta/Importer/CreditMutuel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace AppBundle\Compta\Importer;
66

7+
use AppBundle\Accounting\OperationType;
78
use AppBundle\Model\ComptaCompte;
89

910
class CreditMutuel implements Importer

sources/AppBundle/Compta/Importer/Operation.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace AppBundle\Compta\Importer;
66

7+
use AppBundle\Accounting\OperationType;
8+
79
final readonly class Operation
810
{
911
public function __construct(

sources/AppBundle/Compta/Importer/OperationType.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

sources/AppBundle/Controller/Admin/Accounting/Journal/AddTransactionAction.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ public function __invoke(Request $request): Response
2828
if ($form->isSubmitted() && $form->isValid()) {
2929
$this->transactionRepository->save($transaction);
3030
$this->audit->log("Ajout d'une écriture");
31-
$_SESSION['flash']['message'] = "l'écriture a été ajoutée";
32-
$_SESSION['flash']['error'] = false;
33-
$this->addFlash('notice', "l'écriture a été ajoutée");
34-
return $this->redirect('/pages/administration/index.php?page=compta_journal&action=lister#L' . $transaction->getId());
31+
$this->addFlash('notice', "L'écriture a été ajoutée");
32+
return $this->redirect('/admin/accounting/journal/list#L' . $transaction->getId());
3533
}
3634

3735
return $this->render('admin/accounting/journal/add.html.twig', [

sources/AppBundle/Controller/Admin/Accounting/Journal/AllocateAction.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ public function __invoke(Request $request, int $id): RedirectResponse
5050
$transaction->setAmount($transaction->getAmount() - $totalAmount);
5151
$this->transactionRepository->save($transaction);
5252

53-
$_SESSION['flash'] = "L'écriture a été ventilée";
54-
$_SESSION['erreur'] = false;
5553
$this->addFlash('notice', "L'écriture a été ventilée");
56-
return $this->redirect('/pages/administration/index.php?page=compta_journal#journal-ligne-' . $lastId);
54+
return $this->redirect('/admin/accounting/journal/list#journal-ligne-' . $lastId);
5755
}
5856
}

sources/AppBundle/Controller/Admin/Accounting/Journal/DeleteAction.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,13 @@ public function __invoke(Request $request, int $id): Response
2222
{
2323
$accounting = $this->transactionRepository->get($id);
2424
if (!$accounting instanceof Transaction) {
25-
$_SESSION['flash'] = "Une erreur est survenue lors de la suppression de l'écriture";
26-
$_SESSION['erreur'] = true;
2725
$this->addFlash('error', "Une erreur est survenue lors de la suppression de l'écriture");
28-
return $this->redirect('/pages/administration/index.php?page=compta_journal');
26+
return $this->redirectToRoute('admin_accounting_journal_list');
2927
}
3028

3129
$this->transactionRepository->delete($accounting);
3230
$this->audit->log("Suppression de l'écriture {$id}");
33-
$_SESSION['flash'] = "L'écriture a été supprimée";
34-
$_SESSION['erreur'] = false;
3531
$this->addFlash('notice', "L'écriture a été supprimée");
36-
return $this->redirect('/pages/administration/index.php?page=compta_journal');
32+
return $this->redirectToRoute('admin_accounting_journal_list');
3733
}
3834
}

0 commit comments

Comments
 (0)