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 #======================================================================
43 sub add { &{"add_$form->{type}"} }
44 sub edit { &{"edit_$form->{type}"} }
45 sub save { &{"save_$form->{type}"} }
46 sub delete { &{"delete_$form->{type}"} }
49 $lxdebug->enter_sub();
51 $form->{title} = "Add";
52 $form->{charttype} = "A";
53 AM->get_account(\%myconfig, \%$form);
56 "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}"
57 unless $form->{callback};
62 $lxdebug->leave_sub();
66 $lxdebug->enter_sub();
68 $form->{title} = "Edit";
69 AM->get_account(\%myconfig, \%$form);
71 foreach my $item (split(/:/, $form->{link})) {
72 $form->{$item} = "checked";
78 $lxdebug->leave_sub();
82 $lxdebug->enter_sub();
84 $form->{title} = $locale->text("$form->{title} Account");
86 $checked{ $form->{charttype} } = "checked";
87 $checked{"$form->{category}_"} = "checked";
88 $checked{CT_tax} = ($form->{CT_tax}) ? "" : "checked";
90 $form->{description} =~ s/\"/"/g;
92 if (@{ $form->{TAXKEY} }) {
93 $form->{selecttaxkey} = "<option value=0>Keine Steuer 0%\n";
94 foreach $item (@{ $form->{TAXKEY} }) {
95 if ($item->{taxkey} == $form->{taxkey_id}) {
96 $form->{selecttaxkey} .=
97 "<option value=$item->{taxkey} selected>$item->{taxdescription}\n";
99 $form->{selecttaxkey} .=
100 "<option value=$item->{taxkey}>$item->{taxdescription}\n";
108 <th align=right>| . $locale->text('Steuersatz') . qq|</th>
109 <td><select name=taxkey_id>$form->{selecttaxkey}</select></td>
110 <input type=hidden name=selecttaxkey value="$form->{selecttaxkey}">
113 $form->{selectustva} = "<option>\n";
114 %ustva = (48 => "Steuerfrei, Zeile 48",
115 51 => "Steuerpflichtig 16%, Zeile 51",
116 86 => "Steuerpflichtig 7%, Zeile 86",
117 91 => "Steuerfrei, Zeile 91",
118 97 => "Steuerpflichtig 16%, Zeile 97",
119 93 => "Steuerpflichtig 7%, Zeile 93",
120 94 => "Steuerpflichtig 16%, Zeile 94",
121 66 => "Vorsteuer, Zeile 66");
122 foreach $item (sort({ $a <=> $b } keys %ustva)) {
123 if ($item == $form->{pos_ustva}) {
124 $form->{selectustva} .= "<option value=$item selected>$ustva{$item}\n";
126 $form->{selectustva} .= "<option value=$item>$ustva{$item}\n";
133 <th align=right>| . $locale->text('Umsatzsteuervoranmeldung') . qq|</th>
134 <td><select name=pos_ustva>$form->{selectustva}</select></td>
135 <input type=hidden name=selectustva value="$form->{selectustva}">
138 $form->{selecteur} = "<option>\n";
139 %eur = (1 => "Umsatzerlöse",
140 2 => "sonstige Erlöse",
141 3 => "Privatanteile",
143 5 => "Ausserordentliche Erträge",
144 6 => "Vereinnahmte Umsatzst.",
145 7 => "Umsatzsteuererstattungen",
146 8 => "Wareneingänge",
147 9 => "Löhne und Gehälter",
148 10 => "Gesetzl. sozialer Aufw.",
150 12 => "Gas, Strom, Wasser",
151 13 => "Instandhaltung",
152 14 => "Steuern, Versich., Beiträge",
154 16 => "Kfz-Versicherungen",
155 17 => "Sonst. Fahrtkosten",
156 18 => "Werbe- und Reisekosten",
157 19 => "Instandhaltung u. Werkzeuge",
158 20 => "Fachzeitschriften, Bücher",
159 21 => "Miete für Einrichtungen",
160 22 => "Rechts- und Beratungskosten",
161 23 => "Bürobedarf, Porto, Telefon",
162 24 => "Sonstige Aufwendungen",
163 25 => "Abschreibungen auf Anlagever.",
164 26 => "Abschreibungen auf GWG",
166 28 => "Umsatzsteuerzahlungen",
168 30 => "Ausserordentlicher Aufwand",
169 31 => "Betriebliche Steuern");
170 foreach $item (sort({ $a <=> $b } keys(%eur))) {
171 if ($item == $form->{pos_eur}) {
172 $form->{selecteur} .= "<option value=$item selected>$eur{$item}\n";
174 $form->{selecteur} .= "<option value=$item>$eur{$item}\n";
181 <th align=right>| . $locale->text('EÜR') . qq|</th>
182 <td><select name=pos_eur>$form->{selecteur}</select></td>
183 <input type=hidden name=selecteur value="$form->{selecteur}">
186 $form->{selectbwa} = "<option>\n";
188 %bwapos = (1 => 'Umsatzerlöse',
189 2 => 'Best.Verdg.FE/UE',
190 3 => 'Aktiv.Eigenleistung',
191 4 => 'Mat./Wareneinkauf',
192 5 => 'So.betr.Erlöse',
193 10 => 'Personalkosten',
195 12 => 'Betriebl.Steuern',
196 13 => 'Vers./Beiträge',
197 14 => 'Kfz.Kosten o.St.',
198 15 => 'Werbe-Reisek.',
199 16 => 'Kosten Warenabgabe',
200 17 => 'Abschreibungen',
201 18 => 'Rep./instandhlt.',
202 19 => 'Übrige Steuern',
203 20 => 'Sonst.Kosten',
205 31 => 'Sonst.neutr.Aufw.',
207 33 => 'Sonst.neutr.Ertrag',
208 34 => 'Verr.kalk.Kosten',
209 35 => 'Steuern Eink.u.Ertr.');
210 foreach $item (sort({ $a <=> $b } keys %bwapos)) {
211 if ($item == $form->{pos_bwa}) {
212 $form->{selectbwa} .= "<option value=$item selected>$bwapos{$item}\n";
214 $form->{selectbwa} .= "<option value=$item>$bwapos{$item}\n";
221 <th align=right>| . $locale->text('BWA') . qq|</th>
222 <td><select name=pos_bwa>$form->{selectbwa}</select></td>
223 <input type=hidden name=selectbwa value="$form->{selectbwa}">
226 $form->{selectbilanz} = "<option>\n";
227 foreach $item ((1, 2, 3, 4)) {
228 if ($item == $form->{pos_bilanz}) {
229 $form->{selectbilanz} .= "<option value=$item selected>$item\n";
231 $form->{selectbilanz} .= "<option value=$item>$item\n";
238 <th align=right>| . $locale->text('Bilanz') . qq|</th>
239 <td><select name=pos_bilanz>$form->{selectbilanz}</select></td>
240 <input type=hidden name=selectbilanz value="$form->{selectbilanz}">
243 # this is for our parser only!
244 # type=submit $locale->text('Add Account')
245 # type=submit $locale->text('Edit Account')
252 <form method=post action=$form->{script}>
254 <input type=hidden name=id value=$form->{id}>
255 <input type=hidden name=type value=account>
257 <input type=hidden name=inventory_accno_id value=$form->{inventory_accno_id}>
258 <input type=hidden name=income_accno_id value=$form->{income_accno_id}>
259 <input type=hidden name=expense_accno_id value=$form->{expense_accno_id}>
260 <input type=hidden name=fxgain_accno_id values=$form->{fxgain_accno_id}>
261 <input type=hidden name=fxloss_accno_id values=$form->{fxloss_accno_id}>
263 <table border=0 width=100%>
265 <th class=listtop>$form->{title}</th>
272 <th align=right>| . $locale->text('Account Number') . qq|</th>
273 <td><input name=accno size=20 value=$form->{accno}></td>
276 <th align=right>| . $locale->text('Description') . qq|</th>
277 <td><input name=description size=40 value="$form->{description}"></td>
280 <th align=right>| . $locale->text('Account Type') . qq|</th>
284 <td><input name=category type=radio class=radio value=A $checked{A_}> |
285 . $locale->text('Asset')
287 <input name=category type=radio class=radio value=L $checked{L_}> |
288 . $locale->text('Liability')
290 <input name=category type=radio class=radio value=Q $checked{Q_}> |
291 . $locale->text('Equity')
293 <input name=category type=radio class=radio value=I $checked{I_}> |
294 . $locale->text('Revenue')
296 <input name=category type=radio class=radio value=E $checked{E_}> |
297 . $locale->text('Expense')
299 <td width=50> </td>
301 <input name=charttype type=radio class=radio value="H" $checked{H}> |
302 . $locale->text('Heading') . qq|<br>
303 <input name=charttype type=radio class=radio value="A" $checked{A}> |
304 . $locale->text('Account')
312 if ($form->{charttype} eq "A") {
319 . $locale->text('Is this a summary account to record')
322 <input name=AR type=checkbox class=checkbox value=AR $form->{AR}> |
323 . $locale->text('AR')
324 . qq| <input name=AP type=checkbox class=checkbox value=AP $form->{AP}> |
325 . $locale->text('AP')
326 . qq| <input name=IC type=checkbox class=checkbox value=IC $form->{IC}> |
327 . $locale->text('Inventory')
334 <th colspan=2>| . $locale->text('Include in drop-down menus') . qq|</th>
340 <th align=left>| . $locale->text('Receivables') . qq|</th>
341 <th align=left>| . $locale->text('Payables') . qq|</th>
342 <th align=left>| . $locale->text('Parts Inventory') . qq|</th>
343 <th align=left>| . $locale->text('Service Items') . qq|</th>
347 <input name=AR_amount type=checkbox class=checkbox value=AR_amount $form->{AR_amount}> |
348 . $locale->text('Revenue')
350 <input name=AR_paid type=checkbox class=checkbox value=AR_paid $form->{AR_paid}> |
351 . $locale->text('Receipt')
353 <input name=AR_tax type=checkbox class=checkbox value=AR_tax $form->{AR_tax}> |
354 . $locale->text('Tax') . qq|
357 <input name=AP_amount type=checkbox class=checkbox value=AP_amount $form->{AP_amount}> |
358 . $locale->text('Expense/Asset')
360 <input name=AP_paid type=checkbox class=checkbox value=AP_paid $form->{AP_paid}> |
361 . $locale->text('Payment')
363 <input name=AP_tax type=checkbox class=checkbox value=AP_tax $form->{AP_tax}> |
364 . $locale->text('Tax') . qq|
367 <input name=IC_sale type=checkbox class=checkbox value=IC_sale $form->{IC_sale}> |
368 . $locale->text('Revenue')
370 <input name=IC_cogs type=checkbox class=checkbox value=IC_cogs $form->{IC_cogs}> |
371 . $locale->text('COGS')
373 <input name=IC_taxpart type=checkbox class=checkbox value=IC_taxpart $form->{IC_taxpart}> |
374 . $locale->text('Tax') . qq|
377 <input name=IC_income type=checkbox class=checkbox value=IC_income $form->{IC_income}> |
378 . $locale->text('Revenue')
380 <input name=IC_expense type=checkbox class=checkbox value=IC_expense $form->{IC_expense}> |
381 . $locale->text('Expense')
383 <input name=IC_taxservice type=checkbox class=checkbox value=IC_taxservice $form->{IC_taxservice}> |
384 . $locale->text('Tax') . qq|
403 <td><hr size=3 noshade></td>
408 $lxdebug->leave_sub();
412 $lxdebug->enter_sub();
416 <input name=callback type=hidden value="$form->{callback}">
418 <input type=hidden name=path value=$form->{path}>
419 <input type=hidden name=login value=$form->{login}>
420 <input type=hidden name=password value=$form->{password}>
423 <input type=submit class=submit name=action value="|
424 . $locale->text('Save') . qq|">
427 if ($form->{id} && $form->{orphaned}) {
428 print qq|<input type=submit class=submit name=action value="|
429 . $locale->text('Delete') . qq|">|;
432 if ($form->{menubar}) {
433 require "$form->{path}/menu.pl";
444 $lxdebug->leave_sub();
448 $lxdebug->enter_sub();
450 $form->isblank("accno", $locale->text('Account Number missing!'));
451 $form->isblank("category", $locale->text('Account Type missing!'));
453 $form->redirect($locale->text('Account saved!'))
454 if (AM->save_account(\%myconfig, \%$form));
455 $form->error($locale->text('Cannot save account!'));
457 $lxdebug->leave_sub();
461 $lxdebug->enter_sub();
463 CA->all_accounts(\%myconfig, \%$form);
465 $form->{title} = $locale->text('Chart of Accounts');
469 "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}";
471 @column_index = qw(accno gifi_accno description debit credit link);
473 $column_header{accno} = qq|<th>| . $locale->text('Account') . qq|</a></th>|;
474 $column_header{gifi_accno} =
475 qq|<th>| . $locale->text('GIFI') . qq|</a></th>|;
476 $column_header{description} =
477 qq|<th>| . $locale->text('Description') . qq|</a></th>|;
478 $column_header{debit} = qq|<th>| . $locale->text('Debit') . qq|</a></th>|;
479 $column_header{credit} = qq|<th>| . $locale->text('Credit') . qq|</a></th>|;
480 $column_header{link} = qq|<th>| . $locale->text('Link') . qq|</a></th>|;
483 $colspan = $#column_index + 1;
490 <th class=listtop colspan=$colspan>$form->{title}</th>
493 <tr class=listheading>
496 map { print "$column_header{$_}\n" } @column_index;
503 $callback = $form->escape($callback);
505 foreach $ca (@{ $form->{CA} }) {
507 $ca->{debit} = " ";
508 $ca->{credit} = " ";
510 if ($ca->{amount} > 0) {
512 $form->format_amount(\%myconfig, $ca->{amount}, 2, " ");
514 if ($ca->{amount} < 0) {
516 $form->format_amount(\%myconfig, -$ca->{amount}, 2, " ");
519 $ca->{link} =~ s/:/<br>/og;
521 if ($ca->{charttype} eq "H") {
522 print qq|<tr class=listheading>|;
524 $column_data{accno} =
525 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>|;
526 $column_data{gifi_accno} =
527 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>|;
528 $column_data{description} = qq|<th>$ca->{description} </th>|;
529 $column_data{debit} = qq|<th> </th>|;
530 $column_data{credit} = qq| <th> </th>|;
531 $column_data{link} = qq|<th> </th>|;
537 <tr valign=top class=listrow$i>|;
538 $column_data{accno} =
539 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>|;
540 $column_data{gifi_accno} =
541 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>|;
542 $column_data{description} = qq|<td>$ca->{description} </td>|;
543 $column_data{debit} = qq|<td align=right>$ca->{debit}</td>|;
544 $column_data{credit} = qq|<td align=right>$ca->{credit}</td>|;
545 $column_data{link} = qq|<td>$ca->{link} </td>|;
549 map { print "$column_data{$_}\n" } @column_index;
555 <tr><td colspan=$colspan><hr size=3 noshade></td></tr>
562 $lxdebug->leave_sub();
566 $lxdebug->enter_sub();
568 $form->{title} = $locale->text('Delete Account');
571 qw(inventory_accno_id income_accno_id expense_accno_id fxgain_accno_id fxloss_accno_id)
573 if ($form->{id} == $form->{$id}) {
574 $form->error($locale->text('Cannot delete default account!'));
578 $form->redirect($locale->text('Account deleted!'))
579 if (AM->delete_account(\%myconfig, \%$form));
580 $form->error($locale->text('Cannot delete account!'));
582 $lxdebug->leave_sub();
586 $lxdebug->enter_sub();
588 @{ $form->{fields} } = (accno, description);
589 $form->{table} = "gifi";
590 $form->{sortorder} = "accno";
592 AM->gifi_accounts(\%myconfig, \%$form);
594 $form->{title} = $locale->text('GIFI');
598 "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
600 @column_index = qw(accno description);
602 $column_header{accno} = qq|<th>| . $locale->text('GIFI') . qq|</a></th>|;
603 $column_header{description} =
604 qq|<th>| . $locale->text('Description') . qq|</a></th>|;
607 $colspan = $#column_index + 1;
614 <th class=listtop colspan=$colspan>$form->{title}</th>
617 <tr class=listheading>
620 map { print "$column_header{$_}\n" } @column_index;
627 $callback = $form->escape($callback);
629 foreach $ca (@{ $form->{ALL} }) {
635 <tr valign=top class=listrow$i>|;
637 $column_data{accno} =
638 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>|;
639 $column_data{description} = qq|<td>$ca->{description} </td>|;
641 map { print "$column_data{$_}\n" } @column_index;
648 <td colspan=$colspan><hr size=3 noshade></td>
656 $lxdebug->leave_sub();
660 $lxdebug->enter_sub();
662 $form->{title} = "Add";
666 "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
673 $lxdebug->leave_sub();
677 $lxdebug->enter_sub();
679 $form->{title} = "Edit";
681 AM->get_gifi(\%myconfig, \%$form);
686 $lxdebug->leave_sub();
690 $lxdebug->enter_sub();
692 $form->{title} = $locale->text("$form->{title} GIFI");
694 # $locale->text('Add GIFI')
695 # $locale->text('Edit GIFI')
697 $form->{description} =~ s/\"/"/g;
704 <form method=post action=$form->{script}>
706 <input type=hidden name=id value=$form->{accno}>
707 <input type=hidden name=type value=gifi>
711 <th class=listtop>$form->{title}</th>
718 <th align=right>| . $locale->text('GIFI') . qq|</th>
719 <td><input name=accno size=20 value=$form->{accno}></td>
722 <th align=right>| . $locale->text('Description') . qq|</th>
723 <td><input name=description size=60 value="$form->{description}"></td>
729 <td colspan=2><hr size=3 noshade></td>
734 $lxdebug->leave_sub();
738 $lxdebug->enter_sub();
742 <input name=callback type=hidden value="$form->{callback}">
744 <input type=hidden name=path value=$form->{path}>
745 <input type=hidden name=login value=$form->{login}>
746 <input type=hidden name=password value=$form->{password}>
748 <br><input type=submit class=submit name=action value="|
749 . $locale->text('Save') . qq|">|;
753 <input type=submit class=submit name=action value="|
754 . $locale->text('Copy to COA') . qq|">
757 if ($form->{accno} && $form->{orphaned}) {
758 print qq|<input type=submit class=submit name=action value="|
759 . $locale->text('Delete') . qq|">|;
763 if ($form->{menubar}) {
764 require "$form->{path}/menu.pl";
775 $lxdebug->leave_sub();
779 $lxdebug->enter_sub();
781 $form->isblank("accno", $locale->text('GIFI missing!'));
782 AM->save_gifi(\%myconfig, \%$form);
783 $form->redirect($locale->text('GIFI saved!'));
785 $lxdebug->leave_sub();
789 $lxdebug->enter_sub();
791 $form->isblank("accno", $locale->text('GIFI missing!'));
793 AM->save_gifi(\%myconfig, \%$form);
796 $form->{gifi_accno} = $form->{accno};
797 $form->{title} = "Add";
798 $form->{charttype} = "A";
803 $lxdebug->leave_sub();
807 $lxdebug->enter_sub();
809 AM->delete_gifi(\%myconfig, \%$form);
810 $form->redirect($locale->text('GIFI deleted!'));
812 $lxdebug->leave_sub();
816 $lxdebug->enter_sub();
818 $form->{title} = "Add";
822 "$form->{script}?action=add_department&path=$form->{path}&login=$form->{login}&password=$form->{password}"
823 unless $form->{callback};
828 $lxdebug->leave_sub();
831 sub edit_department {
832 $lxdebug->enter_sub();
834 $form->{title} = "Edit";
836 AM->get_department(\%myconfig, \%$form);
841 $lxdebug->leave_sub();
844 sub list_department {
845 $lxdebug->enter_sub();
847 AM->departments(\%myconfig, \%$form);
850 "$form->{script}?action=list_department&path=$form->{path}&login=$form->{login}&password=$form->{password}";
852 $callback = $form->escape($form->{callback});
854 $form->{title} = $locale->text('Departments');
856 @column_index = qw(description cost profit);
858 $column_header{description} =
859 qq|<th class=listheading width=90%>|
860 . $locale->text('Description')
862 $column_header{cost} =
863 qq|<th class=listheading nowrap>|
864 . $locale->text('Cost Center')
866 $column_header{profit} =
867 qq|<th class=listheading nowrap>|
868 . $locale->text('Profit Center')
878 <th class=listtop>$form->{title}</th>
884 <tr class=listheading>
887 map { print "$column_header{$_}\n" } @column_index;
893 foreach $ref (@{ $form->{ALL} }) {
899 <tr valign=top class=listrow$i>
902 $costcenter = ($ref->{role} eq "C") ? "X" : "";
903 $profitcenter = ($ref->{role} eq "P") ? "X" : "";
905 $column_data{description} =
906 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>|;
907 $column_data{cost} = qq|<td align=center>$costcenter</td>|;
908 $column_data{profit} = qq|<td align=center>$profitcenter</td>|;
910 map { print "$column_data{$_}\n" } @column_index;
922 <td><hr size=3 noshade></td>
927 <form method=post action=$form->{script}>
929 <input name=callback type=hidden value="$form->{callback}">
931 <input type=hidden name=type value=department>
933 <input type=hidden name=path value=$form->{path}>
934 <input type=hidden name=login value=$form->{login}>
935 <input type=hidden name=password value=$form->{password}>
937 <input class=submit type=submit name=action value="|
938 . $locale->text('Add') . qq|">|;
940 if ($form->{menubar}) {
941 require "$form->{path}/menu.pl";
952 $lxdebug->leave_sub();
955 sub department_header {
956 $lxdebug->enter_sub();
958 $form->{title} = $locale->text("$form->{title} Department");
960 # $locale->text('Add Department')
961 # $locale->text('Edit Department')
963 $form->{description} =~ s/\"/"/g;
965 if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
967 qq|<textarea name="description" rows=$rows cols=60 wrap=soft>$form->{description}</textarea>|;
970 qq|<input name=description size=60 value="$form->{description}">|;
973 $costcenter = "checked" if $form->{role} eq "C";
974 $profitcenter = "checked" if $form->{role} eq "P";
981 <form method=post action=$form->{script}>
983 <input type=hidden name=id value=$form->{id}>
984 <input type=hidden name=type value=department>
988 <th class=listtop colspan=2>$form->{title}</th>
992 <th align=right>| . $locale->text('Description') . qq|</th>
993 <td>$description</td>
997 <td><input type=radio style=radio name=role value="C" $costcenter> |
998 . $locale->text('Cost Center') . qq|
999 <input type=radio style=radio name=role value="P" $profitcenter> |
1000 . $locale->text('Profit Center') . qq|
1003 <td colspan=2><hr size=3 noshade></td>
1008 $lxdebug->leave_sub();
1011 sub save_department {
1012 $lxdebug->enter_sub();
1014 $form->isblank("description", $locale->text('Description missing!'));
1015 AM->save_department(\%myconfig, \%$form);
1016 $form->redirect($locale->text('Department saved!'));
1018 $lxdebug->leave_sub();
1021 sub delete_department {
1022 $lxdebug->enter_sub();
1024 AM->delete_department(\%myconfig, \%$form);
1025 $form->redirect($locale->text('Department deleted!'));
1027 $lxdebug->leave_sub();
1031 $lxdebug->enter_sub();
1033 $form->{title} = "Add";
1036 "$form->{script}?action=add_business&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1037 unless $form->{callback};
1042 $lxdebug->leave_sub();
1046 $lxdebug->enter_sub();
1048 $form->{title} = "Edit";
1050 AM->get_business(\%myconfig, \%$form);
1054 $form->{orphaned} = 1;
1057 $lxdebug->leave_sub();
1061 $lxdebug->enter_sub();
1063 AM->business(\%myconfig, \%$form);
1066 "$form->{script}?action=list_business&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1068 $callback = $form->escape($form->{callback});
1070 $form->{title} = $locale->text('Type of Business');
1072 @column_index = qw(description discount customernumberinit);
1074 $column_header{description} =
1075 qq|<th class=listheading width=60%>|
1076 . $locale->text('Description')
1078 $column_header{discount} =
1079 qq|<th class=listheading width=10%>|
1080 . $locale->text('Discount')
1082 $column_header{customernumberinit} =
1083 qq|<th class=listheading>|
1084 . $locale->text('Customernumberinit')
1094 <th class=listtop>$form->{title}</th>
1096 <tr height="5"></tr>
1100 <tr class=listheading>
1103 map { print "$column_header{$_}\n" } @column_index;
1109 foreach $ref (@{ $form->{ALL} }) {
1115 <tr valign=top class=listrow$i>
1119 $form->format_amount(\%myconfig, $ref->{discount} * 100, 1, " ");
1122 ? "<b>$ref->{description}</b>"
1123 : "$ref->{description}";
1124 $column_data{description} =
1125 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>|;
1126 $column_data{discount} = qq|<td align=right>$discount</td>|;
1127 $column_data{customernumberinit} =
1128 qq|<td align=right>$ref->{customernumberinit}</td>|;
1130 map { print "$column_data{$_}\n" } @column_index;
1142 <td><hr size=3 noshade></td>
1147 <form method=post action=$form->{script}>
1149 <input name=callback type=hidden value="$form->{callback}">
1151 <input type=hidden name=type value=business>
1153 <input type=hidden name=path value=$form->{path}>
1154 <input type=hidden name=login value=$form->{login}>
1155 <input type=hidden name=password value=$form->{password}>
1157 <input class=submit type=submit name=action value="|
1158 . $locale->text('Add') . qq|">|;
1160 if ($form->{menubar}) {
1161 require "$form->{path}/menu.pl";
1173 $lxdebug->leave_sub();
1176 sub business_header {
1177 $lxdebug->enter_sub();
1179 $form->{title} = $locale->text("$form->{title} Business");
1180 $form->{salesman} = "checked" if $form->{salesman};
1182 # $locale->text('Add Business')
1183 # $locale->text('Edit Business')
1185 $form->{description} =~ s/\"/"/g;
1187 $form->format_amount(\%myconfig, $form->{discount} * 100);
1194 <form method=post action=$form->{script}>
1196 <input type=hidden name=id value=$form->{id}>
1197 <input type=hidden name=type value=business>
1201 <th class=listtop colspan=2>$form->{title}</th>
1203 <tr height="5"></tr>
1205 <th align=right>| . $locale->text('Type of Business') . qq|</th>
1206 <td><input name=description size=30 value="$form->{description}"></td>
1209 <th align=right>| . $locale->text('Discount') . qq| %</th>
1210 <td><input name=discount size=5 value=$form->{discount}></td>
1213 <th align=right>| . $locale->text('Customernumberinit') . qq|</th>
1214 <td><input name=customernumberinit size=10 value=$form->{customernumberinit}></td>
1217 <td align=right>| . $locale->text('Salesman') . qq|</td>
1218 <td><input name=salesman class=checkbox type=checkbox value=1 $form->{salesman}></td>
1220 <td colspan=2><hr size=3 noshade></td>
1225 $lxdebug->leave_sub();
1229 $lxdebug->enter_sub();
1231 $form->isblank("description", $locale->text('Description missing!'));
1232 AM->save_business(\%myconfig, \%$form);
1233 $form->redirect($locale->text('Business saved!'));
1235 $lxdebug->leave_sub();
1238 sub delete_business {
1239 $lxdebug->enter_sub();
1241 AM->delete_business(\%myconfig, \%$form);
1242 $form->redirect($locale->text('Business deleted!'));
1244 $lxdebug->leave_sub();
1248 $lxdebug->enter_sub();
1250 $form->{title} = "Add";
1253 "$form->{script}?action=add_sic&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1254 unless $form->{callback};
1259 $lxdebug->leave_sub();
1263 $lxdebug->enter_sub();
1265 $form->{title} = "Edit";
1267 AM->get_sic(\%myconfig, \%$form);
1271 $form->{orphaned} = 1;
1274 $lxdebug->leave_sub();
1278 $lxdebug->enter_sub();
1280 AM->sic(\%myconfig, \%$form);
1283 "$form->{script}?action=list_sic&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1285 $callback = $form->escape($form->{callback});
1287 $form->{title} = $locale->text('Standard Industrial Codes');
1289 @column_index = qw(code description);
1291 $column_header{code} =
1292 qq|<th class=listheading>| . $locale->text('Code') . qq|</th>|;
1293 $column_header{description} =
1294 qq|<th class=listheading>| . $locale->text('Description') . qq|</th>|;
1303 <th class=listtop>$form->{title}</th>
1305 <tr height="5"></tr>
1309 <tr class=listheading>
1312 map { print "$column_header{$_}\n" } @column_index;
1318 foreach $ref (@{ $form->{ALL} }) {
1323 if ($ref->{sictype} eq 'H') {
1325 <tr valign=top class=listheading>
1327 $column_data{code} =
1328 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>|;
1329 $column_data{description} = qq|<th>$ref->{description}</th>|;
1333 <tr valign=top class=listrow$i>
1336 $column_data{code} =
1337 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>|;
1338 $column_data{description} = qq|<td>$ref->{description}</td>|;
1342 map { print "$column_data{$_}\n" } @column_index;
1354 <td><hr size=3 noshade></td>
1359 <form method=post action=$form->{script}>
1361 <input name=callback type=hidden value="$form->{callback}">
1363 <input type=hidden name=type value=sic>
1365 <input type=hidden name=path value=$form->{path}>
1366 <input type=hidden name=login value=$form->{login}>
1367 <input type=hidden name=password value=$form->{password}>
1369 <input class=submit type=submit name=action value="|
1370 . $locale->text('Add') . qq|">|;
1372 if ($form->{menubar}) {
1373 require "$form->{path}/menu.pl";
1384 $lxdebug->leave_sub();
1388 $lxdebug->enter_sub();
1390 $form->{title} = $locale->text("$form->{title} SIC");
1392 # $locale->text('Add SIC')
1393 # $locale->text('Edit SIC')
1395 $form->{code} =~ s/\"/"/g;
1396 $form->{description} =~ s/\"/"/g;
1398 $checked = ($form->{sictype} eq 'H') ? "checked" : "";
1405 <form method=post action=$form->{script}>
1407 <input type=hidden name=type value=sic>
1408 <input type=hidden name=id value=$form->{code}>
1412 <th class=listtop colspan=2>$form->{title}</th>
1414 <tr height="5"></tr>
1416 <th align=right>| . $locale->text('Code') . qq|</th>
1417 <td><input name=code size=10 value=$form->{code}></td>
1421 <th align=left><input name=sictype type=checkbox style=checkbox value="H" $checked> |
1422 . $locale->text('Heading')
1426 <th align=right>| . $locale->text('Description') . qq|</th>
1427 <td><input name=description size=60 value="$form->{description}"></td>
1429 <td colspan=2><hr size=3 noshade></td>
1434 $lxdebug->leave_sub();
1438 $lxdebug->enter_sub();
1440 $form->isblank("code", $locale->text('Code missing!'));
1441 $form->isblank("description", $locale->text('Description missing!'));
1442 AM->save_sic(\%myconfig, \%$form);
1443 $form->redirect($locale->text('SIC saved!'));
1445 $lxdebug->leave_sub();
1449 $lxdebug->enter_sub();
1451 AM->delete_sic(\%myconfig, \%$form);
1452 $form->redirect($locale->text('SIC deleted!'));
1454 $lxdebug->leave_sub();
1457 sub display_stylesheet {
1458 $lxdebug->enter_sub();
1460 $form->{file} = "css/$myconfig{stylesheet}";
1463 $lxdebug->leave_sub();
1467 $lxdebug->enter_sub();
1469 $form->{file} =~ s/^(.:)*?\/|\.\.\///g;
1470 $form->{file} =~ s/^\/*//g;
1471 $form->{file} =~ s/$userspath//;
1473 $form->error("$!: $form->{file}") unless -f $form->{file};
1475 AM->load_template(\%$form);
1477 $form->{title} = $form->{file};
1479 # if it is anything but html
1480 if ($form->{file} !~ /\.html$/) {
1481 $form->{body} = "<pre>\n$form->{body}\n</pre>";
1491 <form method=post action=$form->{script}>
1493 <input name=file type=hidden value=$form->{file}>
1494 <input name=type type=hidden value=template>
1496 <input type=hidden name=path value=$form->{path}>
1497 <input type=hidden name=login value=$form->{login}>
1498 <input type=hidden name=password value=$form->{password}>
1500 <input name=action type=submit class=submit value="|
1501 . $locale->text('Edit') . qq|">|;
1503 if ($form->{menubar}) {
1504 require "$form->{path}/menu.pl";
1515 $lxdebug->leave_sub();
1519 $lxdebug->enter_sub();
1521 AM->load_template(\%$form);
1523 $form->{title} = $locale->text('Edit Template');
1525 # convert   to &nbsp;
1526 $form->{body} =~ s/ /&nbsp;/gi;
1533 <form method=post action=$form->{script}>
1535 <input name=file type=hidden value=$form->{file}>
1536 <input name=type type=hidden value=template>
1538 <input type=hidden name=path value=$form->{path}>
1539 <input type=hidden name=login value=$form->{login}>
1540 <input type=hidden name=password value=$form->{password}>
1542 <input name=callback type=hidden value="$form->{script}?action=display_form&file=$form->{file}&path=$form->{path}&login=$form->{login}&password=$form->{password}">
1544 <textarea name=body rows=25 cols=70>
1549 <input type=submit class=submit name=action value="|
1550 . $locale->text('Save') . qq|">|;
1552 if ($form->{menubar}) {
1553 require "$form->{path}/menu.pl";
1565 $lxdebug->leave_sub();
1569 $lxdebug->enter_sub();
1571 AM->save_template(\%$form);
1572 $form->redirect($locale->text('Template saved!'));
1574 $lxdebug->leave_sub();
1578 $lxdebug->enter_sub();
1580 # get defaults for account numbers and last numbers
1581 AM->defaultaccounts(\%myconfig, \%$form);
1583 foreach $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
1585 ($item eq $myconfig{dateformat})
1586 ? "<option selected>$item\n"
1587 : "<option>$item\n";
1590 foreach $item (qw(1,000.00 1000.00 1.000,00 1000,00)) {
1592 ($item eq $myconfig{numberformat})
1593 ? "<option selected>$item\n"
1594 : "<option>$item\n";
1597 foreach $item (qw(name company address signature)) {
1598 $myconfig{$item} =~ s/\"/"/g;
1601 foreach $item (qw(address signature)) {
1602 $myconfig{$item} =~ s/\\n/\r\n/g;
1605 %countrycodes = User->country_codes;
1607 foreach $key (sort { $countrycodes{$a} cmp $countrycodes{$b} }
1608 keys %countrycodes) {
1610 ($myconfig{countrycode} eq $key)
1611 ? "<option selected value=$key>$countrycodes{$key}\n"
1612 : "<option value=$key>$countrycodes{$key}\n";
1614 $countrycodes = "<option>American English\n$countrycodes";
1616 foreach $key (keys %{ $form->{IC} }) {
1617 foreach $accno (sort keys %{ $form->{IC}{$key} }) {
1619 ($form->{IC}{$key}{$accno}{id} == $form->{defaults}{$key})
1620 ? "<option selected>$accno--$form->{IC}{$key}{$accno}{description}\n"
1621 : "<option>$accno--$form->{IC}{$key}{$accno}{description}\n";
1625 opendir CSS, "css/.";
1626 @all = grep /.*\.css$/, readdir CSS;
1629 foreach $item (@all) {
1630 if ($item eq $myconfig{stylesheet}) {
1631 $selectstylesheet .= qq|<option selected>$item\n|;
1633 $selectstylesheet .= qq|<option>$item\n|;
1636 $selectstylesheet .= "<option>\n";
1638 $form->{title} = $locale->text('Edit Preferences for') . qq| $form->{login}|;
1645 <form method=post action=$form->{script}>
1647 <input type=hidden name=old_password value=$myconfig{password}>
1648 <input type=hidden name=type value=preferences>
1649 <input type=hidden name=role value=$myconfig{role}>
1652 <tr><th class=listtop>$form->{title}</th></tr>
1657 <th align=right>| . $locale->text('Name') . qq|</th>
1658 <td><input name=name size=15 value="$myconfig{name}"></td>
1661 <th align=right>| . $locale->text('Password') . qq|</th>
1662 <td><input type=password name=new_password size=10 value=$myconfig{password}></td>
1665 <th align=right>| . $locale->text('E-mail') . qq|</th>
1666 <td><input name=email size=30 value="$myconfig{email}"></td>
1669 <th align=right>| . $locale->text('Signature') . qq|</th>
1670 <td><textarea name=signature rows=3 cols=50>$myconfig{signature}</textarea></td>
1673 <th align=right>| . $locale->text('Phone') . qq|</th>
1674 <td><input name=tel size=14 value="$myconfig{tel}"></td>
1677 <th align=right>| . $locale->text('Fax') . qq|</th>
1678 <td><input name=fax size=14 value="$myconfig{fax}"></td>
1681 <th align=right>| . $locale->text('Company') . qq|</th>
1682 <td><input name=company size=30 value="$myconfig{company}"></td>
1685 <th align=right>| . $locale->text('Address') . qq|</th>
1686 <td><textarea name=address rows=4 cols=50>$myconfig{address}</textarea></td>
1689 <th align=right>| . $locale->text('Date Format') . qq|</th>
1690 <td><select name=dateformat>$dateformat</select></td>
1693 <th align=right>| . $locale->text('Number Format') . qq|</th>
1694 <td><select name=numberformat>$numberformat</select></td>
1697 <th align=right>| . $locale->text('Dropdown Limit') . qq|</th>
1698 <td><input name=vclimit size=10 value="$myconfig{vclimit}"></td>
1701 <th align=right>| . $locale->text('Language') . qq|</th>
1702 <td><select name=countrycode>$countrycodes</select></td>
1705 <th align=right>| . $locale->text('Character Set') . qq|</th>
1706 <td><input name=charset size=20 value="$myconfig{charset}"></td>
1709 <th align=right>| . $locale->text('Stylesheet') . qq|</th>
1710 <td><select name=usestylesheet>$selectstylesheet</select></td>
1712 <input name=printer type=hidden value="$myconfig{printer}">
1713 <tr class=listheading>
1714 <th colspan=2> </th>
1717 <th align=right>| . $locale->text('Business Number') . qq|</th>
1718 <td><input name=businessnumber size=25 value="$myconfig{businessnumber}"></td>
1724 <th align=right>| . $locale->text('Year End') . qq| (mm/dd)</th>
1725 <td><input name=yearend size=5 value=$form->{defaults}{yearend}></td>
1726 <th align=right>| . $locale->text('Weight Unit') . qq|</th>
1727 <td><input name=weightunit size=5 value="$form->{defaults}{weightunit}"></td>
1732 <tr class=listheading>
1734 . $locale->text('Last Numbers & Default Accounts')
1741 <th align=right nowrap>| . $locale->text('Inventory Account') . qq|</th>
1742 <td><select name=inventory_accno>$myconfig{IC}</select></td>
1745 <th align=right nowrap>| . $locale->text('Revenue Account') . qq|</th>
1746 <td><select name=income_accno>$myconfig{IC_income}</select></td>
1749 <th align=right nowrap>| . $locale->text('Expense Account') . qq|</th>
1750 <td><select name=expense_accno>$myconfig{IC_expense}</select></td>
1753 <th align=right nowrap>| . $locale->text('Foreign Exchange Gain') . qq|</th>
1754 <td><select name=fxgain_accno>$myconfig{FX_gain}</select></td>
1757 <th align=right nowrap>| . $locale->text('Foreign Exchange Loss') . qq|</th>
1758 <td><select name=fxloss_accno>$myconfig{FX_loss}</select></td>
1762 . $locale->text('Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies')
1763 . qq|<br><input name=curr size=40 value="$form->{defaults}{curr}"></td>
1772 <th align=right nowrap>| . $locale->text('Last Invoice Number') . qq|</th>
1773 <td><input name=invnumber size=10 value=$form->{defaults}{invnumber}></td>
1774 <th align=right nowrap>|
1775 . $locale->text('Last Customer Number')
1777 <td><input name=customernumber size=10 value=$form->{defaults}{customernumber}></td>
1780 <th align=right nowrap>|
1781 . $locale->text('Last Sales Order Number')
1783 <td><input name=sonumber size=10 value=$form->{defaults}{sonumber}></td>
1784 <th align=right nowrap>|
1785 . $locale->text('Last Vendor Number')
1787 <td><input name=vendornumber size=10 value=$form->{defaults}{vendornumber}></td>
1790 <th align=right nowrap>|
1791 . $locale->text('Last Purchase Order Number')
1793 <td><input name=ponumber size=10 value=$form->{defaults}{ponumber}></td>
1794 <th align=right nowrap>|
1795 . $locale->text('Last Article Number')
1797 <td><input name=articlenumber size=10 value=$form->{defaults}{articlenumber}></td>
1800 <th align=right nowrap>|
1801 . $locale->text('Last Sales Quotation Number')
1803 <td><input name=sqnumber size=10 value=$form->{defaults}{sqnumber}></td>
1804 <th align=right nowrap>|
1805 . $locale->text('Last Service Number')
1807 <td><input name=servicenumber size=10 value=$form->{defaults}{servicenumber}></td>
1810 <th align=right nowrap>| . $locale->text('Last RFQ Number') . qq|</th>
1811 <td><input name=rfqnumber size=10 value=$form->{defaults}{rfqnumber}></td>
1812 <th align=right nowrap></th>
1818 <tr class=listheading>
1819 <th colspan=2>| . $locale->text('Tax Accounts') . qq|</th>
1826 <th>| . $locale->text('Rate') . qq| (%)</th>
1827 <th>| . $locale->text('Number') . qq|</th>
1831 foreach $accno (sort keys %{ $form->{taxrates} }) {
1834 <th align=right>$form->{taxrates}{$accno}{description}</th>
1835 <td><input name=$form->{taxrates}{$accno}{id} size=6 value=$form->{taxrates}{$accno}{rate}></td>
1836 <td><input name="taxnumber_$form->{taxrates}{$accno}{id}" value="$form->{taxrates}{$accno}{taxnumber}"></td>
1839 $form->{taxaccounts} .= "$form->{taxrates}{$accno}{id} ";
1842 chop $form->{taxaccounts};
1845 <input name=taxaccounts type=hidden value="$form->{taxaccounts}">
1854 <td><hr size=3 noshade></td>
1858 <input type=hidden name=path value=$form->{path}>
1859 <input type=hidden name=login value=$form->{login}>
1860 <input type=hidden name=password value=$form->{password}>
1863 <input type=submit class=submit name=action value="|
1864 . $locale->text('Save') . qq|">|;
1866 if ($form->{menubar}) {
1867 require "$form->{path}/menu.pl";
1878 $lxdebug->leave_sub();
1881 sub save_preferences {
1882 $lxdebug->enter_sub();
1884 $form->{stylesheet} = $form->{usestylesheet};
1886 $form->redirect($locale->text('Preferences saved!'))
1888 AM->save_preferences(\%myconfig, \%$form, $memberfile, $userspath, $webdav
1890 $form->error($locale->text('Cannot save preferences!'));
1892 $lxdebug->leave_sub();
1896 $lxdebug->enter_sub();
1898 if ($form->{media} eq 'email') {
1899 $form->error($locale->text('No email address for') . " $myconfig{name}")
1900 unless ($myconfig{email});
1902 $form->{OUT} = "$sendmail";
1906 AM->backup(\%myconfig, \%$form, $userspath);
1908 if ($form->{media} eq 'email') {
1909 $form->redirect($locale->text('Backup sent to') . qq| $myconfig{email}|);
1912 $lxdebug->leave_sub();
1916 $lxdebug->enter_sub();
1918 $form->{title} = $locale->text('Audit Control');
1920 AM->closedto(\%myconfig, \%$form);
1922 if ($form->{revtrans}) {
1923 $checked{Y} = "checked";
1925 $checked{N} = "checked";
1933 <form method=post action=$form->{script}>
1935 <input type=hidden name=path value=$form->{path}>
1936 <input type=hidden name=login value=$form->{login}>
1937 <input type=hidden name=password value=$form->{password}>
1940 <tr><th class=listtop>$form->{title}</th></tr>
1941 <tr height="5"></tr>
1947 . $locale->text('Enforce transaction reversal for all dates')
1949 <td><input name=revtrans class=radio type=radio value="1" $checked{Y}> |
1950 . $locale->text('Yes')
1951 . qq| <input name=revtrans class=radio type=radio value="0" $checked{N}> |
1952 . $locale->text('No')
1956 <th>| . $locale->text('Close Books up to') . qq|</th>
1957 <td><input name=closedto size=11 title="$myconfig{dateformat}" value=$form->{closedto}></td>
1967 <input type=hidden name=nextsub value=doclose>
1969 <input type=submit class=submit name=action value="|
1970 . $locale->text('Continue') . qq|">
1978 $lxdebug->leave_sub();
1982 $lxdebug->enter_sub();
1984 AM->closebooks(\%myconfig, \%$form);
1986 if ($form->{revtrans}) {
1988 $locale->text('Transaction reversal enforced for all dates'));
1990 if ($form->{closedto}) {
1992 $locale->text('Transaction reversal enforced up to') . " "
1993 . $locale->date(\%myconfig, $form->{closedto}, 1));
1995 $form->redirect($locale->text('Books are open'));
1999 $lxdebug->leave_sub();
2003 $lxdebug->enter_sub();
2005 $form->{title} = "Add";
2008 "$form->{script}?action=add_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}"
2009 unless $form->{callback};
2014 $lxdebug->leave_sub();
2017 sub edit_warehouse {
2018 $lxdebug->enter_sub();
2020 $form->{title} = "Edit";
2022 AM->get_warehouse(\%myconfig, \%$form);
2027 $lxdebug->leave_sub();
2030 sub list_warehouse {
2031 $lxdebug->enter_sub();
2033 AM->warehouses(\%myconfig, \%$form);
2036 "$form->{script}?action=list_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}";
2038 $callback = $form->escape($form->{callback});
2040 $form->{title} = $locale->text('Warehouses');
2042 @column_index = qw(description);
2044 $column_header{description} =
2045 qq|<th class=listheading width=100%>|
2046 . $locale->text('Description')
2056 <th class=listtop>$form->{title}</th>
2058 <tr height="5"></tr>
2062 <tr class=listheading>
2065 map { print "$column_header{$_}\n" } @column_index;
2071 foreach $ref (@{ $form->{ALL} }) {
2077 <tr valign=top class=listrow$i>
2080 $column_data{description} =
2081 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>|;
2083 map { print "$column_data{$_}\n" } @column_index;
2095 <td><hr size=3 noshade></td>
2100 <form method=post action=$form->{script}>
2102 <input name=callback type=hidden value="$form->{callback}">
2104 <input type=hidden name=type value=warehouse>
2106 <input type=hidden name=path value=$form->{path}>
2107 <input type=hidden name=login value=$form->{login}>
2108 <input type=hidden name=password value=$form->{password}>
2110 <input class=submit type=submit name=action value="|
2111 . $locale->text('Add') . qq|">|;
2113 if ($form->{menubar}) {
2114 require "$form->{path}/menu.pl";
2125 $lxdebug->leave_sub();
2128 sub warehouse_header {
2129 $lxdebug->enter_sub();
2131 $form->{title} = $locale->text("$form->{title} Warehouse");
2133 # $locale->text('Add Warehouse')
2134 # $locale->text('Edit Warehouse')
2136 $form->{description} =~ s/\"/"/g;
2138 if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
2140 qq|<textarea name="description" rows=$rows cols=60 wrap=soft>$form->{description}</textarea>|;
2143 qq|<input name=description size=60 value="$form->{description}">|;
2151 <form method=post action=$form->{script}>
2153 <input type=hidden name=id value=$form->{id}>
2154 <input type=hidden name=type value=warehouse>
2158 <th class=listtop colspan=2>$form->{title}</th>
2160 <tr height="5"></tr>
2162 <th align=right>| . $locale->text('Description') . qq|</th>
2163 <td>$description</td>
2166 <td colspan=2><hr size=3 noshade></td>
2171 $lxdebug->leave_sub();
2174 sub save_warehouse {
2175 $lxdebug->enter_sub();
2177 $form->isblank("description", $locale->text('Description missing!'));
2178 AM->save_warehouse(\%myconfig, \%$form);
2179 $form->redirect($locale->text('Warehouse saved!'));
2181 $lxdebug->leave_sub();
2184 sub delete_warehouse {
2185 $lxdebug->enter_sub();
2187 AM->delete_warehouse(\%myconfig, \%$form);
2188 $form->redirect($locale->text('Warehouse deleted!'));
2190 $lxdebug->leave_sub();
2194 $lxdebug->enter_sub();
2196 &{ $form->{nextsub} };
2198 $lxdebug->leave_sub();