1 #=====================================================================
4 # Based on SQL-Ledger Version 2.1.9
5 # Web http://www.lx-office.org
7 #=====================================================================
8 # SQL-Ledger Accounting
9 # Copyright (c) 1998-2002
11 # Author: Dieter Simader
12 # Email: dsimader@sql-ledger.org
13 # Web: http://www.sql-ledger.org
16 # This program is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 2 of the License, or
19 # (at your option) any later version.
21 # This program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #======================================================================
32 #======================================================================
45 sub add { &{"add_$form->{type}"} }
46 sub edit { &{"edit_$form->{type}"} }
47 sub save { &{"save_$form->{type}"} }
48 sub delete { &{"delete_$form->{type}"} }
51 $lxdebug->enter_sub();
53 $form->{title} = "Add";
54 $form->{charttype} = "A";
55 AM->get_account(\%myconfig, \%$form);
58 "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}"
59 unless $form->{callback};
64 $lxdebug->leave_sub();
68 $lxdebug->enter_sub();
70 $form->{title} = "Edit";
71 AM->get_account(\%myconfig, \%$form);
73 foreach my $item (split(/:/, $form->{link})) {
74 $form->{$item} = "checked";
80 $lxdebug->leave_sub();
84 $lxdebug->enter_sub();
86 $form->{title} = $locale->text("$form->{title} Account");
88 $checked{ $form->{charttype} } = "checked";
89 $checked{"$form->{category}_"} = "checked";
90 $checked{CT_tax} = ($form->{CT_tax}) ? "" : "checked";
92 $form->{description} =~ s/\"/"/g;
94 if (@{ $form->{TAXKEY} }) {
95 $form->{selecttaxkey} = "<option value=0>Keine Steuer 0%\n";
96 foreach $item (@{ $form->{TAXKEY} }) {
97 if ($item->{taxkey} == $form->{taxkey_id}) {
98 $form->{selecttaxkey} .=
99 "<option value=$item->{taxkey} selected>$item->{taxdescription}\n";
101 $form->{selecttaxkey} .=
102 "<option value=$item->{taxkey}>$item->{taxdescription}\n";
110 <th align=right>| . $locale->text('Steuersatz') . qq|</th>
111 <td><select name=taxkey_id>$form->{selecttaxkey}</select></td>
112 <input type=hidden name=selecttaxkey value="$form->{selecttaxkey}">
115 if (@{ $form->{NEWACCOUNT} }) {
116 if (!$form->{new_chart_valid}) {
117 $form->{selectnewaccount} = "<option value=></option>";
119 foreach $item (@{ $form->{NEWACCOUNT} }) {
120 if ($item->{id} == $form->{new_chart_id}) {
121 $form->{selectnewaccount} .=
122 "<option value=$item->{id} selected>$item->{accno}--$item->{description}</option>";
123 } elsif (!$form->{new_chart_valid}) {
124 $form->{selectnewaccount} .=
125 "<option value=$item->{id}>$item->{accno}--$item->{description}</option>";
136 <th align=right>| . $locale->text('Folgekonto') . qq|</th>
137 <td><select name=new_chart_id>$form->{selectnewaccount}</select></td>
138 <th align=right>| . $locale->text('Gültig ab') . qq|</th>
139 <td><input name=valid_from value="$form->{valid_from}"></td>
145 $form->{selectustva} = "<option>\n";
147 %ustva = (35 => $locale->text('UStVA-Nr. 35'),
148 36 => $locale->text('UStVA-Nr. 36'),
149 39 => $locale->text('UStVA-Nr. 39'),
150 41 => $locale->text('UStVA-Nr. 41'),
151 42 => $locale->text('UStVA-Nr. 42'),
152 43 => $locale->text('UStVA-Nr. 43'),
153 44 => $locale->text('UStVA-Nr. 44'),
154 45 => $locale->text('UStVA-Nr. 45'),
155 48 => $locale->text('UStVA-Nr. 48'),
156 49 => $locale->text('UStVA-Nr. 49'),
157 51 => $locale->text('UStVA-Nr. 51 left'),
158 511 => $locale->text('UStVA-Nr. 51 right'),
159 52 => $locale->text('UStVA-Nr. 52'),
160 53 => $locale->text('UStVA-Nr. 53'),
161 59 => $locale->text('UStVA-Nr. 59'),
162 60 => $locale->text('UStVA-Nr. 60'),
163 61 => $locale->text('UStVA-Nr. 61'),
164 62 => $locale->text('UStVA-Nr. 62'),
165 63 => $locale->text('UStVA-Nr. 63'),
166 64 => $locale->text('UStVA-Nr. 64'),
167 65 => $locale->text('UStVA-Nr. 65'),
168 66 => $locale->text('UStVA-Nr. 66'),
169 67 => $locale->text('UStVA-Nr. 67'),
170 69 => $locale->text('UStVA-Nr. 69'),
171 73 => $locale->text('UStVA-Nr. 73'),
172 74 => $locale->text('UStVA-Nr. 74'),
173 76 => $locale->text('UStVA-Nr. 76'),
174 77 => $locale->text('UStVA-Nr. 77'),
175 80 => $locale->text('UStVA-Nr. 80'),
176 84 => $locale->text('UStVA-Nr. 84'),
177 85 => $locale->text('UStVA-Nr. 85'),
178 86 => $locale->text('UStVA-Nr. 86 left'),
179 861 => $locale->text('UStVA-Nr. 86 right'),
180 91 => $locale->text('UStVA-Nr. 91'),
181 93 => $locale->text('UStVA-Nr. 93 left'),
182 931 => $locale->text('UStVA-Nr. 93 right'),
183 94 => $locale->text('UStVA-Nr. 94'),
184 95 => $locale->text('UStVA-Nr. 95'),
185 96 => $locale->text('UStVA-Nr. 96'),
186 97 => $locale->text('UStVA-Nr. 97 links'),
187 971 => $locale->text('UStVA-Nr. 97 rechts'),
188 98 => $locale->text('UStVA-Nr. 98'));
190 foreach $item (sort({ $a cmp $b } keys %ustva)) {
191 if ($item == $form->{pos_ustva}) {
192 $form->{selectustva} .= "<option value=$item selected>$ustva{$item}\n";
194 $form->{selectustva} .= "<option value=$item>$ustva{$item}\n";
201 <th align=right>| . $locale->text('Umsatzsteuervoranmeldung') . qq|</th>
202 <td><select name=pos_ustva>$form->{selectustva}</select></td>
203 <input type=hidden name=selectustva value="$form->{selectustva}">
206 $form->{selecteur} = "<option>\n";
207 %eur = (1 => "Umsatzerlöse",
208 2 => "sonstige Erlöse",
209 3 => "Privatanteile",
211 5 => "Ausserordentliche Erträge",
212 6 => "Vereinnahmte Umsatzst.",
213 7 => "Umsatzsteuererstattungen",
214 8 => "Wareneingänge",
215 9 => "Löhne und Gehälter",
216 10 => "Gesetzl. sozialer Aufw.",
218 12 => "Gas, Strom, Wasser",
219 13 => "Instandhaltung",
220 14 => "Steuern, Versich., Beiträge",
222 16 => "Kfz-Versicherungen",
223 17 => "Sonst. Fahrtkosten",
224 18 => "Werbe- und Reisekosten",
225 19 => "Instandhaltung u. Werkzeuge",
226 20 => "Fachzeitschriften, Bücher",
227 21 => "Miete für Einrichtungen",
228 22 => "Rechts- und Beratungskosten",
229 23 => "Bürobedarf, Porto, Telefon",
230 24 => "Sonstige Aufwendungen",
231 25 => "Abschreibungen auf Anlagever.",
232 26 => "Abschreibungen auf GWG",
234 28 => "Umsatzsteuerzahlungen",
236 30 => "Ausserordentlicher Aufwand",
237 31 => "Betriebliche Steuern");
238 foreach $item (sort({ $a <=> $b } keys(%eur))) {
239 if ($item == $form->{pos_eur}) {
240 $form->{selecteur} .= "<option value=$item selected>$eur{$item}\n";
242 $form->{selecteur} .= "<option value=$item>$eur{$item}\n";
249 <th align=right>| . $locale->text('EUER') . qq|</th>
250 <td><select name=pos_eur>$form->{selecteur}</select></td>
251 <input type=hidden name=selecteur value="$form->{selecteur}">
254 $form->{selectbwa} = "<option>\n";
256 %bwapos = (1 => 'Umsatzerlöse',
257 2 => 'Best.Verdg.FE/UE',
258 3 => 'Aktiv.Eigenleistung',
259 4 => 'Mat./Wareneinkauf',
260 5 => 'So.betr.Erlöse',
261 10 => 'Personalkosten',
263 12 => 'Betriebl.Steuern',
264 13 => 'Vers./Beiträge',
265 14 => 'Kfz.Kosten o.St.',
266 15 => 'Werbe-Reisek.',
267 16 => 'Kosten Warenabgabe',
268 17 => 'Abschreibungen',
269 18 => 'Rep./instandhlt.',
270 19 => 'Übrige Steuern',
271 20 => 'Sonst.Kosten',
273 31 => 'Sonst.neutr.Aufw.',
275 33 => 'Sonst.neutr.Ertrag',
276 34 => 'Verr.kalk.Kosten',
277 35 => 'Steuern Eink.u.Ertr.');
278 foreach $item (sort({ $a <=> $b } keys %bwapos)) {
279 if ($item == $form->{pos_bwa}) {
280 $form->{selectbwa} .= "<option value=$item selected>$bwapos{$item}\n";
282 $form->{selectbwa} .= "<option value=$item>$bwapos{$item}\n";
289 <th align=right>| . $locale->text('BWA') . qq|</th>
290 <td><select name=pos_bwa>$form->{selectbwa}</select></td>
291 <input type=hidden name=selectbwa value="$form->{selectbwa}">
294 # Entfernt bis es ordentlich umgesetzt wird (hli) 30.03.2006
295 # $form->{selectbilanz} = "<option>\n";
296 # foreach $item ((1, 2, 3, 4)) {
297 # if ($item == $form->{pos_bilanz}) {
298 # $form->{selectbilanz} .= "<option value=$item selected>$item\n";
300 # $form->{selectbilanz} .= "<option value=$item>$item\n";
307 # <th align=right>| . $locale->text('Bilanz') . qq|</th>
308 # <td><select name=pos_bilanz>$form->{selectbilanz}</select></td>
309 # <input type=hidden name=selectbilanz value="$form->{selectbilanz}">
312 # this is for our parser only!
313 # type=submit $locale->text('Add Account')
314 # type=submit $locale->text('Edit Account')
315 $form->{type} = "account";
322 <form method=post action=$form->{script}>
324 <input type=hidden name=id value=$form->{id}>
325 <input type=hidden name=type value=account>
326 <input type=hidden name=orphaned value=$form->{orphaned}>
327 <input type=hidden name=new_chart_valid value=$form->{new_chart_valid}>
329 <input type=hidden name=inventory_accno_id value=$form->{inventory_accno_id}>
330 <input type=hidden name=income_accno_id value=$form->{income_accno_id}>
331 <input type=hidden name=expense_accno_id value=$form->{expense_accno_id}>
332 <input type=hidden name=fxgain_accno_id value=$form->{fxgain_accno_id}>
333 <input type=hidden name=fxloss_accno_id value=$form->{fxloss_accno_id}>
335 <table border=0 width=100%>
337 <th class=listtop>$form->{title}</th>
344 <th align=right>| . $locale->text('Account Number') . qq|</th>
345 <td><input name=accno size=20 value=$form->{accno}></td>
348 <th align=right>| . $locale->text('Description') . qq|</th>
349 <td><input name=description size=40 value="$form->{description}"></td>
352 <th align=right>| . $locale->text('Account Type') . qq|</th>
356 <td><input name=category type=radio class=radio value=A $checked{A_}> |
357 . $locale->text('Asset') . qq|\n<br>
358 <input name=category type=radio class=radio value=L $checked{L_}> |
359 . $locale->text('Liability') . qq|\n<br>
360 <input name=category type=radio class=radio value=Q $checked{Q_}> |
361 . $locale->text('Equity') . qq|\n<br>
362 <input name=category type=radio class=radio value=I $checked{I_}> |
363 . $locale->text('Revenue') . qq|\n<br>
364 <input name=category type=radio class=radio value=E $checked{E_}> |
365 . $locale->text('Expense') . qq|</td>
366 <td width=50> </td>
368 <input name=charttype type=radio class=radio value="H" $checked{H}> |
369 . $locale->text('Heading') . qq|<br>
370 <input name=charttype type=radio class=radio value="A" $checked{A}> |
371 . $locale->text('Account') . qq|</td>
378 if ($form->{charttype} eq "A") {
385 . $locale->text('Is this a summary account to record') . qq|</th>
387 <input name=AR type=checkbox class=checkbox value=AR $form->{AR}> |
388 . $locale->text('AR')
389 . qq| <input name=AP type=checkbox class=checkbox value=AP $form->{AP}> |
390 . $locale->text('AP')
391 . qq| <input name=IC type=checkbox class=checkbox value=IC $form->{IC}> |
392 . $locale->text('Inventory')
399 <th colspan=2>| . $locale->text('Include in drop-down menus') . qq|</th>
405 <th align=left>| . $locale->text('Receivables') . qq|</th>
406 <th align=left>| . $locale->text('Payables') . qq|</th>
407 <th align=left>| . $locale->text('Parts Inventory') . qq|</th>
408 <th align=left>| . $locale->text('Service Items') . qq|</th>
412 <input name=AR_amount type=checkbox class=checkbox value=AR_amount $form->{AR_amount}> |
413 . $locale->text('Revenue') . qq|\n<br>
414 <input name=AR_paid type=checkbox class=checkbox value=AR_paid $form->{AR_paid}> |
415 . $locale->text('Receipt') . qq|\n<br>
416 <input name=AR_tax type=checkbox class=checkbox value=AR_tax $form->{AR_tax}> |
417 . $locale->text('Tax') . qq|
420 <input name=AP_amount type=checkbox class=checkbox value=AP_amount $form->{AP_amount}> |
421 . $locale->text('Expense/Asset') . qq|\n<br>
422 <input name=AP_paid type=checkbox class=checkbox value=AP_paid $form->{AP_paid}> |
423 . $locale->text('Payment') . qq|\n<br>
424 <input name=AP_tax type=checkbox class=checkbox value=AP_tax $form->{AP_tax}> |
425 . $locale->text('Tax') . qq|
428 <input name=IC_sale type=checkbox class=checkbox value=IC_sale $form->{IC_sale}> |
429 . $locale->text('Revenue') . qq|\n<br>
430 <input name=IC_cogs type=checkbox class=checkbox value=IC_cogs $form->{IC_cogs}> |
431 . $locale->text('Expense') . qq|\n<br>
432 <input name=IC_taxpart type=checkbox class=checkbox value=IC_taxpart $form->{IC_taxpart}> |
433 . $locale->text('Tax') . qq|
436 <input name=IC_income type=checkbox class=checkbox value=IC_income $form->{IC_income}> |
437 . $locale->text('Revenue') . qq|\n<br>
438 <input name=IC_expense type=checkbox class=checkbox value=IC_expense $form->{IC_expense}> |
439 . $locale->text('Expense') . qq|\n<br>
440 <input name=IC_taxservice type=checkbox class=checkbox value=IC_taxservice $form->{IC_taxservice}> |
441 . $locale->text('Tax') . qq|
461 <td><hr size=3 noshade></td>
466 $lxdebug->leave_sub();
470 $lxdebug->enter_sub();
474 <input name=callback type=hidden value="$form->{callback}">
476 <input type=hidden name=path value=$form->{path}>
477 <input type=hidden name=login value=$form->{login}>
478 <input type=hidden name=password value=$form->{password}>
481 if ((!$form->{id}) || ($form->{id} && $form->{orphaned}) || (($form->{type} eq "account") && (!$form->{new_chart_valid}))) {
483 <input type=submit class=submit name=action value="|
484 . $locale->text('Save') . qq|">
488 if ($form->{id} && $form->{orphaned}) {
489 print qq|<input type=submit class=submit name=action value="|
490 . $locale->text('Delete') . qq|">|;
493 if ($form->{menubar}) {
494 require "$form->{path}/menu.pl";
505 $lxdebug->leave_sub();
509 $lxdebug->enter_sub();
511 $form->isblank("accno", $locale->text('Account Number missing!'));
512 $form->isblank("category", $locale->text('Account Type missing!'));
514 $form->redirect($locale->text('Account saved!'))
515 if (AM->save_account(\%myconfig, \%$form));
516 $form->error($locale->text('Cannot save account!'));
518 $lxdebug->leave_sub();
522 $lxdebug->enter_sub();
524 CA->all_accounts(\%myconfig, \%$form);
526 $form->{title} = $locale->text('Chart of Accounts');
530 "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}";
532 @column_index = qw(accno gifi_accno description debit credit link);
534 $column_header{accno} = qq|<th>| . $locale->text('Account') . qq|</a></th>|;
535 $column_header{gifi_accno} =
536 qq|<th>| . $locale->text('GIFI') . qq|</a></th>|;
537 $column_header{description} =
538 qq|<th>| . $locale->text('Description') . qq|</a></th>|;
539 $column_header{debit} = qq|<th>| . $locale->text('Debit') . qq|</a></th>|;
540 $column_header{credit} = qq|<th>| . $locale->text('Credit') . qq|</a></th>|;
541 $column_header{link} = qq|<th>| . $locale->text('Link') . qq|</a></th>|;
544 $colspan = $#column_index + 1;
551 <th class=listtop colspan=$colspan>$form->{title}</th>
554 <tr class=listheading>
557 map { print "$column_header{$_}\n" } @column_index;
564 $callback = $form->escape($callback);
566 foreach $ca (@{ $form->{CA} }) {
568 $ca->{debit} = " ";
569 $ca->{credit} = " ";
571 if ($ca->{amount} > 0) {
573 $form->format_amount(\%myconfig, $ca->{amount}, 2, " ");
575 if ($ca->{amount} < 0) {
577 $form->format_amount(\%myconfig, -$ca->{amount}, 2, " ");
580 $ca->{link} =~ s/:/<br>/og;
582 if ($ca->{charttype} eq "H") {
583 print qq|<tr class=listheading>|;
585 $column_data{accno} =
586 qq|<th><a href=$form->{script}?action=edit_account&id=$ca->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}</a></th>|;
587 $column_data{gifi_accno} =
588 qq|<th><a href=$form->{script}?action=edit_gifi&accno=$ca->{gifi_accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{gifi_accno}</a> </th>|;
589 $column_data{description} = qq|<th>$ca->{description} </th>|;
590 $column_data{debit} = qq|<th> </th>|;
591 $column_data{credit} = qq| <th> </th>|;
592 $column_data{link} = qq|<th> </th>|;
598 <tr valign=top class=listrow$i>|;
599 $column_data{accno} =
600 qq|<td><a href=$form->{script}?action=edit_account&id=$ca->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}</a></td>|;
601 $column_data{gifi_accno} =
602 qq|<td><a href=$form->{script}?action=edit_gifi&accno=$ca->{gifi_accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{gifi_accno}</a> </td>|;
603 $column_data{description} = qq|<td>$ca->{description} </td>|;
604 $column_data{debit} = qq|<td align=right>$ca->{debit}</td>|;
605 $column_data{credit} = qq|<td align=right>$ca->{credit}</td>|;
606 $column_data{link} = qq|<td>$ca->{link} </td>|;
610 map { print "$column_data{$_}\n" } @column_index;
616 <tr><td colspan=$colspan><hr size=3 noshade></td></tr>
623 $lxdebug->leave_sub();
627 $lxdebug->enter_sub();
629 $form->{title} = $locale->text('Delete Account');
632 qw(inventory_accno_id income_accno_id expense_accno_id fxgain_accno_id fxloss_accno_id)
634 if ($form->{id} == $form->{$id}) {
635 $form->error($locale->text('Cannot delete default account!'));
639 $form->redirect($locale->text('Account deleted!'))
640 if (AM->delete_account(\%myconfig, \%$form));
641 $form->error($locale->text('Cannot delete account!'));
643 $lxdebug->leave_sub();
647 $lxdebug->enter_sub();
649 @{ $form->{fields} } = (accno, description);
650 $form->{table} = "gifi";
651 $form->{sortorder} = "accno";
653 AM->gifi_accounts(\%myconfig, \%$form);
655 $form->{title} = $locale->text('GIFI');
659 "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
661 @column_index = qw(accno description);
663 $column_header{accno} = qq|<th>| . $locale->text('GIFI') . qq|</a></th>|;
664 $column_header{description} =
665 qq|<th>| . $locale->text('Description') . qq|</a></th>|;
668 $colspan = $#column_index + 1;
675 <th class=listtop colspan=$colspan>$form->{title}</th>
678 <tr class=listheading>
681 map { print "$column_header{$_}\n" } @column_index;
688 $callback = $form->escape($callback);
690 foreach $ca (@{ $form->{ALL} }) {
696 <tr valign=top class=listrow$i>|;
698 $column_data{accno} =
699 qq|<td><a href=$form->{script}?action=edit_gifi&coa=1&accno=$ca->{accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}</td>|;
700 $column_data{description} = qq|<td>$ca->{description} </td>|;
702 map { print "$column_data{$_}\n" } @column_index;
709 <td colspan=$colspan><hr size=3 noshade></td>
717 $lxdebug->leave_sub();
721 $lxdebug->enter_sub();
723 $form->{title} = "Add";
727 "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
734 $lxdebug->leave_sub();
738 $lxdebug->enter_sub();
740 $form->{title} = "Edit";
742 AM->get_gifi(\%myconfig, \%$form);
747 $lxdebug->leave_sub();
751 $lxdebug->enter_sub();
753 $form->{title} = $locale->text("$form->{title} GIFI");
755 # $locale->text('Add GIFI')
756 # $locale->text('Edit GIFI')
758 $form->{description} =~ s/\"/"/g;
765 <form method=post action=$form->{script}>
767 <input type=hidden name=id value=$form->{accno}>
768 <input type=hidden name=type value=gifi>
772 <th class=listtop>$form->{title}</th>
779 <th align=right>| . $locale->text('GIFI') . qq|</th>
780 <td><input name=accno size=20 value=$form->{accno}></td>
783 <th align=right>| . $locale->text('Description') . qq|</th>
784 <td><input name=description size=60 value="$form->{description}"></td>
790 <td colspan=2><hr size=3 noshade></td>
795 $lxdebug->leave_sub();
799 $lxdebug->enter_sub();
803 <input name=callback type=hidden value="$form->{callback}">
805 <input type=hidden name=path value=$form->{path}>
806 <input type=hidden name=login value=$form->{login}>
807 <input type=hidden name=password value=$form->{password}>
809 <br><input type=submit class=submit name=action value="|
810 . $locale->text('Save') . qq|">|;
814 <input type=submit class=submit name=action value="|
815 . $locale->text('Copy to COA') . qq|">
818 if ($form->{accno} && $form->{orphaned}) {
819 print qq|<input type=submit class=submit name=action value="|
820 . $locale->text('Delete') . qq|">|;
824 if ($form->{menubar}) {
825 require "$form->{path}/menu.pl";
836 $lxdebug->leave_sub();
840 $lxdebug->enter_sub();
842 $form->isblank("accno", $locale->text('GIFI missing!'));
843 AM->save_gifi(\%myconfig, \%$form);
844 $form->redirect($locale->text('GIFI saved!'));
846 $lxdebug->leave_sub();
850 $lxdebug->enter_sub();
852 $form->isblank("accno", $locale->text('GIFI missing!'));
854 AM->save_gifi(\%myconfig, \%$form);
857 $form->{gifi_accno} = $form->{accno};
858 $form->{title} = "Add";
859 $form->{charttype} = "A";
864 $lxdebug->leave_sub();
868 $lxdebug->enter_sub();
870 AM->delete_gifi(\%myconfig, \%$form);
871 $form->redirect($locale->text('GIFI deleted!'));
873 $lxdebug->leave_sub();
877 $lxdebug->enter_sub();
879 $form->{title} = "Add";
883 "$form->{script}?action=add_department&path=$form->{path}&login=$form->{login}&password=$form->{password}"
884 unless $form->{callback};
889 $lxdebug->leave_sub();
892 sub edit_department {
893 $lxdebug->enter_sub();
895 $form->{title} = "Edit";
897 AM->get_department(\%myconfig, \%$form);
902 $lxdebug->leave_sub();
905 sub list_department {
906 $lxdebug->enter_sub();
908 AM->departments(\%myconfig, \%$form);
911 "$form->{script}?action=list_department&path=$form->{path}&login=$form->{login}&password=$form->{password}";
913 $callback = $form->escape($form->{callback});
915 $form->{title} = $locale->text('Departments');
917 @column_index = qw(description cost profit);
919 $column_header{description} =
920 qq|<th class=listheading width=90%>|
921 . $locale->text('Description')
923 $column_header{cost} =
924 qq|<th class=listheading nowrap>|
925 . $locale->text('Cost Center')
927 $column_header{profit} =
928 qq|<th class=listheading nowrap>|
929 . $locale->text('Profit Center')
939 <th class=listtop>$form->{title}</th>
945 <tr class=listheading>
948 map { print "$column_header{$_}\n" } @column_index;
954 foreach $ref (@{ $form->{ALL} }) {
960 <tr valign=top class=listrow$i>
963 $costcenter = ($ref->{role} eq "C") ? "X" : "";
964 $profitcenter = ($ref->{role} eq "P") ? "X" : "";
966 $column_data{description} =
967 qq|<td><a href=$form->{script}?action=edit_department&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description}</td>|;
968 $column_data{cost} = qq|<td align=center>$costcenter</td>|;
969 $column_data{profit} = qq|<td align=center>$profitcenter</td>|;
971 map { print "$column_data{$_}\n" } @column_index;
983 <td><hr size=3 noshade></td>
988 <form method=post action=$form->{script}>
990 <input name=callback type=hidden value="$form->{callback}">
992 <input type=hidden name=type value=department>
994 <input type=hidden name=path value=$form->{path}>
995 <input type=hidden name=login value=$form->{login}>
996 <input type=hidden name=password value=$form->{password}>
998 <input class=submit type=submit name=action value="|
999 . $locale->text('Add') . qq|">|;
1001 if ($form->{menubar}) {
1002 require "$form->{path}/menu.pl";
1013 $lxdebug->leave_sub();
1016 sub department_header {
1017 $lxdebug->enter_sub();
1019 $form->{title} = $locale->text("$form->{title} Department");
1021 # $locale->text('Add Department')
1022 # $locale->text('Edit Department')
1024 $form->{description} =~ s/\"/"/g;
1026 if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
1028 qq|<textarea name="description" rows=$rows cols=60 wrap=soft>$form->{description}</textarea>|;
1031 qq|<input name=description size=60 value="$form->{description}">|;
1034 $costcenter = "checked" if $form->{role} eq "C";
1035 $profitcenter = "checked" if $form->{role} eq "P";
1042 <form method=post action=$form->{script}>
1044 <input type=hidden name=id value=$form->{id}>
1045 <input type=hidden name=type value=department>
1049 <th class=listtop colspan=2>$form->{title}</th>
1051 <tr height="5"></tr>
1053 <th align=right>| . $locale->text('Description') . qq|</th>
1054 <td>$description</td>
1058 <td><input type=radio style=radio name=role value="C" $costcenter> |
1059 . $locale->text('Cost Center') . qq|
1060 <input type=radio style=radio name=role value="P" $profitcenter> |
1061 . $locale->text('Profit Center') . qq|
1064 <td colspan=2><hr size=3 noshade></td>
1069 $lxdebug->leave_sub();
1072 sub save_department {
1073 $lxdebug->enter_sub();
1075 $form->isblank("description", $locale->text('Description missing!'));
1076 AM->save_department(\%myconfig, \%$form);
1077 $form->redirect($locale->text('Department saved!'));
1079 $lxdebug->leave_sub();
1082 sub delete_department {
1083 $lxdebug->enter_sub();
1085 AM->delete_department(\%myconfig, \%$form);
1086 $form->redirect($locale->text('Department deleted!'));
1088 $lxdebug->leave_sub();
1092 $lxdebug->enter_sub();
1094 $form->{title} = "Add";
1097 "$form->{script}?action=add_lead&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1098 unless $form->{callback};
1103 $lxdebug->leave_sub();
1107 $lxdebug->enter_sub();
1109 $form->{title} = "Edit";
1111 AM->get_lead(\%myconfig, \%$form);
1115 $form->{orphaned} = 1;
1118 $lxdebug->leave_sub();
1122 $lxdebug->enter_sub();
1124 AM->lead(\%myconfig, \%$form);
1127 "$form->{script}?action=list_lead&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1129 $callback = $form->escape($form->{callback});
1131 $form->{title} = $locale->text('Lead');
1133 @column_index = qw(description cost profit);
1135 $column_header{description} =
1136 qq|<th class=listheading width=100%>|
1137 . $locale->text('Description')
1147 <th class=listtop>$form->{title}</th>
1149 <tr height="5"></tr>
1150 <tr class=listheading>
1153 map { print "$column_header{$_}\n" } @column_index;
1159 foreach $ref (@{ $form->{ALL} }) {
1165 <tr valign=top class=listrow$i>
1168 $lead = $ref->{lead};
1170 $column_data{description} =
1171 qq|<td><a href=$form->{script}?action=edit_lead&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{lead}</td>|;
1173 map { print "$column_data{$_}\n" } @column_index;
1182 <td><hr size=3 noshade></td>
1187 <form method=post action=$form->{script}>
1189 <input name=callback type=hidden value="$form->{callback}">
1191 <input type=hidden name=type value=lead>
1193 <input type=hidden name=path value=$form->{path}>
1194 <input type=hidden name=login value=$form->{login}>
1195 <input type=hidden name=password value=$form->{password}>
1197 <input class=submit type=submit name=action value="|
1198 . $locale->text('Add') . qq|">|;
1200 if ($form->{menubar}) {
1201 require "$form->{path}/menu.pl";
1212 $lxdebug->leave_sub();
1216 $lxdebug->enter_sub();
1218 $form->{title} = $locale->text("$form->{title} Lead");
1220 # $locale->text('Add Lead')
1221 # $locale->text('Edit Lead')
1223 $form->{description} =~ s/\"/"/g;
1226 qq|<input name=description size=50 value="$form->{lead}">|;
1233 <form method=post action=$form->{script}>
1235 <input type=hidden name=id value=$form->{id}>
1236 <input type=hidden name=type value=lead>
1240 <th class=listtop colspan=2>$form->{title}</th>
1242 <tr height="5"></tr>
1244 <th align=right>| . $locale->text('Description') . qq|</th>
1245 <td>$description</td>
1247 <td colspan=2><hr size=3 noshade></td>
1252 $lxdebug->leave_sub();
1256 $lxdebug->enter_sub();
1258 $form->isblank("description", $locale->text('Description missing!'));
1259 AM->save_lead(\%myconfig, \%$form);
1260 $form->redirect($locale->text('lead saved!'));
1262 $lxdebug->leave_sub();
1266 $lxdebug->enter_sub();
1268 AM->delete_lead(\%myconfig, \%$form);
1269 $form->redirect($locale->text('lead deleted!'));
1271 $lxdebug->leave_sub();
1275 $lxdebug->enter_sub();
1277 $form->{title} = "Add";
1280 "$form->{script}?action=add_business&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1281 unless $form->{callback};
1286 $lxdebug->leave_sub();
1290 $lxdebug->enter_sub();
1292 $form->{title} = "Edit";
1294 AM->get_business(\%myconfig, \%$form);
1298 $form->{orphaned} = 1;
1301 $lxdebug->leave_sub();
1305 $lxdebug->enter_sub();
1307 AM->business(\%myconfig, \%$form);
1310 "$form->{script}?action=list_business&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1312 $callback = $form->escape($form->{callback});
1314 $form->{title} = $locale->text('Type of Business');
1316 @column_index = qw(description discount customernumberinit);
1318 $column_header{description} =
1319 qq|<th class=listheading width=60%>|
1320 . $locale->text('Description')
1322 $column_header{discount} =
1323 qq|<th class=listheading width=10%>|
1324 . $locale->text('Discount')
1326 $column_header{customernumberinit} =
1327 qq|<th class=listheading>|
1328 . $locale->text('Customernumberinit')
1338 <th class=listtop>$form->{title}</th>
1340 <tr height="5"></tr>
1344 <tr class=listheading>
1347 map { print "$column_header{$_}\n" } @column_index;
1353 foreach $ref (@{ $form->{ALL} }) {
1359 <tr valign=top class=listrow$i>
1363 $form->format_amount(\%myconfig, $ref->{discount} * 100, 1, " ");
1366 ? "<b>$ref->{description}</b>"
1367 : "$ref->{description}";
1368 $column_data{description} =
1369 qq|<td><a href=$form->{script}?action=edit_business&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$description</td>|;
1370 $column_data{discount} = qq|<td align=right>$discount</td>|;
1371 $column_data{customernumberinit} =
1372 qq|<td align=right>$ref->{customernumberinit}</td>|;
1374 map { print "$column_data{$_}\n" } @column_index;
1386 <td><hr size=3 noshade></td>
1391 <form method=post action=$form->{script}>
1393 <input name=callback type=hidden value="$form->{callback}">
1395 <input type=hidden name=type value=business>
1397 <input type=hidden name=path value=$form->{path}>
1398 <input type=hidden name=login value=$form->{login}>
1399 <input type=hidden name=password value=$form->{password}>
1401 <input class=submit type=submit name=action value="|
1402 . $locale->text('Add') . qq|">|;
1404 if ($form->{menubar}) {
1405 require "$form->{path}/menu.pl";
1417 $lxdebug->leave_sub();
1420 sub business_header {
1421 $lxdebug->enter_sub();
1423 $form->{title} = $locale->text("$form->{title} Business");
1424 $form->{salesman} = "checked" if $form->{salesman};
1426 # $locale->text('Add Business')
1427 # $locale->text('Edit Business')
1429 $form->{description} =~ s/\"/"/g;
1431 $form->format_amount(\%myconfig, $form->{discount} * 100);
1438 <form method=post action=$form->{script}>
1440 <input type=hidden name=id value=$form->{id}>
1441 <input type=hidden name=type value=business>
1445 <th class=listtop colspan=2>$form->{title}</th>
1447 <tr height="5"></tr>
1449 <th align=right>| . $locale->text('Type of Business') . qq|</th>
1450 <td><input name=description size=30 value="$form->{description}"></td>
1453 <th align=right>| . $locale->text('Discount') . qq| %</th>
1454 <td><input name=discount size=5 value=$form->{discount}></td>
1457 <th align=right>| . $locale->text('Customernumberinit') . qq|</th>
1458 <td><input name=customernumberinit size=10 value=$form->{customernumberinit}></td>
1461 <td align=right>| . $locale->text('Salesman') . qq|</td>
1462 <td><input name=salesman class=checkbox type=checkbox value=1 $form->{salesman}></td>
1464 <td colspan=2><hr size=3 noshade></td>
1469 $lxdebug->leave_sub();
1473 $lxdebug->enter_sub();
1475 $form->isblank("description", $locale->text('Description missing!'));
1476 AM->save_business(\%myconfig, \%$form);
1477 $form->redirect($locale->text('Business saved!'));
1479 $lxdebug->leave_sub();
1482 sub delete_business {
1483 $lxdebug->enter_sub();
1485 AM->delete_business(\%myconfig, \%$form);
1486 $form->redirect($locale->text('Business deleted!'));
1488 $lxdebug->leave_sub();
1492 $lxdebug->enter_sub();
1494 $form->{title} = "Add";
1497 "$form->{script}?action=add_language&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1498 unless $form->{callback};
1503 $lxdebug->leave_sub();
1507 $lxdebug->enter_sub();
1509 $form->{title} = "Edit";
1511 AM->get_language(\%myconfig, \%$form);
1515 $form->{orphaned} = 1;
1518 $lxdebug->leave_sub();
1522 $lxdebug->enter_sub();
1524 AM->language(\%myconfig, \%$form);
1527 "$form->{script}?action=list_language&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1529 $callback = $form->escape($form->{callback});
1531 $form->{title} = $locale->text('Languages');
1533 @column_index = qw(description template_code article_code);
1535 $column_header{description} =
1536 qq|<th class=listheading width=60%>|
1537 . $locale->text('Description')
1539 $column_header{template_code} =
1540 qq|<th class=listheading width=10%>|
1541 . $locale->text('Template Code')
1543 $column_header{article_code} =
1544 qq|<th class=listheading>|
1545 . $locale->text('Article Code')
1555 <th class=listtop>$form->{title}</th>
1557 <tr height="5"></tr>
1561 <tr class=listheading>
1564 map { print "$column_header{$_}\n" } @column_index;
1570 foreach $ref (@{ $form->{ALL} }) {
1576 <tr valign=top class=listrow$i>
1580 $column_data{description} =
1581 qq|<td><a href=$form->{script}?action=edit_language&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description}</td>|;
1582 $column_data{template_code} = qq|<td align=right>$ref->{template_code}</td>|;
1583 $column_data{article_code} =
1584 qq|<td align=right>$ref->{article_code}</td>|;
1586 map { print "$column_data{$_}\n" } @column_index;
1598 <td><hr size=3 noshade></td>
1603 <form method=post action=$form->{script}>
1605 <input name=callback type=hidden value="$form->{callback}">
1607 <input type=hidden name=type value=language>
1609 <input type=hidden name=path value=$form->{path}>
1610 <input type=hidden name=login value=$form->{login}>
1611 <input type=hidden name=password value=$form->{password}>
1613 <input class=submit type=submit name=action value="|
1614 . $locale->text('Add') . qq|">|;
1616 if ($form->{menubar}) {
1617 require "$form->{path}/menu.pl";
1629 $lxdebug->leave_sub();
1632 sub language_header {
1633 $lxdebug->enter_sub();
1635 $form->{title} = $locale->text("$form->{title} Language");
1637 # $locale->text('Add Language')
1638 # $locale->text('Edit Language')
1640 $form->{description} =~ s/\"/"/g;
1641 $form->{template_code} =~ s/\"/"/g;
1642 $form->{article_code} =~ s/\"/"/g;
1650 <form method=post action=$form->{script}>
1652 <input type=hidden name=id value=$form->{id}>
1653 <input type=hidden name=type value=language>
1657 <th class=listtop colspan=2>$form->{title}</th>
1659 <tr height="5"></tr>
1661 <th align=right>| . $locale->text('Language') . qq|</th>
1662 <td><input name=description size=30 value="$form->{description}"></td>
1665 <th align=right>| . $locale->text('Template Code') . qq|</th>
1666 <td><input name=template_code size=5 value=$form->{template_code}></td>
1669 <th align=right>| . $locale->text('Article Code') . qq|</th>
1670 <td><input name=article_code size=10 value=$form->{article_code}></td>
1672 <td colspan=2><hr size=3 noshade></td>
1677 $lxdebug->leave_sub();
1681 $lxdebug->enter_sub();
1683 $form->isblank("description", $locale->text('Language missing!'));
1684 $form->isblank("template_code", $locale->text('Template Code missing!'));
1685 $form->isblank("article_code", $locale->text('Article Code missing!'));
1686 AM->save_language(\%myconfig, \%$form);
1687 $form->redirect($locale->text('Language saved!'));
1689 $lxdebug->leave_sub();
1692 sub delete_language {
1693 $lxdebug->enter_sub();
1695 AM->delete_language(\%myconfig, \%$form);
1696 $form->redirect($locale->text('Language deleted!'));
1698 $lxdebug->leave_sub();
1702 sub add_buchungsgruppe {
1703 $lxdebug->enter_sub();
1705 # $locale->text("Add Buchungsgruppe")
1706 # $locale->text("Edit Buchungsgruppe")
1707 $form->{title} = "Add";
1710 "$form->{script}?action=add_buchungsgruppe&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1711 unless $form->{callback};
1712 AM->get_buchungsgruppe(\%myconfig, \%$form);
1714 &buchungsgruppe_header;
1717 $lxdebug->leave_sub();
1720 sub edit_buchungsgruppe {
1721 $lxdebug->enter_sub();
1723 $form->{title} = "Edit";
1725 AM->get_buchungsgruppe(\%myconfig, \%$form);
1727 &buchungsgruppe_header;
1731 $lxdebug->leave_sub();
1734 sub list_buchungsgruppe {
1735 $lxdebug->enter_sub();
1737 AM->buchungsgruppe(\%myconfig, \%$form);
1740 "$form->{script}?action=list_buchungsgruppe&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1742 $callback = $form->escape($form->{callback});
1744 $form->{title} = $locale->text('Buchungsgruppen');
1746 @column_index = qw(description inventory_accno income_accno_0 expense_accno_0 income_accno_1 expense_accno_1 income_accno_2 expense_accno_2 income_accno_3 expense_accno_3 );
1748 $column_header{description} =
1749 qq|<th class=listheading width=60%>|
1750 . $locale->text('Description')
1752 $column_header{inventory_accno} =
1753 qq|<th class=listheading width=10%>|
1754 . $locale->text('Bestandskonto')
1756 $column_header{income_accno_0} =
1757 qq|<th class=listheading>|
1758 . $locale->text('Erlöse Inland')
1760 $column_header{expense_accno_0} =
1761 qq|<th class=listheading>|
1762 . $locale->text('Aufwand Inland')
1764 $column_header{income_accno_1} =
1765 qq|<th class=listheading>|
1766 . $locale->text('Erlöse EU m. UStId')
1768 $column_header{expense_accno_1} =
1769 qq|<th class=listheading>|
1770 . $locale->text('Aufwand EU m. UStId')
1772 $column_header{income_accno_2} =
1773 qq|<th class=listheading>|
1774 . $locale->text('Erlöse EU o. UStId')
1776 $column_header{expense_accno_2} =
1777 qq|<th class=listheading>|
1778 . $locale->text('Aufwand EU o. UStId')
1780 $column_header{income_accno_3} =
1781 qq|<th class=listheading>|
1782 . $locale->text('Erlöse Ausland')
1784 $column_header{expense_accno_3} =
1785 qq|<th class=listheading>|
1786 . $locale->text('Aufwand Ausland')
1795 <th class=listtop>$form->{title}</th>
1797 <tr height="5"></tr>
1801 <tr class=listheading>
1804 map { print "$column_header{$_}\n" } @column_index;
1810 foreach $ref (@{ $form->{ALL} }) {
1816 <tr valign=top class=listrow$i>
1820 $column_data{description} =
1821 qq|<td><a href=$form->{script}?action=edit_buchungsgruppe&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description}</td>|;
1822 $column_data{inventory_accno} = qq|<td align=right>$ref->{inventory_accno}</td>|;
1823 $column_data{income_accno_0} =
1824 qq|<td align=right>$ref->{income_accno_0}</td>|;
1825 $column_data{expense_accno_0} = qq|<td align=right>$ref->{expense_accno_0}</td>|;
1826 $column_data{income_accno_1} =
1827 qq|<td align=right>$ref->{income_accno_1}</td>|;
1828 $column_data{expense_accno_1} = qq|<td align=right>$ref->{expense_accno_1}</td>|;
1829 $column_data{income_accno_2} =
1830 qq|<td align=right>$ref->{income_accno_2}</td>|;
1831 $column_data{expense_accno_2} = qq|<td align=right>$ref->{expense_accno_2}</td>|;
1832 $column_data{income_accno_3} =
1833 qq|<td align=right>$ref->{income_accno_3}</td>|;
1834 $column_data{expense_accno_3} = qq|<td align=right>$ref->{expense_accno_3}</td>|;
1836 map { print "$column_data{$_}\n" } @column_index;
1848 <td><hr size=3 noshade></td>
1853 <form method=post action=$form->{script}>
1855 <input name=callback type=hidden value="$form->{callback}">
1857 <input type=hidden name=type value=buchungsgruppe>
1859 <input type=hidden name=path value=$form->{path}>
1860 <input type=hidden name=login value=$form->{login}>
1861 <input type=hidden name=password value=$form->{password}>
1863 <input class=submit type=submit name=action value="|
1864 . $locale->text('Add') . qq|">|;
1866 if ($form->{menubar}) {
1867 require "$form->{path}/menu.pl";
1879 $lxdebug->leave_sub();
1882 sub buchungsgruppe_header {
1883 $lxdebug->enter_sub();
1885 $form->{title} = $locale->text("$form->{title} Buchungsgruppe");
1887 # $locale->text('Buchungsgruppe hinzufügen')
1888 # $locale->text('Buchungsgruppe bearbeiten')
1890 $form->{description} =~ s/\"/"/g;
1892 # build the popup menus
1893 $form->{taxaccounts} = "";
1894 foreach $key (keys %{ $form->{IC_links} }) {
1895 foreach $ref (@{ $form->{IC_links}{$key} }) {
1897 # if this is a tax field
1898 if ($key =~ /IC_tax/) {
1899 if ($key =~ /$item/) {
1900 $form->{taxaccounts} .= "$ref->{accno} ";
1901 $form->{"IC_tax_$ref->{accno}_description"} =
1902 "$ref->{accno}--$ref->{description}";
1905 if ($form->{amount}{ $ref->{accno} }) {
1906 $form->{"IC_tax_$ref->{accno}"} = "checked";
1909 $form->{"IC_tax_$ref->{accno}"} = "checked";
1914 $form->{"select$key"} .=
1915 "<option value=$ref->{id} $ref->{selected}>$ref->{accno}--$ref->{description}\n";
1916 if (($key eq "IC") && ($ref->{selected} eq "selected")) {
1917 $form->{IC_default} = $ref->{id};
1919 if ($form->{amount}{$key} eq $ref->{accno}) {
1920 $form->{$key} = "$ref->{accno}--$ref->{description}";
1926 $form->{selectIC_income} = $form->{selectIC_sale};
1927 $form->{selectIC_expense} = $form->{selectIC_cogs};
1928 $form->{IC_income} = $form->{IC_sale};
1929 $form->{IC_expense} = $form->{IC_cogs};
1932 $form->{selectIC} =~ s/selected//g;
1933 $form->{selectIC} =~ s/ value=$form->{inventory_accno_id}/ value=$form->{inventory_accno_id} selected/;
1934 $form->{selectIC_income} =~ s/selected//g;
1935 $form->{selectIC_income} =~ s/ value=$form->{income_accno_id_0}/ value=$form->{income_accno_id_0} selected/;
1936 $form->{selectIC_expense} =~ s/selected//g;
1937 $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_0}/ value=$form->{expense_accno_id_0} selected/;
1943 <th align=right>| . $locale->text('Inventory') . qq|</th>
1944 <td><select name=inventory_accno_id>$form->{selectIC}</select></td>
1945 <input name=selectIC type=hidden value="$form->{selectIC}">
1949 <input type=hidden name=inventory_accno_id value=$form->{inventory_accno_id}>|;
1953 $linkaccounts .= qq|
1955 <th align=right>| . $locale->text('Erlöse Inland') . qq|</th>
1956 <td><select name=income_accno_id_0>$form->{selectIC_income}</select></td>
1959 <th align=right>| . $locale->text('Aufwand Inland') . qq|</th>
1960 <td><select name=expense_accno_id_0>$form->{selectIC_expense}</select></td>
1963 $form->{selectIC_income} =~ s/selected//g;
1964 $form->{selectIC_income} =~ s/ value=$form->{income_accno_id_1}/ value=$form->{income_accno_id_1} selected/;
1965 $form->{selectIC_expense} =~ s/selected//g;
1966 $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_1}/ value=$form->{expense_accno_id_1} selected/;
1968 $linkaccounts .= qq| <tr>
1969 <th align=right>| . $locale->text('Erlöse EU m. UStId') . qq|</th>
1970 <td><select name=income_accno_id_1>$form->{selectIC_income}</select></td>
1973 <th align=right>| . $locale->text('Aufwand EU m UStId') . qq|</th>
1974 <td><select name=expense_accno_id_1>$form->{selectIC_expense}</select></td>
1978 $form->{selectIC_income} =~ s/selected//g;
1979 $form->{selectIC_income} =~ s/ value=$form->{income_accno_id_2}/ value=$form->{income_accno_id_2} selected/;
1980 $form->{selectIC_expense} =~ s/selected//g;
1981 $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_2}/ value=$form->{expense_accno_id_2} selected/;
1984 $linkaccounts .= qq| <tr>
1985 <th align=right>| . $locale->text('Erlöse EU o. UStId') . qq|</th>
1986 <td><select name=income_accno_id_2>$form->{selectIC_income}</select></td>
1989 <th align=right>| . $locale->text('Aufwand EU o. UStId') . qq|</th>
1990 <td><select name=expense_accno_id_2>$form->{selectIC_expense}</select></td>
1994 $form->{selectIC_income} =~ s/selected//g;
1995 $form->{selectIC_income} =~ s/ value=$form->{income_accno_id_3}/ value=$form->{income_accno_id_3} selected/;
1996 $form->{selectIC_expense} =~ s/selected//g;
1997 $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_3}/ value=$form->{expense_accno_id_3} selected/;
2000 $linkaccounts .= qq| <tr>
2001 <th align=right>| . $locale->text('Erlöse Ausland') . qq|</th>
2002 <td><select name=income_accno_id_3>$form->{selectIC_income}</select></td>
2005 <th align=right>| . $locale->text('Aufwand Ausland') . qq|</th>
2006 <td><select name=expense_accno_id_3>$form->{selectIC_expense}</select></td>
2016 <form method=post action=$form->{script}>
2018 <input type=hidden name=id value=$form->{id}>
2019 <input type=hidden name=type value=buchungsgruppe>
2023 <th class=listtop colspan=2>$form->{title}</th>
2025 <tr height="5"></tr>
2027 <th align=right>| . $locale->text('Buchungsgruppe') . qq|</th>
2028 <td><input name=description size=30 value="$form->{description}"></td>
2031 <td colspan=2><hr size=3 noshade></td>
2036 $lxdebug->leave_sub();
2039 sub save_buchungsgruppe {
2040 $lxdebug->enter_sub();
2042 $form->isblank("description", $locale->text('Description missing!'));
2044 AM->save_buchungsgruppe(\%myconfig, \%$form);
2045 $form->redirect($locale->text('Buchungsgruppe gespeichert!'));
2047 $lxdebug->leave_sub();
2050 sub delete_buchungsgruppe {
2051 $lxdebug->enter_sub();
2053 AM->delete_buchungsgruppe(\%myconfig, \%$form);
2054 $form->redirect($locale->text('Buchungsgruppe gelöscht!'));
2056 $lxdebug->leave_sub();
2061 $lxdebug->enter_sub();
2063 $form->{title} = "Add";
2066 "$form->{script}?action=add_printer&path=$form->{path}&login=$form->{login}&password=$form->{password}"
2067 unless $form->{callback};
2072 $lxdebug->leave_sub();
2076 $lxdebug->enter_sub();
2078 $form->{title} = "Edit";
2080 AM->get_printer(\%myconfig, \%$form);
2084 $form->{orphaned} = 1;
2087 $lxdebug->leave_sub();
2091 $lxdebug->enter_sub();
2093 AM->printer(\%myconfig, \%$form);
2096 "$form->{script}?action=list_printer&path=$form->{path}&login=$form->{login}&password=$form->{password}";
2098 $callback = $form->escape($form->{callback});
2100 $form->{title} = $locale->text('Printer');
2102 @column_index = qw(printer_description printer_command template_code);
2104 $column_header{printer_description} =
2105 qq|<th class=listheading width=60%>|
2106 . $locale->text('Printer Description')
2108 $column_header{printer_command} =
2109 qq|<th class=listheading width=10%>|
2110 . $locale->text('Printer Command')
2112 $column_header{template_code} =
2113 qq|<th class=listheading>|
2114 . $locale->text('Template Code')
2124 <th class=listtop>$form->{title}</th>
2126 <tr height="5"></tr>
2130 <tr class=listheading>
2133 map { print "$column_header{$_}\n" } @column_index;
2139 foreach $ref (@{ $form->{ALL} }) {
2145 <tr valign=top class=listrow$i>
2149 $column_data{printer_description} =
2150 qq|<td><a href=$form->{script}?action=edit_printer&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{printer_description}</td>|;
2151 $column_data{printer_command} = qq|<td align=right>$ref->{printer_command}</td>|;
2152 $column_data{template_code} =
2153 qq|<td align=right>$ref->{template_code}</td>|;
2155 map { print "$column_data{$_}\n" } @column_index;
2167 <td><hr size=3 noshade></td>
2172 <form method=post action=$form->{script}>
2174 <input name=callback type=hidden value="$form->{callback}">
2176 <input type=hidden name=type value=printer>
2178 <input type=hidden name=path value=$form->{path}>
2179 <input type=hidden name=login value=$form->{login}>
2180 <input type=hidden name=password value=$form->{password}>
2182 <input class=submit type=submit name=action value="|
2183 . $locale->text('Add') . qq|">|;
2185 if ($form->{menubar}) {
2186 require "$form->{path}/menu.pl";
2198 $lxdebug->leave_sub();
2201 sub printer_header {
2202 $lxdebug->enter_sub();
2204 $form->{title} = $locale->text("$form->{title} Printer");
2206 # $locale->text('Add Printer')
2207 # $locale->text('Edit Printer')
2209 $form->{printer_description} =~ s/\"/"/g;
2210 $form->{template_code} =~ s/\"/"/g;
2211 $form->{printer_command} =~ s/\"/"/g;
2219 <form method=post action=$form->{script}>
2221 <input type=hidden name=id value=$form->{id}>
2222 <input type=hidden name=type value=printer>
2226 <th class=listtop colspan=2>$form->{title}</th>
2228 <tr height="5"></tr>
2230 <th align=right>| . $locale->text('Printer') . qq|</th>
2231 <td><input name=printer_description size=30 value="$form->{printer_description}"></td>
2234 <th align=right>| . $locale->text('Printer Command') . qq|</th>
2235 <td><input name=printer_command size=30 value="$form->{printer_command}"></td>
2238 <th align=right>| . $locale->text('Template Code') . qq|</th>
2239 <td><input name=template_code size=5 value="$form->{template_code}"></td>
2241 <td colspan=2><hr size=3 noshade></td>
2246 $lxdebug->leave_sub();
2250 $lxdebug->enter_sub();
2252 $form->isblank("printer_description", $locale->text('Description missing!'));
2253 $form->isblank("printer_command", $locale->text('Printer Command missing!'));
2254 AM->save_printer(\%myconfig, \%$form);
2255 $form->redirect($locale->text('Printer saved!'));
2257 $lxdebug->leave_sub();
2260 sub delete_printer {
2261 $lxdebug->enter_sub();
2263 AM->delete_printer(\%myconfig, \%$form);
2264 $form->redirect($locale->text('Printer deleted!'));
2266 $lxdebug->leave_sub();
2271 $lxdebug->enter_sub();
2273 $form->{title} = "Add";
2276 "$form->{script}?action=add_payment&path=$form->{path}&login=$form->{login}&password=$form->{password}"
2277 unless $form->{callback};
2282 $lxdebug->leave_sub();
2286 $lxdebug->enter_sub();
2288 $form->{title} = "Edit";
2290 AM->get_payment(\%myconfig, \%$form);
2294 $form->{orphaned} = 1;
2297 $lxdebug->leave_sub();
2301 $lxdebug->enter_sub();
2303 AM->payment(\%myconfig, \%$form);
2306 "$form->{script}?action=list_payment&path=$form->{path}&login=$form->{login}&password=$form->{password}";
2308 $callback = $form->escape($form->{callback});
2310 $form->{title} = $locale->text('Payment Terms');
2312 @column_index = qw(description description_long terms_netto terms_skonto percent_skonto);
2314 $column_header{description} =
2315 qq|<th class=listheading>|
2316 . $locale->text('Description')
2318 $column_header{description_long} =
2319 qq|<th class=listheading>|
2320 . $locale->text('Long Description')
2322 $column_header{terms_netto} =
2323 qq|<th class=listheading>|
2324 . $locale->text('Netto Terms')
2326 $column_header{terms_skonto} =
2327 qq|<th class=listheading>|
2328 . $locale->text('Skonto Terms')
2330 $column_header{percent_skonto} =
2331 qq|<th class=listheading>|
2332 . $locale->text('Skonto')
2342 <th class=listtop>$form->{title}</th>
2344 <tr height="5"></tr>
2348 <tr class=listheading>
2351 map { print "$column_header{$_}\n" } @column_index;
2357 foreach $ref (@{ $form->{ALL} }) {
2363 <tr valign=top class=listrow$i>
2367 $column_data{description} =
2368 qq|<td><a href=$form->{script}?action=edit_payment&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description}</td>|;
2369 $column_data{description_long} = qq|<td align=right>$ref->{description_long}</td>|;
2370 $column_data{terms_netto} =
2371 qq|<td align=right>$ref->{terms_netto}</td>|;
2372 $column_data{terms_skonto} =
2373 qq|<td align=right>$ref->{terms_skonto}</td>|;
2374 $column_data{percent_skonto} =
2375 qq|<td align=right>$ref->{percent_skonto} %</td>|;
2376 map { print "$column_data{$_}\n" } @column_index;
2388 <td><hr size=3 noshade></td>
2393 <form method=post action=$form->{script}>
2395 <input name=callback type=hidden value="$form->{callback}">
2397 <input type=hidden name=type value=business>
2399 <input type=hidden name=path value=$form->{path}>
2400 <input type=hidden name=login value=$form->{login}>
2401 <input type=hidden name=password value=$form->{password}>
2403 <input class=submit type=submit name=action value="|
2404 . $locale->text('Add') . qq|">|;
2406 if ($form->{menubar}) {
2407 require "$form->{path}/menu.pl";
2419 $lxdebug->leave_sub();
2422 sub payment_header {
2423 $lxdebug->enter_sub();
2425 $form->{title} = $locale->text("$form->{title} Payment Terms");
2427 # $locale->text('Add Payment Terms')
2428 # $locale->text('Edit Payment Terms')
2430 $form->{description} =~ s/\"/"/g;
2439 <form method=post action=$form->{script}>
2441 <input type=hidden name=id value=$form->{id}>
2442 <input type=hidden name=type value=payment>
2446 <th class=listtop colspan=2>$form->{title}</th>
2448 <tr height="5"></tr>
2450 <th align=right>| . $locale->text('Description') . qq|</th>
2451 <td><input name=description size=30 value="$form->{description}"></td>
2454 <th align=right>| . $locale->text('Ranking') . qq|</th>
2455 <td><input name=ranking size=30 value="$form->{ranking}"></td>
2458 <th align=right>| . $locale->text('Long Description') . qq|</th>
2459 <td><input name=description_long size=50 value="$form->{description_long}"></td>
2462 <th align=right>| . $locale->text('Netto Terms') . qq|</th>
2463 <td><input name=terms_netto size=10 value="$form->{terms_netto}"></td>
2466 <th align=right>| . $locale->text('Skonto Terms') . qq|</th>
2467 <td><input name=terms_skonto size=10 value="$form->{terms_skonto}"></td>
2470 <th align=right>| . $locale->text('Skonto') . qq| %</th>
2471 <td><input name=percent_skonto size=10 value="$form->{percent_skonto}"></td>
2473 <td colspan=2><hr size=3 noshade></td>
2478 $lxdebug->leave_sub();
2482 $lxdebug->enter_sub();
2484 $form->isblank("description", $locale->text('Language missing!'));
2485 AM->save_payment(\%myconfig, \%$form);
2486 $form->redirect($locale->text('Payment Terms saved!'));
2488 $lxdebug->leave_sub();
2491 sub delete_payment {
2492 $lxdebug->enter_sub();
2494 AM->delete_payment(\%myconfig, \%$form);
2495 $form->redirect($locale->text('Payment terms deleted!'));
2497 $lxdebug->leave_sub();
2501 $lxdebug->enter_sub();
2503 $form->{title} = "Add";
2506 "$form->{script}?action=add_sic&path=$form->{path}&login=$form->{login}&password=$form->{password}"
2507 unless $form->{callback};
2512 $lxdebug->leave_sub();
2516 $lxdebug->enter_sub();
2518 $form->{title} = "Edit";
2520 AM->get_sic(\%myconfig, \%$form);
2524 $form->{orphaned} = 1;
2527 $lxdebug->leave_sub();
2531 $lxdebug->enter_sub();
2533 AM->sic(\%myconfig, \%$form);
2536 "$form->{script}?action=list_sic&path=$form->{path}&login=$form->{login}&password=$form->{password}";
2538 $callback = $form->escape($form->{callback});
2540 $form->{title} = $locale->text('Standard Industrial Codes');
2542 @column_index = qw(code description);
2544 $column_header{code} =
2545 qq|<th class=listheading>| . $locale->text('Code') . qq|</th>|;
2546 $column_header{description} =
2547 qq|<th class=listheading>| . $locale->text('Description') . qq|</th>|;
2556 <th class=listtop>$form->{title}</th>
2558 <tr height="5"></tr>
2562 <tr class=listheading>
2565 map { print "$column_header{$_}\n" } @column_index;
2571 foreach $ref (@{ $form->{ALL} }) {
2576 if ($ref->{sictype} eq 'H') {
2578 <tr valign=top class=listheading>
2580 $column_data{code} =
2581 qq|<th><a href=$form->{script}?action=edit_sic&code=$ref->{code}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{code}</th>|;
2582 $column_data{description} = qq|<th>$ref->{description}</th>|;
2586 <tr valign=top class=listrow$i>
2589 $column_data{code} =
2590 qq|<td><a href=$form->{script}?action=edit_sic&code=$ref->{code}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{code}</td>|;
2591 $column_data{description} = qq|<td>$ref->{description}</td>|;
2595 map { print "$column_data{$_}\n" } @column_index;
2607 <td><hr size=3 noshade></td>
2612 <form method=post action=$form->{script}>
2614 <input name=callback type=hidden value="$form->{callback}">
2616 <input type=hidden name=type value=sic>
2618 <input type=hidden name=path value=$form->{path}>
2619 <input type=hidden name=login value=$form->{login}>
2620 <input type=hidden name=password value=$form->{password}>
2622 <input class=submit type=submit name=action value="|
2623 . $locale->text('Add') . qq|">|;
2625 if ($form->{menubar}) {
2626 require "$form->{path}/menu.pl";
2637 $lxdebug->leave_sub();
2641 $lxdebug->enter_sub();
2643 $form->{title} = $locale->text("$form->{title} SIC");
2645 # $locale->text('Add SIC')
2646 # $locale->text('Edit SIC')
2648 $form->{code} =~ s/\"/"/g;
2649 $form->{description} =~ s/\"/"/g;
2651 $checked = ($form->{sictype} eq 'H') ? "checked" : "";
2658 <form method=post action=$form->{script}>
2660 <input type=hidden name=type value=sic>
2661 <input type=hidden name=id value=$form->{code}>
2665 <th class=listtop colspan=2>$form->{title}</th>
2667 <tr height="5"></tr>
2669 <th align=right>| . $locale->text('Code') . qq|</th>
2670 <td><input name=code size=10 value=$form->{code}></td>
2674 <th align=left><input name=sictype type=checkbox style=checkbox value="H" $checked> |
2675 . $locale->text('Heading') . qq|</th>
2678 <th align=right>| . $locale->text('Description') . qq|</th>
2679 <td><input name=description size=60 value="$form->{description}"></td>
2681 <td colspan=2><hr size=3 noshade></td>
2686 $lxdebug->leave_sub();
2690 $lxdebug->enter_sub();
2692 $form->isblank("code", $locale->text('Code missing!'));
2693 $form->isblank("description", $locale->text('Description missing!'));
2694 AM->save_sic(\%myconfig, \%$form);
2695 $form->redirect($locale->text('SIC saved!'));
2697 $lxdebug->leave_sub();
2701 $lxdebug->enter_sub();
2703 AM->delete_sic(\%myconfig, \%$form);
2704 $form->redirect($locale->text('SIC deleted!'));
2706 $lxdebug->leave_sub();
2709 sub display_stylesheet {
2710 $lxdebug->enter_sub();
2712 $form->{file} = "css/$myconfig{stylesheet}";
2715 $lxdebug->leave_sub();
2719 $lxdebug->enter_sub();
2721 $form->{file} =~ s/^(.:)*?\/|\.\.\///g;
2722 $form->{file} =~ s/^\/*//g;
2723 $form->{file} =~ s/$userspath//;
2725 $form->error("$!: $form->{file}") unless -f $form->{file};
2727 AM->load_template(\%$form);
2729 $form->{title} = $form->{file};
2731 # if it is anything but html
2732 if ($form->{file} !~ /\.html$/) {
2733 $form->{body} = "<pre>\n$form->{body}\n</pre>";
2743 <form method=post action=$form->{script}>
2745 <input name=file type=hidden value=$form->{file}>
2746 <input name=type type=hidden value=template>
2748 <input type=hidden name=path value=$form->{path}>
2749 <input type=hidden name=login value=$form->{login}>
2750 <input type=hidden name=password value=$form->{password}>
2752 <input name=action type=submit class=submit value="|
2753 . $locale->text('Edit') . qq|">|;
2755 if ($form->{menubar}) {
2756 require "$form->{path}/menu.pl";
2767 $lxdebug->leave_sub();
2771 $lxdebug->enter_sub();
2773 AM->load_template(\%$form);
2775 $form->{title} = $locale->text('Edit Template');
2777 # convert   to &nbsp;
2778 $form->{body} =~ s/ /&nbsp;/gi;
2785 <form method=post action=$form->{script}>
2787 <input name=file type=hidden value=$form->{file}>
2788 <input name=type type=hidden value=template>
2790 <input type=hidden name=path value=$form->{path}>
2791 <input type=hidden name=login value=$form->{login}>
2792 <input type=hidden name=password value=$form->{password}>
2794 <input name=callback type=hidden value="$form->{script}?action=display_form&file=$form->{file}&path=$form->{path}&login=$form->{login}&password=$form->{password}">
2796 <textarea name=body rows=25 cols=70>
2801 <input type=submit class=submit name=action value="|
2802 . $locale->text('Save') . qq|">|;
2804 if ($form->{menubar}) {
2805 require "$form->{path}/menu.pl";
2817 $lxdebug->leave_sub();
2821 $lxdebug->enter_sub();
2823 AM->save_template(\%$form);
2824 $form->redirect($locale->text('Template saved!'));
2826 $lxdebug->leave_sub();
2830 $lxdebug->enter_sub();
2832 # get defaults for account numbers and last numbers
2833 AM->defaultaccounts(\%myconfig, \%$form);
2835 foreach $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
2837 ($item eq $myconfig{dateformat})
2838 ? "<option selected>$item\n"
2839 : "<option>$item\n";
2842 foreach $item (qw(1,000.00 1000.00 1.000,00 1000,00)) {
2844 ($item eq $myconfig{numberformat})
2845 ? "<option selected>$item\n"
2846 : "<option>$item\n";
2849 foreach $item (qw(name company address signature)) {
2850 $myconfig{$item} =~ s/\"/"/g;
2853 foreach $item (qw(address signature)) {
2854 $myconfig{$item} =~ s/\\n/\r\n/g;
2857 %countrycodes = User->country_codes;
2859 foreach $key (sort { $countrycodes{$a} cmp $countrycodes{$b} }
2863 ($myconfig{countrycode} eq $key)
2864 ? "<option selected value=$key>$countrycodes{$key}\n"
2865 : "<option value=$key>$countrycodes{$key}\n";
2867 $countrycodes = "<option>American English\n$countrycodes";
2869 # use an other input number format than output numberformat
2870 # look at Form.pm, sub parse_amount
2871 my $in_numberformat = '';
2872 $text1 = qq|value="0">| . $locale->text('equal Outputformat');
2873 $text2 = qq|value="1">| . $locale->text('1000,00 or 1000.00');
2874 @in_nf = ($text1, $text2);
2875 foreach $item (@in_nf) {
2877 (substr($item, 7, 1) eq $myconfig{in_numberformat})
2878 ? "<option selected $item\n"
2879 : "<option $item\n";
2882 foreach $key (keys %{ $form->{IC} }) {
2883 foreach $accno (sort keys %{ $form->{IC}{$key} }) {
2885 ($form->{IC}{$key}{$accno}{id} == $form->{defaults}{$key})
2886 ? "<option selected>$accno--$form->{IC}{$key}{$accno}{description}\n"
2887 : "<option>$accno--$form->{IC}{$key}{$accno}{description}\n";
2891 opendir CSS, "css/.";
2892 @all = grep /.*\.css$/, readdir CSS;
2895 foreach $item (@all) {
2896 if ($item eq $myconfig{stylesheet}) {
2897 $selectstylesheet .= qq|<option selected>$item\n|;
2899 $selectstylesheet .= qq|<option>$item\n|;
2902 $selectstylesheet .= "<option>\n";
2904 $form->{title} = $locale->text('Edit Preferences for') . qq| $form->{login}|;
2908 if ($myconfig{menustyle} eq "old") { $oldS = "checked"; }
2909 else { $newS = "checked"; }
2914 <form method=post action=$form->{script}>
2916 <input type=hidden name=old_password value=$myconfig{password}>
2917 <input type=hidden name=type value=preferences>
2918 <input type=hidden name=role value=$myconfig{role}>
2921 <tr><th class=listtop>$form->{title}</th></tr>
2926 <th align=right>| . $locale->text('Name') . qq|</th>
2927 <td><input name=name size=15 value="$myconfig{name}"></td>
2930 <th align=right>| . $locale->text('Password') . qq|</th>
2931 <td><input type=password name=new_password size=10 value=$myconfig{password}></td>
2934 <th align=right>| . $locale->text('E-mail') . qq|</th>
2935 <td><input name=email size=30 value="$myconfig{email}"></td>
2938 <th align=right>| . $locale->text('Signature') . qq|</th>
2939 <td><textarea name=signature rows=3 cols=50>$myconfig{signature}</textarea></td>
2942 <th align=right>| . $locale->text('Phone') . qq|</th>
2943 <td><input name=tel size=14 value="$myconfig{tel}"></td>
2946 <th align=right>| . $locale->text('Fax') . qq|</th>
2947 <td><input name=fax size=14 value="$myconfig{fax}"></td>
2950 <th align=right>| . $locale->text('Company') . qq|</th>
2951 <td><input name=company size=30 value="$myconfig{company}"></td>
2954 <th align=right>| . $locale->text('Address') . qq|</th>
2955 <td><textarea name=address rows=4 cols=50>$myconfig{address}</textarea></td>
2958 <th align=right>| . $locale->text('Date Format') . qq|</th>
2959 <td><select name=dateformat>$dateformat</select></td>
2962 <th align=right>| . $locale->text('Output Number Format') . qq|</th>
2963 <td><select name=numberformat>$numberformat</select></td>
2966 <th align=right>| . $locale->text('Input Number Format') . qq|</th>
2967 <td><select name=in_numberformat>$in_numberformat</select></td>
2971 <th align=right>| . $locale->text('Dropdown Limit') . qq|</th>
2972 <td><input name=vclimit size=10 value="$myconfig{vclimit}"></td>
2975 <th align=right>| . $locale->text('Language') . qq|</th>
2976 <td><select name=countrycode>$countrycodes</select></td>
2979 <th align=right>| . $locale->text('Stylesheet') . qq|</th>
2980 <td><select name=usestylesheet>$selectstylesheet</select></td>
2983 <th align=right>| . $locale->text('Setup Menu') . qq|</th>
2984 <td><input name=menustyle type=radio class=radio value=neu $newS> New
2985 <input name=menustyle type=radio class=radio value=old $oldS> Old</td>
2987 <input name=printer type=hidden value="$myconfig{printer}">
2988 <tr class=listheading>
2989 <th colspan=2> </th>
2992 <th align=right>| . $locale->text('Business Number') . qq|</th>
2993 <td><input name=businessnumber size=25 value="$myconfig{businessnumber}"></td>
2999 <th align=right>| . $locale->text('Year End') . qq| (mm/dd)</th>
3000 <td><input name=yearend size=5 value=$form->{defaults}{yearend}></td>
3001 <th align=right>| . $locale->text('Weight Unit') . qq|</th>
3002 <td><input name=weightunit size=5 value="$form->{defaults}{weightunit}"></td>
3007 <tr class=listheading>
3009 . $locale->text('Last Numbers & Default Accounts') . qq|</th>
3015 <th align=right nowrap>| . $locale->text('Inventory Account') . qq|</th>
3016 <td><select name=inventory_accno>$myconfig{IC}</select></td>
3019 <th align=right nowrap>| . $locale->text('Revenue Account') . qq|</th>
3020 <td><select name=income_accno>$myconfig{IC_income}</select></td>
3023 <th align=right nowrap>| . $locale->text('Expense Account') . qq|</th>
3024 <td><select name=expense_accno>$myconfig{IC_expense}</select></td>
3027 <th align=right nowrap>| . $locale->text('Foreign Exchange Gain') . qq|</th>
3028 <td><select name=fxgain_accno>$myconfig{FX_gain}</select></td>
3031 <th align=right nowrap>| . $locale->text('Foreign Exchange Loss') . qq|</th>
3032 <td><select name=fxloss_accno>$myconfig{FX_loss}</select></td>
3037 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies'
3039 . qq|<br><input name=curr size=40 value="$form->{defaults}{curr}"></td>
3048 <th align=right nowrap>| . $locale->text('Last Invoice Number') . qq|</th>
3049 <td><input name=invnumber size=10 value=$form->{defaults}{invnumber}></td>
3050 <th align=right nowrap>|
3051 . $locale->text('Last Customer Number') . qq|</th>
3052 <td><input name=customernumber size=10 value=$form->{defaults}{customernumber}></td>
3055 <th align=right nowrap>|
3056 . $locale->text('Last Credit Note Number') . qq|</th>
3057 <td><input name=cnnumber size=10 value=$form->{defaults}{cnnumber}></td>
3058 <th align=right nowrap>|
3059 . $locale->text('Last Vendor Number') . qq|</th>
3060 <td><input name=vendornumber size=10 value=$form->{defaults}{vendornumber}></td>
3063 <th align=right nowrap>|
3064 . $locale->text('Last Sales Order Number') . qq|</th>
3065 <td><input name=sonumber size=10 value=$form->{defaults}{sonumber}></td>
3068 <th align=right nowrap>|
3069 . $locale->text('Last Purchase Order Number') . qq|</th>
3070 <td><input name=ponumber size=10 value=$form->{defaults}{ponumber}></td>
3071 <th align=right nowrap>|
3072 . $locale->text('Last Article Number') . qq|</th>
3073 <td><input name=articlenumber size=10 value=$form->{defaults}{articlenumber}></td>
3076 <th align=right nowrap>|
3077 . $locale->text('Last Sales Quotation Number') . qq|</th>
3078 <td><input name=sqnumber size=10 value=$form->{defaults}{sqnumber}></td>
3079 <th align=right nowrap>|
3080 . $locale->text('Last Service Number') . qq|</th>
3081 <td><input name=servicenumber size=10 value=$form->{defaults}{servicenumber}></td>
3084 <th align=right nowrap>| . $locale->text('Last RFQ Number') . qq|</th>
3085 <td><input name=rfqnumber size=10 value=$form->{defaults}{rfqnumber}></td>
3086 <th align=right nowrap></th>
3092 <tr class=listheading>
3093 <th colspan=2>| . $locale->text('Tax Accounts') . qq|</th>
3100 <th>| . $locale->text('Rate') . qq| (%)</th>
3101 <th>| . $locale->text('Number') . qq|</th>
3105 foreach $accno (sort keys %{ $form->{taxrates} }) {
3108 <th align=right>$form->{taxrates}{$accno}{description}</th>
3109 <td><input name=$form->{taxrates}{$accno}{id} size=6 value=$form->{taxrates}{$accno}{rate}></td>
3110 <td><input name="taxnumber_$form->{taxrates}{$accno}{id}" value="$form->{taxrates}{$accno}{taxnumber}"></td>
3113 $form->{taxaccounts} .= "$form->{taxrates}{$accno}{id} ";
3116 chop $form->{taxaccounts};
3119 <input name=taxaccounts type=hidden value="$form->{taxaccounts}">
3128 <td><hr size=3 noshade></td>
3132 <input type=hidden name=path value=$form->{path}>
3133 <input type=hidden name=login value=$form->{login}>
3134 <input type=hidden name=password value=$form->{password}>
3137 <input type=submit class=submit name=action value="|
3138 . $locale->text('Save') . qq|">|;
3140 if ($form->{menubar}) {
3141 require "$form->{path}/menu.pl";
3152 $lxdebug->leave_sub();
3155 sub save_preferences {
3156 $lxdebug->enter_sub();
3158 $form->{stylesheet} = $form->{usestylesheet};
3160 $form->redirect($locale->text('Preferences saved!'))
3162 AM->save_preferences(\%myconfig, \%$form, $memberfile, $userspath, $webdav
3164 $form->error($locale->text('Cannot save preferences!'));
3166 $lxdebug->leave_sub();
3170 $lxdebug->enter_sub();
3172 if ($form->{media} eq 'email') {
3173 $form->error($locale->text('No email address for') . " $myconfig{name}")
3174 unless ($myconfig{email});
3176 $form->{OUT} = "$sendmail";
3180 AM->backup(\%myconfig, \%$form, $userspath);
3182 if ($form->{media} eq 'email') {
3183 $form->redirect($locale->text('Backup sent to') . qq| $myconfig{email}|);
3186 $lxdebug->leave_sub();
3190 $lxdebug->enter_sub();
3192 $form->{title} = $locale->text('Audit Control');
3194 AM->closedto(\%myconfig, \%$form);
3196 if ($form->{revtrans}) {
3197 $checked{Y} = "checked";
3199 $checked{N} = "checked";
3207 <form method=post action=$form->{script}>
3209 <input type=hidden name=path value=$form->{path}>
3210 <input type=hidden name=login value=$form->{login}>
3211 <input type=hidden name=password value=$form->{password}>
3214 <tr><th class=listtop>$form->{title}</th></tr>
3215 <tr height="5"></tr>
3221 . $locale->text('Enforce transaction reversal for all dates') . qq|</th>
3222 <td><input name=revtrans class=radio type=radio value="1" $checked{Y}> |
3223 . $locale->text('Yes')
3224 . qq| <input name=revtrans class=radio type=radio value="0" $checked{N}> |
3225 . $locale->text('No')
3229 <th>| . $locale->text('Close Books up to') . qq|</th>
3230 <td><input name=closedto size=11 title="$myconfig{dateformat}" value=$form->{closedto}></td>
3240 <input type=hidden name=nextsub value=doclose>
3242 <input type=submit class=submit name=action value="|
3243 . $locale->text('Continue') . qq|">
3251 $lxdebug->leave_sub();
3255 $lxdebug->enter_sub();
3257 AM->closebooks(\%myconfig, \%$form);
3259 if ($form->{revtrans}) {
3261 $locale->text('Transaction reversal enforced for all dates'));
3263 if ($form->{closedto}) {
3265 $locale->text('Transaction reversal enforced up to') . " "
3266 . $locale->date(\%myconfig, $form->{closedto}, 1));
3268 $form->redirect($locale->text('Books are open'));
3272 $lxdebug->leave_sub();
3276 $lxdebug->enter_sub();
3278 $form->{title} = "Add";
3281 "$form->{script}?action=add_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}"
3282 unless $form->{callback};
3287 $lxdebug->leave_sub();
3290 sub edit_warehouse {
3291 $lxdebug->enter_sub();
3293 $form->{title} = "Edit";
3295 AM->get_warehouse(\%myconfig, \%$form);
3300 $lxdebug->leave_sub();
3303 sub list_warehouse {
3304 $lxdebug->enter_sub();
3306 AM->warehouses(\%myconfig, \%$form);
3309 "$form->{script}?action=list_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}";
3311 $callback = $form->escape($form->{callback});
3313 $form->{title} = $locale->text('Warehouses');
3315 @column_index = qw(description);
3317 $column_header{description} =
3318 qq|<th class=listheading width=100%>|
3319 . $locale->text('Description')
3329 <th class=listtop>$form->{title}</th>
3331 <tr height="5"></tr>
3335 <tr class=listheading>
3338 map { print "$column_header{$_}\n" } @column_index;
3344 foreach $ref (@{ $form->{ALL} }) {
3350 <tr valign=top class=listrow$i>
3353 $column_data{description} =
3354 qq|<td><a href=$form->{script}?action=edit_warehouse&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description}</td>|;
3356 map { print "$column_data{$_}\n" } @column_index;
3368 <td><hr size=3 noshade></td>
3373 <form method=post action=$form->{script}>
3375 <input name=callback type=hidden value="$form->{callback}">
3377 <input type=hidden name=type value=warehouse>
3379 <input type=hidden name=path value=$form->{path}>
3380 <input type=hidden name=login value=$form->{login}>
3381 <input type=hidden name=password value=$form->{password}>
3383 <input class=submit type=submit name=action value="|
3384 . $locale->text('Add') . qq|">|;
3386 if ($form->{menubar}) {
3387 require "$form->{path}/menu.pl";
3398 $lxdebug->leave_sub();
3401 sub warehouse_header {
3402 $lxdebug->enter_sub();
3404 $form->{title} = $locale->text("$form->{title} Warehouse");
3406 # $locale->text('Add Warehouse')
3407 # $locale->text('Edit Warehouse')
3409 $form->{description} =~ s/\"/"/g;
3411 if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
3413 qq|<textarea name="description" rows=$rows cols=60 wrap=soft>$form->{description}</textarea>|;
3416 qq|<input name=description size=60 value="$form->{description}">|;
3424 <form method=post action=$form->{script}>
3426 <input type=hidden name=id value=$form->{id}>
3427 <input type=hidden name=type value=warehouse>
3431 <th class=listtop colspan=2>$form->{title}</th>
3433 <tr height="5"></tr>
3435 <th align=right>| . $locale->text('Description') . qq|</th>
3436 <td>$description</td>
3439 <td colspan=2><hr size=3 noshade></td>
3444 $lxdebug->leave_sub();
3447 sub save_warehouse {
3448 $lxdebug->enter_sub();
3450 $form->isblank("description", $locale->text('Description missing!'));
3451 AM->save_warehouse(\%myconfig, \%$form);
3452 $form->redirect($locale->text('Warehouse saved!'));
3454 $lxdebug->leave_sub();
3457 sub delete_warehouse {
3458 $lxdebug->enter_sub();
3460 AM->delete_warehouse(\%myconfig, \%$form);
3461 $form->redirect($locale->text('Warehouse deleted!'));
3463 $lxdebug->leave_sub();
3467 $lxdebug->enter_sub();
3469 &{ $form->{nextsub} };
3471 $lxdebug->leave_sub();
3475 $lxdebug->enter_sub();
3477 $units = AM->retrieve_units(\%myconfig, $form, $form->{"unit_type"}, "resolved_");
3478 AM->units_in_use(\%myconfig, $form, $units);
3479 map({ $units->{$_}->{"BASE_UNIT_DDBOX"} = AM->unit_select_data($units, $units->{$_}->{"base_unit"}, 1); } keys(%{$units}));
3482 foreach $name (sort({ lc($a) cmp lc($b) } grep({ !$units->{$_}->{"base_unit"} } keys(%{$units})))) {
3483 map({ push(@unit_list, $units->{$_}); }
3484 sort({ ($units->{$a}->{"resolved_factor"} * 1) <=> ($units->{$b}->{"resolved_factor"} * 1) }
3485 grep({ $units->{$_}->{"resolved_base_unit"} eq $name } keys(%{$units}))));
3487 map({ $_->{"factor"} = $form->format_amount(\%myconfig, $_->{"factor"}, 5) if ($_->{"factor"}); } @unit_list);
3489 $units = AM->retrieve_units(\%myconfig, $form, $form->{"unit_type"});
3490 $ddbox = AM->unit_select_data($units, undef, 1);
3492 $form->{"title"} = sprintf($locale->text("Add and edit %s"), $form->{"unit_type"} eq "dimension" ? $locale->text("dimension units") : $locale->text("service units"));
3494 print($form->parse_html_template("am/edit_units", { "UNITS" => \@unit_list, "NEW_BASE_UNIT_DDBOX" => $ddbox }));
3496 $lxdebug->leave_sub();
3500 $lxdebug->enter_sub();
3502 $form->isblank("new_name", $locale->text("The name is missing."));
3503 $units = AM->retrieve_units(\%myconfig, $form, $form->{"unit_type"});
3504 $form->show_generic_error($locale->text("A unit with this name does already exist.")) if ($units->{$form->{"new_name"}});
3506 my ($base_unit, $factor);
3507 if ($form->{"new_base_unit"}) {
3508 $form->show_generic_error($locale->text("The base unit does not exist.")) unless (defined($units->{$form->{"new_base_unit"}}));
3510 $form->isblank("new_factor", $locale->text("The factor is missing."));
3511 $factor = $form->parse_amount(\%myconfig, $form->{"new_factor"});
3512 $form->show_generic_error($locale->text("The factor is missing.")) unless ($factor);
3513 $base_unit = $form->{"new_base_unit"};
3516 AM->add_unit(\%myconfig, $form, $form->{"new_name"}, $base_unit, $factor, $form->{"unit_type"});
3518 $form->{"saved_message"} = $locale->text("The unit has been saved.");
3522 $lxdebug->leave_sub();
3526 $lxdebug->enter_sub();
3528 $old_units = AM->retrieve_units(\%myconfig, $form, $form->{"unit_type"}, "resolved_");
3529 AM->units_in_use(\%myconfig, $form, $old_units);
3533 foreach $i (1..($form->{"rowcount"} * 1)) {
3534 $old_unit = $old_units->{$form->{"old_name_$i"}};
3536 $form->show_generic_error(sprintf($locale->text("The unit in row %d has been deleted in the meantime."), $i));
3539 if ($form->{"unchangeable_$i"}) {
3540 $new_units->{$form->{"old_name_$i"}} = $old_units->{$form->{"old_name_$i"}};
3541 $new_units->{$form->{"old_name_$i"}}->{"unchanged_unit"} = 1;
3545 if ($old_unit->{"in_use"}) {
3546 $form->show_generic_error(sprintf($locale->text("The unit in row %d has been used in the meantime and cannot be changed anymore."), $i));
3549 if ($form->{"delete_$i"}) {
3550 push(@delete_units, $old_unit->{"name"});
3554 $form->isblank("name_$i", sprintf($locale->text("The name is missing in row %d."), $i));
3556 $form->show_generic_error(sprintf($locale->text("The name in row %d has already been used before."), $i)) if ($new_units->{$form->{"name_$i"}});
3557 my %h = map({ $_ => $form->{"${_}_$i"} } qw(name base_unit factor old_name));
3558 $new_units->{$form->{"name_$i"}} = \%h;
3559 $new_units->{$form->{"name_$i"}}->{"row"} = $i;
3562 foreach $unit (values(%{$new_units})) {
3563 next unless ($unit->{"old_name"});
3564 if ($unit->{"base_unit"}) {
3565 $form->show_generic_error(sprintf($locale->text("The base unit does not exist or it is about to be deleted in row %d."), $unit->{"row"}))
3566 unless (defined($new_units->{$unit->{"base_unit"}}));
3567 $unit->{"factor"} = $form->parse_amount(\%myconfig, $unit->{"factor"});
3568 $form->show_generic_error(sprintf($locale->text("The factor is missing in row %d."), $unit->{"row"})) unless ($unit->{"factor"} >= 1.0);
3570 $unit->{"base_unit"} = undef;
3571 $unit->{"factor"} = undef;
3575 foreach $unit (values(%{$new_units})) {
3576 next if ($unit->{"unchanged_unit"});
3578 map({ $_->{"seen"} = 0; } values(%{$new_units}));
3580 while ($new_unit->{"base_unit"}) {
3581 $new_unit->{"seen"} = 1;
3582 $new_unit = $new_units->{$new_unit->{"base_unit"}};
3583 if ($new_unit->{"seen"}) {
3584 $form->show_generic_error(sprintf($locale->text("The base unit relations must not contain loops (e.g. by saying that unit A's base unit is B, " .
3585 "B's base unit is C and C's base unit is A) in row %d."), $unit->{"row"}));
3590 AM->save_units(\%myconfig, $form, $form->{"unit_type"}, $new_units, \@delete_units);
3592 $form->{"saved_message"} = $locale->text("The units have been saved.");
3596 $lxdebug->leave_sub();