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 #======================================================================
46 sub add { &{ "add_$form->{type}" } };
47 sub edit { &{ "edit_$form->{type}" } };
48 sub save { &{ "save_$form->{type}" } };
49 sub delete { &{ "delete_$form->{type}" } };
55 $lxdebug->enter_sub();
58 $form->{title} = "Add";
59 $form->{charttype} = "A";
60 AM->get_account(\%myconfig, \%$form);
62 $form->{callback} = "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback};
67 $lxdebug->leave_sub();
72 $lxdebug->enter_sub();
75 $form->{title} = "Edit";
76 AM->get_account(\%myconfig, \%$form);
78 foreach my $item (split(/:/, $form->{link})) {
79 $form->{$item} = "checked";
85 $lxdebug->leave_sub();
90 $lxdebug->enter_sub();
93 $form->{title} = $locale->text("$form->{title} Account");
95 $checked{$form->{charttype}} = "checked";
96 $checked{"$form->{category}_"} = "checked";
97 $checked{CT_tax} = ($form->{CT_tax}) ? "" : "checked";
99 $form->{description} =~ s/\"/"/g;
101 if (@{ $form->{TAXKEY} }) {
102 $form->{selecttaxkey} = "<option value=0>Keine Steuer 0%\n";
103 foreach $item (@{ $form->{TAXKEY} }) {
104 if ($item->{taxkey}==$form->{taxkey_id}) {
105 $form->{selecttaxkey} .= "<option value=$item->{taxkey} selected>$item->{taxdescription}\n";}
107 $form->{selecttaxkey} .= "<option value=$item->{taxkey}>$item->{taxdescription}\n";
116 <th align=right>|.$locale->text('Steuersatz').qq|</th>
117 <td><select name=taxkey_id>$form->{selecttaxkey}</select></td>
118 <input type=hidden name=selecttaxkey value="$form->{selecttaxkey}">
122 $form->{selectustva} = "<option>\n";
123 %ustva = ( 48 => "Steuerfrei, Zeile 48", 51 => "Steuerpflichtig 16%, Zeile 51", 86 => "Steuerpflichtig 7%, Zeile 86", 91 => "Steuerfrei, Zeile 91", 97 => "Steuerpflichtig 16%, Zeile 97", 93 => "Steuerpflichtig 7%, Zeile 93", 94 => "Steuerpflichtig 16%, Zeile 94", 66 => "Vorsteuer, Zeile 66");
124 foreach $item (sort({ $a <=> $b }keys %ustva)) {
125 if ($item==$form->{pos_ustva}) {
126 $form->{selectustva} .= "<option value=$item selected>$ustva{$item}\n";
128 $form->{selectustva} .= "<option value=$item>$ustva{$item}\n";
137 <th align=right>|.$locale->text('Umsatzsteuervoranmeldung').qq|</th>
138 <td><select name=pos_ustva>$form->{selectustva}</select></td>
139 <input type=hidden name=selectustva value="$form->{selectustva}">
142 $form->{selecteur} = "<option>\n";
143 %eur = ( 1 => "Umsatzerlöse", 2 => "sonstige Erlöse", 3 => "Privatanteile", 4 => "Zinserträge", 5 => "Ausserordentliche Erträge", 6 => "Vereinnahmte Umsatzst.", 7 => "Umsatzsteuererstattungen", 8 => "Wareneingänge", 9 => "Löhne und Gehälter", 10 => "Gesetzl. sozialer Aufw.", 11 => "Mieten", 12 => "Gas, Strom, Wasser", 13 => "Instandhaltung", 14 => "Steuern, Versich., Beiträge", 15 => "Kfz-Steuern", 16 => "Kfz-Versicherungen", 17 => "Sonst. Fahrtkosten", 18 => "Werbe- und Reisekosten", 19 => "Instandhaltung u. Werkzeuge", 20 => "Fachzeitschriften, Bücher", 21 => "Miete für Einrichtungen", 22 => "Rechts- und Beratungskosten", 23 => "Bürobedarf, Porto, Telefon", 24 => "Sonstige Aufwendungen", 25 => "Abschreibungen auf Anlagever.", 26 => "Abschreibungen auf GWG", 27 => "Vorsteuer", 28 => "Umsatzsteuerzahlungen", 29 => "Zinsaufwand", 30 => "Ausserordentlicher Aufwand", 31 => "Betriebliche Steuern");
144 foreach $item (sort({ $a <=> $b } keys(%eur))) {
145 if ($item==$form->{pos_eur}) {
146 $form->{selecteur} .= "<option value=$item selected>$eur{$item}\n";
148 $form->{selecteur} .= "<option value=$item>$eur{$item}\n";
157 <th align=right>|.$locale->text('EÜR').qq|</th>
158 <td><select name=pos_eur>$form->{selecteur}</select></td>
159 <input type=hidden name=selecteur value="$form->{selecteur}">
162 $form->{selectbwa} = "<option>\n";
164 %bwapos = (1 => 'Umsatzerlöse', 2 => 'Best.Verdg.FE/UE', 3 => 'Aktiv.Eigenleistung', 4 => 'Mat./Wareneinkauf', 5 => 'So.betr.Erlöse', 10 => 'Personalkosten', 11 => 'Raumkosten', 12 => 'Betriebl.Steuern', 13 => 'Vers./Beiträge', 14 => 'Kfz.Kosten o.St.', 15 => 'Werbe-Reisek.', 16 => 'Kosten Warenabgabe', 17 => 'Abschreibungen', 18 => 'Rep./instandhlt.', 19 => 'Übrige Steuern', 20 => 'Sonst.Kosten', 30 => 'Zinsauwand', 31 => 'Sonst.neutr.Aufw.', 32 => 'Zinserträge', 33 => 'Sonst.neutr.Ertrag', 34 => 'Verr.kalk.Kosten', 35 => 'Steuern Eink.u.Ertr.');
165 foreach $item (sort({ $a <=> $b } keys %bwapos)) {
166 if ($item==$form->{pos_bwa}) {
167 $form->{selectbwa} .= "<option value=$item selected>$bwapos{$item}\n";
169 $form->{selectbwa} .= "<option value=$item>$bwapos{$item}\n";
178 <th align=right>|.$locale->text('BWA').qq|</th>
179 <td><select name=pos_bwa>$form->{selectbwa}</select></td>
180 <input type=hidden name=selectbwa value="$form->{selectbwa}">
183 $form->{selectbilanz} = "<option>\n";
184 foreach $item ((1, 2, 3, 4)) {
185 if ($item==$form->{pos_bilanz}) {
186 $form->{selectbilanz} .= "<option value=$item selected>$item\n";
188 $form->{selectbilanz} .= "<option value=$item>$item\n";
197 <th align=right>|.$locale->text('Bilanz').qq|</th>
198 <td><select name=pos_bilanz>$form->{selectbilanz}</select></td>
199 <input type=hidden name=selectbilanz value="$form->{selectbilanz}">
201 # this is for our parser only!
202 # type=submit $locale->text('Add Account')
203 # type=submit $locale->text('Edit Account')
210 <form method=post action=$form->{script}>
212 <input type=hidden name=id value=$form->{id}>
213 <input type=hidden name=type value=account>
215 <input type=hidden name=inventory_accno_id value=$form->{inventory_accno_id}>
216 <input type=hidden name=income_accno_id value=$form->{income_accno_id}>
217 <input type=hidden name=expense_accno_id value=$form->{expense_accno_id}>
218 <input type=hidden name=fxgain_accno_id values=$form->{fxgain_accno_id}>
219 <input type=hidden name=fxloss_accno_id values=$form->{fxloss_accno_id}>
221 <table border=0 width=100%>
223 <th class=listtop>$form->{title}</th>
230 <th align=right>|.$locale->text('Account Number').qq|</th>
231 <td><input name=accno size=20 value=$form->{accno}></td>
234 <th align=right>|.$locale->text('Description').qq|</th>
235 <td><input name=description size=40 value="$form->{description}"></td>
238 <th align=right>|.$locale->text('Account Type').qq|</th>
242 <td><input name=category type=radio class=radio value=A $checked{A_}> |.$locale->text('Asset').qq|\n<br>
243 <input name=category type=radio class=radio value=L $checked{L_}> |.$locale->text('Liability').qq|\n<br>
244 <input name=category type=radio class=radio value=Q $checked{Q_}> |.$locale->text('Equity').qq|\n<br>
245 <input name=category type=radio class=radio value=I $checked{I_}> |.$locale->text('Revenue').qq|\n<br>
246 <input name=category type=radio class=radio value=E $checked{E_}> |.$locale->text('Expense')
248 <td width=50> </td>
250 <input name=charttype type=radio class=radio value="H" $checked{H}> |.$locale->text('Heading').qq|<br>
251 <input name=charttype type=radio class=radio value="A" $checked{A}> |.$locale->text('Account')
260 if ($form->{charttype} eq "A") {
266 <th align=left>|.$locale->text('Is this a summary account to record').qq|</th>
268 <input name=AR type=checkbox class=checkbox value=AR $form->{AR}> |.$locale->text('AR')
269 .qq| <input name=AP type=checkbox class=checkbox value=AP $form->{AP}> |.$locale->text('AP')
270 .qq| <input name=IC type=checkbox class=checkbox value=IC $form->{IC}> |.$locale->text('Inventory')
277 <th colspan=2>|.$locale->text('Include in drop-down menus').qq|</th>
283 <th align=left>|.$locale->text('Receivables').qq|</th>
284 <th align=left>|.$locale->text('Payables').qq|</th>
285 <th align=left>|.$locale->text('Parts Inventory').qq|</th>
286 <th align=left>|.$locale->text('Service Items').qq|</th>
290 <input name=AR_amount type=checkbox class=checkbox value=AR_amount $form->{AR_amount}> |.$locale->text('Revenue').qq|\n<br>
291 <input name=AR_paid type=checkbox class=checkbox value=AR_paid $form->{AR_paid}> |.$locale->text('Receipt').qq|\n<br>
292 <input name=AR_tax type=checkbox class=checkbox value=AR_tax $form->{AR_tax}> |.$locale->text('Tax')
296 <input name=AP_amount type=checkbox class=checkbox value=AP_amount $form->{AP_amount}> |.$locale->text('Expense/Asset').qq|\n<br>
297 <input name=AP_paid type=checkbox class=checkbox value=AP_paid $form->{AP_paid}> |.$locale->text('Payment').qq|\n<br>
298 <input name=AP_tax type=checkbox class=checkbox value=AP_tax $form->{AP_tax}> |.$locale->text('Tax')
302 <input name=IC_sale type=checkbox class=checkbox value=IC_sale $form->{IC_sale}> |.$locale->text('Revenue').qq|\n<br>
303 <input name=IC_cogs type=checkbox class=checkbox value=IC_cogs $form->{IC_cogs}> |.$locale->text('COGS').qq|\n<br>
304 <input name=IC_taxpart type=checkbox class=checkbox value=IC_taxpart $form->{IC_taxpart}> |.$locale->text('Tax')
308 <input name=IC_income type=checkbox class=checkbox value=IC_income $form->{IC_income}> |.$locale->text('Revenue').qq|\n<br>
309 <input name=IC_expense type=checkbox class=checkbox value=IC_expense $form->{IC_expense}> |.$locale->text('Expense').qq|\n<br>
310 <input name=IC_taxservice type=checkbox class=checkbox value=IC_taxservice $form->{IC_taxservice}> |.$locale->text('Tax')
330 <td><hr size=3 noshade></td>
335 $lxdebug->leave_sub();
340 $lxdebug->enter_sub();
345 <input name=callback type=hidden value="$form->{callback}">
347 <input type=hidden name=path value=$form->{path}>
348 <input type=hidden name=login value=$form->{login}>
349 <input type=hidden name=password value=$form->{password}>
352 <input type=submit class=submit name=action value="|.$locale->text('Save').qq|">
355 if ($form->{id} && $form->{orphaned}) {
356 print qq|<input type=submit class=submit name=action value="|.$locale->text('Delete').qq|">|;
359 if ($form->{menubar}) {
360 require "$form->{path}/menu.pl";
371 $lxdebug->leave_sub();
376 $lxdebug->enter_sub();
379 $form->isblank("accno", $locale->text('Account Number missing!'));
380 $form->isblank("category", $locale->text('Account Type missing!'));
382 $form->redirect($locale->text('Account saved!')) if (AM->save_account(\%myconfig, \%$form));
383 $form->error($locale->text('Cannot save account!'));
385 $lxdebug->leave_sub();
390 $lxdebug->enter_sub();
393 CA->all_accounts(\%myconfig, \%$form);
395 $form->{title} = $locale->text('Chart of Accounts');
398 $callback = "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}";
400 @column_index = qw(accno gifi_accno description debit credit link);
402 $column_header{accno} = qq|<th>|.$locale->text('Account').qq|</a></th>|;
403 $column_header{gifi_accno} = qq|<th>|.$locale->text('GIFI').qq|</a></th>|;
404 $column_header{description} = qq|<th>|.$locale->text('Description').qq|</a></th>|;
405 $column_header{debit} = qq|<th>|.$locale->text('Debit').qq|</a></th>|;
406 $column_header{credit} = qq|<th>|.$locale->text('Credit').qq|</a></th>|;
407 $column_header{link} = qq|<th>|.$locale->text('Link').qq|</a></th>|;
411 $colspan = $#column_index + 1;
418 <th class=listtop colspan=$colspan>$form->{title}</th>
421 <tr class=listheading>
424 map { print "$column_header{$_}\n" } @column_index;
431 $callback = $form->escape($callback);
433 foreach $ca (@{ $form->{CA} }) {
435 $ca->{debit} = " ";
436 $ca->{credit} = " ";
438 if ($ca->{amount} > 0) {
439 $ca->{credit} = $form->format_amount(\%myconfig, $ca->{amount}, 2, " ");
441 if ($ca->{amount} < 0) {
442 $ca->{debit} = $form->format_amount(\%myconfig, -$ca->{amount}, 2, " ");
445 $ca->{link} =~ s/:/<br>/og;
447 if ($ca->{charttype} eq "H") {
448 print qq|<tr class=listheading>|;
450 $column_data{accno} = 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>|;
451 $column_data{gifi_accno} = 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>|;
452 $column_data{description} = qq|<th>$ca->{description} </th>|;
453 $column_data{debit} = qq|<th> </th>|;
454 $column_data{credit} = qq| <th> </th>|;
455 $column_data{link} = qq|<th> </th>|;
460 <tr valign=top class=listrow$i>|;
461 $column_data{accno} = 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>|;
462 $column_data{gifi_accno} = 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>|;
463 $column_data{description} = qq|<td>$ca->{description} </td>|;
464 $column_data{debit} = qq|<td align=right>$ca->{debit}</td>|;
465 $column_data{credit} = qq|<td align=right>$ca->{credit}</td>|;
466 $column_data{link} = qq|<td>$ca->{link} </td>|;
470 map { print "$column_data{$_}\n" } @column_index;
476 <tr><td colspan=$colspan><hr size=3 noshade></td></tr>
483 $lxdebug->leave_sub();
488 $lxdebug->enter_sub();
491 $form->{title} = $locale->text('Delete Account');
493 foreach $id (qw(inventory_accno_id income_accno_id expense_accno_id fxgain_accno_id fxloss_accno_id)) {
494 if ($form->{id} == $form->{$id}) {
495 $form->error($locale->text('Cannot delete default account!'));
499 $form->redirect($locale->text('Account deleted!')) if (AM->delete_account(\%myconfig, \%$form));
500 $form->error($locale->text('Cannot delete account!'));
502 $lxdebug->leave_sub();
507 $lxdebug->enter_sub();
510 @{ $form->{fields} } = (accno, description);
511 $form->{table} = "gifi";
512 $form->{sortorder} = "accno";
514 AM->gifi_accounts(\%myconfig, \%$form);
516 $form->{title} = $locale->text('GIFI');
519 $callback = "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
521 @column_index = qw(accno description);
523 $column_header{accno} = qq|<th>|.$locale->text('GIFI').qq|</a></th>|;
524 $column_header{description} = qq|<th>|.$locale->text('Description').qq|</a></th>|;
528 $colspan = $#column_index + 1;
535 <th class=listtop colspan=$colspan>$form->{title}</th>
538 <tr class=listheading>
541 map { print "$column_header{$_}\n" } @column_index;
548 $callback = $form->escape($callback);
550 foreach $ca (@{ $form->{ALL} }) {
555 <tr valign=top class=listrow$i>|;
557 $column_data{accno} = 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>|;
558 $column_data{description} = qq|<td>$ca->{description} </td>|;
560 map { print "$column_data{$_}\n" } @column_index;
567 <td colspan=$colspan><hr size=3 noshade></td>
575 $lxdebug->leave_sub();
580 $lxdebug->enter_sub();
582 $form->{title} = "Add";
585 $form->{callback} = "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
592 $lxdebug->leave_sub();
597 $lxdebug->enter_sub();
600 $form->{title} = "Edit";
602 AM->get_gifi(\%myconfig, \%$form);
607 $lxdebug->leave_sub();
612 $lxdebug->enter_sub();
615 $form->{title} = $locale->text("$form->{title} GIFI");
617 # $locale->text('Add GIFI')
618 # $locale->text('Edit GIFI')
620 $form->{description} =~ s/\"/"/g;
627 <form method=post action=$form->{script}>
629 <input type=hidden name=id value=$form->{accno}>
630 <input type=hidden name=type value=gifi>
634 <th class=listtop>$form->{title}</th>
641 <th align=right>|.$locale->text('GIFI').qq|</th>
642 <td><input name=accno size=20 value=$form->{accno}></td>
645 <th align=right>|.$locale->text('Description').qq|</th>
646 <td><input name=description size=60 value="$form->{description}"></td>
652 <td colspan=2><hr size=3 noshade></td>
657 $lxdebug->leave_sub();
662 $lxdebug->enter_sub();
667 <input name=callback type=hidden value="$form->{callback}">
669 <input type=hidden name=path value=$form->{path}>
670 <input type=hidden name=login value=$form->{login}>
671 <input type=hidden name=password value=$form->{password}>
673 <br><input type=submit class=submit name=action value="|.$locale->text('Save').qq|">|;
677 <input type=submit class=submit name=action value="|.$locale->text('Copy to COA').qq|">
680 if ($form->{accno} && $form->{orphaned}) {
681 print qq|<input type=submit class=submit name=action value="|.$locale->text('Delete').qq|">|;
685 if ($form->{menubar}) {
686 require "$form->{path}/menu.pl";
697 $lxdebug->leave_sub();
702 $lxdebug->enter_sub();
705 $form->isblank("accno", $locale->text('GIFI missing!'));
706 AM->save_gifi(\%myconfig, \%$form);
707 $form->redirect($locale->text('GIFI saved!'));
709 $lxdebug->leave_sub();
714 $lxdebug->enter_sub();
717 $form->isblank("accno", $locale->text('GIFI missing!'));
719 AM->save_gifi(\%myconfig, \%$form);
722 $form->{gifi_accno} = $form->{accno};
723 $form->{title} = "Add";
724 $form->{charttype} = "A";
729 $lxdebug->leave_sub();
734 $lxdebug->enter_sub();
737 AM->delete_gifi(\%myconfig, \%$form);
738 $form->redirect($locale->text('GIFI deleted!'));
740 $lxdebug->leave_sub();
745 $lxdebug->enter_sub();
748 $form->{title} = "Add";
751 $form->{callback} = "$form->{script}?action=add_department&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback};
756 $lxdebug->leave_sub();
760 sub edit_department {
761 $lxdebug->enter_sub();
764 $form->{title} = "Edit";
766 AM->get_department(\%myconfig, \%$form);
771 $lxdebug->leave_sub();
775 sub list_department {
776 $lxdebug->enter_sub();
779 AM->departments(\%myconfig, \%$form);
781 $form->{callback} = "$form->{script}?action=list_department&path=$form->{path}&login=$form->{login}&password=$form->{password}";
783 $callback = $form->escape($form->{callback});
785 $form->{title} = $locale->text('Departments');
787 @column_index = qw(description cost profit);
789 $column_header{description} = qq|<th class=listheading width=90%>|.$locale->text('Description').qq|</th>|;
790 $column_header{cost} = qq|<th class=listheading nowrap>|.$locale->text('Cost Center').qq|</th>|;
791 $column_header{profit} = qq|<th class=listheading nowrap>|.$locale->text('Profit Center').qq|</th>|;
800 <th class=listtop>$form->{title}</th>
806 <tr class=listheading>
809 map { print "$column_header{$_}\n" } @column_index;
815 foreach $ref (@{ $form->{ALL} }) {
820 <tr valign=top class=listrow$i>
823 $costcenter = ($ref->{role} eq "C") ? "X" : "";
824 $profitcenter = ($ref->{role} eq "P") ? "X" : "";
826 $column_data{description} = 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>|;
827 $column_data{cost} = qq|<td align=center>$costcenter</td>|;
828 $column_data{profit} = qq|<td align=center>$profitcenter</td>|;
830 map { print "$column_data{$_}\n" } @column_index;
842 <td><hr size=3 noshade></td>
847 <form method=post action=$form->{script}>
849 <input name=callback type=hidden value="$form->{callback}">
851 <input type=hidden name=type value=department>
853 <input type=hidden name=path value=$form->{path}>
854 <input type=hidden name=login value=$form->{login}>
855 <input type=hidden name=password value=$form->{password}>
857 <input class=submit type=submit name=action value="|.$locale->text('Add').qq|">|;
859 if ($form->{menubar}) {
860 require "$form->{path}/menu.pl";
871 $lxdebug->leave_sub();
875 sub department_header {
876 $lxdebug->enter_sub();
879 $form->{title} = $locale->text("$form->{title} Department");
881 # $locale->text('Add Department')
882 # $locale->text('Edit Department')
884 $form->{description} =~ s/\"/"/g;
886 if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
887 $description = qq|<textarea name="description" rows=$rows cols=60 wrap=soft>$form->{description}</textarea>|;
889 $description = qq|<input name=description size=60 value="$form->{description}">|;
892 $costcenter = "checked" if $form->{role} eq "C";
893 $profitcenter = "checked" if $form->{role} eq "P";
900 <form method=post action=$form->{script}>
902 <input type=hidden name=id value=$form->{id}>
903 <input type=hidden name=type value=department>
907 <th class=listtop colspan=2>$form->{title}</th>
911 <th align=right>|.$locale->text('Description').qq|</th>
912 <td>$description</td>
916 <td><input type=radio style=radio name=role value="C" $costcenter> |.$locale->text('Cost Center').qq|
917 <input type=radio style=radio name=role value="P" $profitcenter> |.$locale->text('Profit Center').qq|
920 <td colspan=2><hr size=3 noshade></td>
925 $lxdebug->leave_sub();
929 sub save_department {
930 $lxdebug->enter_sub();
933 $form->isblank("description", $locale->text('Description missing!'));
934 AM->save_department(\%myconfig, \%$form);
935 $form->redirect($locale->text('Department saved!'));
937 $lxdebug->leave_sub();
941 sub delete_department {
942 $lxdebug->enter_sub();
945 AM->delete_department(\%myconfig, \%$form);
946 $form->redirect($locale->text('Department deleted!'));
948 $lxdebug->leave_sub();
953 $lxdebug->enter_sub();
956 $form->{title} = "Add";
958 $form->{callback} = "$form->{script}?action=add_business&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback};
963 $lxdebug->leave_sub();
968 $lxdebug->enter_sub();
971 $form->{title} = "Edit";
973 AM->get_business(\%myconfig, \%$form);
977 $form->{orphaned} = 1;
980 $lxdebug->leave_sub();
985 $lxdebug->enter_sub();
988 AM->business(\%myconfig, \%$form);
990 $form->{callback} = "$form->{script}?action=list_business&path=$form->{path}&login=$form->{login}&password=$form->{password}";
992 $callback = $form->escape($form->{callback});
994 $form->{title} = $locale->text('Type of Business');
996 @column_index = qw(description discount customernumberinit);
998 $column_header{description} = qq|<th class=listheading width=60%>|.$locale->text('Description').qq|</th>|;
999 $column_header{discount} = qq|<th class=listheading width=10%>|.$locale->text('Discount').qq| %</th>|;
1000 $column_header{customernumberinit} = qq|<th class=listheading>|.$locale->text('Customernumberinit').qq|</th>|;
1009 <th class=listtop>$form->{title}</th>
1011 <tr height="5"></tr>
1015 <tr class=listheading>
1018 map { print "$column_header{$_}\n" } @column_index;
1024 foreach $ref (@{ $form->{ALL} }) {
1029 <tr valign=top class=listrow$i>
1032 $discount = $form->format_amount(\%myconfig, $ref->{discount} * 100, 1, " ");
1033 $description = ($ref->{salesman}) ? "<b>$ref->{description}</b>" : "$ref->{description}";
1034 $column_data{description} = 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>|;
1035 $column_data{discount} = qq|<td align=right>$discount</td>|;
1036 $column_data{customernumberinit} = qq|<td align=right>$ref->{customernumberinit}</td>|;
1038 map { print "$column_data{$_}\n" } @column_index;
1050 <td><hr size=3 noshade></td>
1055 <form method=post action=$form->{script}>
1057 <input name=callback type=hidden value="$form->{callback}">
1059 <input type=hidden name=type value=business>
1061 <input type=hidden name=path value=$form->{path}>
1062 <input type=hidden name=login value=$form->{login}>
1063 <input type=hidden name=password value=$form->{password}>
1065 <input class=submit type=submit name=action value="|.$locale->text('Add').qq|">|;
1067 if ($form->{menubar}) {
1068 require "$form->{path}/menu.pl";
1080 $lxdebug->leave_sub();
1084 sub business_header {
1085 $lxdebug->enter_sub();
1088 $form->{title} = $locale->text("$form->{title} Business");
1089 $form->{salesman} = "checked" if $form->{salesman};
1090 # $locale->text('Add Business')
1091 # $locale->text('Edit Business')
1093 $form->{description} =~ s/\"/"/g;
1094 $form->{discount} = $form->format_amount(\%myconfig, $form->{discount} * 100);
1101 <form method=post action=$form->{script}>
1103 <input type=hidden name=id value=$form->{id}>
1104 <input type=hidden name=type value=business>
1108 <th class=listtop colspan=2>$form->{title}</th>
1110 <tr height="5"></tr>
1112 <th align=right>|.$locale->text('Type of Business').qq|</th>
1113 <td><input name=description size=30 value="$form->{description}"></td>
1116 <th align=right>|.$locale->text('Discount').qq| %</th>
1117 <td><input name=discount size=5 value=$form->{discount}></td>
1120 <th align=right>|.$locale->text('Customernumberinit').qq|</th>
1121 <td><input name=customernumberinit size=10 value=$form->{customernumberinit}></td>
1124 <td align=right>|.$locale->text('Salesman').qq|</td>
1125 <td><input name=salesman class=checkbox type=checkbox value=1 $form->{salesman}></td>
1127 <td colspan=2><hr size=3 noshade></td>
1132 $lxdebug->leave_sub();
1137 $lxdebug->enter_sub();
1140 $form->isblank("description", $locale->text('Description missing!'));
1141 AM->save_business(\%myconfig, \%$form);
1142 $form->redirect($locale->text('Business saved!'));
1144 $lxdebug->leave_sub();
1148 sub delete_business {
1149 $lxdebug->enter_sub();
1152 AM->delete_business(\%myconfig, \%$form);
1153 $form->redirect($locale->text('Business deleted!'));
1155 $lxdebug->leave_sub();
1161 $lxdebug->enter_sub();
1164 $form->{title} = "Add";
1166 $form->{callback} = "$form->{script}?action=add_sic&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback};
1171 $lxdebug->leave_sub();
1176 $lxdebug->enter_sub();
1179 $form->{title} = "Edit";
1181 AM->get_sic(\%myconfig, \%$form);
1185 $form->{orphaned} = 1;
1188 $lxdebug->leave_sub();
1193 $lxdebug->enter_sub();
1196 AM->sic(\%myconfig, \%$form);
1198 $form->{callback} = "$form->{script}?action=list_sic&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1200 $callback = $form->escape($form->{callback});
1202 $form->{title} = $locale->text('Standard Industrial Codes');
1204 @column_index = qw(code description);
1206 $column_header{code} = qq|<th class=listheading>|.$locale->text('Code').qq|</th>|;
1207 $column_header{description} = qq|<th class=listheading>|.$locale->text('Description').qq|</th>|;
1216 <th class=listtop>$form->{title}</th>
1218 <tr height="5"></tr>
1222 <tr class=listheading>
1225 map { print "$column_header{$_}\n" } @column_index;
1231 foreach $ref (@{ $form->{ALL} }) {
1235 if ($ref->{sictype} eq 'H') {
1237 <tr valign=top class=listheading>
1239 $column_data{code} = 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>|;
1240 $column_data{description} = qq|<th>$ref->{description}</th>|;
1244 <tr valign=top class=listrow$i>
1247 $column_data{code} = 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>|;
1248 $column_data{description} = qq|<td>$ref->{description}</td>|;
1252 map { print "$column_data{$_}\n" } @column_index;
1264 <td><hr size=3 noshade></td>
1269 <form method=post action=$form->{script}>
1271 <input name=callback type=hidden value="$form->{callback}">
1273 <input type=hidden name=type value=sic>
1275 <input type=hidden name=path value=$form->{path}>
1276 <input type=hidden name=login value=$form->{login}>
1277 <input type=hidden name=password value=$form->{password}>
1279 <input class=submit type=submit name=action value="|.$locale->text('Add').qq|">|;
1281 if ($form->{menubar}) {
1282 require "$form->{path}/menu.pl";
1293 $lxdebug->leave_sub();
1298 $lxdebug->enter_sub();
1301 $form->{title} = $locale->text("$form->{title} SIC");
1303 # $locale->text('Add SIC')
1304 # $locale->text('Edit SIC')
1306 $form->{code} =~ s/\"/"/g;
1307 $form->{description} =~ s/\"/"/g;
1309 $checked = ($form->{sictype} eq 'H') ? "checked" : "";
1316 <form method=post action=$form->{script}>
1318 <input type=hidden name=type value=sic>
1319 <input type=hidden name=id value=$form->{code}>
1323 <th class=listtop colspan=2>$form->{title}</th>
1325 <tr height="5"></tr>
1327 <th align=right>|.$locale->text('Code').qq|</th>
1328 <td><input name=code size=10 value=$form->{code}></td>
1332 <th align=left><input name=sictype type=checkbox style=checkbox value="H" $checked> |.$locale->text('Heading').qq|</th>
1335 <th align=right>|.$locale->text('Description').qq|</th>
1336 <td><input name=description size=60 value="$form->{description}"></td>
1338 <td colspan=2><hr size=3 noshade></td>
1343 $lxdebug->leave_sub();
1348 $lxdebug->enter_sub();
1351 $form->isblank("code", $locale->text('Code missing!'));
1352 $form->isblank("description", $locale->text('Description missing!'));
1353 AM->save_sic(\%myconfig, \%$form);
1354 $form->redirect($locale->text('SIC saved!'));
1356 $lxdebug->leave_sub();
1361 $lxdebug->enter_sub();
1364 AM->delete_sic(\%myconfig, \%$form);
1365 $form->redirect($locale->text('SIC deleted!'));
1367 $lxdebug->leave_sub();
1372 sub display_stylesheet {
1373 $lxdebug->enter_sub();
1376 $form->{file} = "css/$myconfig{stylesheet}";
1379 $lxdebug->leave_sub();
1384 $lxdebug->enter_sub();
1387 $form->{file} =~ s/^(.:)*?\/|\.\.\///g;
1388 $form->{file} =~ s/^\/*//g;
1389 $form->{file} =~ s/$userspath//;
1391 $form->error("$!: $form->{file}") unless -f $form->{file};
1393 AM->load_template(\%$form);
1395 $form->{title} = $form->{file};
1397 # if it is anything but html
1398 if ($form->{file} !~ /\.html$/) {
1399 $form->{body} = "<pre>\n$form->{body}\n</pre>";
1409 <form method=post action=$form->{script}>
1411 <input name=file type=hidden value=$form->{file}>
1412 <input name=type type=hidden value=template>
1414 <input type=hidden name=path value=$form->{path}>
1415 <input type=hidden name=login value=$form->{login}>
1416 <input type=hidden name=password value=$form->{password}>
1418 <input name=action type=submit class=submit value="|.$locale->text('Edit').qq|">|;
1420 if ($form->{menubar}) {
1421 require "$form->{path}/menu.pl";
1432 $lxdebug->leave_sub();
1437 $lxdebug->enter_sub();
1440 AM->load_template(\%$form);
1442 $form->{title} = $locale->text('Edit Template');
1443 # convert   to &nbsp;
1444 $form->{body} =~ s/ /&nbsp;/gi;
1452 <form method=post action=$form->{script}>
1454 <input name=file type=hidden value=$form->{file}>
1455 <input name=type type=hidden value=template>
1457 <input type=hidden name=path value=$form->{path}>
1458 <input type=hidden name=login value=$form->{login}>
1459 <input type=hidden name=password value=$form->{password}>
1461 <input name=callback type=hidden value="$form->{script}?action=display_form&file=$form->{file}&path=$form->{path}&login=$form->{login}&password=$form->{password}">
1463 <textarea name=body rows=25 cols=70>
1468 <input type=submit class=submit name=action value="|.$locale->text('Save').qq|">|;
1470 if ($form->{menubar}) {
1471 require "$form->{path}/menu.pl";
1483 $lxdebug->leave_sub();
1488 $lxdebug->enter_sub();
1491 AM->save_template(\%$form);
1492 $form->redirect($locale->text('Template saved!'));
1494 $lxdebug->leave_sub();
1499 $lxdebug->enter_sub();
1502 # get defaults for account numbers and last numbers
1503 AM->defaultaccounts(\%myconfig, \%$form);
1505 foreach $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
1506 $dateformat .= ($item eq $myconfig{dateformat}) ? "<option selected>$item\n" : "<option>$item\n";
1509 foreach $item (qw(1,000.00 1000.00 1.000,00 1000,00)) {
1510 $numberformat .= ($item eq $myconfig{numberformat}) ? "<option selected>$item\n" : "<option>$item\n";
1513 foreach $item (qw(name company address signature)) {
1514 $myconfig{$item} =~ s/\"/"/g;
1517 foreach $item (qw(address signature)) {
1518 $myconfig{$item} =~ s/\\n/\r\n/g;
1521 %countrycodes = User->country_codes;
1523 foreach $key (sort { $countrycodes{$a} cmp $countrycodes{$b} } keys %countrycodes) {
1524 $countrycodes .= ($myconfig{countrycode} eq $key) ? "<option selected value=$key>$countrycodes{$key}\n" : "<option value=$key>$countrycodes{$key}\n";
1526 $countrycodes = "<option>American English\n$countrycodes";
1528 foreach $key (keys %{ $form->{IC} }) {
1529 foreach $accno (sort keys %{ $form->{IC}{$key} }) {
1530 $myconfig{$key} .= ($form->{IC}{$key}{$accno}{id} == $form->{defaults}{$key}) ? "<option selected>$accno--$form->{IC}{$key}{$accno}{description}\n" : "<option>$accno--$form->{IC}{$key}{$accno}{description}\n";
1534 opendir CSS, "css/.";
1535 @all = grep /.*\.css$/, readdir CSS;
1538 foreach $item (@all) {
1539 if ($item eq $myconfig{stylesheet}) {
1540 $selectstylesheet .= qq|<option selected>$item\n|;
1542 $selectstylesheet .= qq|<option>$item\n|;
1545 $selectstylesheet .= "<option>\n";
1548 $form->{title} = $locale->text('Edit Preferences for').qq| $form->{login}|;
1555 <form method=post action=$form->{script}>
1557 <input type=hidden name=old_password value=$myconfig{password}>
1558 <input type=hidden name=type value=preferences>
1559 <input type=hidden name=role value=$myconfig{role}>
1562 <tr><th class=listtop>$form->{title}</th></tr>
1567 <th align=right>|.$locale->text('Name').qq|</th>
1568 <td><input name=name size=15 value="$myconfig{name}"></td>
1571 <th align=right>|.$locale->text('Password').qq|</th>
1572 <td><input type=password name=new_password size=10 value=$myconfig{password}></td>
1575 <th align=right>|.$locale->text('E-mail').qq|</th>
1576 <td><input name=email size=30 value="$myconfig{email}"></td>
1579 <th align=right>|.$locale->text('Signature').qq|</th>
1580 <td><textarea name=signature rows=3 cols=50>$myconfig{signature}</textarea></td>
1583 <th align=right>|.$locale->text('Phone').qq|</th>
1584 <td><input name=tel size=14 value="$myconfig{tel}"></td>
1587 <th align=right>|.$locale->text('Fax').qq|</th>
1588 <td><input name=fax size=14 value="$myconfig{fax}"></td>
1591 <th align=right>|.$locale->text('Company').qq|</th>
1592 <td><input name=company size=30 value="$myconfig{company}"></td>
1595 <th align=right>|.$locale->text('Address').qq|</th>
1596 <td><textarea name=address rows=4 cols=50>$myconfig{address}</textarea></td>
1599 <th align=right>|.$locale->text('Date Format').qq|</th>
1600 <td><select name=dateformat>$dateformat</select></td>
1603 <th align=right>|.$locale->text('Number Format').qq|</th>
1604 <td><select name=numberformat>$numberformat</select></td>
1607 <th align=right>|.$locale->text('Dropdown Limit').qq|</th>
1608 <td><input name=vclimit size=10 value="$myconfig{vclimit}"></td>
1611 <th align=right>|.$locale->text('Language').qq|</th>
1612 <td><select name=countrycode>$countrycodes</select></td>
1615 <th align=right>|.$locale->text('Character Set').qq|</th>
1616 <td><input name=charset size=20 value="$myconfig{charset}"></td>
1619 <th align=right>|.$locale->text('Stylesheet').qq|</th>
1620 <td><select name=usestylesheet>$selectstylesheet</select></td>
1622 <input name=printer type=hidden value="$myconfig{printer}">
1623 <tr class=listheading>
1624 <th colspan=2> </th>
1627 <th align=right>|.$locale->text('Business Number').qq|</th>
1628 <td><input name=businessnumber size=25 value="$myconfig{businessnumber}"></td>
1634 <th align=right>|.$locale->text('Year End').qq| (mm/dd)</th>
1635 <td><input name=yearend size=5 value=$form->{defaults}{yearend}></td>
1636 <th align=right>|.$locale->text('Weight Unit').qq|</th>
1637 <td><input name=weightunit size=5 value="$form->{defaults}{weightunit}"></td>
1642 <tr class=listheading>
1643 <th colspan=2>|.$locale->text('Last Numbers & Default Accounts').qq|</th>
1649 <th align=right nowrap>|.$locale->text('Inventory Account').qq|</th>
1650 <td><select name=inventory_accno>$myconfig{IC}</select></td>
1653 <th align=right nowrap>|.$locale->text('Revenue Account').qq|</th>
1654 <td><select name=income_accno>$myconfig{IC_income}</select></td>
1657 <th align=right nowrap>|.$locale->text('Expense Account').qq|</th>
1658 <td><select name=expense_accno>$myconfig{IC_expense}</select></td>
1661 <th align=right nowrap>|.$locale->text('Foreign Exchange Gain').qq|</th>
1662 <td><select name=fxgain_accno>$myconfig{FX_gain}</select></td>
1665 <th align=right nowrap>|.$locale->text('Foreign Exchange Loss').qq|</th>
1666 <td><select name=fxloss_accno>$myconfig{FX_loss}</select></td>
1669 <td colspan=2>|.$locale->text('Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies').qq|<br><input name=curr size=40 value="$form->{defaults}{curr}"></td>
1678 <th align=right nowrap>|.$locale->text('Last Invoice Number').qq|</th>
1679 <td><input name=invnumber size=10 value=$form->{defaults}{invnumber}></td>
1680 <th align=right nowrap>|.$locale->text('Last Customer Number').qq|</th>
1681 <td><input name=customernumber size=10 value=$form->{defaults}{customernumber}></td>
1684 <th align=right nowrap>|.$locale->text('Last Sales Order Number').qq|</th>
1685 <td><input name=sonumber size=10 value=$form->{defaults}{sonumber}></td>
1686 <th align=right nowrap>|.$locale->text('Last Vendor Number').qq|</th>
1687 <td><input name=vendornumber size=10 value=$form->{defaults}{vendornumber}></td>
1690 <th align=right nowrap>|.$locale->text('Last Purchase Order Number').qq|</th>
1691 <td><input name=ponumber size=10 value=$form->{defaults}{ponumber}></td>
1692 <th align=right nowrap>|.$locale->text('Last Article Number').qq|</th>
1693 <td><input name=articlenumber size=10 value=$form->{defaults}{articlenumber}></td>
1696 <th align=right nowrap>|.$locale->text('Last Sales Quotation Number').qq|</th>
1697 <td><input name=sqnumber size=10 value=$form->{defaults}{sqnumber}></td>
1698 <th align=right nowrap>|.$locale->text('Last Service Number').qq|</th>
1699 <td><input name=servicenumber size=10 value=$form->{defaults}{servicenumber}></td>
1702 <th align=right nowrap>|.$locale->text('Last RFQ Number').qq|</th>
1703 <td><input name=rfqnumber size=10 value=$form->{defaults}{rfqnumber}></td>
1704 <th align=right nowrap></th>
1710 <tr class=listheading>
1711 <th colspan=2>|.$locale->text('Tax Accounts').qq|</th>
1718 <th>|.$locale->text('Rate').qq| (%)</th>
1719 <th>|.$locale->text('Number').qq|</th>
1723 foreach $accno (sort keys %{ $form->{taxrates} }) {
1726 <th align=right>$form->{taxrates}{$accno}{description}</th>
1727 <td><input name=$form->{taxrates}{$accno}{id} size=6 value=$form->{taxrates}{$accno}{rate}></td>
1728 <td><input name="taxnumber_$form->{taxrates}{$accno}{id}" value="$form->{taxrates}{$accno}{taxnumber}"></td>
1731 $form->{taxaccounts} .= "$form->{taxrates}{$accno}{id} ";
1734 chop $form->{taxaccounts};
1737 <input name=taxaccounts type=hidden value="$form->{taxaccounts}">
1746 <td><hr size=3 noshade></td>
1750 <input type=hidden name=path value=$form->{path}>
1751 <input type=hidden name=login value=$form->{login}>
1752 <input type=hidden name=password value=$form->{password}>
1755 <input type=submit class=submit name=action value="|.$locale->text('Save').qq|">|;
1757 if ($form->{menubar}) {
1758 require "$form->{path}/menu.pl";
1769 $lxdebug->leave_sub();
1773 sub save_preferences {
1774 $lxdebug->enter_sub();
1777 $form->{stylesheet} = $form->{usestylesheet};
1780 $form->redirect($locale->text('Preferences saved!')) if (AM->save_preferences(\%myconfig, \%$form, $memberfile, $userspath, $webdav));
1781 $form->error($locale->text('Cannot save preferences!'));
1783 $lxdebug->leave_sub();
1788 $lxdebug->enter_sub();
1791 if ($form->{media} eq 'email') {
1792 $form->error($locale->text('No email address for')." $myconfig{name}") unless ($myconfig{email});
1794 $form->{OUT} = "$sendmail";
1798 AM->backup(\%myconfig, \%$form, $userspath);
1800 if ($form->{media} eq 'email') {
1801 $form->redirect($locale->text('Backup sent to').qq| $myconfig{email}|);
1804 $lxdebug->leave_sub();
1810 $lxdebug->enter_sub();
1813 $form->{title} = $locale->text('Audit Control');
1815 AM->closedto(\%myconfig, \%$form);
1817 if ($form->{revtrans}) {
1818 $checked{Y} = "checked";
1820 $checked{N} = "checked";
1828 <form method=post action=$form->{script}>
1830 <input type=hidden name=path value=$form->{path}>
1831 <input type=hidden name=login value=$form->{login}>
1832 <input type=hidden name=password value=$form->{password}>
1835 <tr><th class=listtop>$form->{title}</th></tr>
1836 <tr height="5"></tr>
1841 <td>|.$locale->text('Enforce transaction reversal for all dates').qq|</th>
1842 <td><input name=revtrans class=radio type=radio value="1" $checked{Y}> |.$locale->text('Yes').qq| <input name=revtrans class=radio type=radio value="0" $checked{N}> |.$locale->text('No').qq|</td>
1845 <th>|.$locale->text('Close Books up to').qq|</th>
1846 <td><input name=closedto size=11 title="$myconfig{dateformat}" value=$form->{closedto}></td>
1856 <input type=hidden name=nextsub value=doclose>
1858 <input type=submit class=submit name=action value="|.$locale->text('Continue').qq|">
1866 $lxdebug->leave_sub();
1871 $lxdebug->enter_sub();
1874 AM->closebooks(\%myconfig, \%$form);
1876 if ($form->{revtrans}) {
1877 $form->redirect($locale->text('Transaction reversal enforced for all dates'));
1879 if ($form->{closedto}) {
1880 $form->redirect($locale->text('Transaction reversal enforced up to')
1881 ." ".$locale->date(\%myconfig, $form->{closedto}, 1));
1883 $form->redirect($locale->text('Books are open'));
1887 $lxdebug->leave_sub();
1892 $lxdebug->enter_sub();
1895 $form->{title} = "Add";
1897 $form->{callback} = "$form->{script}?action=add_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback};
1902 $lxdebug->leave_sub();
1906 sub edit_warehouse {
1907 $lxdebug->enter_sub();
1910 $form->{title} = "Edit";
1912 AM->get_warehouse(\%myconfig, \%$form);
1917 $lxdebug->leave_sub();
1921 sub list_warehouse {
1922 $lxdebug->enter_sub();
1925 AM->warehouses(\%myconfig, \%$form);
1927 $form->{callback} = "$form->{script}?action=list_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1929 $callback = $form->escape($form->{callback});
1931 $form->{title} = $locale->text('Warehouses');
1933 @column_index = qw(description);
1935 $column_header{description} = qq|<th class=listheading width=100%>|.$locale->text('Description').qq|</th>|;
1944 <th class=listtop>$form->{title}</th>
1946 <tr height="5"></tr>
1950 <tr class=listheading>
1953 map { print "$column_header{$_}\n" } @column_index;
1959 foreach $ref (@{ $form->{ALL} }) {
1964 <tr valign=top class=listrow$i>
1967 $column_data{description} = 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>|;
1969 map { print "$column_data{$_}\n" } @column_index;
1981 <td><hr size=3 noshade></td>
1986 <form method=post action=$form->{script}>
1988 <input name=callback type=hidden value="$form->{callback}">
1990 <input type=hidden name=type value=warehouse>
1992 <input type=hidden name=path value=$form->{path}>
1993 <input type=hidden name=login value=$form->{login}>
1994 <input type=hidden name=password value=$form->{password}>
1996 <input class=submit type=submit name=action value="|.$locale->text('Add').qq|">|;
1998 if ($form->{menubar}) {
1999 require "$form->{path}/menu.pl";
2010 $lxdebug->leave_sub();
2014 sub warehouse_header {
2015 $lxdebug->enter_sub();
2018 $form->{title} = $locale->text("$form->{title} Warehouse");
2020 # $locale->text('Add Warehouse')
2021 # $locale->text('Edit Warehouse')
2023 $form->{description} =~ s/\"/"/g;
2025 if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
2026 $description = qq|<textarea name="description" rows=$rows cols=60 wrap=soft>$form->{description}</textarea>|;
2028 $description = qq|<input name=description size=60 value="$form->{description}">|;
2037 <form method=post action=$form->{script}>
2039 <input type=hidden name=id value=$form->{id}>
2040 <input type=hidden name=type value=warehouse>
2044 <th class=listtop colspan=2>$form->{title}</th>
2046 <tr height="5"></tr>
2048 <th align=right>|.$locale->text('Description').qq|</th>
2049 <td>$description</td>
2052 <td colspan=2><hr size=3 noshade></td>
2057 $lxdebug->leave_sub();
2061 sub save_warehouse {
2062 $lxdebug->enter_sub();
2065 $form->isblank("description", $locale->text('Description missing!'));
2066 AM->save_warehouse(\%myconfig, \%$form);
2067 $form->redirect($locale->text('Warehouse saved!'));
2069 $lxdebug->leave_sub();
2073 sub delete_warehouse {
2074 $lxdebug->enter_sub();
2077 AM->delete_warehouse(\%myconfig, \%$form);
2078 $form->redirect($locale->text('Warehouse deleted!'));
2080 $lxdebug->leave_sub();
2086 $lxdebug->enter_sub();
2089 &{ $form->{nextsub} };
2091 $lxdebug->leave_sub();