1 {**************************************************************************}
3 {* Copyright (C) 2003-2011 Polytechnique.org *}
4 {* http://opensource.polytechnique.org/ *}
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. *}
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. *}
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 *}
21 {**************************************************************************}
23 <h1>Réconciliation - {$title}</h1>
27 <form method="POST" action="admin/reconcile/transfers">
30 <th> </th><th>id</th><th>method</th><th>du</th><th>au</th><th>statut</th><th>transactions</th><th>total (€)</th><th>coms (€)</th><th>actions</th>
32 <tr class="impair" style="border-top: 1px solid #A2C2E1">
34 <th style="text-align: left" colspan="9">non régroupées</th>
38 <td colspan="8"><strong><a href="admin/reconcile/importlogs/step1">Créer une nouvelle réconciliation</a></strong></td>
39 <td class="right"><a href="admin/reconcile/importlogs/step1">{icon name=add title='nouvelle réconciliation'}</a></td>
41 {foreach from=$recongps item=recongp}
42 {assign var='sum1' value='0'}
43 {assign var='sum2' value='0'}
44 {assign var='sum3' value='0'}
46 <tr class="impair"><td colspan="10"> </td></tr>
47 <tr class="impair" style="border-top: 1px solid #A2C2E1">
49 <th style="text-align: left" colspan="8">groupe ID {$recongp.id}</th>
50 <th style="text-align: right"><a href="admin/reconcile/transfers/delgroup/{$recongp.id}?token={xsrf_token}">{icon name=delete title='supprimer'}</a></th>
53 {foreach from=$recongp.recons item=recon}
54 {assign var='sum1' value=`$sum1+$recon.payment_count`}
55 {assign var='sum2' value=`$sum2+$recon.sum_amounts`}
56 {assign var='sum3' value=`$sum3+$recon.sum_commissions`}
59 {if $recon.status eq 'transfering'}
60 <input type="checkbox" name="recon_id[{$recon.id}]" />
66 <td>{$recon.method}</td>
67 <td>{$recon.period_start}</td>
68 <td>{$recon.period_end}</td>
69 <td>{$recon.status}</td>
70 <td class="right">{$recon.payment_count}</td>
71 <td class="right">{$recon.sum_amounts}</td>
72 <td class="right">{$recon.sum_commissions}</td>
73 <td class="right">{if $recongp.id} {else}<a href="admin/reconcile/delete/{$recon.id}?token={xsrf_token}">{icon name=delete title='supprimer'}</a>{/if}</td>
78 <td colspan="5"> </td>
79 <td class="right">total :</td>
80 <td class="right">{$sum1}</td>
81 <td class="right">{$sum2|string_format:"%.2f"}</td>
82 <td class="right">{$sum3|string_format:"%.2f"}</td>
88 <th>id</th><th>date</th><th>message</th><th>RIB</th><th>€</th><th>action</th>
90 {assign var='sum' value='0'}
91 {foreach from=$recongp.transfers item=transfer}
92 {assign var='sum' value=`$sum+$transfer.amount`}
93 <tr class="{cycle values="pair,impair"}">
94 <td>{$transfer.id}</td>
95 <td>{if $transfer.date}{$transfer.date}{else}à virer{/if}</td>
96 <td><small>{$transfer.message}</small></td>
97 <td>{$transfer.account}</td>
98 <td class="right">{$transfer.amount}</td>
100 {if !$transfer.date}<a href="admin/reconcile/transfers/confirm/{$transfer.id}?token={xsrf_token}">{icon name=tick title='Confirmer la réalisation'}</a>{/if}
101 <a href="admin/reconcile/transfers/edit/{$transfer.id}?token={xsrf_token}">{icon name=page_edit title='Éditer'}</a>
108 <td colspan="6"> </td>
109 <td class="right">total :</td>
110 <td colspan="2">{$sum|string_format:"%.2f"} - coms = {$sum-$sum3|string_format:"%.2f"}</td>
116 <p><input type="submit" name="generate" value="Grouper et créer les virements" /></p>
119 {elseif $step eq 'step1'}
121 <table class="bicol">
123 <th>Choix de la méthode de paiement</th>
125 {foreach from=$methods item=method}
126 <tr class="{cycle values="pair,impair"}">
128 <a href="admin/reconcile/importlogs/step1/{$method.id}">{$method.text}</a>
134 {elseif $step eq 'step2'}
136 {include core=csv-importer.tpl}
138 {elseif $step eq 'step3'}
142 <table class="bicol">
144 <th colspan="3">Récapitulatif des informations de réconciliation</th>
147 <td width="30%">ID de la méthode de paiement:</td>
148 <td colspan="2">{$recon.method_id}</td>
151 <td>Début de période :</td>
153 <input type="text" name="period_start" value="{$recon.period_start}" maxlength="10" />
158 <td>Fin de période :</td>
160 <input type="text" name="period_end" value="{$recon.period_end}" maxlength="10" />
165 <td>Nombre de transactions :</td>
166 <td colspan="2">{$recon.payment_count}</td>
169 <td>Total des paiements :</td>
170 <td>{$recon.sum_amounts|string_format:"%.2f"|replace:'.':','}€</td>
171 <td>(environ {$recon.sum_amounts/$recon.payment_count|string_format:"%.2f"|replace:'.':','}€/paiement)</td>
174 <td>Total des commissions :</td>
175 <td>{$recon.sum_commissions|string_format:"%.2f"|replace:'.':','}€</td>
176 <td>(environ {$recon.sum_commissions/$recon.sum_amounts*100|string_format:"%.2f"|replace:'.':','}%)</td>
182 <table class="bicol">
184 <th colspan="2">À l'étape suivante, une comparaison entre les transactions existantes et la liste importé va être réalisée.</th>
187 <td width="30%">Vérification à faire :</td>
189 <label><input type="checkbox" name="check1" checked="checked" disabled="disabled"/> apparier les transactions</label><br />
190 <label><input type="checkbox" name="check2" checked="checked" /> afficher les transactions existantes orphelines</label><br />
191 <label><input type="checkbox" name="check3" checked="checked" /> afficher les transactions importées orphelines</label><br />
196 <p class="center"><input type="submit" name="next" value="étape suivante" /></p>
199 {elseif $step eq 'step4'}
201 <p>ok : {$ok_count}<br />
202 differ : {$differ_count}<br />
203 onlydb : {$onlydb_count}<br />
204 onlyim : {$onlyim_count}<br />
205 total (excepted onlydb) : {$ok_count+$differ_count+$onlyim_count} (doit être égal à {$recon.payment_count})
208 <h2>Enregistrements avec champs qui diffèrent</h2>
210 {if $differ_count ne 0}
211 <table class="bicol">
213 <th>Référence</th><th>method_id</th><th>Date</th>
214 <th>Montant</th><th>Com</th><th>Statut</th>
215 <th>recon_id</th><th>Action</th>
217 {foreach from=$differs item=i}
218 <tr class="{cycle values="pair,impair"}">
219 <td>{$i.fullref}<br />{$i.reference}</td>
220 <td>{$i.method_id}<br /> </td>
221 <td>{$i.ts_confirmed}<br />{$i.date}</td>
222 <td>{$i.amount}<br />{$i.amount2}</td>
223 <td>{$i.commission}<br />{$i.commission2}</td>
224 <td>{$i.status}<br /> </td>
225 <td>{$i.recon_id}<br /> </td>
226 <td><form method="POST">{xsrf_token_field}<input type="submit" name="force[{$i.id}]" value="Forcer" /></form></td>
234 <h2>Enregistrements uniquement dans la base</h2>
236 {if $onlydb_count ne 0}
237 <table class="bicol">
238 {assign var='headerstatus' value='doheader'}
239 {foreach from=$only_database item=i}
240 {if $headerstatus eq 'doheader'}
241 {assign var='headerstatus' value='headerdone'}
243 {foreach from=$i key=k item=v}
248 <tr class="{cycle values="pair,impair"}">
249 {foreach from=$i key=k item=v}
259 <h2>Enregistrements uniquement dans l'import</h2>
261 {if $onlyim_count ne 0}
262 <table class="bicol">
263 {assign var='headerstatus' value='doheader'}
264 {foreach from=$only_import item=i}
265 {if $headerstatus eq 'doheader'}
266 {assign var='headerstatus' value='headerdone'}
268 {foreach from=$i key=k item=v}
273 <tr class="{cycle values="pair,impair"}">
274 {foreach from=$i key=k item=v}
284 <h2>Commentaires</h2>
286 <p>Les tableaux si dessus ne seront pas enregistrés, il convient donc de reprendre leur contenu dans
287 le champ de commentaires si dessous, si nécesssaire.</p>
291 <textarea name="comments" rows="10" cols="100">{$recon.comments}</textarea>
292 <input type="submit" name="savecomments" value="Enregistrer les commentaires" /></p>
298 <p class="center"><input type="submit" name="next" value="Terminer la réconciliation" /></p>
301 {else} {* defaults to "list" *}
302 {assign var='dontshowback' value='dontshowback'}
310 <a href="admin/reconcile">back</a>