Commit f59dd2c0 by Yvon Kerdoncuff

Merge branch '5486-caissier-exclude-reconversions-from-total-transactions' into 'develop'

as caissier exclude reconversions from prestataire total transactions calculation

See merge request cooperatic/kohinos-tav!49
parents f8d3edff 83263ff2
...@@ -148,7 +148,8 @@ class PrestatairesController extends FrontController ...@@ -148,7 +148,8 @@ class PrestatairesController extends FrontController
} }
/** /**
* Get the total transactions amount towards the Prestataire since the last time it was fetched * Get the total transactions amount towards the Prestataire since the last time it was fetched.
* Exclude Reconversions from calculation.
* *
* @Route("/prestataires/get_last_transactions", name="get_presta_last_transactions") * @Route("/prestataires/get_last_transactions", name="get_presta_last_transactions")
* @IsGranted({"ROLE_CAISSIER", "ROLE_PRESTATAIRE"}) * @IsGranted({"ROLE_CAISSIER", "ROLE_PRESTATAIRE"})
...@@ -177,7 +178,10 @@ class PrestatairesController extends FrontController ...@@ -177,7 +178,10 @@ class PrestatairesController extends FrontController
$total_amount = 0; $total_amount = 0;
foreach ($flux as $flux_item) { foreach ($flux as $flux_item) {
$total_amount += $flux_item->getMontant(); // Exclude reconversions from calculation
if ($flux_item->getType() != "reconversion_prestataire") {
$total_amount += $flux_item->getMontant();
}
} }
// Set now as this presta last export date // Set now as this presta last export date
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
{% block blockcontent %} {% block blockcontent %}
{% set datetime_last_export = getPrestaLastTransactionsExportDate() %} {% set datetime_last_export = getPrestaLastTransactionsExportDate() %}
<p>Récupérer le montant total des transactions depuis le <b>{{ datetime_last_export }}</b></p> <p>Récupérer le montant total des transactions (hors reconversions) depuis le <b>{{ datetime_last_export }}</b></p>
<a class='btn btn-xs btn-primary mt-2' href='{{ path('get_presta_last_transactions') }}'> <a class='btn btn-xs btn-primary mt-2' href='{{ path('get_presta_last_transactions') }}'>
{{ 'Exporter'|trans }} {{ 'Exporter'|trans }}
</a> </a>
......
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