Overview
Comment:Liste des activités en cours et état des paiements
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6d02803261115068e28ff16bc017ff3b0618999c
User & Date: bohwaz on 2014-02-03 16:16:16
Other Links: manifest | tags
Context
2014-02-03
16:44
Simplification statut cotisation obligatoire check-in: d62276773e user: bohwaz tags: trunk
16:16
Liste des activités en cours et état des paiements check-in: 6d02803261 user: bohwaz tags: trunk
15:54
Liens actions avec icône unicode check-in: 9a50bc5f21 user: bohwaz tags: trunk
Changes

Modified src/include/class.membres_transactions.php from [7a570041fe] to [e1019c0a10].

136
137
138
139
140
141
142


















143
144
145
146
147
148
149
		$db = DB::getInstance();
		return $db->simpleStatementFetch('SELECT mtr.*, 
				tr.intitule, tr.duree, tr.debut, tr.fin
			FROM membres_transactions AS mtr 
				LEFT JOIN transactions AS tr ON tr.id = mtr.id_transaction
			WHERE mtr.id_membre = ? ORDER BY mtr.date DESC;', \SQLITE3_ASSOC, (int)$id);
	}



















	public function isMemberUpToDate($id, $transaction)
	{
		$db = DB::getInstance();

		$where = '';
		$expires = 'NULL';







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
		$db = DB::getInstance();
		return $db->simpleStatementFetch('SELECT mtr.*, 
				tr.intitule, tr.duree, tr.debut, tr.fin
			FROM membres_transactions AS mtr 
				LEFT JOIN transactions AS tr ON tr.id = mtr.id_transaction
			WHERE mtr.id_membre = ? ORDER BY mtr.date DESC;', \SQLITE3_ASSOC, (int)$id);
	}

	public function listCurrentSubscriptionsForMember($id)
	{
		$db = DB::getInstance();
		return $db->simpleStatementFetch('SELECT SUM(mtr.montant) AS total, tr.montant,
				tr.montant - SUM(mtr.montant) AS a_payer, tr.intitule, tr.duree, tr.debut, tr.fin,
				CASE WHEN tr.duree IS NOT NULL THEN date(mtr.date, \'+\'||tr.duree||\' days\')
				WHEN tr.fin IS NOT NULL THEN tr.fin ELSE NULL END AS expiration
			FROM membres_transactions AS mtr 
				INNER JOIN transactions AS tr ON tr.id = mtr.id_transaction
			WHERE mtr.id_membre = ? AND (
				(tr.duree IS NOT NULL AND mtr.date >= date(\'now\', \'-\'||tr.duree||\' days\'))
				OR (tr.fin IS NOT NULL AND tr.fin >= date(\'now\'))
				OR (tr.fin IS NULL AND tr.duree IS NULL)
			)
			GROUP BY mtr.id_transaction
			ORDER BY mtr.date DESC;', \SQLITE3_ASSOC, (int)$id);
	}

	public function isMemberUpToDate($id, $transaction)
	{
		$db = DB::getInstance();

		$where = '';
		$expires = 'NULL';

Modified src/templates/admin/membres/transactions.tpl from [cb12ea13d8] to [d7a672e152].

42
43
44
45
46
47
48














49
50
51
52
53
54
55
        {elseif $nb_paiements}
            {$nb_paiements|escape} paiements enregistrés
        {else}
            Aucun paiement enregistré
        {/if} 
    </dd>
    <dd><form method="get" action="{$admin_url}membres/transactions/ajout.php"><input type="submit" value="Enregistrer un paiement &rarr;" /><input type="hidden" name="id" value="{$membre.id|escape}" /></form></dd>














</dl>

<table class="list">
    <thead>
        <th>Date</th>
        <td width="40%">Intitulé</td>
        <td>Montant</td>







>
>
>
>
>
>
>
>
>
>
>
>
>
>







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
        {elseif $nb_paiements}
            {$nb_paiements|escape} paiements enregistrés
        {else}
            Aucun paiement enregistré
        {/if} 
    </dd>
    <dd><form method="get" action="{$admin_url}membres/transactions/ajout.php"><input type="submit" value="Enregistrer un paiement &rarr;" /><input type="hidden" name="id" value="{$membre.id|escape}" /></form></dd>
{if !empty($activites)}
    <dt>Activités ou cotisations en cours</dt>
    {foreach from=$activites item="activite"}
    <dd>{$activite.intitule|escape} — 
        {if $activite.total == $activite.montant}<span class="confirm">Réglé</span>
        {else}
            <span class="alert">{$activite.total|escape_money} {$config.monnaie|escape} 
                réglés sur un total de {$activite.montant|escape_money} {$config.monnaie|escape}</span>
            <span class="error">(reste {$activite.a_payer|escape_money} {$config.monnaie|escape} à payer)</span>
        {/if}
        {if $activite.expiration}— Valide jusqu'au {$activite.expiration|format_sqlite_date_to_french}{/if}
    </dd>
    {/foreach}
{/if}
</dl>

<table class="list">
    <thead>
        <th>Date</th>
        <td width="40%">Intitulé</td>
        <td>Montant</td>

Modified src/www/admin/membres/transactions.php from [aeb7c1fd11] to [7fcfe252c1].

40
41
42
43
44
45
46

47
48
49
50
51
52
else
{
	$tpl->assign('cotisation', false);
}

$tpl->assign('nb_paiements', $m_transactions->countForMember($membre['id']));
$tpl->assign('paiements', $m_transactions->listForMember($membre['id']));


$tpl->assign('membre', $membre);

$tpl->display('admin/membres/transactions.tpl');

?>







>






40
41
42
43
44
45
46
47
48
49
50
51
52
53
else
{
	$tpl->assign('cotisation', false);
}

$tpl->assign('nb_paiements', $m_transactions->countForMember($membre['id']));
$tpl->assign('paiements', $m_transactions->listForMember($membre['id']));
$tpl->assign('activites', $m_transactions->listCurrentSubscriptionsForMember($membre['id']));

$tpl->assign('membre', $membre);

$tpl->display('admin/membres/transactions.tpl');

?>