diff --git a/lib/Utils.php b/lib/Utils.php index fac6190..d9416f7 100644 --- a/lib/Utils.php +++ b/lib/Utils.php @@ -63,13 +63,12 @@ class Utils INNER JOIN acc_accounts ON acc_transactions_lines.id_account = acc_accounts.id WHERE - (strftime(%s, acc_transactions.date) = "%d" + (strftime("%%Y", acc_transactions.date) = "%d" AND acc_accounts.%s ) GROUP by acc_accounts.code ORDER by acc_accounts.code', - '"%Y"', $annee, $db->where('code', $op, $comptes) ); @@ -104,14 +103,13 @@ class Utils INNER JOIN acc_accounts ON acc_transactions_lines.id_account = acc_accounts.id WHERE - (strftime(%s, acc_transactions.date) = "%d" + (strftime("%%Y", acc_transactions.date) = "%d" AND acc_accounts.%s ) GROUP BY services_fees.id, acc_accounts.code ORDER BY acc_accounts.code ', - '"%Y"', $annee, $db->where('code', $op, $comptes) ); @@ -170,12 +168,12 @@ class Utils INNER JOIN acc_accounts ON acc_transactions_lines.id_account = acc_accounts.id WHERE - (strftime(%s, acc_transactions.date) = "%d" + (strftime("%%Y", acc_transactions.date) = "%d" AND acc_accounts.%s ) + GROUP BY acc_transactions.id, acc_accounts.id ORDER by %s, acc_accounts.code, acc_transactions.date', - '"%Y"', $annee, $db->where('code', $op, $comptes), $tri @@ -225,7 +223,8 @@ class Utils AND %s ) - ORDER by services_fees.id, %s, acc_accounts.code, acc_transactions.date', + GROUP BY acc_transactions.id, acc_accounts.id + ORDER by %s, acc_accounts.code, acc_transactions.date', $annee, $condition, $tri @@ -265,14 +264,13 @@ class Utils INNER JOIN acc_accounts ON acc_transactions_lines.id_account = acc_accounts.id WHERE - (strftime(%s, acc_transactions.date) = "%d" + (strftime("%%Y", acc_transactions.date) = "%d" AND acc_accounts.%s ) - + GROUP BY acc_transactions.id, acc_accounts.id ORDER by %s, acc_accounts.code, acc_transactions.date ', - '"%Y"', $annee, $db->where('id', 'in', $comptesIsoles), $tri @@ -308,7 +306,7 @@ class Utils INNER JOIN acc_transactions_lines ON acc_transactions_lines.id_transaction = acc_transactions.id WHERE ( - strftime(%s, acc_transactions.date) = "%d" + strftime("%%Y", acc_transactions.date) = "%d" AND acc_transactions_users.id_transaction = acc_transactions.id AND @@ -319,7 +317,6 @@ class Utils ', $tri, $nom, - '"%Y"', $annee ); $donateurs = array(); diff --git a/www/admin/index.php b/www/admin/index.php index 9125c0c..2b4fb14 100644 --- a/www/admin/index.php +++ b/www/admin/index.php @@ -37,7 +37,7 @@ if (null !== $champsNom) // pendant l'année fiscale choisie $_SESSION['comptes'] = Utils::getComptes($_SESSION['annee_recu'], 'like', '7%'); -// liste des activités, cotisations et comptes associés +// liste des activités, tarifs et comptes associés $activitesTarifsComptes = Utils::getTarifsComptes($_SESSION['annee_recu'], 'like', '7%'); $_SESSION['lesTarifs'] = Utils::getTarifs(); $_SESSION['lesActivites'] = Utils::getActivites(); diff --git a/www/admin/versements_activites.php b/www/admin/versements_activites.php index 20aae12..7ffc9ec 100644 --- a/www/admin/versements_activites.php +++ b/www/admin/versements_activites.php @@ -63,12 +63,15 @@ $lesComptes = array_map(fn($elem) : string => $tarifsSelectionnes); # versements des tarifs sélectionnées et de leur compte associé -$_SESSION['lesVersements'] = +if (count($lesTarifs) != 0) +{ + $_SESSION['lesVersements'] = Utils::getVersementsTarifsComptes( $_SESSION['annee_recu'], $lesTarifs, $lesComptes, $champsNom); +} // ajouter les versements sans tarif (tri par nom, compte, date) if (isset($_SESSION['comptesSelectionnes']))