Add support for 'lists' permission in the list.rpc.
[platal.git] / templates / payment / reconcile.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2010 Polytechnique.org                             *}
4 {*  http://opensource.polytechnique.org/                                  *}
5 {*                                                                        *}
6 {*  This program is free software; you can redistribute it and/or modify  *}
7 {*  it under the terms of the GNU General Public License as published by  *}
8 {*  the Free Software Foundation; either version 2 of the License, or     *}
9 {*  (at your option) any later version.                                   *}
10 {*                                                                        *}
11 {*  This program is distributed in the hope that it will be useful,       *}
12 {*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
13 {*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
14 {*  GNU General Public License for more details.                          *}
15 {*                                                                        *}
16 {*  You should have received a copy of the GNU General Public License     *}
17 {*  along with this program; if not, write to the Free Software           *}
18 {*  Foundation, Inc.,                                                     *}
19 {*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
20 {*                                                                        *}
21 {**************************************************************************}
22
23 <h1>Réconciliation - {$title}</h1>
24
25 {if $step eq 'step1'}
26
27 <table class="bicol">
28   <tr class="impair">
29     <th>Choix de la méthode de paiement</th>
30   </tr>
31   {foreach from=$methods item=method}
32   <tr class="{cycle values="pair,impair"}">
33     <td>
34       <a href="admin/payments/reconcile/step1/{$method.id}">{$method.text}</a>
35     </td>
36   </tr>
37   {/foreach}
38 </table>
39
40 {elseif $step eq 'step2'}
41
42 {include core=csv-importer.tpl}
43
44 {elseif $step eq 'step3'}
45
46 <form method="POST">
47   {xsrf_token_field}
48         <table class="bicol">
49                 <tr class="impair">
50                         <th colspan="3">Récapitulatif des informations de réconciliation</th>
51                 </tr>
52                 <tr class="pair">
53                         <td width="30%">ID de la méthode de paiement:</td>
54                         <td colspan="2">{$recon.method_id}</td>
55                 </tr>
56                 <tr class="impair">
57                         <td>Début de période :</td>
58                         <td colspan="2">
59                                 <input type="text" name="period_start" value="{$recon.period_start}" maxlength="10" />
60                                 <em>jj/mm/aaaa</em>
61                         </td>
62                 </tr>
63                 <tr class="pair">
64                         <td>Fin de période :</td>
65                         <td colspan="2">
66                           <input type="text" name="period_end" value="{$recon.period_end}" maxlength="10" />
67                                 <em>jj/mm/aaaa</em>
68                         </td>
69                 </tr>
70                 <tr class="impair">
71                         <td>Nombre de transactions :</td>
72                         <td colspan="2">{$recon.payment_count}</td>
73                 </tr>
74                 <tr class="pair">
75                         <td>Total des paiements :</td>
76                         <td>{$recon.sum_amounts|string_format:"%.2f"|replace:'.':','}€</td>
77                         <td>(environ {$recon.sum_amounts/$recon.payment_count|string_format:"%.2f"|replace:'.':','}€/paiement)</td>
78                 </tr>
79                 <tr class="impair">
80                         <td>Total des commissions :</td>
81                         <td>{$recon.sum_commissions|string_format:"%.2f"|replace:'.':','}€</td>
82                         <td>(environ {$recon.sum_commissions/$recon.sum_amounts*100|string_format:"%.2f"|replace:'.':','}%)</td>
83                 </tr>
84         </table>
85
86         <br />
87
88         <table class="bicol">
89                 <tr class="impair">
90                         <th colspan="2">À l'étape suivante, une comparaison entre les transactions existantes et la liste importé va être réalisée.</th>
91                 </tr>
92                 <tr class="pair">
93                         <td width="30%">Vérification à faire :</td>
94                         <td>
95                           <label><input type="checkbox" name="check1" checked="checked" disabled="disabled"/> apparier les transactions</label><br />
96                           <label><input type="checkbox" name="check2" checked="checked" /> afficher les transactions existantes orphelines</label><br />
97                           <label><input type="checkbox" name="check3" checked="checked" /> afficher les transactions importées orphelines</label><br />
98                         </td>
99                 </tr>
100         </table>
101
102   <p class="center"><input type="submit" name="next" value="étape suivante" /></p>
103 </form>
104
105 {elseif $step eq 'step4'}
106
107 <p>ok : {$ok_count}<br />
108 differ : {$differ_count}<br />
109 onlydb : {$onlydb_count}<br />
110 onlyim : {$onlyim_count}<br />
111 total (excepted onlydb) : {$ok_count+$differ_count+$onlyim_count} (doit être égal à {$recon.payment_count})
112 </p>
113
114 <h2>Enregistrements avec champs qui diffèrent</h2>
115
116 {if $differ_count ne 0}
117 <table class="bicol">
118         <tr class="impair">
119                 <th>Référence</th><th>method_id</th><th>Date</th>
120                 <th>Montant</th><th>Com</th><th>Statut</th>
121                 <th>recon_id</th><th>Action</th>
122         </tr>
123 {foreach from=$differs item=i}
124   <tr class="{cycle values="pair,impair"}">
125                 <td>{$i.fullref}<br />{$i.reference}</td>
126                 <td>{$i.method_id}<br />&nbsp;</td>
127                 <td>{$i.ts_confirmed}<br />{$i.date}</td>
128                 <td>{$i.amount}<br />{$i.amount2}</td>
129                 <td>{$i.commission}<br />{$i.commission2}</td>
130                 <td>{$i.status}<br />&nbsp;</td>
131                 <td>{$i.recon_id}<br />&nbsp;</td>
132                 <td><form method="POST">{xsrf_token_field}<input type="submit" name="force[{$i.id}]" value="Forcer" /></form></td>
133         </tr>
134 {/foreach}
135 </table>
136 {else}
137 <p>Aucun</p>
138 {/if}
139
140 <h2>Enregistrements uniquement dans la base</h2>
141
142 {if $onlydb_count ne 0}
143 <table class="bicol">
144 {assign var='headerstatus' value='doheader'}
145 {foreach from=$only_database item=i}
146         {if $headerstatus eq 'doheader'}
147         {assign var='headerstatus' value='headerdone'}
148         <tr class="impair">
149                 {foreach from=$i key=k item=v}
150                         <th>{$k}</th>
151                 {/foreach}
152         </tr>
153         {/if}
154   <tr class="{cycle values="pair,impair"}">
155                 {foreach from=$i key=k item=v}
156                         <td>{$v}</td>
157                 {/foreach}
158         </tr>
159 {/foreach}
160 </table>
161 {else}
162 <p>Aucun</p>
163 {/if}
164
165 <h2>Enregistrements uniquement dans l'import</h2>
166
167 {if $onlyim_count ne 0}
168 <table class="bicol">
169 {assign var='headerstatus' value='doheader'}
170 {foreach from=$only_import item=i}
171         {if $headerstatus eq 'doheader'}
172         {assign var='headerstatus' value='headerdone'}
173         <tr class="impair">
174                 {foreach from=$i key=k item=v}
175                         <th>{$k}</th>
176                 {/foreach}
177         </tr>
178         {/if}
179   <tr class="{cycle values="pair,impair"}">
180                 {foreach from=$i key=k item=v}
181                         <td>{$v}</td>
182                 {/foreach}
183         </tr>
184 {/foreach}
185 </table>
186 {else}
187 <p>Aucun</p>
188 {/if}
189
190 <h2>Commentaires</h2>
191
192 <p>Les tableaux si dessus ne seront pas enregistrés, il convient donc de reprendre leur contenu dans
193 le champ de commentaires si dessous, si nécesssaire.</p>
194
195 <form method="POST">
196 {xsrf_token_field}
197 <textarea name="comments" rows="10" cols="100">{$recon.comments}</textarea>
198 <input type="submit" name="savecomments" value="Enregistrer les commentaires" /></p>
199 </form>
200
201 <h2>Suite</h2>
202
203 <form method="POST">
204 <p class="center"><input type="submit" name="next" value="Terminer la réconciliation" /></p>
205 </form>
206
207 {else} {* defaults to "list" *}
208 {assign var='dontshowback' value='dontshowback'}
209
210 TODO: listing
211
212 {/if}
213
214 {if $dontshowback}
215 <p>
216 <a href="admin/payments/reconcile">back</a>
217 </p>
218 {/if}