closes 358
[platal.git] / templates / trezo / gere_operations.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2004 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
24
25 {if $smarty.request.action eq "edit"}
26 <h1>
27   Gestion des opérations de trésorerie
28 </h1>
29
30 <form method="post" action="{$smarty.server.PHP_SEL}">
31   <table class="bicol">
32     <tr>
33       <th colspan="2">
34         {if $op_id}
35         Modifier une opération
36         {else}
37         Ajouter une opération
38         {/if}
39       </th>
40     </tr>
41     <tr>
42       <td>Date (DD/MM/YYYY)</td>
43       <td><input type="text" name="op_date" size="40"
44         value="{$op_date|date_format}" /></td>
45     </tr>
46     <tr>
47       <td>Description libre</td>
48       <td><input type="text" name="op_label" size="40" value="{$op_label}" /></td>
49     </tr>
50     <tr>
51       <td>Débit</td>
52       <td><input type="text" name="op_debit" size="40" value="{$op_debit}" /></td>
53     </tr>
54     <tr>
55       <td>Crédit</td>
56       <td><input type="text" name="op_credit" size="40" value="{$op_credit}" /></td>
57     </tr>
58     <tr>
59       <td class="center" colspan="2">
60         <input type="hidden" name="op_id" value="{$op_id}" />
61         <input type="hidden" name="action" value="update" />
62         <input type="hidden" name="annee" value="{$annee_sel}" />
63         <input type="hidden" name="mois" value="{$mois_sel}" />
64         <input type="submit" value="enregistrer" /> 
65       </td>
66     </tr>
67   </table>
68 </form>
69
70 <a href="{$smarty.server.PHP_SELF}">retour</a>
71 {elseif $smarty.request.action eq "update" && $op_id}
72 <strong>modification de l'opération</strong>
73 {elseif $smarty.request.action eq "update"}
74 <strong>ajout de l'opération</strong>
75 {elseif $smarty.request.action eq "del"}
76 <strong>suppression de l'opération</strong>
77 {/if}
78
79 {if $smarty.request.action neq "edit"}
80 <h1>
81   Tr&eacute;sorerie pour {$mon_sel}
82 </h1>
83
84 <table class="bicol">
85 <tr>
86   <th>Solde en début de mois</th>
87 </tr>
88 <tr>
89   <td class="right">{$from_solde}</td>
90 </tr>
91 </table>
92
93 <br />
94
95 <table class="bicol" style="font-size: 90%">
96   <tr>
97     <th>Id</th>
98     <th>Date</th>
99     <th>Description</th>
100     <th>Débit</th>
101     <th>Crédit</th>
102     <th>Action</th>
103   </tr>
104   <tr class="impair">
105     <td>&nbsp;</td>
106     <td>&nbsp;</td>
107     <td><strong>Nouvelle opération</strong></td>
108     <td>&nbsp;</td>
109     <td>&nbsp;</td>
110     <td>
111       <form method="post" action="{$smarty.server.PHP_SELF}">
112         <div>
113           <input type="hidden" name="op_id" value="0" />
114           <input type="hidden" name="action" value="edit" />
115           <input type="hidden" name="annee" value="{$annee_sel}" />
116           <input type="hidden" name="mois" value="{$mois_sel}" />
117           <input type="submit" value="new" />
118         </div>
119       </form>
120     </td>
121   </tr>
122 {iterate item=op from=$ops}
123   <tr class="{cycle values="pair,impair"}">
124     <td>{$op.id}</td>
125     <td>{$op.date|date_format}</td>
126     <td>{$op.label}</td>
127     <td class="right">{$op.debit}</td>
128     <td class="right">{$op.credit}</td>
129     <td>
130       <form method="post" action="{$smarty.server.PHP_SELF}">
131         <div>
132           <input type="hidden" name="op_id" value="{$op.id}" />
133           <input type="hidden" name="annee" value="{$annee_sel}" />
134           <input type="hidden" name="mois" value="{$mois_sel}" />
135           <input type="submit" name="action" value="edit" />
136           <input type="submit" name="action" value="del" />
137         </div>
138       </form>
139     </td>
140   </tr>
141 {/iterate}
142 </table>
143
144 <br />
145
146 <table class="bicol">
147 <tr>
148   <th>Solde en fin de mois</th>
149 </tr>
150 <tr>
151   <td class="right">{$to_solde}</td>
152 </tr>
153 </table>
154
155 <br />
156
157 {include file=trezo/choix_date.tpl month_arr=$month_arr}
158 {/if}
159
160 {* vim:set et sw=2 sts=2 sws=2: *}