suppression fonctions inutiles ; ajout fichiers oubliés
FossilOrigin-Name: fd2e220b6b0f50b860d8887f6149b50756485ee81c7eecef851f476bc3514d31
This commit is contained in:
parent
c221014650
commit
c7e336fa96
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace Garradin\Plugin\RecusFiscaux;
|
||||
/*
|
||||
* information d'une activité
|
||||
*/
|
||||
class Activite
|
||||
{
|
||||
public $id;
|
||||
public $label;
|
||||
public $description;
|
||||
|
||||
public function __construct(
|
||||
$id,
|
||||
$label,
|
||||
$description)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->label = $label;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
/*
|
||||
* @return instance de Activite initialisée avec l'objet o
|
||||
*/
|
||||
public static function copier($o)
|
||||
{
|
||||
return new Activite(
|
||||
$o->id,
|
||||
$o->label,
|
||||
$o->description);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
namespace Garradin\Plugin\RecusFiscaux;
|
||||
/*
|
||||
* information d'un tarif
|
||||
*/
|
||||
class Tarif
|
||||
{
|
||||
public $id;
|
||||
public $idActivite; // activité associée
|
||||
public $label;
|
||||
public $description;
|
||||
public $montant;
|
||||
|
||||
public function __construct(
|
||||
$id,
|
||||
$idActivite,
|
||||
$label,
|
||||
$description,
|
||||
$montant)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->idActivite = $idActivite;
|
||||
$this->label = $label;
|
||||
$this->description = $description;
|
||||
$this->montant = $montant;
|
||||
}
|
||||
|
||||
/*
|
||||
* @return instance de Tarif initialisée avec l'objet o
|
||||
*/
|
||||
public static function copier($o)
|
||||
{
|
||||
return new Tarif(
|
||||
$o->id,
|
||||
$o->idActivite,
|
||||
$o->label,
|
||||
$o->description,
|
||||
$o->montant);
|
||||
}
|
||||
}
|
179
lib/Utils.php
179
lib/Utils.php
|
@ -7,8 +7,6 @@ use KD2\ZipWriter;
|
|||
|
||||
class Utils
|
||||
{
|
||||
// ------------------------------------------------------------
|
||||
// test nouvelle organisation
|
||||
/**
|
||||
* @return tarifs demandés
|
||||
* @param array $tarifs
|
||||
|
@ -156,60 +154,6 @@ class Utils
|
|||
return $_SESSION['ligneReduction'][$taux];
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @return liste des activités
|
||||
*/
|
||||
public static function getToutesActivites()
|
||||
{
|
||||
return DB::getInstance()->get(
|
||||
"SELECT
|
||||
id as idActivite,
|
||||
label,
|
||||
description
|
||||
FROM services
|
||||
ORDER BY label"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return liste des tarifs d'une activité
|
||||
* @param $activite : identifiant de l'activité
|
||||
*/
|
||||
public static function getTarifsActivite($activite)
|
||||
{
|
||||
return DB::getInstance()->get(
|
||||
"SELECT
|
||||
services_fees.id as idTarif,
|
||||
services_fees.label as titreTarif,
|
||||
services_fees.description as descTarif,
|
||||
services_fees.amount as montantTarif
|
||||
FROM services_fees
|
||||
WHERE services_fees.id_service = ?",
|
||||
$activite
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return liste de toutes les activités et tarifs
|
||||
*/
|
||||
public static function getActivitesEtTarifs()
|
||||
{
|
||||
return DB::getInstance()->get(
|
||||
"SELECT
|
||||
services.id as idActivite,
|
||||
services.label as titreActivite,
|
||||
services.description as descActivite,
|
||||
services_fees.id as idTarif,
|
||||
services_fees.label as titreTarif,
|
||||
services_fees.description as descTarif
|
||||
FROM services
|
||||
LEFT JOIN services_fees ON services_fees.id_service = services.id
|
||||
ORDER BY services.id, services_fees.id"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return liste de toutes les activités, tarifs et comptes associés
|
||||
*/
|
||||
|
@ -232,121 +176,6 @@ class Utils
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return tous les versements de l'année
|
||||
* @param $annee
|
||||
*/
|
||||
public static function getTousLesVersements($annee)
|
||||
{
|
||||
$sql =
|
||||
"SELECT
|
||||
services.id as idActivite,
|
||||
services_fees.id as idTarif,
|
||||
services.label as activite,
|
||||
services_fees.label as tarif,
|
||||
services_fees.amount as montant,
|
||||
acc_transactions_users.id_user as idUser,
|
||||
acc_transactions_lines.credit as versement,
|
||||
membres.nom as nom,
|
||||
membres.adresse as adresse,
|
||||
membres.ville as ville,
|
||||
membres.code_postal as codePostal,
|
||||
membres.email as courriel,
|
||||
acc_transactions.date,
|
||||
acc_transactions_users.id_transaction as idTrans
|
||||
FROM acc_transactions_users
|
||||
INNER JOIN membres on acc_transactions_users.id_user = membres.id
|
||||
INNER JOIN acc_transactions on acc_transactions_users.id_transaction = acc_transactions.id
|
||||
INNER JOIN services_users on acc_transactions_users.id_service_user = services_users.id
|
||||
INNER JOIN services on services_users.id_service = services.id
|
||||
INNER JOIN services_fees on services_users.id_fee = services_fees.id
|
||||
INNER JOIN acc_transactions_lines on acc_transactions_lines.id_transaction = acc_transactions.id
|
||||
WHERE
|
||||
(strftime(\"%Y\", acc_transactions.date) = ?
|
||||
AND
|
||||
acc_transactions_lines.credit > 0)
|
||||
ORDER by services.id, services_fees.id, membres.nom, acc_transactions.date";
|
||||
return DB::getInstance()->get($sql, $annee);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return versements d'une année pour un ensemble de tarifs donnés
|
||||
* @param $annee
|
||||
* @param array $lesTarifs
|
||||
*/
|
||||
public static function getVersementsActivite($annee, $lesTarifs)
|
||||
{
|
||||
$db = DB::getInstance();
|
||||
$sql = sprintf(
|
||||
'SELECT
|
||||
services.id as idActivite,
|
||||
services_fees.id as idTarif,
|
||||
services.label as activite,
|
||||
services_fees.label as tarif,
|
||||
services_fees.amount as montant,
|
||||
acc_transactions_users.id_user as idUser,
|
||||
acc_transactions_lines.credit as versement,
|
||||
membres.nom as nom,
|
||||
membres.adresse as adresse,
|
||||
membres.ville as ville,
|
||||
membres.code_postal as codePostal,
|
||||
membres.email as courriel,
|
||||
acc_transactions.date,
|
||||
acc_transactions_users.id_transaction as idTrans
|
||||
FROM acc_transactions_users
|
||||
INNER JOIN membres on acc_transactions_users.id_user = membres.id
|
||||
INNER JOIN acc_transactions on acc_transactions_users.id_transaction = acc_transactions.id
|
||||
INNER JOIN services_users on acc_transactions_users.id_service_user = services_users.id
|
||||
INNER JOIN services on services_users.id_service = services.id
|
||||
INNER JOIN services_fees on services_users.id_fee = services_fees.id
|
||||
INNER JOIN acc_transactions_lines on acc_transactions_lines.id_transaction = acc_transactions.id
|
||||
WHERE
|
||||
(strftime(%s, acc_transactions.date) = "%d"
|
||||
AND
|
||||
services_fees.%s
|
||||
AND
|
||||
acc_transactions_lines.credit > 0)
|
||||
ORDER by membres.nom, acc_transactions.date',
|
||||
'"%Y"',
|
||||
$annee,
|
||||
$db->where('id', $lesTarifs));
|
||||
return $db->get($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Versements totaux par personne pour une année donnée
|
||||
* @param année
|
||||
*/
|
||||
public static function getVersementsTotaux_old($annee) {
|
||||
$sql =
|
||||
"SELECT
|
||||
acc_transactions_users.id_user as idUser,
|
||||
membres.nom as nom,
|
||||
sum(acc_transactions_lines.credit) AS montant,
|
||||
membres.adresse as adresse,
|
||||
membres.code_postal as codePostal,
|
||||
membres.ville as ville
|
||||
FROM
|
||||
acc_transactions_users,
|
||||
membres,
|
||||
acc_transactions
|
||||
INNER JOIN acc_transactions_lines
|
||||
ON acc_transactions_lines.id_transaction = acc_transactions.id
|
||||
WHERE (
|
||||
strftime('%Y', acc_transactions.date) = ?
|
||||
AND
|
||||
acc_transactions_lines.credit > 0
|
||||
AND
|
||||
acc_transactions_users.id_transaction = acc_transactions.id
|
||||
AND
|
||||
acc_transactions_users.id_user = membres.id
|
||||
)
|
||||
GROUP by acc_transactions_users.id_user
|
||||
ORDER by membres.nom COLLATE U_NOCASE;
|
||||
";
|
||||
return DB::getInstance()->get($sql, $annee);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return nom de l'association
|
||||
*/
|
||||
|
@ -385,14 +214,6 @@ class Utils
|
|||
return $anneesFiscales;
|
||||
}
|
||||
|
||||
/** TODO
|
||||
* générer les reçus
|
||||
* @param tableau des versements par personne
|
||||
*/
|
||||
static function genererRecus() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* enregistrer les fichiers dans une archive zip
|
||||
* @param $fileList : liste des fichiers à archiver
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
<b title="Champ obligatoire">obligatoire</b>
|
||||
</dt>
|
||||
{foreach from=$plugin_config->articlesCGI key="key" item="article"}
|
||||
{* {input : checked ne fonctionne pas si l'attribut name est un tableau...
|
||||
{*
|
||||
À VÉRIFIER : {input : checked ne fonctionne pas si l'attribut name est un tableau...
|
||||
{input type="checkbox" name="articlesCGI[]" value=$key label=$article.titre}
|
||||
*}
|
||||
<input type="checkbox" name="articlesCGI[]" value="{$key}"
|
||||
|
|
|
@ -105,7 +105,6 @@
|
|||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{*<p class="help">Si vous ne savez pas quel taux de réduction utiliser, n'en choisissez aucun</p>*}
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -17,9 +17,6 @@ $_SESSION['ligneReduction'] = Utils::getLignesReduction($plugin->getConfig('redu
|
|||
// liste des activités, cotisations et comptes associés
|
||||
$activitesTarifsComptes = Utils::getActivitesTarifsEtComptes();
|
||||
|
||||
// actions
|
||||
//lesActions = [ 'versements_personnes.php', 'versements_activites.php' ];
|
||||
|
||||
// préparation de l'affichage
|
||||
$tpl->assign('anneesFiscales', $anneesFiscales);
|
||||
$tpl->assign('anneeCourante', $anneeCourante);
|
||||
|
|
|
@ -178,43 +178,3 @@ function verifierRadio(idElem)
|
|||
alert("Erreur : il faut sélectionner un taux de réduction");
|
||||
return false;
|
||||
}
|
||||
|
||||
// inutilisé
|
||||
function activerDesactiverRadio(evt)
|
||||
{
|
||||
var idCase = evt.target;
|
||||
// checher la ligne englobante ( <tr>)
|
||||
var ligne = idCase.closest("tr");
|
||||
// itérer sur les radio de cette ligne
|
||||
var lesRadios = ligne.querySelectorAll('input[type=radio]');
|
||||
for (var idRadio of lesRadios) {
|
||||
if (idCase.checked) {
|
||||
idRadio.disabled = '';
|
||||
} else {
|
||||
idRadio.disabled = 'disabled';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Associer un écouteur à la première case à cocher de chaque table
|
||||
* @remarks : n'est plus utile
|
||||
*/
|
||||
function activerListener()
|
||||
{
|
||||
// parcourir les tables
|
||||
const lesTables = document.querySelectorAll("table.list");
|
||||
for (let i = 0; i < lesTables.length; ++i) {
|
||||
// vérifier si c'est l'une des tables qui nous intéresse
|
||||
// l'id est du genre : versements_xx où xx est un entier
|
||||
const id = lesTables[i].id;
|
||||
const re = /^versements_[0-9]+/;
|
||||
console.log("id = " + id + " => " + re.test(id));
|
||||
if (re.test(id)) {
|
||||
// chercher le premier élément input
|
||||
const premierInput = lesTables[i].querySelector("input");
|
||||
// associer un écouteur à la première case à cocher
|
||||
premierInput.addEventListener('change', cocherDecocher);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ div.impair {
|
|||
padding : 0.1em;
|
||||
}
|
||||
fieldset {
|
||||
border:2px solid brown;
|
||||
border:1px solid brown;
|
||||
-webkit-border-radius:8px;
|
||||
border-radius:8px;
|
||||
}
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
namespace Garradin;
|
||||
|
||||
use Garradin\Plugin\RecusFiscaux\Activite;
|
||||
use Garradin\Plugin\RecusFiscaux\Personne;
|
||||
use Garradin\Plugin\RecusFiscaux\Tarif;
|
||||
use Garradin\Plugin\RecusFiscaux\Utils;
|
||||
|
||||
// vérifier si l'année a bien été sélectionnée au préalable
|
||||
|
|
Loading…
Reference in New Issue