Commit 157ff19b by Damien Moulard

Merge branch 'develop'

parents d3417d3c f8d3edff
......@@ -460,7 +460,7 @@ services:
admin.flux.gerer:
class: App\Admin\FluxAdmin
arguments: [~, App\Entity\Flux, ~]
arguments: [~, App\Entity\Flux, 'App\Controller\CRUD\CRUDController']
tags:
- name: sonata.admin
manager_type: orm
......
--pour voir le compte de michel marques
select aa.id, aa.balance, user.email from account_adherent aa join user on user.email = 'marques.michel1951@gmail.com' where user.adherent_id = aa.adherent_id;
--permet de voir les derniers flux de typê reversement cotisation et vente emlc
select type, montant, moyen, reference, role, adherent_id, cotisationinfos_id, user_id, created_at from flux where type in ('vente_emlc_adherent','reversement_cotisation_adherent') order by created_at desc limit 20;
--idée :
--
-- Supprimer :
-- l'écriture de flux 22733fa2-fd02-427d-9cdd-36161157a9e9 (dernière étape)
-- l'operation_adherent associée à ce flux
-- l'operation_siege associée à ce flux
-- Enlever :
-- 5 mona sur la balance de account_siege
-- 5 mona sur la balance de Michel
delete from operation_adherent where flux_id = '22733fa2-fd02-427d-9cdd-36161157a9e9';
delete from operation_siege where flux_id = '22733fa2-fd02-427d-9cdd-36161157a9e9';
delete from flux where id = '22733fa2-fd02-427d-9cdd-36161157a9e9';
update account_adherent set balance = balance - 5 where id = '3fe6e79a-1288-4fbd-ba33-0007b9c6de7f';
update account_siege set balance = balance - 5 where currency = 'emlc';
--Puis redéclencher le process de cotisation.
\ No newline at end of file
......@@ -7,6 +7,8 @@ use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
use Symfony\Component\Form\FormRenderer;
use Symfony\Component\Form\FormView;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
class CRUDController extends Controller
{
......@@ -127,53 +129,60 @@ class CRUDController extends Controller
], null);
}
// /**
// * @inheritdoc
// */
// public function exportAction(Request $request)
// {
// $this->admin->checkAccess('export');
// $format = $request->get('format');
// // // NEXT_MAJOR: remove the check
// // if (!$this->has('sonata.admin.admin_exporter')) {
// // @trigger_error(
// // 'Not registering the exporter bundle is deprecated since version 3.14. You must register it to be able to use the export action in 4.0.',
// // \E_USER_DEPRECATED
// // );
// // $allowedExportFormats = (array) $this->admin->getExportFormats();
// // $class = (string) $this->admin->getClass();
// // $filename = sprintf(
// // 'export_%s_%s.%s',
// // strtolower((string) substr($class, strripos($class, '\\') + 1)),
// // date('Y_m_d_H_i_s', strtotime('now')),
// // $format
// // );
// // $exporter = $this->get('sonata.admin.exporter');
// // } else {
// $adminExporter = $this->get('sonata.admin.admin_exporter');
// $allowedExportFormats = $adminExporter->getAvailableFormats($this->admin);
// $filename = $adminExporter->getExportFilename($this->admin, $format);
// $exporter = $this->get('sonata.exporter.exporter');
// // }
// if (!\in_array($format, $allowedExportFormats, true)) {
// throw new \RuntimeException(sprintf(
// 'Export in format `%s` is not allowed for class: `%s`. Allowed formats are: `%s`',
// $format,
// $this->admin->getClass(),
// implode(', ', $allowedExportFormats)
// ));
// }
// return $exporter->getResponse(
// $format,
// $filename,
// $this->admin->getDataSourceIterator()
// );
// }
/**
* Export data to specified format.
*
* @throws AccessDeniedException If access is not granted
* @throws \RuntimeException If the export format is invalid
*
*/
public function exportAction(Request $request)
{
set_time_limit(300); //set php time limit to 5 minutes to make sure big exports can be done
$this->admin->checkAccess('export');
$format = $request->get('format');
// NEXT_MAJOR: remove the check
if (!$this->has('sonata.admin.admin_exporter')) {
@trigger_error(
'Not registering the exporter bundle is deprecated since version 3.14. You must register it to be able to use the export action in 4.0.',
\E_USER_DEPRECATED
);
$allowedExportFormats = (array) $this->admin->getExportFormats();
$class = (string) $this->admin->getClass();
$filename = sprintf(
'export_%s_%s.%s',
strtolower((string) substr($class, strripos($class, '\\') + 1)),
date('Y_m_d_H_i_s', strtotime('now')),
$format
);
$exporter = $this->get('sonata.admin.exporter');
} else {
$adminExporter = $this->get('sonata.admin.admin_exporter');
$allowedExportFormats = $adminExporter->getAvailableFormats($this->admin);
$filename = $adminExporter->getExportFilename($this->admin, $format);
$exporter = $this->get('sonata.exporter.exporter');
}
if (!\in_array($format, $allowedExportFormats, true)) {
throw new \RuntimeException(sprintf(
'Export in format `%s` is not allowed for class: `%s`. Allowed formats are: `%s`',
$format,
$this->admin->getClass(),
implode(', ', $allowedExportFormats)
));
}
return $exporter->getResponse(
$format,
$filename,
$this->admin->getDataSourceIterator()
);
}
public function deleteAction($id)
{
......
{% extends '@kohinos/block/block_collapse.html.twig' %}
{% block blocktitle %}
<i class="fa fa-shopping-basket mr-4"></i> {{'Encaisser un paiement en Monnaie Solidaire'|trans }}
<i class="fa fa-shopping-basket mr-4"></i> {{'Encaisser un paiement en MonA (Monnaie Alimentaire)'|trans }}
{% endblock blocktitle %}
{% block blockcontent %}
<a class='btn btn-xs btn-primary mt-2' href='{{ path('encaissement') }}'>
......
......@@ -14,7 +14,7 @@
<b>{{ app.session.get('_prestagere') }}</b>
</div>
<h2 class='text-center w-100 mt-4 mb-4'>{{ "Paiement en Monnaie Solidaire"|trans }}</h2>
<h2 class='text-center w-100 mt-4 mb-4'>{{ "Paiement en MonA"|trans }}</h2>
{% else %}
<div class="mt-3 payment-page-header">
<a href='{{ path('encaissement') }}'>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment