Alle Dateien durch Perltidy laufen lassen. Die verwendeten Optionen sind am Ende...
[kivitendo-erp.git] / bin / mozilla / datev.pl
1 #=====================================================================
2 # Lx-Office ERP
3 # Copyright (c) 2004
4 #
5 #  Author: Philip Reetz
6 #   Email: p.reetz@linet-services.de
7 #     Web: http://www.lx-office.org
8 #
9 #
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
14 #
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #======================================================================
23 #
24 # Datev export module
25 #
26 #======================================================================
27
28 use SL::DATEV;
29
30 1;
31
32 # end of main
33
34 sub continue { &{ $form->{nextsub} } }
35
36 sub export {
37   $lxdebug->enter_sub();
38
39   $form->{title} = $locale->text("DATEX - Export Assistent");
40
41   DATEV->get_datev_stamm(\%myconfig, \%$form);
42   $form->header;
43
44   print qq|
45 <body>
46
47 <form method=post action=$form->{script}>
48
49
50 <table width=100%>
51   <tr>
52     <th class=listtop>$form->{title}</th>
53   </tr>
54   <tr>
55     <th align=left>| . $locale->text("DATEV Angaben") . qq|</th>
56   </tr>
57   <tr height="5"></tr>
58   <tr valign=top>
59     <td>
60       <table>
61         <tr>
62           <td align=left nowrap>| . $locale->text("Beraternummer") . qq|</td>
63           <td><input name=beraternr size=10 maxlength=7 value="$form->{beraternr}"></td>
64         
65           <td align=left nowrap>| . $locale->text("DFV-Kennzeichen") . qq|</td>
66           <td><input name=dfvkz size=5 maxlength=2 value="$form->{dfvkz}"></td>
67         </tr>
68         <tr>
69           <td align=left nowrap>| . $locale->text("Beratername") . qq|</td>
70           <td><input name=beratername size=10 maxlength=9 value="$form->{beratername}"></td>
71         
72           <td align=left nowrap>| . $locale->text("Password") . qq|</td>
73           <td><input name=passwort size=5 maxlength=4 value="$form->{passwort}"></td>
74         </tr>
75         <tr>
76           <td align=left nowrap>| . $locale->text("Mandantennummer") . qq|</td>
77           <td><input name=mandantennr size=10 maxlength=5 value="$form->{mandantennr}"></td>
78         
79           <td align=left nowrap>| . $locale->text("Datenträgernummer") . qq|</td>
80           <td><input name=datentraegernr size=5 maxlength=3 value="$form->{datentraegernr}"></td>
81         </tr>   
82         <tr>
83           <td><input checked name=kne type=checkbox class=checkbox value=1> |
84     . $locale->text("Kontonummernerweiterung (KNE)")
85     . qq|</td>
86           <td></td>
87         
88           <td align=left nowrap>| . $locale->text("Abrechnungsnummer") . qq|</td>
89           <td><input name=abrechnungsnr size=5 maxlength=3 value="$form->{abrechnungsnr}"></td>
90         </tr>
91         <tr>
92           <td><input name=exporttype type=radio class=radio value=0 checked> |
93     . $locale->text("Export Buchungsdaten")
94     . qq|</td>
95           <td></td>
96           
97           <td><input name=exporttype type=radio class=radio value=1> |
98     . $locale->text("Export Stammdaten")
99     . qq|</td>
100           <td></td>
101         </td>
102       </table>
103     </td>
104   </tr>
105   <tr>
106     <td><hr size=3 noshade></td>
107   </tr>
108 </table>
109
110 <input type=hidden name=nextsub value=export2>
111
112 <input type=hidden name=path value=$form->{path}>
113 <input type=hidden name=login value=$form->{login}>
114 <input type=hidden name=password value=$form->{password}>
115
116 <br>
117 <input type=submit class=submit name=action value="|
118     . $locale->text('Continue') . qq|">
119 </form>
120
121 </body>
122 </html>
123 |;
124   $lxdebug->leave_sub();
125 }
126
127 sub export2 {
128   $lxdebug->enter_sub();
129
130   if ($form->{exporttype} == 0) {
131     &export_bewegungsdaten();
132   } else {
133     &export_stammdaten();
134   }
135   $lxdebug->leave_sub();
136 }
137
138 sub export_bewegungsdaten {
139   $lxdebug->enter_sub();
140
141   $form->{title} = $locale->text("DATEX - Export Assistent");
142
143   $form->{allemonate} =
144       qq|<option value=1>|
145     . $locale->text('January')
146     . qq|</option>
147                          <option value=2>|
148     . $locale->text('February')
149     . qq|</option>
150                          <option value=3>|
151     . $locale->text('March')
152     . qq|</option>
153                          <option value=4>|
154     . $locale->text('April')
155     . qq|</option>
156                          <option value=5>|
157     . $locale->text('May')
158     . qq|</option>
159                          <option value=6>|
160     . $locale->text('June')
161     . qq|</option>
162                          <option value=7>|
163     . $locale->text('July')
164     . qq|</option>
165                          <option value=8>|
166     . $locale->text('August')
167     . qq|</option>
168                          <option value=9>|
169     . $locale->text('September')
170     . qq|</option>
171                          <option value=10>|
172     . $locale->text('October')
173     . qq|</option>
174                          <option value=11>|
175     . $locale->text('November')
176     . qq|</option>
177                          <option value=12>|
178     . $locale->text('December')
179     . qq|</option>|;
180
181   $form->{allequartale} =
182       qq|<option selected value=1>|
183     . $locale->text('I')
184     . qq|</option>
185                          <option value=2>| . $locale->text('II') . qq|</option>
186                          <option value=3>|
187     . $locale->text('III')
188     . qq|</option>
189                          <option value=4>|
190     . $locale->text('IV')
191     . qq|</option>|;
192   $form->header;
193
194   print qq|
195 <body>
196
197 <form method=post action=$form->{script}>
198
199
200 <table width=100%>
201   <tr>
202     <th class=listtop>$form->{title}</th>
203   </tr>
204   <tr>
205     <th align=left>| . $locale->text("Zeitraum") . qq|</th>
206   </tr>
207   <tr height="5"></tr>
208   <tr valign=top>
209     <td>
210       <table>
211         <tr>
212           <td align=left><input checked name=zeitraum class=radio type=radio value=monat>&nbsp;</td><td align=left>|
213     . $locale->text('Monat')
214     . qq|</td>
215           <td align=left></td>
216           <td align=left></td>
217           <td align=left><select name=monat>$form->{allemonate}</select></td>
218         </tr>
219         <tr>  
220           <td align=left><input name=zeitraum class=radio type=radio value=quartal>&nbsp;</td><td align=left>|
221     . $locale->text('Quartal')
222     . qq|</td>
223           <td align=left></td>
224           <td align=left></td>
225           <td align=left><select name=quartal>$form->{allequartale}</select></td>
226         </tr>
227         <tr> 
228           <td align=left><input name=zeitraum class=radio type=radio value=zeit>&nbsp;</td><td align=left>|
229     . $locale->text('Datum von')
230     . qq|</td>
231           <td align=left><input name=transdatefrom size=8></td>
232           <td align=left>| . $locale->text('bis') . qq|</td>
233           <td align=left><input name=transdateto size=8></td>           
234         </tr>
235       </table>
236     </td>
237   </tr>
238   <tr>
239     <td><hr size=3 noshade></td>
240   </tr>
241 </table>
242
243 <input type=hidden name=beraternr value="$form->{beraternr}">
244 <input type=hidden name=dfvkz value="$form->{dfvkz}">
245 <input type=hidden name=beratername value="$form->{beratername}">
246 <input type=hidden name=passwort value="$form->{passwort}">
247 <input type=hidden name=mandantennr value="$form->{mandantennr}">
248 <input type=hidden name=datentraegernr value="$form->{datentraegernr}">
249 <input type=hidden name=kne value="$form->{kne}">
250 <input type=hidden name=abrechnungsnr value="$form->{abrechnungsnr}">
251
252 <input type=hidden name=exporttype value="$form->{exporttype}">
253
254 <input type=hidden name=nextsub value=export3>
255
256 <input type=hidden name=path value=$form->{path}>
257 <input type=hidden name=login value=$form->{login}>
258 <input type=hidden name=password value=$form->{password}>
259
260 <br>
261 <input type=submit class=submit name=action value="|
262     . $locale->text('Continue') . qq|">
263 </form>
264
265 </body>
266 </html>
267 |;
268
269   $lxdebug->leave_sub();
270 }
271
272 sub export_stammdaten {
273   $lxdebug->enter_sub();
274
275   $form->{title} = $locale->text("DATEX - Export Assistent");
276
277   $form->header;
278
279   print qq|
280 <body>
281
282 <form method=post action=$form->{script}>
283 <table width=100%>
284   <tr>
285     <th class=listtop>$form->{title}</th>
286   </tr>
287   <tr>
288     <th align=left>| . $locale->text("Konten") . qq|</th>
289   </tr>
290   <tr height="5"></tr>
291   <tr valign=top>
292     <td>
293       <table>
294         <tr>
295           <td align=left>| . $locale->text('Von Konto: ') . qq|</td>
296           <td align=left><input name=accnofrom size=8 maxlength=8></td>
297         </tr>
298         <tr>
299           <td align=left>| . $locale->text('Bis Konto: ') . qq|</td>
300           <td align=left><input name=accnoto size=8 maxlength=8></td>
301         </tr>
302       </table>
303     </td>
304   </tr>
305   <tr>
306     <td><hr size=3 noshade></td>
307   </tr>
308 </table>
309 <input type=hidden name=beraternr value="$form->{beraternr}">
310 <input type=hidden name=dfvkz value="$form->{dfvkz}">
311 <input type=hidden name=beratername value="$form->{beratername}">
312 <input type=hidden name=passwort value="$form->{passwort}">
313 <input type=hidden name=mandantennr value="$form->{mandantennr}">
314 <input type=hidden name=datentraegernr value="$form->{datentraegernr}">
315 <input type=hidden name=kne value="$form->{kne}">
316 <input type=hidden name=abrechnungsnr value="$form->{abrechnungsnr}">
317
318 <input type=hidden name=exporttype value="$form->{exporttype}">
319
320 <input type=hidden name=nextsub value=export3>
321
322 <input type=hidden name=path value=$form->{path}>
323 <input type=hidden name=login value=$form->{login}>
324 <input type=hidden name=password value=$form->{password}>
325
326 <br>
327 <input type=submit class=submit name=action value="|
328     . $locale->text('Continue') . qq|">
329 </form>
330
331 </body>
332 </html>
333 |;
334
335   $lxdebug->leave_sub();
336 }
337
338 sub export3 {
339   $lxdebug->enter_sub();
340
341   DATEV->save_datev_stamm(\%myconfig, \%$form);
342
343   if ($form->{kne}) {
344     if (DATEV->kne_export(\%myconfig, \%$form)) {
345       $form->redirect($locale->text('KNE Export erfolgreich!'));
346     }
347   } else {
348     if (DATEV->obe_export(\%myconfig, \%$form)) {
349       $form->redirect($locale->text('OBE Export erfolgreich!'));
350     }
351   }
352   $lxdebug->leave_sub();
353 }