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 require "$form->{path}/common.pl";
49 sub add { &{"add_$form->{type}"} }
50 sub edit { &{"edit_$form->{type}"} }
51 sub save { &{"save_$form->{type}"} }
52 sub delete { &{"delete_$form->{type}"} }
55 $lxdebug->enter_sub();
57 $form->{title} = "Add";
58 $form->{charttype} = "A";
59 AM->get_account(\%myconfig, \%$form);
62 "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}"
63 unless $form->{callback};
68 $lxdebug->leave_sub();
72 $lxdebug->enter_sub();
74 $form->{title} = "Edit";
75 AM->get_account(\%myconfig, \%$form);
77 foreach my $item (split(/:/, $form->{link})) {
78 $form->{$item} = "checked";
84 $lxdebug->leave_sub();
88 $lxdebug->enter_sub();
90 $form->{title} = $locale->text("$form->{title} Account");
92 $checked{ $form->{charttype} } = "checked";
93 $checked{"$form->{category}_"} = "checked";
94 $checked{CT_tax} = ($form->{CT_tax}) ? "" : "checked";
96 $form->{description} =~ s/\"/"/g;
98 if (@{ $form->{TAXKEY} }) {
99 foreach $item (@{ $form->{TAXKEY} }) {
100 if ($item->{tax} == $form->{tax}) {
101 $form->{selecttaxkey} .=
102 "<option value=$item->{tax} selected>$item->{taxdescription}\n";
104 $form->{selecttaxkey} .=
105 "<option value=$item->{tax}>$item->{taxdescription}\n";
113 <th align=right>| . $locale->text('Steuersatz') . qq|</th>
114 <td><select name=tax>$form->{selecttaxkey}</select></td>
115 <th align=right>| . $locale->text('Gültig ab') . qq|</th>
116 <td><input name=startdate value="$form->{startdate}"></td>
119 if (@{ $form->{NEWACCOUNT} }) {
120 if (!$form->{new_chart_valid}) {
121 $form->{selectnewaccount} = "<option value=></option>";
123 foreach $item (@{ $form->{NEWACCOUNT} }) {
124 if ($item->{id} == $form->{new_chart_id}) {
125 $form->{selectnewaccount} .=
126 "<option value=$item->{id} selected>$item->{accno}--$item->{description}</option>";
127 } elsif (!$form->{new_chart_valid}) {
128 $form->{selectnewaccount} .=
129 "<option value=$item->{id}>$item->{accno}--$item->{description}</option>";
140 <th align=right>| . $locale->text('Folgekonto') . qq|</th>
141 <td><select name=new_chart_id>$form->{selectnewaccount}</select></td>
142 <th align=right>| . $locale->text('Gültig ab') . qq|</th>
143 <td><input name=valid_from value="$form->{valid_from}"></td>
149 $form->{selectustva} = "<option>\n";
151 %ustva = (35 => $locale->text('UStVA-Nr. 35'),
152 36 => $locale->text('UStVA-Nr. 36'),
153 39 => $locale->text('UStVA-Nr. 39'),
154 41 => $locale->text('UStVA-Nr. 41'),
155 42 => $locale->text('UStVA-Nr. 42'),
156 43 => $locale->text('UStVA-Nr. 43'),
157 44 => $locale->text('UStVA-Nr. 44'),
158 45 => $locale->text('UStVA-Nr. 45'),
159 48 => $locale->text('UStVA-Nr. 48'),
160 49 => $locale->text('UStVA-Nr. 49'),
161 51 => $locale->text('UStVA-Nr. 51 left'),
162 511 => $locale->text('UStVA-Nr. 51 right'),
163 52 => $locale->text('UStVA-Nr. 52'),
164 53 => $locale->text('UStVA-Nr. 53'),
165 59 => $locale->text('UStVA-Nr. 59'),
166 60 => $locale->text('UStVA-Nr. 60'),
167 61 => $locale->text('UStVA-Nr. 61'),
168 62 => $locale->text('UStVA-Nr. 62'),
169 63 => $locale->text('UStVA-Nr. 63'),
170 64 => $locale->text('UStVA-Nr. 64'),
171 65 => $locale->text('UStVA-Nr. 65'),
172 66 => $locale->text('UStVA-Nr. 66'),
173 67 => $locale->text('UStVA-Nr. 67'),
174 69 => $locale->text('UStVA-Nr. 69'),
175 73 => $locale->text('UStVA-Nr. 73'),
176 74 => $locale->text('UStVA-Nr. 74'),
177 76 => $locale->text('UStVA-Nr. 76'),
178 77 => $locale->text('UStVA-Nr. 77'),
179 80 => $locale->text('UStVA-Nr. 80'),
180 81 => $locale->text('UStVA-Nr. 81 left'),
181 811 => $locale->text('UStVA-Nr. 81 right'),
182 84 => $locale->text('UStVA-Nr. 84'),
183 85 => $locale->text('UStVA-Nr. 85'),
184 86 => $locale->text('UStVA-Nr. 86 left'),
185 861 => $locale->text('UStVA-Nr. 86 right'),
186 89 => $locale->text('UStVA-Nr. 89 left'),
187 891 => $locale->text('UStVA-Nr. 89 right'),
188 91 => $locale->text('UStVA-Nr. 91'),
189 93 => $locale->text('UStVA-Nr. 93 left'),
190 931 => $locale->text('UStVA-Nr. 93 right'),
191 94 => $locale->text('UStVA-Nr. 94'),
192 95 => $locale->text('UStVA-Nr. 95'),
193 96 => $locale->text('UStVA-Nr. 96'),
194 97 => $locale->text('UStVA-Nr. 97 links'),
195 971 => $locale->text('UStVA-Nr. 97 rechts'),
196 98 => $locale->text('UStVA-Nr. 98'));
198 foreach $item (sort({ $a cmp $b } keys %ustva)) {
199 if ($item == $form->{pos_ustva}) {
200 $form->{selectustva} .= "<option value=$item selected>$ustva{$item}\n";
202 $form->{selectustva} .= "<option value=$item>$ustva{$item}\n";
209 <th align=right>| . $locale->text('Umsatzsteuervoranmeldung') . qq|</th>
210 <td><select name=pos_ustva>$form->{selectustva}</select></td>
211 <input type=hidden name=selectustva value="$form->{selectustva}">
214 $form->{selecteur} = "<option>\n";
215 %eur = (1 => "Umsatzerlöse",
216 2 => "sonstige Erlöse",
217 3 => "Privatanteile",
219 5 => "Ausserordentliche Erträge",
220 6 => "Vereinnahmte Umsatzst.",
221 7 => "Umsatzsteuererstattungen",
222 8 => "Wareneingänge",
223 9 => "Löhne und Gehälter",
224 10 => "Gesetzl. sozialer Aufw.",
226 12 => "Gas, Strom, Wasser",
227 13 => "Instandhaltung",
228 14 => "Steuern, Versich., Beiträge",
230 16 => "Kfz-Versicherungen",
231 17 => "Sonst. Fahrtkosten",
232 18 => "Werbe- und Reisekosten",
233 19 => "Instandhaltung u. Werkzeuge",
234 20 => "Fachzeitschriften, Bücher",
235 21 => "Miete für Einrichtungen",
236 22 => "Rechts- und Beratungskosten",
237 23 => "Bürobedarf, Porto, Telefon",
238 24 => "Sonstige Aufwendungen",
239 25 => "Abschreibungen auf Anlagever.",
240 26 => "Abschreibungen auf GWG",
242 28 => "Umsatzsteuerzahlungen",
244 30 => "Ausserordentlicher Aufwand",
245 31 => "Betriebliche Steuern");
246 foreach $item (sort({ $a <=> $b } keys(%eur))) {
247 if ($item == $form->{pos_eur}) {
248 $form->{selecteur} .= "<option value=$item selected>$eur{$item}\n";
250 $form->{selecteur} .= "<option value=$item>$eur{$item}\n";
257 <th align=right>| . $locale->text('EUER') . qq|</th>
258 <td><select name=pos_eur>$form->{selecteur}</select></td>
259 <input type=hidden name=selecteur value="$form->{selecteur}">
262 $form->{selectbwa} = "<option>\n";
264 %bwapos = (1 => 'Umsatzerlöse',
265 2 => 'Best.Verdg.FE/UE',
266 3 => 'Aktiv.Eigenleistung',
267 4 => 'Mat./Wareneinkauf',
268 5 => 'So.betr.Erlöse',
269 10 => 'Personalkosten',
271 12 => 'Betriebl.Steuern',
272 13 => 'Vers./Beiträge',
273 14 => 'Kfz.Kosten o.St.',
274 15 => 'Werbe-Reisek.',
275 16 => 'Kosten Warenabgabe',
276 17 => 'Abschreibungen',
277 18 => 'Rep./instandhlt.',
278 19 => 'Übrige Steuern',
279 20 => 'Sonst.Kosten',
281 31 => 'Sonst.neutr.Aufw.',
283 33 => 'Sonst.neutr.Ertrag',
284 34 => 'Verr.kalk.Kosten',
285 35 => 'Steuern Eink.u.Ertr.');
286 foreach $item (sort({ $a <=> $b } keys %bwapos)) {
287 if ($item == $form->{pos_bwa}) {
288 $form->{selectbwa} .= "<option value=$item selected>$bwapos{$item}\n";
290 $form->{selectbwa} .= "<option value=$item>$bwapos{$item}\n";
297 <th align=right>| . $locale->text('BWA') . qq|</th>
298 <td><select name=pos_bwa>$form->{selectbwa}</select></td>
299 <input type=hidden name=selectbwa value="$form->{selectbwa}">
302 # Entfernt bis es ordentlich umgesetzt wird (hli) 30.03.2006
303 # $form->{selectbilanz} = "<option>\n";
304 # foreach $item ((1, 2, 3, 4)) {
305 # if ($item == $form->{pos_bilanz}) {
306 # $form->{selectbilanz} .= "<option value=$item selected>$item\n";
308 # $form->{selectbilanz} .= "<option value=$item>$item\n";
315 # <th align=right>| . $locale->text('Bilanz') . qq|</th>
316 # <td><select name=pos_bilanz>$form->{selectbilanz}</select></td>
317 # <input type=hidden name=selectbilanz value="$form->{selectbilanz}">
320 # this is for our parser only!
321 # type=submit $locale->text('Add Account')
322 # type=submit $locale->text('Edit Account')
323 $form->{type} = "account";
330 <form method=post action=$form->{script}>
332 <input type=hidden name=id value=$form->{id}>
333 <input type=hidden name=type value=account>
334 <input type=hidden name=orphaned value=$form->{orphaned}>
335 <input type=hidden name=new_chart_valid value=$form->{new_chart_valid}>
337 <input type=hidden name=inventory_accno_id value=$form->{inventory_accno_id}>
338 <input type=hidden name=income_accno_id value=$form->{income_accno_id}>
339 <input type=hidden name=expense_accno_id value=$form->{expense_accno_id}>
340 <input type=hidden name=fxgain_accno_id value=$form->{fxgain_accno_id}>
341 <input type=hidden name=fxloss_accno_id value=$form->{fxloss_accno_id}>
343 <table border=0 width=100%>
345 <th class=listtop>$form->{title}</th>
352 <th align=right>| . $locale->text('Account Number') . qq|</th>
353 <td><input name=accno size=20 value=$form->{accno}></td>
356 <th align=right>| . $locale->text('Description') . qq|</th>
357 <td><input name=description size=40 value="$form->{description}"></td>
360 <th align=right>| . $locale->text('Account Type') . qq|</th>
364 <td><input name=category type=radio class=radio value=A $checked{A_}> |
365 . $locale->text('Asset') . qq|\n<br>
366 <input name=category type=radio class=radio value=L $checked{L_}> |
367 . $locale->text('Liability') . qq|\n<br>
368 <input name=category type=radio class=radio value=Q $checked{Q_}> |
369 . $locale->text('Equity') . qq|\n<br>
370 <input name=category type=radio class=radio value=I $checked{I_}> |
371 . $locale->text('Revenue') . qq|\n<br>
372 <input name=category type=radio class=radio value=E $checked{E_}> |
373 . $locale->text('Expense') . qq|<br>
374 <input name=category type=radio class=radio value=C $checked{C_}> |
375 . $locale->text('Costs') . qq|</td>
376 <td width=50> </td>
378 <input name=charttype type=radio class=radio value="H" $checked{H}> |
379 . $locale->text('Heading') . qq|<br>
380 <input name=charttype type=radio class=radio value="A" $checked{A}> |
381 . $locale->text('Account') . qq|</td>
388 if ($form->{charttype} eq "A") {
395 . $locale->text('Is this a summary account to record') . qq|</th>
397 <input name=AR type=checkbox class=checkbox value=AR $form->{AR}> |
398 . $locale->text('AR')
399 . qq| <input name=AP type=checkbox class=checkbox value=AP $form->{AP}> |
400 . $locale->text('AP')
401 . qq| <input name=IC type=checkbox class=checkbox value=IC $form->{IC}> |
402 . $locale->text('Inventory')
409 <th colspan=2>| . $locale->text('Include in drop-down menus') . qq|</th>
415 <th align=left>| . $locale->text('Receivables') . qq|</th>
416 <th align=left>| . $locale->text('Payables') . qq|</th>
417 <th align=left>| . $locale->text('Parts Inventory') . qq|</th>
418 <th align=left>| . $locale->text('Service Items') . qq|</th>
422 <input name=AR_amount type=checkbox class=checkbox value=AR_amount $form->{AR_amount}> |
423 . $locale->text('Revenue') . qq|\n<br>
424 <input name=AR_paid type=checkbox class=checkbox value=AR_paid $form->{AR_paid}> |
425 . $locale->text('Receipt') . qq|\n<br>
426 <input name=AR_tax type=checkbox class=checkbox value=AR_tax $form->{AR_tax}> |
427 . $locale->text('Tax') . qq|
430 <input name=AP_amount type=checkbox class=checkbox value=AP_amount $form->{AP_amount}> |
431 . $locale->text('Expense/Asset') . qq|\n<br>
432 <input name=AP_paid type=checkbox class=checkbox value=AP_paid $form->{AP_paid}> |
433 . $locale->text('Payment') . qq|\n<br>
434 <input name=AP_tax type=checkbox class=checkbox value=AP_tax $form->{AP_tax}> |
435 . $locale->text('Tax') . qq|
438 <input name=IC_sale type=checkbox class=checkbox value=IC_sale $form->{IC_sale}> |
439 . $locale->text('Revenue') . qq|\n<br>
440 <input name=IC_cogs type=checkbox class=checkbox value=IC_cogs $form->{IC_cogs}> |
441 . $locale->text('Expense') . qq|\n<br>
442 <input name=IC_taxpart type=checkbox class=checkbox value=IC_taxpart $form->{IC_taxpart}> |
443 . $locale->text('Tax') . qq|
446 <input name=IC_income type=checkbox class=checkbox value=IC_income $form->{IC_income}> |
447 . $locale->text('Revenue') . qq|\n<br>
448 <input name=IC_expense type=checkbox class=checkbox value=IC_expense $form->{IC_expense}> |
449 . $locale->text('Expense') . qq|\n<br>
450 <input name=IC_taxservice type=checkbox class=checkbox value=IC_taxservice $form->{IC_taxservice}> |
451 . $locale->text('Tax') . qq|
471 <td><hr size=3 noshade></td>
476 $lxdebug->leave_sub();
480 $lxdebug->enter_sub();
484 <input name=callback type=hidden value="$form->{callback}">
486 <input type=hidden name=path value=$form->{path}>
487 <input type=hidden name=login value=$form->{login}>
488 <input type=hidden name=password value=$form->{password}>
491 if ((!$form->{id}) || ($form->{id} && $form->{orphaned}) || (($form->{type} eq "account") && (!$form->{new_chart_valid}))) {
493 <input type=submit class=submit name=action value="|
494 . $locale->text('Save') . qq|">
498 if ($form->{id} && $form->{orphaned}) {
499 print qq|<input type=submit class=submit name=action value="|
500 . $locale->text('Delete') . qq|">|;
510 $lxdebug->leave_sub();
514 $lxdebug->enter_sub();
516 $form->isblank("accno", $locale->text('Account Number missing!'));
517 $form->isblank("category", $locale->text('Account Type missing!'));
519 $form->redirect($locale->text('Account saved!'))
520 if (AM->save_account(\%myconfig, \%$form));
521 $form->error($locale->text('Cannot save account!'));
523 $lxdebug->leave_sub();
527 $lxdebug->enter_sub();
529 CA->all_accounts(\%myconfig, \%$form);
531 $form->{title} = $locale->text('Chart of Accounts');
535 "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}";
540 $callback = $form->escape($callback);
542 foreach $ca (@{ $form->{CA} }) {
544 $ca->{debit} = " ";
545 $ca->{credit} = " ";
547 if ($ca->{amount} > 0) {
549 $form->format_amount(\%myconfig, $ca->{amount}, 2, " ");
551 if ($ca->{amount} < 0) {
553 $form->format_amount(\%myconfig, -$ca->{amount}, 2, " ");
556 my @links = split( q{:}, $ca->{link});
560 foreach my $link (@links){
561 $link = ( $link eq 'AR') ? $locale->text('Account Link AR')
562 : ( $link eq 'AP') ? $locale->text('Account Link AP')
563 : ( $link eq 'IC') ? $locale->text('Account Link IC')
564 : ( $link eq 'AR_amount' ) ? $locale->text('Account Link AR_amount')
565 : ( $link eq 'AR_paid' ) ? $locale->text('Account Link AR_paid')
566 : ( $link eq 'AR_tax' ) ? $locale->text('Account Link AR_tax')
567 : ( $link eq 'AP_amount' ) ? $locale->text('Account Link AP_amount')
568 : ( $link eq 'AP_paid' ) ? $locale->text('Account Link AP_paid')
569 : ( $link eq 'AP_tax' ) ? $locale->text('Account Link AP_tax')
570 : ( $link eq 'IC_sale' ) ? $locale->text('Account Link IC_sale')
571 : ( $link eq 'IC_cogs' ) ? $locale->text('Account Link IC_cogs')
572 : ( $link eq 'IC_taxpart' ) ? $locale->text('Account Link IC_taxpart')
573 : ( $link eq 'IC_income' ) ? $locale->text('Account Link IC_income')
574 : ( $link eq 'IC_expense' ) ? $locale->text('Account Link IC_expense')
575 : ( $link eq 'IC_taxservice' ) ? $locale->text('Account Link IC_taxservice')
576 : ( $link eq 'CT_tax' ) ? $locale->text('Account Link CT_tax')
577 : $locale->text('Unknown Link') . ': ' . $link;
579 $ca->{link} .= qq|[| . $link . qq|] |;
582 $ca->{startdate} =~ s/,/<br>/og;
583 $ca->{tk_ustva} =~ s/,/<br>/og;
584 $ca->{taxkey} =~ s/,/<br>/og;
585 $ca->{taxaccount} =~ s/,/<br>/og;
586 $ca->{taxdescription} =~ s/,/<br>/og;
587 $ca->{datevautomatik} = ($ca->{datevautomatik}) ? $locale->text('On'):q{};
589 $ca->{category} = ($ca->{category} eq 'A') ? $locale->text('Account Category A')
590 : ($ca->{category} eq 'E') ? $locale->text('Account Category E')
591 : ($ca->{category} eq 'L') ? $locale->text('Account Category L')
592 : ($ca->{category} eq 'I') ? $locale->text('Account Category I')
593 : ($ca->{category} eq 'Q') ? $locale->text('Account Category Q')
594 : ($ca->{category} eq 'C') ? $locale->text('Account Category C')
595 : ($ca->{category} eq 'G') ? $locale->text('Account Category G')
596 : $locale->text('Unknown Category') . ': ' . $ca->{category};
598 $ca->{link_edit_account} =
599 qq|$form->{script}?action=edit_account&id=$ca->{id}|
600 .qq|&path=$form->{path}&login=$form->{login}|
601 .qq|&password=$form->{password}&callback=$callback|;
604 my $parameters_ref = {
607 # hidden_variables => $_hidden_variables_ref,
610 # Ausgabe des Templates
611 print($form->parse_html_template('am/list_accounts', $parameters_ref));
613 $lxdebug->leave_sub();
619 $lxdebug->enter_sub();
621 $form->{title} = $locale->text('Delete Account');
624 qw(inventory_accno_id income_accno_id expense_accno_id fxgain_accno_id fxloss_accno_id)
626 if ($form->{id} == $form->{$id}) {
627 $form->error($locale->text('Cannot delete default account!'));
631 $form->redirect($locale->text('Account deleted!'))
632 if (AM->delete_account(\%myconfig, \%$form));
633 $form->error($locale->text('Cannot delete account!'));
635 $lxdebug->leave_sub();
639 $lxdebug->enter_sub();
641 $form->{title} = "Add";
645 "$form->{script}?action=add_department&path=$form->{path}&login=$form->{login}&password=$form->{password}"
646 unless $form->{callback};
651 $lxdebug->leave_sub();
654 sub edit_department {
655 $lxdebug->enter_sub();
657 $form->{title} = "Edit";
659 AM->get_department(\%myconfig, \%$form);
664 $lxdebug->leave_sub();
667 sub list_department {
668 $lxdebug->enter_sub();
670 AM->departments(\%myconfig, \%$form);
673 "$form->{script}?action=list_department&path=$form->{path}&login=$form->{login}&password=$form->{password}";
675 $callback = $form->escape($form->{callback});
677 $form->{title} = $locale->text('Departments');
679 @column_index = qw(description cost profit);
681 $column_header{description} =
682 qq|<th class=listheading width=90%>|
683 . $locale->text('Description')
685 $column_header{cost} =
686 qq|<th class=listheading nowrap>|
687 . $locale->text('Cost Center')
689 $column_header{profit} =
690 qq|<th class=listheading nowrap>|
691 . $locale->text('Profit Center')
701 <th class=listtop>$form->{title}</th>
707 <tr class=listheading>
710 map { print "$column_header{$_}\n" } @column_index;
716 foreach $ref (@{ $form->{ALL} }) {
722 <tr valign=top class=listrow$i>
725 $costcenter = ($ref->{role} eq "C") ? "X" : "";
726 $profitcenter = ($ref->{role} eq "P") ? "X" : "";
728 $column_data{description} =
729 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>|;
730 $column_data{cost} = qq|<td align=center>$costcenter</td>|;
731 $column_data{profit} = qq|<td align=center>$profitcenter</td>|;
733 map { print "$column_data{$_}\n" } @column_index;
745 <td><hr size=3 noshade></td>
750 <form method=post action=$form->{script}>
752 <input name=callback type=hidden value="$form->{callback}">
754 <input type=hidden name=type value=department>
756 <input type=hidden name=path value=$form->{path}>
757 <input type=hidden name=login value=$form->{login}>
758 <input type=hidden name=password value=$form->{password}>
760 <input class=submit type=submit name=action value="|
761 . $locale->text('Add') . qq|">
769 $lxdebug->leave_sub();
772 sub department_header {
773 $lxdebug->enter_sub();
775 $form->{title} = $locale->text("$form->{title} Department");
777 # $locale->text('Add Department')
778 # $locale->text('Edit Department')
780 $form->{description} =~ s/\"/"/g;
782 if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
784 qq|<textarea name="description" rows=$rows cols=60 wrap=soft>$form->{description}</textarea>|;
787 qq|<input name=description size=60 value="$form->{description}">|;
790 $costcenter = "checked" if $form->{role} eq "C";
791 $profitcenter = "checked" if $form->{role} eq "P";
798 <form method=post action=$form->{script}>
800 <input type=hidden name=id value=$form->{id}>
801 <input type=hidden name=type value=department>
805 <th class=listtop colspan=2>$form->{title}</th>
809 <th align=right>| . $locale->text('Description') . qq|</th>
810 <td>$description</td>
814 <td><input type=radio style=radio name=role value="C" $costcenter> |
815 . $locale->text('Cost Center') . qq|
816 <input type=radio style=radio name=role value="P" $profitcenter> |
817 . $locale->text('Profit Center') . qq|
820 <td colspan=2><hr size=3 noshade></td>
825 $lxdebug->leave_sub();
828 sub save_department {
829 $lxdebug->enter_sub();
831 $form->isblank("description", $locale->text('Description missing!'));
832 AM->save_department(\%myconfig, \%$form);
833 $form->redirect($locale->text('Department saved!'));
835 $lxdebug->leave_sub();
838 sub delete_department {
839 $lxdebug->enter_sub();
841 AM->delete_department(\%myconfig, \%$form);
842 $form->redirect($locale->text('Department deleted!'));
844 $lxdebug->leave_sub();
848 $lxdebug->enter_sub();
850 $form->{title} = "Add";
853 "$form->{script}?action=add_lead&path=$form->{path}&login=$form->{login}&password=$form->{password}"
854 unless $form->{callback};
859 $lxdebug->leave_sub();
863 $lxdebug->enter_sub();
865 $form->{title} = "Edit";
867 AM->get_lead(\%myconfig, \%$form);
871 $form->{orphaned} = 1;
874 $lxdebug->leave_sub();
878 $lxdebug->enter_sub();
880 AM->lead(\%myconfig, \%$form);
883 "$form->{script}?action=list_lead&path=$form->{path}&login=$form->{login}&password=$form->{password}";
885 $callback = $form->escape($form->{callback});
887 $form->{title} = $locale->text('Lead');
889 @column_index = qw(description cost profit);
891 $column_header{description} =
892 qq|<th class=listheading width=100%>|
893 . $locale->text('Description')
903 <th class=listtop>$form->{title}</th>
906 <tr class=listheading>
909 map { print "$column_header{$_}\n" } @column_index;
915 foreach $ref (@{ $form->{ALL} }) {
921 <tr valign=top class=listrow$i>
924 $lead = $ref->{lead};
926 $column_data{description} =
927 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>|;
929 map { print "$column_data{$_}\n" } @column_index;
938 <td><hr size=3 noshade></td>
943 <form method=post action=$form->{script}>
945 <input name=callback type=hidden value="$form->{callback}">
947 <input type=hidden name=type value=lead>
949 <input type=hidden name=path value=$form->{path}>
950 <input type=hidden name=login value=$form->{login}>
951 <input type=hidden name=password value=$form->{password}>
953 <input class=submit type=submit name=action value="|
954 . $locale->text('Add') . qq|">
962 $lxdebug->leave_sub();
966 $lxdebug->enter_sub();
968 $form->{title} = $locale->text("$form->{title} Lead");
970 # $locale->text('Add Lead')
971 # $locale->text('Edit Lead')
973 $form->{description} =~ s/\"/"/g;
976 qq|<input name=description size=50 value="$form->{lead}">|;
983 <form method=post action=$form->{script}>
985 <input type=hidden name=id value=$form->{id}>
986 <input type=hidden name=type value=lead>
990 <th class=listtop colspan=2>$form->{title}</th>
994 <th align=right>| . $locale->text('Description') . qq|</th>
995 <td>$description</td>
997 <td colspan=2><hr size=3 noshade></td>
1002 $lxdebug->leave_sub();
1006 $lxdebug->enter_sub();
1008 $form->isblank("description", $locale->text('Description missing!'));
1009 AM->save_lead(\%myconfig, \%$form);
1010 $form->redirect($locale->text('lead saved!'));
1012 $lxdebug->leave_sub();
1016 $lxdebug->enter_sub();
1018 AM->delete_lead(\%myconfig, \%$form);
1019 $form->redirect($locale->text('lead deleted!'));
1021 $lxdebug->leave_sub();
1025 $lxdebug->enter_sub();
1027 $form->{title} = "Add";
1030 "$form->{script}?action=add_business&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1031 unless $form->{callback};
1036 $lxdebug->leave_sub();
1040 $lxdebug->enter_sub();
1042 $form->{title} = "Edit";
1044 AM->get_business(\%myconfig, \%$form);
1048 $form->{orphaned} = 1;
1051 $lxdebug->leave_sub();
1055 $lxdebug->enter_sub();
1057 AM->business(\%myconfig, \%$form);
1060 "$form->{script}?action=list_business&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1062 $callback = $form->escape($form->{callback});
1064 $form->{title} = $locale->text('Type of Business');
1066 @column_index = qw(description discount customernumberinit);
1068 $column_header{description} =
1069 qq|<th class=listheading width=60%>|
1070 . $locale->text('Description')
1072 $column_header{discount} =
1073 qq|<th class=listheading width=10%>|
1074 . $locale->text('Discount')
1076 $column_header{customernumberinit} =
1077 qq|<th class=listheading>|
1078 . $locale->text('Customernumberinit')
1088 <th class=listtop>$form->{title}</th>
1090 <tr height="5"></tr>
1094 <tr class=listheading>
1097 map { print "$column_header{$_}\n" } @column_index;
1103 foreach $ref (@{ $form->{ALL} }) {
1109 <tr valign=top class=listrow$i>
1113 $form->format_amount(\%myconfig, $ref->{discount} * 100, 1, " ");
1116 ? "<b>$ref->{description}</b>"
1117 : "$ref->{description}";
1118 $column_data{description} =
1119 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>|;
1120 $column_data{discount} = qq|<td align=right>$discount</td>|;
1121 $column_data{customernumberinit} =
1122 qq|<td align=right>$ref->{customernumberinit}</td>|;
1124 map { print "$column_data{$_}\n" } @column_index;
1136 <td><hr size=3 noshade></td>
1141 <form method=post action=$form->{script}>
1143 <input name=callback type=hidden value="$form->{callback}">
1145 <input type=hidden name=type value=business>
1147 <input type=hidden name=path value=$form->{path}>
1148 <input type=hidden name=login value=$form->{login}>
1149 <input type=hidden name=password value=$form->{password}>
1151 <input class=submit type=submit name=action value="|
1152 . $locale->text('Add') . qq|">
1160 $lxdebug->leave_sub();
1163 sub business_header {
1164 $lxdebug->enter_sub();
1166 $form->{title} = $locale->text("$form->{title} Business");
1167 $form->{salesman} = "checked" if $form->{salesman};
1169 # $locale->text('Add Business')
1170 # $locale->text('Edit Business')
1172 $form->{description} =~ s/\"/"/g;
1174 $form->format_amount(\%myconfig, $form->{discount} * 100);
1181 <form method=post action=$form->{script}>
1183 <input type=hidden name=id value=$form->{id}>
1184 <input type=hidden name=type value=business>
1188 <th class=listtop colspan=2>$form->{title}</th>
1190 <tr height="5"></tr>
1192 <th align=right>| . $locale->text('Type of Business') . qq|</th>
1193 <td><input name=description size=30 value="$form->{description}"></td>
1196 <th align=right>| . $locale->text('Discount') . qq| %</th>
1197 <td><input name=discount size=5 value=$form->{discount}></td>
1200 <th align=right>| . $locale->text('Customernumberinit') . qq|</th>
1201 <td><input name=customernumberinit size=10 value=$form->{customernumberinit}></td>
1204 <td align=right>| . $locale->text('Salesman') . qq|</td>
1205 <td><input name=salesman class=checkbox type=checkbox value=1 $form->{salesman}></td>
1207 <td colspan=2><hr size=3 noshade></td>
1212 $lxdebug->leave_sub();
1216 $lxdebug->enter_sub();
1218 $form->isblank("description", $locale->text('Description missing!'));
1219 AM->save_business(\%myconfig, \%$form);
1220 $form->redirect($locale->text('Business saved!'));
1222 $lxdebug->leave_sub();
1225 sub delete_business {
1226 $lxdebug->enter_sub();
1228 AM->delete_business(\%myconfig, \%$form);
1229 $form->redirect($locale->text('Business deleted!'));
1231 $lxdebug->leave_sub();
1235 $lxdebug->enter_sub();
1237 $form->{title} = "Add";
1240 "$form->{script}?action=add_language&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1241 unless $form->{callback};
1246 $lxdebug->leave_sub();
1250 $lxdebug->enter_sub();
1252 $form->{title} = "Edit";
1254 AM->get_language(\%myconfig, \%$form);
1258 $form->{orphaned} = 1;
1261 $lxdebug->leave_sub();
1265 $lxdebug->enter_sub();
1267 AM->language(\%myconfig, \%$form);
1270 "$form->{script}?action=list_language&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1272 $callback = $form->escape($form->{callback});
1274 $form->{title} = $locale->text('Languages');
1276 @column_index = qw(description template_code article_code output_numberformat output_dateformat output_longdates);
1278 $column_header{description} =
1279 qq|<th class=listheading width=60%>|
1280 . $locale->text('Description')
1282 $column_header{template_code} =
1283 qq|<th class=listheading width=10%>|
1284 . $locale->text('Template Code')
1286 $column_header{article_code} =
1287 qq|<th class=listheading>|
1288 . $locale->text('Article Code')
1290 $column_header{output_numberformat} =
1291 qq|<th class=listheading>|
1292 . $locale->text('Number Format')
1294 $column_header{output_dateformat} =
1295 qq|<th class=listheading>|
1296 . $locale->text('Date Format')
1298 $column_header{output_longdates} =
1299 qq|<th class=listheading>|
1300 . $locale->text('Long Dates')
1310 <th class=listtop>$form->{title}</th>
1312 <tr height="5"></tr>
1316 <tr class=listheading>
1319 map { print "$column_header{$_}\n" } @column_index;
1325 foreach $ref (@{ $form->{ALL} }) {
1331 <tr valign=top class=listrow$i>
1335 $column_data{description} =
1336 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>|;
1337 $column_data{template_code} = qq|<td align=right>$ref->{template_code}</td>|;
1338 $column_data{article_code} =
1339 qq|<td align=right>$ref->{article_code}</td>|;
1340 $column_data{output_numberformat} =
1342 ($ref->{output_numberformat} ? $ref->{output_numberformat} :
1343 $locale->text("use program settings")) .
1345 $column_data{output_dateformat} =
1347 ($ref->{output_dateformat} ? $ref->{output_dateformat} :
1348 $locale->text("use program settings")) .
1350 $column_data{output_longdates} =
1352 ($ref->{output_longdates} ? $locale->text("Yes") : $locale->text("No")) .
1355 map { print "$column_data{$_}\n" } @column_index;
1367 <td><hr size=3 noshade></td>
1372 <form method=post action=$form->{script}>
1374 <input name=callback type=hidden value="$form->{callback}">
1376 <input type=hidden name=type value=language>
1378 <input type=hidden name=path value=$form->{path}>
1379 <input type=hidden name=login value=$form->{login}>
1380 <input type=hidden name=password value=$form->{password}>
1382 <input class=submit type=submit name=action value="|
1383 . $locale->text('Add') . qq|">
1391 $lxdebug->leave_sub();
1394 sub language_header {
1395 $lxdebug->enter_sub();
1397 $form->{title} = $locale->text("$form->{title} Language");
1399 # $locale->text('Add Language')
1400 # $locale->text('Edit Language')
1402 $form->{description} =~ s/\"/"/g;
1403 $form->{template_code} =~ s/\"/"/g;
1404 $form->{article_code} =~ s/\"/"/g;
1410 qq|<option value="">| . $locale->text("use program settings") .
1412 foreach $item (qw(1,000.00 1000.00 1.000,00 1000,00)) {
1414 ($item eq $form->{output_numberformat})
1415 ? "<option selected>$item"
1421 qq|<option value="">| . $locale->text("use program settings") .
1423 foreach $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
1425 ($item eq $form->{output_dateformat})
1426 ? "<option selected>$item"
1434 <form method=post action=$form->{script}>
1436 <input type=hidden name=id value=$form->{id}>
1437 <input type=hidden name=type value=language>
1441 <th class=listtop colspan=2>$form->{title}</th>
1443 <tr height="5"></tr>
1445 <th align=right>| . $locale->text('Language') . qq|</th>
1446 <td><input name=description size=30 value="| . $form->quote($form->{description}) . qq|"></td>
1449 <th align=right>| . $locale->text('Template Code') . qq|</th>
1450 <td><input name=template_code size=5 value="| . $form->quote($form->{template_code}) . qq|"></td>
1453 <th align=right>| . $locale->text('Article Code') . qq|</th>
1454 <td><input name=article_code size=10 value="| . $form->quote($form->{article_code}) . qq|"></td>
1457 <th align=right>| . $locale->text('Number Format') . qq|</th>
1458 <td><select name="output_numberformat">$numberformat</select></td>
1461 <th align=right>| . $locale->text('Date Format') . qq|</th>
1462 <td><select name="output_dateformat">$dateformat</select></td>
1465 <th align=right>| . $locale->text('Long Dates') . qq|</th>
1466 <td><input type="radio" name="output_longdates" value="1"| .
1467 ($form->{output_longdates} ? " checked" : "") .
1468 qq|>| . $locale->text("Yes") .
1469 qq|<input type="radio" name="output_longdates" value="0"| .
1470 ($form->{output_longdates} ? "" : " checked") .
1471 qq|>| . $locale->text("No") .
1474 <td colspan=2><hr size=3 noshade></td>
1479 $lxdebug->leave_sub();
1483 $lxdebug->enter_sub();
1485 $form->isblank("description", $locale->text('Language missing!'));
1486 $form->isblank("template_code", $locale->text('Template Code missing!'));
1487 $form->isblank("article_code", $locale->text('Article Code missing!'));
1488 AM->save_language(\%myconfig, \%$form);
1489 $form->redirect($locale->text('Language saved!'));
1491 $lxdebug->leave_sub();
1494 sub delete_language {
1495 $lxdebug->enter_sub();
1497 AM->delete_language(\%myconfig, \%$form);
1498 $form->redirect($locale->text('Language deleted!'));
1500 $lxdebug->leave_sub();
1504 sub add_buchungsgruppe {
1505 $lxdebug->enter_sub();
1507 # $locale->text("Add Buchungsgruppe")
1508 # $locale->text("Edit Buchungsgruppe")
1509 $form->{title} = "Add";
1512 "$form->{script}?action=add_buchungsgruppe&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1513 unless $form->{callback};
1514 AM->get_buchungsgruppe(\%myconfig, \%$form);
1515 $form->{"inventory_accno_id"} = $form->{"std_inventory_accno_id"};
1516 for (my $i = 0; 4 > $i; $i++) {
1517 map({ $form->{"${_}_accno_id_$i"} = $form->{"std_${_}_accno_id"}; }
1518 qw(income expense));
1521 &buchungsgruppe_header;
1524 $lxdebug->leave_sub();
1527 sub edit_buchungsgruppe {
1528 $lxdebug->enter_sub();
1530 $form->{title} = "Edit";
1532 AM->get_buchungsgruppe(\%myconfig, \%$form);
1534 &buchungsgruppe_header;
1538 $lxdebug->leave_sub();
1541 sub list_buchungsgruppe {
1542 $lxdebug->enter_sub();
1544 AM->buchungsgruppe(\%myconfig, \%$form);
1547 "$form->{script}?action=list_buchungsgruppe&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1549 $callback = $form->escape($form->{callback});
1551 $form->{title} = $locale->text('Buchungsgruppen');
1553 @column_index = qw(up down description inventory_accno
1554 income_accno_0 expense_accno_0
1555 income_accno_1 expense_accno_1
1556 income_accno_2 expense_accno_2
1557 income_accno_3 expense_accno_3 );
1559 $column_header{up} =
1560 qq|<th class="listheading" width="16">|
1561 . qq|<img src="image/up.png" alt="| . $locale->text("up") . qq|">|
1563 $column_header{down} =
1564 qq|<th class="listheading" width="16">|
1565 . qq|<img src="image/down.png" alt="| . $locale->text("down") . qq|">|
1567 $column_header{description} =
1568 qq|<th class="listheading" width="40%">|
1569 . $locale->text('Description')
1571 $column_header{inventory_accno} =
1572 qq|<th class=listheading>|
1573 . $locale->text('Bestandskonto')
1575 $column_header{income_accno_0} =
1576 qq|<th class=listheading>|
1577 . $locale->text('Erlöse Inland')
1579 $column_header{expense_accno_0} =
1580 qq|<th class=listheading>|
1581 . $locale->text('Aufwand Inland')
1583 $column_header{income_accno_1} =
1584 qq|<th class=listheading>|
1585 . $locale->text('Erlöse EU m. UStId')
1587 $column_header{expense_accno_1} =
1588 qq|<th class=listheading>|
1589 . $locale->text('Aufwand EU m. UStId')
1591 $column_header{income_accno_2} =
1592 qq|<th class=listheading>|
1593 . $locale->text('Erlöse EU o. UStId')
1595 $column_header{expense_accno_2} =
1596 qq|<th class=listheading>|
1597 . $locale->text('Aufwand EU o. UStId')
1599 $column_header{income_accno_3} =
1600 qq|<th class=listheading>|
1601 . $locale->text('Erlöse Ausland')
1603 $column_header{expense_accno_3} =
1604 qq|<th class=listheading>|
1605 . $locale->text('Aufwand Ausland')
1614 <th class=listtop>$form->{title}</th>
1616 <tr height="5"></tr>
1620 <tr class=listheading>
1623 map { print "$column_header{$_}\n" } @column_index;
1629 my $swap_link = qq|$form->{script}?action=swap_buchungsgruppen&|;
1630 map({ $swap_link .= $_ . "=" . $form->escape($form->{$_}) . "&" }
1631 qw(login password path));
1634 foreach $ref (@{ $form->{ALL} }) {
1640 <tr valign=top class=listrow$i>
1644 my $pref = $form->{ALL}->[$row - 1];
1646 qq|<td align="center" valign="center" width="16">| .
1647 qq|<a href="${swap_link}id1=$ref->{id}&id2=$pref->{id}">| .
1648 qq|<img src="image/up.png" alt="| . $locale->text("up") . qq|">| .
1651 $column_data{up} = qq|<td width="16"> </td>|;
1654 if ($row == (scalar(@{ $form->{ALL} }) - 1)) {
1655 $column_data{down} = qq|<td width="16"> </td>|;
1657 my $nref = $form->{ALL}->[$row + 1];
1658 $column_data{down} =
1659 qq|<td align="center" valign="center" width="16">| .
1660 qq|<a href="${swap_link}id1=$ref->{id}&id2=$nref->{id}">| .
1661 qq|<img src="image/down.png" alt="| . $locale->text("down") . qq|">| .
1665 $column_data{description} =
1666 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>|;
1667 $column_data{inventory_accno} = qq|<td align=right>$ref->{inventory_accno}</td>|;
1668 $column_data{income_accno_0} =
1669 qq|<td align=right>$ref->{income_accno_0}</td>|;
1670 $column_data{expense_accno_0} = qq|<td align=right>$ref->{expense_accno_0}</td>|;
1671 $column_data{income_accno_1} =
1672 qq|<td align=right>$ref->{income_accno_1}</td>|;
1673 $column_data{expense_accno_1} = qq|<td align=right>$ref->{expense_accno_1}</td>|;
1674 $column_data{income_accno_2} =
1675 qq|<td align=right>$ref->{income_accno_2}</td>|;
1676 $column_data{expense_accno_2} = qq|<td align=right>$ref->{expense_accno_2}</td>|;
1677 $column_data{income_accno_3} =
1678 qq|<td align=right>$ref->{income_accno_3}</td>|;
1679 $column_data{expense_accno_3} = qq|<td align=right>$ref->{expense_accno_3}</td>|;
1681 map { print "$column_data{$_}\n" } @column_index;
1695 <td><hr size=3 noshade></td>
1700 <form method=post action=$form->{script}>
1702 <input name=callback type=hidden value="$form->{callback}">
1704 <input type=hidden name=type value=buchungsgruppe>
1706 <input type=hidden name=path value=$form->{path}>
1707 <input type=hidden name=login value=$form->{login}>
1708 <input type=hidden name=password value=$form->{password}>
1710 <input class=submit type=submit name=action value="|
1711 . $locale->text('Add') . qq|">
1719 $lxdebug->leave_sub();
1722 sub buchungsgruppe_header {
1723 $lxdebug->enter_sub();
1725 $form->{title} = $locale->text("$form->{title} Buchungsgruppe");
1727 # $locale->text('Buchungsgruppe hinzufügen')
1728 # $locale->text('Buchungsgruppe bearbeiten')
1730 my ($acc_inventory, $acc_income, $acc_expense) = ({}, {}, {});
1731 my %acc_type_map = (
1732 "IC" => $acc_inventory,
1733 "IC_income" => $acc_income,
1734 "IC_sale" => $acc_income,
1735 "IC_expense" => $acc_expense,
1736 "IC_cogs" => $acc_expense,
1739 foreach $key (keys(%acc_type_map)) {
1740 foreach $ref (@{ $form->{IC_links}{$key} }) {
1741 $acc_type_map{$key}->{$ref->{"id"}} = $ref;
1745 foreach my $type (qw(IC IC_income IC_expense)) {
1746 $form->{"select$type"} =
1748 map({ "<option value=$_->{id} $_->{selected}>" .
1749 "$_->{accno}--" . H($_->{description}) . "</option>" }
1750 sort({ $a->{"accno"} cmp $b->{"accno"} }
1751 values(%{$acc_type_map{$type}}))));
1755 $form->{selectIC} =~ s/selected//g;
1756 $form->{selectIC} =~ s/ value=$form->{inventory_accno_id}/ value=$form->{inventory_accno_id} selected/;
1757 $form->{selectIC_income} =~ s/selected//g;
1758 $form->{selectIC_income} =~ s/ value=$form->{income_accno_id_0}/ value=$form->{income_accno_id_0} selected/;
1759 $form->{selectIC_expense} =~ s/selected//g;
1760 $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_0}/ value=$form->{expense_accno_id_0} selected/;
1766 <th align=right>| . $locale->text('Inventory') . qq|</th>
1767 <td><select name=inventory_accno_id>$form->{selectIC}</select></td>
1768 <input name=selectIC type=hidden value="$form->{selectIC}">
1772 <input type=hidden name=inventory_accno_id value=$form->{inventory_accno_id}>|;
1776 $linkaccounts .= qq|
1778 <th align=right>| . $locale->text('Erlöse Inland') . qq|</th>
1779 <td><select name=income_accno_id_0>$form->{selectIC_income}</select></td>
1782 <th align=right>| . $locale->text('Aufwand Inland') . qq|</th>
1783 <td><select name=expense_accno_id_0>$form->{selectIC_expense}</select></td>
1786 $form->{selectIC_income} =~ s/selected//g;
1787 $form->{selectIC_income} =~ s/ value=$form->{income_accno_id_1}/ value=$form->{income_accno_id_1} selected/;
1788 $form->{selectIC_expense} =~ s/selected//g;
1789 $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_1}/ value=$form->{expense_accno_id_1} selected/;
1791 $linkaccounts .= qq| <tr>
1792 <th align=right>| . $locale->text('Erlöse EU m. UStId') . qq|</th>
1793 <td><select name=income_accno_id_1>$form->{selectIC_income}</select></td>
1796 <th align=right>| . $locale->text('Aufwand EU m UStId') . qq|</th>
1797 <td><select name=expense_accno_id_1>$form->{selectIC_expense}</select></td>
1801 $form->{selectIC_income} =~ s/selected//g;
1802 $form->{selectIC_income} =~ s/ value=$form->{income_accno_id_2}/ value=$form->{income_accno_id_2} selected/;
1803 $form->{selectIC_expense} =~ s/selected//g;
1804 $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_2}/ value=$form->{expense_accno_id_2} selected/;
1807 $linkaccounts .= qq| <tr>
1808 <th align=right>| . $locale->text('Erlöse EU o. UStId') . qq|</th>
1809 <td><select name=income_accno_id_2>$form->{selectIC_income}</select></td>
1812 <th align=right>| . $locale->text('Aufwand EU o. UStId') . qq|</th>
1813 <td><select name=expense_accno_id_2>$form->{selectIC_expense}</select></td>
1817 $form->{selectIC_income} =~ s/selected//g;
1818 $form->{selectIC_income} =~ s/ value=$form->{income_accno_id_3}/ value=$form->{income_accno_id_3} selected/;
1819 $form->{selectIC_expense} =~ s/selected//g;
1820 $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_3}/ value=$form->{expense_accno_id_3} selected/;
1823 $linkaccounts .= qq| <tr>
1824 <th align=right>| . $locale->text('Erlöse Ausland') . qq|</th>
1825 <td><select name=income_accno_id_3>$form->{selectIC_income}</select></td>
1828 <th align=right>| . $locale->text('Aufwand Ausland') . qq|</th>
1829 <td><select name=expense_accno_id_3>$form->{selectIC_expense}</select></td>
1839 <form method=post action=$form->{script}>
1841 <input type=hidden name=id value=$form->{id}>
1842 <input type=hidden name=type value=buchungsgruppe>
1846 <th class=listtop colspan=2>$form->{title}</th>
1848 <tr height="5"></tr>
1850 <th align=right>| . $locale->text('Buchungsgruppe') . qq|</th>
1851 <td><input name=description size=30 value="| . $form->quote($form->{description}) . qq|"></td>
1854 <td colspan=2><hr size=3 noshade></td>
1859 $lxdebug->leave_sub();
1862 sub save_buchungsgruppe {
1863 $lxdebug->enter_sub();
1865 $form->isblank("description", $locale->text('Description missing!'));
1867 AM->save_buchungsgruppe(\%myconfig, \%$form);
1868 $form->redirect($locale->text('Buchungsgruppe gespeichert!'));
1870 $lxdebug->leave_sub();
1873 sub delete_buchungsgruppe {
1874 $lxdebug->enter_sub();
1876 AM->delete_buchungsgruppe(\%myconfig, \%$form);
1877 $form->redirect($locale->text('Buchungsgruppe gelöscht!'));
1879 $lxdebug->leave_sub();
1882 sub swap_buchungsgruppen {
1883 $lxdebug->enter_sub();
1885 AM->swap_sortkeys(\%myconfig, $form, "buchungsgruppen");
1886 list_buchungsgruppe();
1888 $lxdebug->leave_sub();
1893 $lxdebug->enter_sub();
1895 $form->{title} = "Add";
1898 "$form->{script}?action=add_printer&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1899 unless $form->{callback};
1904 $lxdebug->leave_sub();
1908 $lxdebug->enter_sub();
1910 $form->{title} = "Edit";
1912 AM->get_printer(\%myconfig, \%$form);
1916 $form->{orphaned} = 1;
1919 $lxdebug->leave_sub();
1923 $lxdebug->enter_sub();
1925 AM->printer(\%myconfig, \%$form);
1928 "$form->{script}?action=list_printer&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1930 $callback = $form->escape($form->{callback});
1932 $form->{title} = $locale->text('Printer');
1934 @column_index = qw(printer_description printer_command template_code);
1936 $column_header{printer_description} =
1937 qq|<th class=listheading width=60%>|
1938 . $locale->text('Printer Description')
1940 $column_header{printer_command} =
1941 qq|<th class=listheading width=10%>|
1942 . $locale->text('Printer Command')
1944 $column_header{template_code} =
1945 qq|<th class=listheading>|
1946 . $locale->text('Template Code')
1956 <th class=listtop>$form->{title}</th>
1958 <tr height="5"></tr>
1962 <tr class=listheading>
1965 map { print "$column_header{$_}\n" } @column_index;
1971 foreach $ref (@{ $form->{ALL} }) {
1977 <tr valign=top class=listrow$i>
1981 $column_data{printer_description} =
1982 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>|;
1983 $column_data{printer_command} = qq|<td align=right>$ref->{printer_command}</td>|;
1984 $column_data{template_code} =
1985 qq|<td align=right>$ref->{template_code}</td>|;
1987 map { print "$column_data{$_}\n" } @column_index;
1999 <td><hr size=3 noshade></td>
2004 <form method=post action=$form->{script}>
2006 <input name=callback type=hidden value="$form->{callback}">
2008 <input type=hidden name=type value=printer>
2010 <input type=hidden name=path value=$form->{path}>
2011 <input type=hidden name=login value=$form->{login}>
2012 <input type=hidden name=password value=$form->{password}>
2014 <input class=submit type=submit name=action value="|
2015 . $locale->text('Add') . qq|">
2023 $lxdebug->leave_sub();
2026 sub printer_header {
2027 $lxdebug->enter_sub();
2029 $form->{title} = $locale->text("$form->{title} Printer");
2031 # $locale->text('Add Printer')
2032 # $locale->text('Edit Printer')
2034 $form->{printer_description} =~ s/\"/"/g;
2035 $form->{template_code} =~ s/\"/"/g;
2036 $form->{printer_command} =~ s/\"/"/g;
2044 <form method=post action=$form->{script}>
2046 <input type=hidden name=id value=$form->{id}>
2047 <input type=hidden name=type value=printer>
2051 <th class=listtop colspan=2>$form->{title}</th>
2053 <tr height="5"></tr>
2055 <th align=right>| . $locale->text('Printer') . qq|</th>
2056 <td><input name=printer_description size=30 value="$form->{printer_description}"></td>
2059 <th align=right>| . $locale->text('Printer Command') . qq|</th>
2060 <td><input name=printer_command size=30 value="$form->{printer_command}"></td>
2063 <th align=right>| . $locale->text('Template Code') . qq|</th>
2064 <td><input name=template_code size=5 value="$form->{template_code}"></td>
2066 <td colspan=2><hr size=3 noshade></td>
2071 $lxdebug->leave_sub();
2075 $lxdebug->enter_sub();
2077 $form->isblank("printer_description", $locale->text('Description missing!'));
2078 $form->isblank("printer_command", $locale->text('Printer Command missing!'));
2079 AM->save_printer(\%myconfig, \%$form);
2080 $form->redirect($locale->text('Printer saved!'));
2082 $lxdebug->leave_sub();
2085 sub delete_printer {
2086 $lxdebug->enter_sub();
2088 AM->delete_printer(\%myconfig, \%$form);
2089 $form->redirect($locale->text('Printer deleted!'));
2091 $lxdebug->leave_sub();
2096 $lxdebug->enter_sub();
2098 $form->{title} = "Add";
2101 "$form->{script}?action=add_payment&path=$form->{path}&login=$form->{login}&password=$form->{password}"
2102 unless $form->{callback};
2104 $form->{terms_netto} = 0;
2105 $form->{terms_skonto} = 0;
2106 $form->{percent_skonto} = 0;
2107 my @languages = AM->language(\%myconfig, $form, 1);
2108 map({ $_->{"language"} = $_->{"description"};
2109 $_->{"language_id"} = $_->{"id"}; } @languages);
2110 $form->{"TRANSLATION"} = \@languages;
2114 $lxdebug->leave_sub();
2118 $lxdebug->enter_sub();
2120 $form->{title} = "Edit";
2122 AM->get_payment(\%myconfig, $form);
2123 $form->{percent_skonto} =
2124 $form->format_amount(\%myconfig, $form->{percent_skonto} * 100);
2128 $form->{orphaned} = 1;
2131 $lxdebug->leave_sub();
2135 $lxdebug->enter_sub();
2137 AM->payment(\%myconfig, \%$form);
2139 $form->{callback} = build_std_url("action=list_payment");
2141 $callback = $form->escape($form->{callback});
2143 $form->{title} = $locale->text('Payment Terms');
2145 @column_index = qw(up down description description_long terms_netto
2146 terms_skonto percent_skonto);
2148 $column_header{up} =
2149 qq|<th class="listheading" align="center" valign="center" width="16">|
2150 . qq|<img src="image/up.png" alt="| . $locale->text("up") . qq|">|
2152 $column_header{down} =
2153 qq|<th class="listheading" align="center" valign="center" width="16">|
2154 . qq|<img src="image/down.png" alt="| . $locale->text("down") . qq|">|
2156 $column_header{description} =
2157 qq|<th class=listheading>|
2158 . $locale->text('Description')
2160 $column_header{description_long} =
2161 qq|<th class=listheading>|
2162 . $locale->text('Long Description')
2164 $column_header{terms_netto} =
2165 qq|<th class=listheading>|
2166 . $locale->text('Netto Terms')
2168 $column_header{terms_skonto} =
2169 qq|<th class=listheading>|
2170 . $locale->text('Skonto Terms')
2172 $column_header{percent_skonto} =
2173 qq|<th class=listheading>|
2174 . $locale->text('Skonto')
2184 <th class=listtop>$form->{title}</th>
2186 <tr height="5"></tr>
2190 <tr class=listheading>
2193 map { print "$column_header{$_}\n" } @column_index;
2199 my $swap_link = build_std_url("action=swap_payment_terms");
2202 foreach $ref (@{ $form->{ALL} }) {
2208 <tr valign=top class=listrow$i>
2212 my $pref = $form->{ALL}->[$row - 1];
2214 qq|<td align="center" valign="center" width="16">| .
2215 qq|<a href="${swap_link}&id1=$ref->{id}&id2=$pref->{id}">| .
2216 qq|<img src="image/up.png" alt="| . $locale->text("up") . qq|">| .
2219 $column_data{up} = qq|<td width="16"> </td>|;
2222 if ($row == (scalar(@{ $form->{ALL} }) - 1)) {
2223 $column_data{down} = qq|<td width="16"> </td>|;
2225 my $nref = $form->{ALL}->[$row + 1];
2226 $column_data{down} =
2227 qq|<td align="center" valign="center" width="16">| .
2228 qq|<a href="${swap_link}&id1=$ref->{id}&id2=$nref->{id}">| .
2229 qq|<img src="image/down.png" alt="| . $locale->text("down") . qq|">| .
2233 $column_data{description} =
2235 build_std_url("action=edit_payment", "id=$ref->{id}", "callback=$callback") .
2236 qq|">| . H($ref->{description}) . qq|</a></td>|;
2237 $column_data{description_long} =
2238 qq|<td>| . H($ref->{description_long}) . qq|</td>|;
2239 $column_data{terms_netto} =
2240 qq|<td align=right>$ref->{terms_netto}</td>|;
2241 $column_data{terms_skonto} =
2242 qq|<td align=right>$ref->{terms_skonto}</td>|;
2243 $column_data{percent_skonto} =
2244 qq|<td align=right>| .
2245 $form->format_amount(\%myconfig, $ref->{percent_skonto} * 100) .
2247 map { print "$column_data{$_}\n" } @column_index;
2260 <td><hr size=3 noshade></td>
2265 <form method=post action=$form->{script}>
2267 <input name=callback type=hidden value="$form->{callback}">
2269 <input type=hidden name=type value=payment>
2271 <input type=hidden name=path value=$form->{path}>
2272 <input type=hidden name=login value=$form->{login}>
2273 <input type=hidden name=password value=$form->{password}>
2275 <input class=submit type=submit name=action value="|
2276 . $locale->text('Add') . qq|">
2284 $lxdebug->leave_sub();
2287 sub payment_header {
2288 $lxdebug->enter_sub();
2290 $form->{title} = $locale->text("$form->{title} Payment Terms");
2292 # $locale->text('Add Payment Terms')
2293 # $locale->text('Edit Payment Terms')
2295 $form->{description} =~ s/\"/"/g;
2304 <form method=post action=$form->{script}>
2306 <input type=hidden name=id value=$form->{id}>
2307 <input type=hidden name=type value=payment>
2311 <th class=listtop colspan=2>$form->{title}</th>
2313 <tr height="5"></tr>
2315 <th align=right>| . $locale->text('Description') . qq|</th>
2316 <td><input name=description size=30 value="$form->{description}"></td>
2319 <th align=right>| . $locale->text('Long Description') . qq|</th>
2320 <td><input name=description_long size=50 value="$form->{description_long}"></td>
2324 foreach my $language (@{ $form->{"TRANSLATION"} }) {
2327 <th align="right">| .
2328 sprintf($locale->text('Translation (%s)'),
2329 $language->{"language"})
2331 <td><input name="description_long_$language->{language_id}" size="50"
2332 value="| . Q($language->{"description_long"}) . qq|"></td>
2339 <th align=right>| . $locale->text('Netto Terms') . qq|</th>
2340 <td><input name=terms_netto size=10 value="$form->{terms_netto}"></td>
2343 <th align=right>| . $locale->text('Skonto Terms') . qq|</th>
2344 <td><input name=terms_skonto size=10 value="$form->{terms_skonto}"></td>
2347 <th align=right>| . $locale->text('Skonto') . qq| %</th>
2348 <td><input name=percent_skonto size=10 value="$form->{percent_skonto}"></td>
2350 <td colspan=2><hr size=3 noshade></td>
2354 <p>| . $locale->text("You can use the following strings in the long " .
2355 "description and all translations. They will be " .
2356 "replaced by their actual values by Lx-Office " .
2357 "before they're output.")
2361 <li>| . $locale->text("<%netto_date%> -- Date the payment is due in " .
2364 <li>| . $locale->text("<%skonto_date%> -- Date the payment is due " .
2367 <li>| . $locale->text("<%skonto_amount%> -- The deductible amount")
2369 <li>| . $locale->text("<%total%> -- Amount payable")
2371 <li>| . $locale->text("<%invtotal%> -- Invoice total")
2373 <li>| . $locale->text("<%currency%> -- The selected currency")
2375 <li>| . $locale->text("<%terms_netto%> -- The number of days for " .
2378 <li>| . $locale->text("<%account_number%> -- Your account number")
2380 <li>| . $locale->text("<%bank%> -- Your bank")
2382 <li>| . $locale->text("<%bank_code%> -- Your bank code")
2386 $lxdebug->leave_sub();
2390 $lxdebug->enter_sub();
2392 $form->isblank("description", $locale->text('Description missing!'));
2393 $form->{"percent_skonto"} =
2394 $form->parse_amount(\%myconfig, $form->{percent_skonto}) / 100;
2395 AM->save_payment(\%myconfig, \%$form);
2396 $form->redirect($locale->text('Payment Terms saved!'));
2398 $lxdebug->leave_sub();
2401 sub delete_payment {
2402 $lxdebug->enter_sub();
2404 AM->delete_payment(\%myconfig, \%$form);
2405 $form->redirect($locale->text('Payment terms deleted!'));
2407 $lxdebug->leave_sub();
2410 sub swap_payment_terms {
2411 $lxdebug->enter_sub();
2413 AM->swap_sortkeys(\%myconfig, $form, "payment_terms");
2416 $lxdebug->leave_sub();
2420 $lxdebug->enter_sub();
2422 $form->{title} = "Add";
2425 "$form->{script}?action=add_sic&path=$form->{path}&login=$form->{login}&password=$form->{password}"
2426 unless $form->{callback};
2431 $lxdebug->leave_sub();
2435 $lxdebug->enter_sub();
2437 $form->{title} = "Edit";
2439 AM->get_sic(\%myconfig, \%$form);
2443 $form->{orphaned} = 1;
2446 $lxdebug->leave_sub();
2450 $lxdebug->enter_sub();
2452 AM->sic(\%myconfig, \%$form);
2455 "$form->{script}?action=list_sic&path=$form->{path}&login=$form->{login}&password=$form->{password}";
2457 $callback = $form->escape($form->{callback});
2459 $form->{title} = $locale->text('Standard Industrial Codes');
2461 @column_index = qw(code description);
2463 $column_header{code} =
2464 qq|<th class=listheading>| . $locale->text('Code') . qq|</th>|;
2465 $column_header{description} =
2466 qq|<th class=listheading>| . $locale->text('Description') . qq|</th>|;
2475 <th class=listtop>$form->{title}</th>
2477 <tr height="5"></tr>
2481 <tr class=listheading>
2484 map { print "$column_header{$_}\n" } @column_index;
2490 foreach $ref (@{ $form->{ALL} }) {
2495 if ($ref->{sictype} eq 'H') {
2497 <tr valign=top class=listheading>
2499 $column_data{code} =
2500 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>|;
2501 $column_data{description} = qq|<th>$ref->{description}</th>|;
2505 <tr valign=top class=listrow$i>
2508 $column_data{code} =
2509 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>|;
2510 $column_data{description} = qq|<td>$ref->{description}</td>|;
2514 map { print "$column_data{$_}\n" } @column_index;
2526 <td><hr size=3 noshade></td>
2531 <form method=post action=$form->{script}>
2533 <input name=callback type=hidden value="$form->{callback}">
2535 <input type=hidden name=type value=sic>
2537 <input type=hidden name=path value=$form->{path}>
2538 <input type=hidden name=login value=$form->{login}>
2539 <input type=hidden name=password value=$form->{password}>
2541 <input class=submit type=submit name=action value="|
2542 . $locale->text('Add') . qq|">
2550 $lxdebug->leave_sub();
2554 $lxdebug->enter_sub();
2556 $form->{title} = $locale->text("$form->{title} SIC");
2558 # $locale->text('Add SIC')
2559 # $locale->text('Edit SIC')
2561 $form->{code} =~ s/\"/"/g;
2562 $form->{description} =~ s/\"/"/g;
2564 $checked = ($form->{sictype} eq 'H') ? "checked" : "";
2571 <form method=post action=$form->{script}>
2573 <input type=hidden name=type value=sic>
2574 <input type=hidden name=id value=$form->{code}>
2578 <th class=listtop colspan=2>$form->{title}</th>
2580 <tr height="5"></tr>
2582 <th align=right>| . $locale->text('Code') . qq|</th>
2583 <td><input name=code size=10 value=$form->{code}></td>
2587 <th align=left><input name=sictype type=checkbox style=checkbox value="H" $checked> |
2588 . $locale->text('Heading') . qq|</th>
2591 <th align=right>| . $locale->text('Description') . qq|</th>
2592 <td><input name=description size=60 value="$form->{description}"></td>
2594 <td colspan=2><hr size=3 noshade></td>
2599 $lxdebug->leave_sub();
2603 $lxdebug->enter_sub();
2605 $form->isblank("code", $locale->text('Code missing!'));
2606 $form->isblank("description", $locale->text('Description missing!'));
2607 AM->save_sic(\%myconfig, \%$form);
2608 $form->redirect($locale->text('SIC saved!'));
2610 $lxdebug->leave_sub();
2614 $lxdebug->enter_sub();
2616 AM->delete_sic(\%myconfig, \%$form);
2617 $form->redirect($locale->text('SIC deleted!'));
2619 $lxdebug->leave_sub();
2622 sub display_stylesheet {
2623 $lxdebug->enter_sub();
2625 $form->{file} = "css/$myconfig{stylesheet}";
2628 $lxdebug->leave_sub();
2632 $lxdebug->enter_sub();
2634 $form->{file} =~ s/^(.:)*?\/|\.\.\///g;
2635 $form->{file} =~ s/^\/*//g;
2636 $form->{file} =~ s/$userspath//;
2638 $form->error("$!: $form->{file}") unless -f $form->{file};
2640 AM->load_template(\%$form);
2642 $form->{title} = $form->{file};
2644 # if it is anything but html
2645 if ($form->{file} !~ /\.html$/) {
2646 $form->{body} = "<pre>\n$form->{body}\n</pre>";
2656 <form method=post action=$form->{script}>
2658 <input name=file type=hidden value=$form->{file}>
2659 <input name=type type=hidden value=template>
2661 <input type=hidden name=path value=$form->{path}>
2662 <input type=hidden name=login value=$form->{login}>
2663 <input type=hidden name=password value=$form->{password}>
2665 <input name=action type=submit class=submit value="|
2666 . $locale->text('Edit') . qq|">
2674 $lxdebug->leave_sub();
2678 $lxdebug->enter_sub();
2680 AM->load_template(\%$form);
2682 $form->{title} = $locale->text('Edit Template');
2684 # convert   to &nbsp;
2685 $form->{body} =~ s/ /&nbsp;/gi;
2692 <form method=post action=$form->{script}>
2694 <input name=file type=hidden value=$form->{file}>
2695 <input name=type type=hidden value=template>
2697 <input type=hidden name=path value=$form->{path}>
2698 <input type=hidden name=login value=$form->{login}>
2699 <input type=hidden name=password value=$form->{password}>
2701 <input name=callback type=hidden value="$form->{script}?action=display_form&file=$form->{file}&path=$form->{path}&login=$form->{login}&password=$form->{password}">
2703 <textarea name=body rows=25 cols=70>
2708 <input type=submit class=submit name=action value="|
2709 . $locale->text('Save') . qq|">
2718 $lxdebug->leave_sub();
2722 $lxdebug->enter_sub();
2724 AM->save_template(\%$form);
2725 $form->redirect($locale->text('Template saved!'));
2727 $lxdebug->leave_sub();
2731 $lxdebug->enter_sub();
2733 # get defaults for account numbers and last numbers
2734 AM->defaultaccounts(\%myconfig, \%$form);
2736 foreach $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
2738 ($item eq $myconfig{dateformat})
2739 ? "<option selected>$item\n"
2740 : "<option>$item\n";
2743 foreach $item (qw(1,000.00 1000.00 1.000,00 1000,00)) {
2745 ($item eq $myconfig{numberformat})
2746 ? "<option selected>$item\n"
2747 : "<option>$item\n";
2750 foreach $item (qw(name company address signature)) {
2751 $myconfig{$item} =~ s/\"/"/g;
2754 foreach $item (qw(address signature)) {
2755 $myconfig{$item} =~ s/\\n/\r\n/g;
2759 if ($opendocument_templates && $openofficeorg_writer_bin &&
2760 $xvfb_bin && (-x $openofficeorg_writer_bin) && (-x $xvfb_bin)) {
2761 push(@formats, { "name" => $locale->text("PDF (OpenDocument/OASIS)"),
2762 "value" => "opendocument_pdf" });
2764 if ($latex_templates) {
2765 push(@formats, { "name" => $locale->text("PDF"), "value" => "pdf" });
2767 push(@formats, { "name" => "HTML", "value" => "html" });
2768 if ($latex_templates) {
2769 push(@formats, { "name" => $locale->text("Postscript"),
2770 "value" => "postscript" });
2772 if ($opendocument_templates) {
2773 push(@formats, { "name" => $locale->text("OpenDocument/OASIS"),
2774 "value" => "opendocument" });
2777 if (!$myconfig{"template_format"}) {
2778 $myconfig{"template_format"} = "pdf";
2780 my $template_format = "";
2781 foreach $item (@formats) {
2783 "<option value=\"$item->{value}\"" .
2784 ($item->{"value"} eq $myconfig{"template_format"} ?
2786 ">" . H($item->{"name"}) . "</option>";
2789 if (!$myconfig{"default_media"}) {
2790 $myconfig{"default_media"} = "screen";
2792 my %selected = ($myconfig{"default_media"} => "selected");
2793 my $default_media = qq|
2794 <option value="screen" $selected{'screen'}>| . $locale->text("Screen") . qq|</option>
2795 <option value="printer" $selected{'printer'}>| . $locale->text("Printer") . qq|</option>
2796 <option value="queue" $selected{'queue'}>| . $locale->text("Queue") . qq|</option>
2800 $selected{$myconfig{"default_printer_id"}} = "selected"
2801 if ($myconfig{"default_printer_id"});
2802 my $default_printer = qq|<option></option>|;
2803 AM->printer(\%myconfig, $form);
2804 foreach my $printer (@{$form->{"ALL"}}) {
2805 $default_printer .= qq|<option value="| . Q($printer->{"id"}) .
2806 qq|" $selected{$printer->{'id'}}>| .
2807 H($printer->{"printer_description"}) . qq|</option>|;
2810 %countrycodes = User->country_codes;
2812 foreach $key (sort { $countrycodes{$a} cmp $countrycodes{$b} }
2816 ($myconfig{countrycode} eq $key)
2817 ? "<option selected value=$key>$countrycodes{$key}\n"
2818 : "<option value=$key>$countrycodes{$key}\n";
2820 $countrycodes = "<option>American English\n$countrycodes";
2822 foreach $key (keys %{ $form->{IC} }) {
2823 foreach $accno (sort keys %{ $form->{IC}{$key} }) {
2825 ($form->{IC}{$key}{$accno}{id} == $form->{defaults}{$key})
2826 ? "<option selected>$accno--$form->{IC}{$key}{$accno}{description}\n"
2827 : "<option>$accno--$form->{IC}{$key}{$accno}{description}\n";
2831 opendir CSS, "css/.";
2832 @all = grep /.*\.css$/, readdir CSS;
2835 foreach $item (@all) {
2836 if ($item eq $myconfig{stylesheet}) {
2837 $selectstylesheet .= qq|<option selected>$item\n|;
2839 $selectstylesheet .= qq|<option>$item\n|;
2842 $selectstylesheet .= "<option>\n";
2844 $form->{title} = $locale->text('Edit Preferences for') . qq| $form->{login}|;
2848 if ($myconfig{menustyle} eq "old") {
2849 $menustyle_old = "checked";
2850 } elsif ($myconfig{menustyle} eq "neu") {
2851 $menustyle_neu = "checked";
2852 } elsif ($myconfig{menustyle} eq "v3") {
2853 $menustyle_v3 = "checked";
2856 my ($show_form_details, $hide_form_details);
2857 $myconfig{"show_form_details"} = 1
2858 unless (defined($myconfig{"show_form_details"}));
2859 $show_form_details = "checked" if ($myconfig{"show_form_details"});
2860 $hide_form_details = "checked" unless ($myconfig{"show_form_details"});
2865 <form method=post action=$form->{script}>
2867 <input type=hidden name=old_password value=$myconfig{password}>
2868 <input type=hidden name=type value=preferences>
2869 <input type=hidden name=role value=$myconfig{role}>
2872 <tr><th class=listtop>$form->{title}</th></tr>
2877 <th align=right>| . $locale->text('Name') . qq|</th>
2878 <td><input name=name size=15 value="$myconfig{name}"></td>
2881 <th align=right>| . $locale->text('Password') . qq|</th>
2882 <td><input type=password name=new_password size=10 value=$myconfig{password}></td>
2885 <th align=right>| . $locale->text('E-mail') . qq|</th>
2886 <td><input name=email size=30 value="$myconfig{email}"></td>
2889 <th align=right>| . $locale->text('Signature') . qq|</th>
2890 <td><textarea name=signature rows=3 cols=50>$myconfig{signature}</textarea></td>
2893 <th align=right>| . $locale->text('Phone') . qq|</th>
2894 <td><input name=tel size=14 value="$myconfig{tel}"></td>
2897 <th align=right>| . $locale->text('Fax') . qq|</th>
2898 <td><input name=fax size=14 value="$myconfig{fax}"></td>
2901 <th align=right>| . $locale->text('Company') . qq|</th>
2902 <td><input name=company size=30 value="$myconfig{company}"></td>
2905 <th align=right>| . $locale->text('Address') . qq|</th>
2906 <td><textarea name=address rows=4 cols=50>$myconfig{address}</textarea></td>
2909 <th align=right>| . $locale->text('Date Format') . qq|</th>
2910 <td><select name=dateformat>$dateformat</select></td>
2913 <th align=right>| . $locale->text('Output Number Format') . qq|</th>
2914 <td><select name=numberformat>$numberformat</select></td>
2918 <th align=right>| . $locale->text('Dropdown Limit') . qq|</th>
2919 <td><input name=vclimit size=10 value="$myconfig{vclimit}"></td>
2922 <th align=right>| . $locale->text('Language') . qq|</th>
2923 <td><select name=countrycode>$countrycodes</select></td>
2926 <th align=right>| . $locale->text('Stylesheet') . qq|</th>
2927 <td><select name=usestylesheet>$selectstylesheet</select></td>
2930 <th align=right>| . $locale->text('Setup Menu') . qq|</th>
2931 <td><input name=menustyle type=radio class=radio value=v3 $menustyle_v3> | .
2932 $locale->text("Top (CSS)") . qq|
2933 <input name=menustyle type=radio class=radio value=neu $menustyle_neu> | .
2934 $locale->text("Top (Javascript)") . qq|
2935 <input name=menustyle type=radio class=radio value=old $menustyle_old> | .
2936 $locale->text("Old (on the side)") . qq|</td>
2939 <th align=right>| . $locale->text('Form details (second row)') . qq|</th>
2940 <td><input type="radio" id="rad_show_form_details" name="show_form_details" value="1" $show_form_details>
2941 <label for="rad_show_form_details">| . $locale->text('Show by default') . qq|</label>
2942 <input type="radio" id="rad_hide_form_details" name="show_form_details" value="0" $hide_form_details>
2943 <label for="rad_hide_form_details">| . $locale->text('Hide by default') . qq|</label></td>
2945 <input name=printer type=hidden value="$myconfig{printer}">
2946 <tr class=listheading>
2947 <th colspan=2>| . $locale->text("Print options") . qq|</th>
2950 <th align=right>| . $locale->text('Default template format') . qq|</th>
2951 <td><select name="template_format">$template_format</select></td>
2954 <th align=right>| . $locale->text('Default output medium') . qq|</th>
2955 <td><select name="default_media">$default_media</select></td>
2958 <th align=right>| . $locale->text('Default printer') . qq|</th>
2959 <td><select name="default_printer_id">$default_printer</select></td>
2962 <th align=right>| . $locale->text('Number of copies') . qq|</th>
2963 <td><input name="copies" size="10" value="| .
2964 $form->quote($myconfig{"copies"}) . qq|"></td>
2968 <tr class=listheading>
2969 <th colspan=2> </th>
2972 <th align=right>| . $locale->text('Business Number') . qq|</th>
2973 <td><input name=businessnumber size=25 value="$myconfig{businessnumber}"></td>
2976 <th align=right>| . $locale->text('Year End') . qq| (mm/dd)</th>
2977 <td><input name=yearend size=5 value=$form->{defaults}{yearend}></td>
2979 <tr class=listheading>
2981 . $locale->text('Last Numbers & Default Accounts') . qq|</th>
2987 <th align=right nowrap>| . $locale->text('Inventory Account') . qq|</th>
2988 <td><select name=inventory_accno>$myconfig{IC}</select></td>
2991 <th align=right nowrap>| . $locale->text('Revenue Account') . qq|</th>
2992 <td><select name=income_accno>$myconfig{IC_income}</select></td>
2995 <th align=right nowrap>| . $locale->text('Expense Account') . qq|</th>
2996 <td><select name=expense_accno>$myconfig{IC_expense}</select></td>
2999 <th align=right nowrap>| . $locale->text('Foreign Exchange Gain') . qq|</th>
3000 <td><select name=fxgain_accno>$myconfig{FX_gain}</select></td>
3003 <th align=right nowrap>| . $locale->text('Foreign Exchange Loss') . qq|</th>
3004 <td><select name=fxloss_accno>$myconfig{FX_loss}</select></td>
3009 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies'
3011 . qq|<br><input name=curr size=40 value="$form->{defaults}{curr}"></td>
3020 <th align=right nowrap>| . $locale->text('Last Invoice Number') . qq|</th>
3021 <td><input name=invnumber size=10 value=$form->{defaults}{invnumber}></td>
3022 <th align=right nowrap>|
3023 . $locale->text('Last Customer Number') . qq|</th>
3024 <td><input name=customernumber size=10 value=$form->{defaults}{customernumber}></td>
3027 <th align=right nowrap>|
3028 . $locale->text('Last Credit Note Number') . qq|</th>
3029 <td><input name=cnnumber size=10 value=$form->{defaults}{cnnumber}></td>
3030 <th align=right nowrap>|
3031 . $locale->text('Last Vendor Number') . qq|</th>
3032 <td><input name=vendornumber size=10 value=$form->{defaults}{vendornumber}></td>
3035 <th align=right nowrap>|
3036 . $locale->text('Last Sales Order Number') . qq|</th>
3037 <td><input name=sonumber size=10 value=$form->{defaults}{sonumber}></td>
3040 <th align=right nowrap>|
3041 . $locale->text('Last Purchase Order Number') . qq|</th>
3042 <td><input name=ponumber size=10 value=$form->{defaults}{ponumber}></td>
3043 <th align=right nowrap>|
3044 . $locale->text('Last Article Number') . qq|</th>
3045 <td><input name=articlenumber size=10 value=$form->{defaults}{articlenumber}></td>
3048 <th align=right nowrap>|
3049 . $locale->text('Last Sales Quotation Number') . qq|</th>
3050 <td><input name=sqnumber size=10 value=$form->{defaults}{sqnumber}></td>
3051 <th align=right nowrap>|
3052 . $locale->text('Last Service Number') . qq|</th>
3053 <td><input name=servicenumber size=10 value=$form->{defaults}{servicenumber}></td>
3056 <th align=right nowrap>| . $locale->text('Last RFQ Number') . qq|</th>
3057 <td><input name=rfqnumber size=10 value=$form->{defaults}{rfqnumber}></td>
3058 <th align=right nowrap></th>
3064 # <tr class=listheading>
3065 # <th colspan=2>| . $locale->text('Tax Accounts') . qq|</th>
3072 # <th>| . $locale->text('Rate') . qq| (%)</th>
3073 # <th>| . $locale->text('Number') . qq|</th>
3077 # foreach $accno (sort keys %{ $form->{taxrates} }) {
3080 # <th align=right>$form->{taxrates}{$accno}{description}</th>
3081 # <td><input name=$form->{taxrates}{$accno}{id} size=6 value=$form->{taxrates}{$accno}{rate}></td>
3082 # <td><input name="taxnumber_$form->{taxrates}{$accno}{id}" value="$form->{taxrates}{$accno}{taxnumber}"></td>
3085 # $form->{taxaccounts} .= "$form->{taxrates}{$accno}{id} ";
3088 # chop $form->{taxaccounts};
3091 # <input name=taxaccounts type=hidden value="$form->{taxaccounts}">
3100 <td><hr size=3 noshade></td>
3104 <input type=hidden name=path value=$form->{path}>
3105 <input type=hidden name=login value=$form->{login}>
3106 <input type=hidden name=password value=$form->{password}>
3109 <input type=submit class=submit name=action value="|
3110 . $locale->text('Save') . qq|">
3118 $lxdebug->leave_sub();
3121 sub save_preferences {
3122 $lxdebug->enter_sub();
3124 $form->{stylesheet} = $form->{usestylesheet};
3126 $form->redirect($locale->text('Preferences saved!'))
3128 AM->save_preferences(\%myconfig, \%$form, $memberfile, $userspath, $webdav
3130 $form->error($locale->text('Cannot save preferences!'));
3132 $lxdebug->leave_sub();
3136 $lxdebug->enter_sub();
3138 if ($form->{media} eq 'email') {
3139 $form->error($locale->text('No email address for') . " $myconfig{name}")
3140 unless ($myconfig{email});
3142 $form->{OUT} = "$sendmail";
3146 AM->backup(\%myconfig, \%$form, $userspath);
3148 if ($form->{media} eq 'email') {
3149 $form->redirect($locale->text('Backup sent to') . qq| $myconfig{email}|);
3152 $lxdebug->leave_sub();
3156 $lxdebug->enter_sub();
3158 $form->{title} = $locale->text('Audit Control');
3160 AM->closedto(\%myconfig, \%$form);
3162 if ($form->{revtrans}) {
3163 $checked{Y} = "checked";
3165 $checked{N} = "checked";
3173 <form method=post action=$form->{script}>
3175 <input type=hidden name=path value=$form->{path}>
3176 <input type=hidden name=login value=$form->{login}>
3177 <input type=hidden name=password value=$form->{password}>
3180 <tr><th class=listtop>$form->{title}</th></tr>
3181 <tr height="5"></tr>
3187 . $locale->text('Enforce transaction reversal for all dates') . qq|</th>
3188 <td><input name=revtrans class=radio type=radio value="1" $checked{Y}> |
3189 . $locale->text('Yes')
3190 . qq| <input name=revtrans class=radio type=radio value="0" $checked{N}> |
3191 . $locale->text('No')
3195 <th>| . $locale->text('Close Books up to') . qq|</th>
3196 <td><input name=closedto size=11 title="$myconfig{dateformat}" value=$form->{closedto}></td>
3206 <input type=hidden name=nextsub value=doclose>
3208 <input type=submit class=submit name=action value="|
3209 . $locale->text('Continue') . qq|">
3217 $lxdebug->leave_sub();
3221 $lxdebug->enter_sub();
3223 AM->closebooks(\%myconfig, \%$form);
3225 if ($form->{revtrans}) {
3227 $locale->text('Transaction reversal enforced for all dates'));
3229 if ($form->{closedto}) {
3231 $locale->text('Transaction reversal enforced up to') . " "
3232 . $locale->date(\%myconfig, $form->{closedto}, 1));
3234 $form->redirect($locale->text('Books are open'));
3238 $lxdebug->leave_sub();
3242 $lxdebug->enter_sub();
3244 $form->{title} = "Add";
3247 "$form->{script}?action=add_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}"
3248 unless $form->{callback};
3253 $lxdebug->leave_sub();
3256 sub edit_warehouse {
3257 $lxdebug->enter_sub();
3259 $form->{title} = "Edit";
3261 AM->get_warehouse(\%myconfig, \%$form);
3266 $lxdebug->leave_sub();
3269 sub list_warehouse {
3270 $lxdebug->enter_sub();
3272 AM->warehouses(\%myconfig, \%$form);
3275 "$form->{script}?action=list_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}";
3277 $callback = $form->escape($form->{callback});
3279 $form->{title} = $locale->text('Warehouses');
3281 @column_index = qw(description);
3283 $column_header{description} =
3284 qq|<th class=listheading width=100%>|
3285 . $locale->text('Description')
3295 <th class=listtop>$form->{title}</th>
3297 <tr height="5"></tr>
3301 <tr class=listheading>
3304 map { print "$column_header{$_}\n" } @column_index;
3310 foreach $ref (@{ $form->{ALL} }) {
3316 <tr valign=top class=listrow$i>
3319 $column_data{description} =
3320 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>|;
3322 map { print "$column_data{$_}\n" } @column_index;
3334 <td><hr size=3 noshade></td>
3339 <form method=post action=$form->{script}>
3341 <input name=callback type=hidden value="$form->{callback}">
3343 <input type=hidden name=type value=warehouse>
3345 <input type=hidden name=path value=$form->{path}>
3346 <input type=hidden name=login value=$form->{login}>
3347 <input type=hidden name=password value=$form->{password}>
3349 <input class=submit type=submit name=action value="|
3350 . $locale->text('Add') . qq|">
3358 $lxdebug->leave_sub();
3361 sub warehouse_header {
3362 $lxdebug->enter_sub();
3364 $form->{title} = $locale->text("$form->{title} Warehouse");
3366 # $locale->text('Add Warehouse')
3367 # $locale->text('Edit Warehouse')
3369 $form->{description} =~ s/\"/"/g;
3371 if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
3373 qq|<textarea name="description" rows=$rows cols=60 wrap=soft>$form->{description}</textarea>|;
3376 qq|<input name=description size=60 value="$form->{description}">|;
3384 <form method=post action=$form->{script}>
3386 <input type=hidden name=id value=$form->{id}>
3387 <input type=hidden name=type value=warehouse>
3391 <th class=listtop colspan=2>$form->{title}</th>
3393 <tr height="5"></tr>
3395 <th align=right>| . $locale->text('Description') . qq|</th>
3396 <td>$description</td>
3399 <td colspan=2><hr size=3 noshade></td>
3404 $lxdebug->leave_sub();
3407 sub save_warehouse {
3408 $lxdebug->enter_sub();
3410 $form->isblank("description", $locale->text('Description missing!'));
3411 AM->save_warehouse(\%myconfig, \%$form);
3412 $form->redirect($locale->text('Warehouse saved!'));
3414 $lxdebug->leave_sub();
3417 sub delete_warehouse {
3418 $lxdebug->enter_sub();
3420 AM->delete_warehouse(\%myconfig, \%$form);
3421 $form->redirect($locale->text('Warehouse deleted!'));
3423 $lxdebug->leave_sub();
3427 $lxdebug->enter_sub();
3429 &{ $form->{nextsub} };
3431 $lxdebug->leave_sub();
3435 $lxdebug->enter_sub();
3437 $units = AM->retrieve_units(\%myconfig, $form, $form->{"unit_type"}, "resolved_");
3438 AM->units_in_use(\%myconfig, $form, $units);
3439 map({ $units->{$_}->{"BASE_UNIT_DDBOX"} = AM->unit_select_data($units, $units->{$_}->{"base_unit"}, 1); } keys(%{$units}));
3441 @languages = AM->language(\%myconfig, $form, 1);
3443 @unit_list = sort({ $a->{"sortkey"} <=> $b->{"sortkey"} } values(%{$units}));
3446 foreach (@unit_list) {
3447 $_->{"factor"} = $form->format_amount(\%myconfig, $_->{"factor"} * 1) if ($_->{"factor"});
3448 $_->{"UNITLANGUAGES"} = [];
3449 foreach my $lang (@languages) {
3450 push(@{ $_->{"UNITLANGUAGES"} },
3452 "unit" => $_->{"name"},
3453 "language_id" => $lang->{"id"},
3454 "localized" => $_->{"LANGUAGES"}->{$lang->{"template_code"}}->{"localized"},
3455 "localized_plural" => $_->{"LANGUAGES"}->{$lang->{"template_code"}}->{"localized_plural"},
3461 $units = AM->retrieve_units(\%myconfig, $form, $form->{"unit_type"});
3462 $ddbox = AM->unit_select_data($units, undef, 1);
3464 my $updownlink = build_std_url("action=swap_units", "unit_type");
3466 $form->{"title"} = sprintf($locale->text("Add and edit %s"), $form->{"unit_type"} eq "dimension" ? $locale->text("dimension units") : $locale->text("service units"));
3468 print($form->parse_html_template("am/edit_units",
3469 { "UNITS" => \@unit_list,
3470 "NEW_BASE_UNIT_DDBOX" => $ddbox,
3471 "LANGUAGES" => \@languages,
3472 "updownlink" => $updownlink }));
3474 $lxdebug->leave_sub();
3478 $lxdebug->enter_sub();
3480 $form->isblank("new_name", $locale->text("The name is missing."));
3481 $units = AM->retrieve_units(\%myconfig, $form, $form->{"unit_type"});
3482 $all_units = AM->retrieve_units(\%myconfig, $form);
3483 $form->show_generic_error($locale->text("A unit with this name does already exist.")) if ($all_units->{$form->{"new_name"}});
3485 my ($base_unit, $factor);
3486 if ($form->{"new_base_unit"}) {
3487 $form->show_generic_error($locale->text("The base unit does not exist.")) unless (defined($units->{$form->{"new_base_unit"}}));
3489 $form->isblank("new_factor", $locale->text("The factor is missing."));
3490 $factor = $form->parse_amount(\%myconfig, $form->{"new_factor"});
3491 $form->show_generic_error($locale->text("The factor is missing.")) unless ($factor);
3492 $base_unit = $form->{"new_base_unit"};
3496 foreach my $lang (AM->language(\%myconfig, $form, 1)) {
3497 next unless ($form->{"new_localized_$lang->{id}"} || $form->{"new_localized_plural_$lang->{id}"});
3498 push(@languages, { "id" => $lang->{"id"},
3499 "localized" => $form->{"new_localized_$lang->{id}"},
3500 "localized_plural" => $form->{"new_localized_plural_$lang->{id}"},
3504 AM->add_unit(\%myconfig, $form, $form->{"new_name"}, $base_unit, $factor, $form->{"unit_type"}, \@languages);
3506 $form->{"saved_message"} = $locale->text("The unit has been saved.");
3510 $lxdebug->leave_sub();
3513 sub set_unit_languages {
3514 $lxdebug->enter_sub();
3516 my ($unit, $languages, $idx) = @_;
3518 $unit->{"LANGUAGES"} = [];
3520 foreach my $lang (@{$languages}) {
3521 push(@{ $unit->{"LANGUAGES"} },
3522 { "id" => $lang->{"id"},
3523 "localized" => $form->{"localized_${idx}_$lang->{id}"},
3524 "localized_plural" => $form->{"localized_plural_${idx}_$lang->{id}"},
3528 $lxdebug->leave_sub();
3532 $lxdebug->enter_sub();
3534 $old_units = AM->retrieve_units(\%myconfig, $form, $form->{"unit_type"}, "resolved_");
3535 AM->units_in_use(\%myconfig, $form, $old_units);
3537 @languages = AM->language(\%myconfig, $form, 1);
3541 foreach $i (1..($form->{"rowcount"} * 1)) {
3542 $old_unit = $old_units->{$form->{"old_name_$i"}};
3544 $form->show_generic_error(sprintf($locale->text("The unit in row %d has been deleted in the meantime."), $i));
3547 if ($form->{"unchangeable_$i"}) {
3548 $new_units->{$form->{"old_name_$i"}} = $old_units->{$form->{"old_name_$i"}};
3549 $new_units->{$form->{"old_name_$i"}}->{"unchanged_unit"} = 1;
3550 set_unit_languages($new_units->{$form->{"old_name_$i"}}, \@languages, $i);
3554 if ($old_unit->{"in_use"}) {
3555 $form->show_generic_error(sprintf($locale->text("The unit in row %d has been used in the meantime and cannot be changed anymore."), $i));
3558 if ($form->{"delete_$i"}) {
3559 push(@delete_units, $old_unit->{"name"});
3563 $form->isblank("name_$i", sprintf($locale->text("The name is missing in row %d."), $i));
3565 $form->show_generic_error(sprintf($locale->text("The name in row %d has already been used before."), $i)) if ($new_units->{$form->{"name_$i"}});
3566 my %h = map({ $_ => $form->{"${_}_$i"} } qw(name base_unit factor old_name));
3567 $new_units->{$form->{"name_$i"}} = \%h;
3568 $new_units->{$form->{"name_$i"}}->{"row"} = $i;
3569 set_unit_languages($new_units->{$form->{"old_name_$i"}}, \@languages, $i);
3572 foreach $unit (values(%{$new_units})) {
3573 next unless ($unit->{"old_name"});
3574 if ($unit->{"base_unit"}) {
3575 $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"}))
3576 unless (defined($new_units->{$unit->{"base_unit"}}));
3577 $unit->{"factor"} = $form->parse_amount(\%myconfig, $unit->{"factor"});
3578 $form->show_generic_error(sprintf($locale->text("The factor is missing in row %d."), $unit->{"row"})) unless ($unit->{"factor"} >= 1.0);
3580 $unit->{"base_unit"} = undef;
3581 $unit->{"factor"} = undef;
3585 foreach $unit (values(%{$new_units})) {
3586 next if ($unit->{"unchanged_unit"});
3588 map({ $_->{"seen"} = 0; } values(%{$new_units}));
3590 while ($new_unit->{"base_unit"}) {
3591 $new_unit->{"seen"} = 1;
3592 $new_unit = $new_units->{$new_unit->{"base_unit"}};
3593 if ($new_unit->{"seen"}) {
3594 $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, " .
3595 "B's base unit is C and C's base unit is A) in row %d."), $unit->{"row"}));
3600 AM->save_units(\%myconfig, $form, $form->{"unit_type"}, $new_units, \@delete_units);
3602 $form->{"saved_message"} = $locale->text("The units have been saved.");
3606 $lxdebug->leave_sub();
3610 $lxdebug->enter_sub();
3612 my $dir = $form->{"dir"} eq "down" ? "down" : "up";
3613 my $unit_type = $form->{"unit_type"} eq "dimension" ?
3614 "dimension" : "service";
3615 AM->swap_units(\%myconfig, $form, $dir, $form->{"name"}, $unit_type);
3619 $lxdebug->leave_sub();