Overview
Comment:Alerter du besoin de créer un type de cotisation avant de pouvoir affecter une cotisation
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: dba8af4479b1db131ab26cfed41d4476b0fbff75
User & Date: bohwaz on 2019-12-10 14:49:40
Other Links: manifest | tags
Context
2019-12-10
14:50
Supprimer le tag dans les sous-actions des fiches membre (bug visuel dans chrome) check-in: 80fc64962d user: bohwaz tags: trunk
14:49
Alerter du besoin de créer un type de cotisation avant de pouvoir affecter une cotisation check-in: dba8af4479 user: bohwaz tags: trunk
2019-12-09
18:10
Ajout d'un signal de plugin motdepasse.compromis check-in: 501bf924d3 user: bohwaz tags: trunk
Changes

Modified src/templates/admin/_head.tpl from [98aefc23bb] to [ab1e909a41].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
    <meta charset="utf-8" />
    <title>{$title}</title>
    <link rel="icon" type="image/png" href="{$admin_url}static/icon.png" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, target-densitydpi=device-dpi" />
    <link rel="stylesheet" type="text/css" href="{$admin_url}static/admin.css?{$version_hash}1" media="all" />
    {if isset($js) || isset($custom_js)}
        <script type="text/javascript" src="{$admin_url}static/scripts/global.js?{$version_hash}"></script>
    {/if}
    {if isset($custom_js)}
        {foreach from=$custom_js item="js"}
            <script type="text/javascript" src="{$admin_url}static/scripts/{$js}?{$version_hash}"></script>
        {/foreach}







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
    <meta charset="utf-8" />
    <title>{$title}</title>
    <link rel="icon" type="image/png" href="{$admin_url}static/icon.png" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, target-densitydpi=device-dpi" />
    <link rel="stylesheet" type="text/css" href="{$admin_url}static/admin.css?{$version_hash}" media="all" />
    {if isset($js) || isset($custom_js)}
        <script type="text/javascript" src="{$admin_url}static/scripts/global.js?{$version_hash}"></script>
    {/if}
    {if isset($custom_js)}
        {foreach from=$custom_js item="js"}
            <script type="text/javascript" src="{$admin_url}static/scripts/{$js}?{$version_hash}"></script>
        {/foreach}

Modified src/templates/admin/membres/cotisations/ajout.tpl from [433111eec2] to [6a2c71a215].

26
27
28
29
30
31
32








33
34
35
36
37
38
39
40
41
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152

153
154
{if $session->canAccess('compta', Membres::DROIT_ECRITURE)}
    <p class="help">
        Cette page sert à enregistrer les cotisations des membres de l'association.
        Pour enregistrer un don ou une dépense, comme le paiement d'un prestataire ou une facture, il est possible de <a href="{$admin_url}compta/operations/saisir.php">saisir une opération comptable</a>.
    </p>
{/if}









<form method="post" action="{$self_url}">
    <fieldset>
        <legend>Enregistrer une cotisation</legend>
        <dl>
            <dt><label for="f_id_cotisation">Cotisation</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd>
                <select id="f_id_cotisation" required="required" name="id_cotisation">
                    {foreach from=$cotisations item="co"}
                    <option value="{$co.id}" {form_field name="id_cotisation" selected=$co.id default=$default_co} data-compta="{$co.id_categorie_compta}" data-amount="{$co.montant}">
                        {$co.intitule}
                        — {$co.montant|escape|html_money} {$config.monnaie}
                        — {if $co.duree}pour {$co.duree} jours
                        {elseif $co.debut}
                            du {$co.debut|format_sqlite_date_to_french} au {$co.fin|format_sqlite_date_to_french}
                        {else}
                            ponctuelle
                        {/if}
                    </option>
                    {/foreach}
                </select>
            </dd>
            <dt><label for="f_date">Date</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd><input type="date" name="date" id="f_date" value="{form_field name=date default=$default_date}" required="required" /></dd>
            {if !$membre}
            <dt><label for="f_numero_membre">Numéro de membre</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd><input type="number" name="numero_membre" id="f_numero_membre" value="{form_field name=numero_membre}" step="1" min="1" required="required" /></dd>
            {/if}
            <dt class="f_compta"><label for="f_montant">Montant</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd class="f_compta"><input type="number" name="montant" step="0.01" min="0.00" id="f_montant" value="{form_field name=montant default=$default_amount}" /></dd>
            <dt class="f_compta"><label for="f_moyen_paiement">Moyen de paiement</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd class="f_compta">
                <select name="moyen_paiement" id="f_moyen_paiement">
                {foreach from=$moyens_paiement item="moyen"}
                    <option value="{$moyen.code}"{if $moyen.code == $moyen_paiement} selected="selected"{/if}>{$moyen.nom}</option>
                {/foreach}
                </select>
            </dd>
            <dd class="f_compta f_a_encaisser">
                <input type="checkbox" name="a_encaisser" value="1" id="f_a_encaisser" {form_field name=a_encaisser checked="1"} />
                <label for="f_a_encaisser">En attente d'encaissement</label>
            </dd>
            <dt class="f_compta f_cheque"><label for="f_numero_cheque">Numéro de chèque</label></dt>
            <dd class="f_compta f_cheque"><input type="text" name="numero_cheque" id="f_numero_cheque" value="{form_field name=numero_cheque}" /></dd>
            <dt class="f_compta f_banque"><label for="f_banque">Compte bancaire</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd class="f_compta f_banque">
                <select name="banque" id="f_banque">
                {foreach from=$comptes_bancaires item="compte"}
                    <option value="{$compte.id}"{if $compte.id == $banque} selected="selected"{/if}>{$compte.libelle} - {$compte.banque}</option>
                {/foreach}
                </select>
            </dd>
            <dt class="f_compta"><label for="f_numero_piece">Numéro de pièce comptable</label></dt>
            <dd class="f_compta"><input type="text" name="numero_piece" id="f_numero_piece" value="{form_field name=numero_piece}" /></dd>
            <dt class="f_compta"><label for="f_remarques">Remarques</label></dt>
            <dd class="f_compta"><textarea name="remarques" id="f_remarques" rows="4" cols="30">{form_field name=remarques}</textarea></dd>
        </dl>
    </fieldset>

    <p class="submit">
        {csrf_field key="add_cotisation"}
        {if $membre}<input type="hidden" name="id_membre" value="{$membre.id}" />{/if}
        <input type="submit" name="add" value="Enregistrer &rarr;" />
    </p>
</form>

<script type="text/javascript">
{literal}
(function () {
    window.changeMoyenPaiement = function()
    {
        var elm = $('#f_moyen_paiement');
        g.toggle('.f_cheque', elm.value == 'CH');
        g.toggle('.f_banque', elm.value != 'ES');

        g.toggle('.f_a_encaisser', elm.value == 'CB' || elm.value == 'CH');
        cocherAEncaisser();
    };

    function cocherAEncaisser()
    {
        var elm = $('#f_a_encaisser');
        g.toggle('.f_banque', !elm.checked && $('#f_moyen_paiement').value != 'ES');
    }

    changeMoyenPaiement();
    cocherAEncaisser();

    $('#f_moyen_paiement').onchange = changeMoyenPaiement;
    $('#f_a_encaisser').onchange = cocherAEncaisser;

    function changeCotisation()
    {
        var s = $('#f_id_cotisation');

        if (s.options[s.selectedIndex].getAttribute('data-compta'))
        {
            $('#f_montant').value = s.options[s.selectedIndex].getAttribute('data-amount'); 
            g.toggle('.f_compta', true);
            changeMoyenPaiement();
            cocherAEncaisser();
        }
        else
        {
            g.toggle('.f_compta', false);
        }
    }

    $('#f_id_cotisation').onchange = changeCotisation;

    if (!$('#f_id_cotisation').options[$('#f_id_cotisation').selectedIndex].getAttribute('data-compta'))
    {
        g.toggle('.f_compta', false);
    }
    else
    {
        changeCotisation();
    }
} ());
{/literal}
</script>


{include file="admin/_foot.tpl"}







>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|

|
|
|
|
|
|
|
|

|
|
|

|
|
|
|
|

|
|

|
|

|
|
|

|
|
|
|
|
|
|
|
|
|
|
|

|

|
|
|
|
|
|
|
|
|
|
|
>


26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
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
{if $session->canAccess('compta', Membres::DROIT_ECRITURE)}
    <p class="help">
        Cette page sert à enregistrer les cotisations des membres de l'association.
        Pour enregistrer un don ou une dépense, comme le paiement d'un prestataire ou une facture, il est possible de <a href="{$admin_url}compta/operations/saisir.php">saisir une opération comptable</a>.
    </p>
{/if}

{if !count($cotisations)}
    <div class="alert">
        <p>Il n'y a aucun type de cotisation créé. Il n'est pas possible d'affecter une cotisation à un membre.</p>
        <form method="get" action="{$admin_url}membres/cotisations/">
            <p><input type="submit" value="Ajouter une cotisation &rarr;" /></p>
        </form>
    </div>
{else}
    <form method="post" action="{$self_url}">
        <fieldset>
            <legend>Enregistrer une cotisation</legend>
            <dl>
                <dt><label for="f_id_cotisation">Cotisation</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
                <dd>
                    <select id="f_id_cotisation" required="required" name="id_cotisation">
                        {foreach from=$cotisations item="co"}
                        <option value="{$co.id}" {form_field name="id_cotisation" selected=$co.id default=$default_co} data-compta="{$co.id_categorie_compta}" data-amount="{$co.montant}">
                            {$co.intitule}
                            — {$co.montant|escape|html_money} {$config.monnaie}
                            — {if $co.duree}pour {$co.duree} jours
                            {elseif $co.debut}
                                du {$co.debut|format_sqlite_date_to_french} au {$co.fin|format_sqlite_date_to_french}
                            {else}
                                ponctuelle
                            {/if}
                        </option>
                        {/foreach}
                    </select>
                </dd>
                <dt><label for="f_date">Date</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
                <dd><input type="date" name="date" id="f_date" value="{form_field name=date default=$default_date}" required="required" /></dd>
                {if !$membre}
                <dt><label for="f_numero_membre">Numéro de membre</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
                <dd><input type="number" name="numero_membre" id="f_numero_membre" value="{form_field name=numero_membre}" step="1" min="1" required="required" /></dd>
                {/if}
                <dt class="f_compta"><label for="f_montant">Montant</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
                <dd class="f_compta"><input type="number" name="montant" step="0.01" min="0.00" id="f_montant" value="{form_field name=montant default=$default_amount}" /></dd>
                <dt class="f_compta"><label for="f_moyen_paiement">Moyen de paiement</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
                <dd class="f_compta">
                    <select name="moyen_paiement" id="f_moyen_paiement">
                    {foreach from=$moyens_paiement item="moyen"}
                        <option value="{$moyen.code}"{if $moyen.code == $moyen_paiement} selected="selected"{/if}>{$moyen.nom}</option>
                    {/foreach}
                    </select>
                </dd>
                <dd class="f_compta f_a_encaisser">
                    <input type="checkbox" name="a_encaisser" value="1" id="f_a_encaisser" {form_field name=a_encaisser checked="1"} />
                    <label for="f_a_encaisser">En attente d'encaissement</label>
                </dd>
                <dt class="f_compta f_cheque"><label for="f_numero_cheque">Numéro de chèque</label></dt>
                <dd class="f_compta f_cheque"><input type="text" name="numero_cheque" id="f_numero_cheque" value="{form_field name=numero_cheque}" /></dd>
                <dt class="f_compta f_banque"><label for="f_banque">Compte bancaire</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
                <dd class="f_compta f_banque">
                    <select name="banque" id="f_banque">
                    {foreach from=$comptes_bancaires item="compte"}
                        <option value="{$compte.id}"{if $compte.id == $banque} selected="selected"{/if}>{$compte.libelle} - {$compte.banque}</option>
                    {/foreach}
                    </select>
                </dd>
                <dt class="f_compta"><label for="f_numero_piece">Numéro de pièce comptable</label></dt>
                <dd class="f_compta"><input type="text" name="numero_piece" id="f_numero_piece" value="{form_field name=numero_piece}" /></dd>
                <dt class="f_compta"><label for="f_remarques">Remarques</label></dt>
                <dd class="f_compta"><textarea name="remarques" id="f_remarques" rows="4" cols="30">{form_field name=remarques}</textarea></dd>
            </dl>
        </fieldset>

        <p class="submit">
            {csrf_field key="add_cotisation"}
            {if $membre}<input type="hidden" name="id_membre" value="{$membre.id}" />{/if}
            <input type="submit" name="add" value="Enregistrer &rarr;" />
        </p>
    </form>

    <script type="text/javascript">
    {literal}
    (function () {
        window.changeMoyenPaiement = function()
        {
            var elm = $('#f_moyen_paiement');
            g.toggle('.f_cheque', elm.value == 'CH');
            g.toggle('.f_banque', elm.value != 'ES');

            g.toggle('.f_a_encaisser', elm.value == 'CB' || elm.value == 'CH');
            cocherAEncaisser();
        };

        function cocherAEncaisser()
        {
            var elm = $('#f_a_encaisser');
            g.toggle('.f_banque', !elm.checked && $('#f_moyen_paiement').value != 'ES');
        }

        changeMoyenPaiement();
        cocherAEncaisser();

        $('#f_moyen_paiement').onchange = changeMoyenPaiement;
        $('#f_a_encaisser').onchange = cocherAEncaisser;

        function changeCotisation()
        {
            var s = $('#f_id_cotisation');

            if (s.options[s.selectedIndex].getAttribute('data-compta'))
            {
                $('#f_montant').value = s.options[s.selectedIndex].getAttribute('data-amount'); 
                g.toggle('.f_compta', true);
                changeMoyenPaiement();
                cocherAEncaisser();
            }
            else
            {
                g.toggle('.f_compta', false);
            }
        }

        $('#f_id_cotisation').onchange = changeCotisation;

        if (!$('#f_id_cotisation').options[$('#f_id_cotisation').selectedIndex].getAttribute('data-compta'))
        {
            g.toggle('.f_compta', false);
        }
        else
        {
            changeCotisation();
        }
    } ());
    {/literal}
    </script>
{/if}

{include file="admin/_foot.tpl"}

Modified src/templates/admin/membres/cotisations/index.tpl from [2f3ec3b601] to [754a0411a5].

1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48



49
50
51
52
53
54
55
{include file="admin/_head.tpl" title="Cotisations" current="membres/cotisations" js=1}

<ul class="actions">
    <li class="current"><a href="{$admin_url}membres/cotisations/">Cotisations</a></li>
    {if $session->canAccess('membres', Membres::DROIT_ECRITURE)}
        <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li>
    {/if}
    {if $session->canAccess('membres', Membres::DROIT_ADMIN)}
        <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li>
    {/if}
</ul>


<table class="list">
    <thead>
        <th>Cotisation</th>
        <td>Période</td>
        <td>Montant</td>
        <td>Membres inscrits</td>
        <td>Membres à jour</td>
        <td></td>
    </thead>
    <tbody>
        {foreach from=$liste item="co"}
            <tr>
                <th><a href="{$admin_url}membres/cotisations/voir.php?id={$co.id}">{$co.intitule}</a></th>
                <td>
                    {if $co.duree}
                        {$co.duree} jours
                    {elseif $co.debut}
                        du {$co.debut|format_sqlite_date_to_french} au {$co.fin|format_sqlite_date_to_french}
                    {else}
                        ponctuelle
                    {/if}
                </td>
                <td class="num">{$co.montant|escape|html_money} {$config.monnaie}</td>
                <td class="num">{$co.nb_membres}</td>
                <td class="num">{$co.nb_a_jour}</td>
                <td class="actions">
                    <a class="icn" href="{$admin_url}membres/cotisations/voir.php?id={$co.id}" title="Liste des membres cotisants">👪</a>
                    {if $session->canAccess('membres', Membres::DROIT_ADMIN)}
                        <a class="icn" href="{$admin_url}membres/cotisations/gestion/modifier.php?id={$co.id}" title="Modifier">✎</a>
                        <a class="icn" href="{$admin_url}membres/cotisations/gestion/supprimer.php?id={$co.id}" title="Supprimer">✘</a>
                    {/if}
                </td>
            </tr>
        {/foreach}
    </tbody>
</table>




{if $session->canAccess('membres', Membres::DROIT_ADMIN)}

{form_errors}

<p class="help">
    Idée : les cotisations peuvent également être utilisées pour suivre les activités auxquelles












>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{include file="admin/_head.tpl" title="Cotisations" current="membres/cotisations" js=1}

<ul class="actions">
    <li class="current"><a href="{$admin_url}membres/cotisations/">Cotisations</a></li>
    {if $session->canAccess('membres', Membres::DROIT_ECRITURE)}
        <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li>
    {/if}
    {if $session->canAccess('membres', Membres::DROIT_ADMIN)}
        <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li>
    {/if}
</ul>

{if count($liste)}
    <table class="list">
        <thead>
            <th>Cotisation</th>
            <td>Période</td>
            <td>Montant</td>
            <td>Membres inscrits</td>
            <td>Membres à jour</td>
            <td></td>
        </thead>
        <tbody>
            {foreach from=$liste item="co"}
                <tr>
                    <th><a href="{$admin_url}membres/cotisations/voir.php?id={$co.id}">{$co.intitule}</a></th>
                    <td>
                        {if $co.duree}
                            {$co.duree} jours
                        {elseif $co.debut}
                            du {$co.debut|format_sqlite_date_to_french} au {$co.fin|format_sqlite_date_to_french}
                        {else}
                            ponctuelle
                        {/if}
                    </td>
                    <td class="num">{$co.montant|escape|html_money} {$config.monnaie}</td>
                    <td class="num">{$co.nb_membres}</td>
                    <td class="num">{$co.nb_a_jour}</td>
                    <td class="actions">
                        <a class="icn" href="{$admin_url}membres/cotisations/voir.php?id={$co.id}" title="Liste des membres cotisants">👪</a>
                        {if $session->canAccess('membres', Membres::DROIT_ADMIN)}
                            <a class="icn" href="{$admin_url}membres/cotisations/gestion/modifier.php?id={$co.id}" title="Modifier">✎</a>
                            <a class="icn" href="{$admin_url}membres/cotisations/gestion/supprimer.php?id={$co.id}" title="Supprimer">✘</a>
                        {/if}
                    </td>
                </tr>
            {/foreach}
        </tbody>
    </table>
{else}
    <p class="alert">Il n'y a aucun type de cotisation enregistré.</p>
{/if}

{if $session->canAccess('membres', Membres::DROIT_ADMIN)}

{form_errors}

<p class="help">
    Idée : les cotisations peuvent également être utilisées pour suivre les activités auxquelles

Modified src/www/admin/static/admin.css from [0909cedb7e] to [4d61ee3dc8].

184
185
186
187
188
189
190




191
192
193
194
195
196
197
span.confirm, b.confirm {
    color: #090;
}

span.alert, b.alert {
    color: #990;
}





p.alert, div.alert, p.error, div.error, p.confirm, div.confirm {
    border: 1px solid #ccc;
    padding: .5em;
    margin-bottom: 1em;
    border-radius: .3em;
    padding-left: 3em;







>
>
>
>







184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
span.confirm, b.confirm {
    color: #090;
}

span.alert, b.alert {
    color: #990;
}

.alert p, .error p, .confirm p {
    margin-bottom: .8em;
}

p.alert, div.alert, p.error, div.error, p.confirm, div.confirm {
    border: 1px solid #ccc;
    padding: .5em;
    margin-bottom: 1em;
    border-radius: .3em;
    padding-left: 3em;
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
p.confirm::before, div.confirm::before, p.alert::before, div.alert::before, p.error::before, div.error::before {
    font-family: "gicon";
    left: .5em;
    top: .2em;
    position: absolute;
    font-size: 1.5em;
    text-shadow: 2px 2px 5px #666;
}    

p.confirm::before, div.confirm::before {
    content: "☑";
    color: green;
}

p.alert::before, div.alert::before {







|







220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
p.confirm::before, div.confirm::before, p.alert::before, div.alert::before, p.error::before, div.error::before {
    font-family: "gicon";
    left: .5em;
    top: .2em;
    position: absolute;
    font-size: 1.5em;
    text-shadow: 2px 2px 5px #666;
}

p.confirm::before, div.confirm::before {
    content: "☑";
    color: green;
}

p.alert::before, div.alert::before {