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";
115 %ustva = (35 => $locale->text('UStVA-Nr. 35'),
116 36 => $locale->text('UStVA-Nr. 36'),
117 39 => $locale->text('UStVA-Nr. 39'),
118 41 => $locale->text('UStVA-Nr. 41'),
119 42 => $locale->text('UStVA-Nr. 42'),
120 43 => $locale->text('UStVA-Nr. 43'),
121 44 => $locale->text('UStVA-Nr. 44'),
122 45 => $locale->text('UStVA-Nr. 45'),
123 48 => $locale->text('UStVA-Nr. 48'),
124 49 => $locale->text('UStVA-Nr. 49'),
125 51 => $locale->text('UStVA-Nr. 51 left'),
126 511 => $locale->text('UStVA-Nr. 51 right'),
127 52 => $locale->text('UStVA-Nr. 52'),
128 53 => $locale->text('UStVA-Nr. 53'),
129 59 => $locale->text('UStVA-Nr. 59'),
130 60 => $locale->text('UStVA-Nr. 60'),
131 61 => $locale->text('UStVA-Nr. 61'),
132 62 => $locale->text('UStVA-Nr. 62'),
133 63 => $locale->text('UStVA-Nr. 63'),
134 64 => $locale->text('UStVA-Nr. 64'),
135 65 => $locale->text('UStVA-Nr. 65'),
136 66 => $locale->text('UStVA-Nr. 66'),
137 67 => $locale->text('UStVA-Nr. 67'),
138 69 => $locale->text('UStVA-Nr. 69'),
139 73 => $locale->text('UStVA-Nr. 73'),
140 74 => $locale->text('UStVA-Nr. 74'),
141 76 => $locale->text('UStVA-Nr. 76'),
142 77 => $locale->text('UStVA-Nr. 77'),
143 80 => $locale->text('UStVA-Nr. 80'),
144 84 => $locale->text('UStVA-Nr. 84'),
145 85 => $locale->text('UStVA-Nr. 85'),
146 86 => $locale->text('UStVA-Nr. 86 left'),
147 861 => $locale->text('UStVA-Nr. 86 right'),
148 91 => $locale->text('UStVA-Nr. 91'),
149 93 => $locale->text('UStVA-Nr. 93 left'),
150 931 => $locale->text('UStVA-Nr. 93 right'),
151 94 => $locale->text('UStVA-Nr. 94'),
152 95 => $locale->text('UStVA-Nr. 95'),
153 96 => $locale->text('UStVA-Nr. 96'),
154 97 => $locale->text('UStVA-Nr. 97 links'),
155 971 => $locale->text('UStVA-Nr. 97 rechts'),
156 98 => $locale->text('UStVA-Nr. 98'));
158 foreach $item (sort({ $a cmp $b } keys %ustva)) {
159 if ($item == $form->{pos_ustva}) {
160 $form->{selectustva} .= "<option value=$item selected>$ustva{$item}\n";
162 $form->{selectustva} .= "<option value=$item>$ustva{$item}\n";
169 <th align=right>| . $locale->text('Umsatzsteuervoranmeldung') . qq|</th>
170 <td><select name=pos_ustva>$form->{selectustva}</select></td>
171 <input type=hidden name=selectustva value="$form->{selectustva}">
174 $form->{selecteur} = "<option>\n";
175 %eur = (1 => "Umsatzerlöse",
176 2 => "sonstige Erlöse",
177 3 => "Privatanteile",
179 5 => "Ausserordentliche Erträge",
180 6 => "Vereinnahmte Umsatzst.",
181 7 => "Umsatzsteuererstattungen",
182 8 => "Wareneingänge",
183 9 => "Löhne und Gehälter",
184 10 => "Gesetzl. sozialer Aufw.",
186 12 => "Gas, Strom, Wasser",
187 13 => "Instandhaltung",
188 14 => "Steuern, Versich., Beiträge",
190 16 => "Kfz-Versicherungen",
191 17 => "Sonst. Fahrtkosten",
192 18 => "Werbe- und Reisekosten",
193 19 => "Instandhaltung u. Werkzeuge",
194 20 => "Fachzeitschriften, Bücher",
195 21 => "Miete für Einrichtungen",
196 22 => "Rechts- und Beratungskosten",
197 23 => "Bürobedarf, Porto, Telefon",
198 24 => "Sonstige Aufwendungen",
199 25 => "Abschreibungen auf Anlagever.",
200 26 => "Abschreibungen auf GWG",
202 28 => "Umsatzsteuerzahlungen",
204 30 => "Ausserordentlicher Aufwand",
205 31 => "Betriebliche Steuern");
206 foreach $item (sort({ $a <=> $b } keys(%eur))) {
207 if ($item == $form->{pos_eur}) {
208 $form->{selecteur} .= "<option value=$item selected>$eur{$item}\n";
210 $form->{selecteur} .= "<option value=$item>$eur{$item}\n";
217 <th align=right>| . $locale->text('EUER') . qq|</th>
218 <td><select name=pos_eur>$form->{selecteur}</select></td>
219 <input type=hidden name=selecteur value="$form->{selecteur}">
222 $form->{selectbwa} = "<option>\n";
224 %bwapos = (1 => 'Umsatzerlöse',
225 2 => 'Best.Verdg.FE/UE',
226 3 => 'Aktiv.Eigenleistung',
227 4 => 'Mat./Wareneinkauf',
228 5 => 'So.betr.Erlöse',
229 10 => 'Personalkosten',
231 12 => 'Betriebl.Steuern',
232 13 => 'Vers./Beiträge',
233 14 => 'Kfz.Kosten o.St.',
234 15 => 'Werbe-Reisek.',
235 16 => 'Kosten Warenabgabe',
236 17 => 'Abschreibungen',
237 18 => 'Rep./instandhlt.',
238 19 => 'Übrige Steuern',
239 20 => 'Sonst.Kosten',
241 31 => 'Sonst.neutr.Aufw.',
243 33 => 'Sonst.neutr.Ertrag',
244 34 => 'Verr.kalk.Kosten',
245 35 => 'Steuern Eink.u.Ertr.');
246 foreach $item (sort({ $a <=> $b } keys %bwapos)) {
247 if ($item == $form->{pos_bwa}) {
248 $form->{selectbwa} .= "<option value=$item selected>$bwapos{$item}\n";
250 $form->{selectbwa} .= "<option value=$item>$bwapos{$item}\n";
257 <th align=right>| . $locale->text('BWA') . qq|</th>
258 <td><select name=pos_bwa>$form->{selectbwa}</select></td>
259 <input type=hidden name=selectbwa value="$form->{selectbwa}">
262 $form->{selectbilanz} = "<option>\n";
263 foreach $item ((1, 2, 3, 4)) {
264 if ($item == $form->{pos_bilanz}) {
265 $form->{selectbilanz} .= "<option value=$item selected>$item\n";
267 $form->{selectbilanz} .= "<option value=$item>$item\n";
274 <th align=right>| . $locale->text('Bilanz') . qq|</th>
275 <td><select name=pos_bilanz>$form->{selectbilanz}</select></td>
276 <input type=hidden name=selectbilanz value="$form->{selectbilanz}">
279 # this is for our parser only!
280 # type=submit $locale->text('Add Account')
281 # type=submit $locale->text('Edit Account')
288 <form method=post action=$form->{script}>
290 <input type=hidden name=id value=$form->{id}>
291 <input type=hidden name=type value=account>
293 <input type=hidden name=inventory_accno_id value=$form->{inventory_accno_id}>
294 <input type=hidden name=income_accno_id value=$form->{income_accno_id}>
295 <input type=hidden name=expense_accno_id value=$form->{expense_accno_id}>
296 <input type=hidden name=fxgain_accno_id values=$form->{fxgain_accno_id}>
297 <input type=hidden name=fxloss_accno_id values=$form->{fxloss_accno_id}>
299 <table border=0 width=100%>
301 <th class=listtop>$form->{title}</th>
308 <th align=right>| . $locale->text('Account Number') . qq|</th>
309 <td><input name=accno size=20 value=$form->{accno}></td>
312 <th align=right>| . $locale->text('Description') . qq|</th>
313 <td><input name=description size=40 value="$form->{description}"></td>
316 <th align=right>| . $locale->text('Account Type') . qq|</th>
320 <td><input name=category type=radio class=radio value=A $checked{A_}> |
321 . $locale->text('Asset') . qq|\n<br>
322 <input name=category type=radio class=radio value=L $checked{L_}> |
323 . $locale->text('Liability') . qq|\n<br>
324 <input name=category type=radio class=radio value=I $checked{I_}> |
325 . $locale->text('Revenue') . qq|\n<br>
326 <input name=category type=radio class=radio value=E $checked{E_}> |
327 . $locale->text('Expense') . qq|</td>
328 <td width=50> </td>
330 <input name=charttype type=radio class=radio value="H" $checked{H}> |
331 . $locale->text('Heading') . qq|<br>
332 <input name=charttype type=radio class=radio value="A" $checked{A}> |
333 . $locale->text('Account') . qq|</td>
340 if ($form->{charttype} eq "A") {
347 . $locale->text('Is this a summary account to record') . qq|</th>
349 <input name=AR type=checkbox class=checkbox value=AR $form->{AR}> |
350 . $locale->text('AR')
351 . qq| <input name=AP type=checkbox class=checkbox value=AP $form->{AP}> |
352 . $locale->text('AP')
353 . qq| <input name=IC type=checkbox class=checkbox value=IC $form->{IC}> |
354 . $locale->text('Inventory')
361 <th colspan=2>| . $locale->text('Include in drop-down menus') . qq|</th>
367 <th align=left>| . $locale->text('Receivables') . qq|</th>
368 <th align=left>| . $locale->text('Payables') . qq|</th>
369 <th align=left>| . $locale->text('Parts Inventory') . qq|</th>
370 <th align=left>| . $locale->text('Service Items') . qq|</th>
374 <input name=AR_amount type=checkbox class=checkbox value=AR_amount $form->{AR_amount}> |
375 . $locale->text('Revenue') . qq|\n<br>
376 <input name=AR_paid type=checkbox class=checkbox value=AR_paid $form->{AR_paid}> |
377 . $locale->text('Receipt') . qq|\n<br>
378 <input name=AR_tax type=checkbox class=checkbox value=AR_tax $form->{AR_tax}> |
379 . $locale->text('Tax') . qq|
382 <input name=AP_amount type=checkbox class=checkbox value=AP_amount $form->{AP_amount}> |
383 . $locale->text('Expense/Asset') . qq|\n<br>
384 <input name=AP_paid type=checkbox class=checkbox value=AP_paid $form->{AP_paid}> |
385 . $locale->text('Payment') . qq|\n<br>
386 <input name=AP_tax type=checkbox class=checkbox value=AP_tax $form->{AP_tax}> |
387 . $locale->text('Tax') . qq|
390 <input name=IC_sale type=checkbox class=checkbox value=IC_sale $form->{IC_sale}> |
391 . $locale->text('Revenue') . qq|\n<br>
392 <input name=IC_cogs type=checkbox class=checkbox value=IC_cogs $form->{IC_cogs}> |
393 . $locale->text('COGS') . qq|\n<br>
394 <input name=IC_taxpart type=checkbox class=checkbox value=IC_taxpart $form->{IC_taxpart}> |
395 . $locale->text('Tax') . qq|
398 <input name=IC_income type=checkbox class=checkbox value=IC_income $form->{IC_income}> |
399 . $locale->text('Revenue') . qq|\n<br>
400 <input name=IC_expense type=checkbox class=checkbox value=IC_expense $form->{IC_expense}> |
401 . $locale->text('Expense') . qq|\n<br>
402 <input name=IC_taxservice type=checkbox class=checkbox value=IC_taxservice $form->{IC_taxservice}> |
403 . $locale->text('Tax') . qq|
422 <td><hr size=3 noshade></td>
427 $lxdebug->leave_sub();
431 $lxdebug->enter_sub();
435 <input name=callback type=hidden value="$form->{callback}">
437 <input type=hidden name=path value=$form->{path}>
438 <input type=hidden name=login value=$form->{login}>
439 <input type=hidden name=password value=$form->{password}>
442 <input type=submit class=submit name=action value="|
443 . $locale->text('Save') . qq|">
446 if ($form->{id} && $form->{orphaned}) {
447 print qq|<input type=submit class=submit name=action value="|
448 . $locale->text('Delete') . qq|">|;
451 if ($form->{menubar}) {
452 require "$form->{path}/menu.pl";
463 $lxdebug->leave_sub();
467 $lxdebug->enter_sub();
469 $form->isblank("accno", $locale->text('Account Number missing!'));
470 $form->isblank("category", $locale->text('Account Type missing!'));
472 $form->redirect($locale->text('Account saved!'))
473 if (AM->save_account(\%myconfig, \%$form));
474 $form->error($locale->text('Cannot save account!'));
476 $lxdebug->leave_sub();
480 $lxdebug->enter_sub();
482 CA->all_accounts(\%myconfig, \%$form);
484 $form->{title} = $locale->text('Chart of Accounts');
488 "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}";
490 @column_index = qw(accno gifi_accno description debit credit link);
492 $column_header{accno} = qq|<th>| . $locale->text('Account') . qq|</a></th>|;
493 $column_header{gifi_accno} =
494 qq|<th>| . $locale->text('GIFI') . qq|</a></th>|;
495 $column_header{description} =
496 qq|<th>| . $locale->text('Description') . qq|</a></th>|;
497 $column_header{debit} = qq|<th>| . $locale->text('Debit') . qq|</a></th>|;
498 $column_header{credit} = qq|<th>| . $locale->text('Credit') . qq|</a></th>|;
499 $column_header{link} = qq|<th>| . $locale->text('Link') . qq|</a></th>|;
502 $colspan = $#column_index + 1;
509 <th class=listtop colspan=$colspan>$form->{title}</th>
512 <tr class=listheading>
515 map { print "$column_header{$_}\n" } @column_index;
522 $callback = $form->escape($callback);
524 foreach $ca (@{ $form->{CA} }) {
526 $ca->{debit} = " ";
527 $ca->{credit} = " ";
529 if ($ca->{amount} > 0) {
531 $form->format_amount(\%myconfig, $ca->{amount}, 2, " ");
533 if ($ca->{amount} < 0) {
535 $form->format_amount(\%myconfig, -$ca->{amount}, 2, " ");
538 $ca->{link} =~ s/:/<br>/og;
540 if ($ca->{charttype} eq "H") {
541 print qq|<tr class=listheading>|;
543 $column_data{accno} =
544 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>|;
545 $column_data{gifi_accno} =
546 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>|;
547 $column_data{description} = qq|<th>$ca->{description} </th>|;
548 $column_data{debit} = qq|<th> </th>|;
549 $column_data{credit} = qq| <th> </th>|;
550 $column_data{link} = qq|<th> </th>|;
556 <tr valign=top class=listrow$i>|;
557 $column_data{accno} =
558 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>|;
559 $column_data{gifi_accno} =
560 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>|;
561 $column_data{description} = qq|<td>$ca->{description} </td>|;
562 $column_data{debit} = qq|<td align=right>$ca->{debit}</td>|;
563 $column_data{credit} = qq|<td align=right>$ca->{credit}</td>|;
564 $column_data{link} = qq|<td>$ca->{link} </td>|;
568 map { print "$column_data{$_}\n" } @column_index;
574 <tr><td colspan=$colspan><hr size=3 noshade></td></tr>
581 $lxdebug->leave_sub();
585 $lxdebug->enter_sub();
587 $form->{title} = $locale->text('Delete Account');
590 qw(inventory_accno_id income_accno_id expense_accno_id fxgain_accno_id fxloss_accno_id)
592 if ($form->{id} == $form->{$id}) {
593 $form->error($locale->text('Cannot delete default account!'));
597 $form->redirect($locale->text('Account deleted!'))
598 if (AM->delete_account(\%myconfig, \%$form));
599 $form->error($locale->text('Cannot delete account!'));
601 $lxdebug->leave_sub();
605 $lxdebug->enter_sub();
607 @{ $form->{fields} } = (accno, description);
608 $form->{table} = "gifi";
609 $form->{sortorder} = "accno";
611 AM->gifi_accounts(\%myconfig, \%$form);
613 $form->{title} = $locale->text('GIFI');
617 "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
619 @column_index = qw(accno description);
621 $column_header{accno} = qq|<th>| . $locale->text('GIFI') . qq|</a></th>|;
622 $column_header{description} =
623 qq|<th>| . $locale->text('Description') . qq|</a></th>|;
626 $colspan = $#column_index + 1;
633 <th class=listtop colspan=$colspan>$form->{title}</th>
636 <tr class=listheading>
639 map { print "$column_header{$_}\n" } @column_index;
646 $callback = $form->escape($callback);
648 foreach $ca (@{ $form->{ALL} }) {
654 <tr valign=top class=listrow$i>|;
656 $column_data{accno} =
657 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>|;
658 $column_data{description} = qq|<td>$ca->{description} </td>|;
660 map { print "$column_data{$_}\n" } @column_index;
667 <td colspan=$colspan><hr size=3 noshade></td>
675 $lxdebug->leave_sub();
679 $lxdebug->enter_sub();
681 $form->{title} = "Add";
685 "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
692 $lxdebug->leave_sub();
696 $lxdebug->enter_sub();
698 $form->{title} = "Edit";
700 AM->get_gifi(\%myconfig, \%$form);
705 $lxdebug->leave_sub();
709 $lxdebug->enter_sub();
711 $form->{title} = $locale->text("$form->{title} GIFI");
713 # $locale->text('Add GIFI')
714 # $locale->text('Edit GIFI')
716 $form->{description} =~ s/\"/"/g;
723 <form method=post action=$form->{script}>
725 <input type=hidden name=id value=$form->{accno}>
726 <input type=hidden name=type value=gifi>
730 <th class=listtop>$form->{title}</th>
737 <th align=right>| . $locale->text('GIFI') . qq|</th>
738 <td><input name=accno size=20 value=$form->{accno}></td>
741 <th align=right>| . $locale->text('Description') . qq|</th>
742 <td><input name=description size=60 value="$form->{description}"></td>
748 <td colspan=2><hr size=3 noshade></td>
753 $lxdebug->leave_sub();
757 $lxdebug->enter_sub();
761 <input name=callback type=hidden value="$form->{callback}">
763 <input type=hidden name=path value=$form->{path}>
764 <input type=hidden name=login value=$form->{login}>
765 <input type=hidden name=password value=$form->{password}>
767 <br><input type=submit class=submit name=action value="|
768 . $locale->text('Save') . qq|">|;
772 <input type=submit class=submit name=action value="|
773 . $locale->text('Copy to COA') . qq|">
776 if ($form->{accno} && $form->{orphaned}) {
777 print qq|<input type=submit class=submit name=action value="|
778 . $locale->text('Delete') . qq|">|;
782 if ($form->{menubar}) {
783 require "$form->{path}/menu.pl";
794 $lxdebug->leave_sub();
798 $lxdebug->enter_sub();
800 $form->isblank("accno", $locale->text('GIFI missing!'));
801 AM->save_gifi(\%myconfig, \%$form);
802 $form->redirect($locale->text('GIFI saved!'));
804 $lxdebug->leave_sub();
808 $lxdebug->enter_sub();
810 $form->isblank("accno", $locale->text('GIFI missing!'));
812 AM->save_gifi(\%myconfig, \%$form);
815 $form->{gifi_accno} = $form->{accno};
816 $form->{title} = "Add";
817 $form->{charttype} = "A";
822 $lxdebug->leave_sub();
826 $lxdebug->enter_sub();
828 AM->delete_gifi(\%myconfig, \%$form);
829 $form->redirect($locale->text('GIFI deleted!'));
831 $lxdebug->leave_sub();
835 $lxdebug->enter_sub();
837 $form->{title} = "Add";
841 "$form->{script}?action=add_department&path=$form->{path}&login=$form->{login}&password=$form->{password}"
842 unless $form->{callback};
847 $lxdebug->leave_sub();
850 sub edit_department {
851 $lxdebug->enter_sub();
853 $form->{title} = "Edit";
855 AM->get_department(\%myconfig, \%$form);
860 $lxdebug->leave_sub();
863 sub list_department {
864 $lxdebug->enter_sub();
866 AM->departments(\%myconfig, \%$form);
869 "$form->{script}?action=list_department&path=$form->{path}&login=$form->{login}&password=$form->{password}";
871 $callback = $form->escape($form->{callback});
873 $form->{title} = $locale->text('Departments');
875 @column_index = qw(description cost profit);
877 $column_header{description} =
878 qq|<th class=listheading width=90%>|
879 . $locale->text('Description')
881 $column_header{cost} =
882 qq|<th class=listheading nowrap>|
883 . $locale->text('Cost Center')
885 $column_header{profit} =
886 qq|<th class=listheading nowrap>|
887 . $locale->text('Profit Center')
897 <th class=listtop>$form->{title}</th>
903 <tr class=listheading>
906 map { print "$column_header{$_}\n" } @column_index;
912 foreach $ref (@{ $form->{ALL} }) {
918 <tr valign=top class=listrow$i>
921 $costcenter = ($ref->{role} eq "C") ? "X" : "";
922 $profitcenter = ($ref->{role} eq "P") ? "X" : "";
924 $column_data{description} =
925 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>|;
926 $column_data{cost} = qq|<td align=center>$costcenter</td>|;
927 $column_data{profit} = qq|<td align=center>$profitcenter</td>|;
929 map { print "$column_data{$_}\n" } @column_index;
941 <td><hr size=3 noshade></td>
946 <form method=post action=$form->{script}>
948 <input name=callback type=hidden value="$form->{callback}">
950 <input type=hidden name=type value=department>
952 <input type=hidden name=path value=$form->{path}>
953 <input type=hidden name=login value=$form->{login}>
954 <input type=hidden name=password value=$form->{password}>
956 <input class=submit type=submit name=action value="|
957 . $locale->text('Add') . qq|">|;
959 if ($form->{menubar}) {
960 require "$form->{path}/menu.pl";
971 $lxdebug->leave_sub();
974 sub department_header {
975 $lxdebug->enter_sub();
977 $form->{title} = $locale->text("$form->{title} Department");
979 # $locale->text('Add Department')
980 # $locale->text('Edit Department')
982 $form->{description} =~ s/\"/"/g;
984 if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
986 qq|<textarea name="description" rows=$rows cols=60 wrap=soft>$form->{description}</textarea>|;
989 qq|<input name=description size=60 value="$form->{description}">|;
992 $costcenter = "checked" if $form->{role} eq "C";
993 $profitcenter = "checked" if $form->{role} eq "P";
1000 <form method=post action=$form->{script}>
1002 <input type=hidden name=id value=$form->{id}>
1003 <input type=hidden name=type value=department>
1007 <th class=listtop colspan=2>$form->{title}</th>
1009 <tr height="5"></tr>
1011 <th align=right>| . $locale->text('Description') . qq|</th>
1012 <td>$description</td>
1016 <td><input type=radio style=radio name=role value="C" $costcenter> |
1017 . $locale->text('Cost Center') . qq|
1018 <input type=radio style=radio name=role value="P" $profitcenter> |
1019 . $locale->text('Profit Center') . qq|
1022 <td colspan=2><hr size=3 noshade></td>
1027 $lxdebug->leave_sub();
1030 sub save_department {
1031 $lxdebug->enter_sub();
1033 $form->isblank("description", $locale->text('Description missing!'));
1034 AM->save_department(\%myconfig, \%$form);
1035 $form->redirect($locale->text('Department saved!'));
1037 $lxdebug->leave_sub();
1040 sub delete_department {
1041 $lxdebug->enter_sub();
1043 AM->delete_department(\%myconfig, \%$form);
1044 $form->redirect($locale->text('Department deleted!'));
1046 $lxdebug->leave_sub();
1050 $lxdebug->enter_sub();
1052 $form->{title} = "Add";
1055 "$form->{script}?action=add_business&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1056 unless $form->{callback};
1061 $lxdebug->leave_sub();
1065 $lxdebug->enter_sub();
1067 $form->{title} = "Edit";
1069 AM->get_business(\%myconfig, \%$form);
1073 $form->{orphaned} = 1;
1076 $lxdebug->leave_sub();
1080 $lxdebug->enter_sub();
1082 AM->business(\%myconfig, \%$form);
1085 "$form->{script}?action=list_business&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1087 $callback = $form->escape($form->{callback});
1089 $form->{title} = $locale->text('Type of Business');
1091 @column_index = qw(description discount customernumberinit);
1093 $column_header{description} =
1094 qq|<th class=listheading width=60%>|
1095 . $locale->text('Description')
1097 $column_header{discount} =
1098 qq|<th class=listheading width=10%>|
1099 . $locale->text('Discount')
1101 $column_header{customernumberinit} =
1102 qq|<th class=listheading>|
1103 . $locale->text('Customernumberinit')
1113 <th class=listtop>$form->{title}</th>
1115 <tr height="5"></tr>
1119 <tr class=listheading>
1122 map { print "$column_header{$_}\n" } @column_index;
1128 foreach $ref (@{ $form->{ALL} }) {
1134 <tr valign=top class=listrow$i>
1138 $form->format_amount(\%myconfig, $ref->{discount} * 100, 1, " ");
1141 ? "<b>$ref->{description}</b>"
1142 : "$ref->{description}";
1143 $column_data{description} =
1144 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>|;
1145 $column_data{discount} = qq|<td align=right>$discount</td>|;
1146 $column_data{customernumberinit} =
1147 qq|<td align=right>$ref->{customernumberinit}</td>|;
1149 map { print "$column_data{$_}\n" } @column_index;
1161 <td><hr size=3 noshade></td>
1166 <form method=post action=$form->{script}>
1168 <input name=callback type=hidden value="$form->{callback}">
1170 <input type=hidden name=type value=business>
1172 <input type=hidden name=path value=$form->{path}>
1173 <input type=hidden name=login value=$form->{login}>
1174 <input type=hidden name=password value=$form->{password}>
1176 <input class=submit type=submit name=action value="|
1177 . $locale->text('Add') . qq|">|;
1179 if ($form->{menubar}) {
1180 require "$form->{path}/menu.pl";
1192 $lxdebug->leave_sub();
1195 sub business_header {
1196 $lxdebug->enter_sub();
1198 $form->{title} = $locale->text("$form->{title} Business");
1199 $form->{salesman} = "checked" if $form->{salesman};
1201 # $locale->text('Add Business')
1202 # $locale->text('Edit Business')
1204 $form->{description} =~ s/\"/"/g;
1206 $form->format_amount(\%myconfig, $form->{discount} * 100);
1213 <form method=post action=$form->{script}>
1215 <input type=hidden name=id value=$form->{id}>
1216 <input type=hidden name=type value=business>
1220 <th class=listtop colspan=2>$form->{title}</th>
1222 <tr height="5"></tr>
1224 <th align=right>| . $locale->text('Type of Business') . qq|</th>
1225 <td><input name=description size=30 value="$form->{description}"></td>
1228 <th align=right>| . $locale->text('Discount') . qq| %</th>
1229 <td><input name=discount size=5 value=$form->{discount}></td>
1232 <th align=right>| . $locale->text('Customernumberinit') . qq|</th>
1233 <td><input name=customernumberinit size=10 value=$form->{customernumberinit}></td>
1236 <td align=right>| . $locale->text('Salesman') . qq|</td>
1237 <td><input name=salesman class=checkbox type=checkbox value=1 $form->{salesman}></td>
1239 <td colspan=2><hr size=3 noshade></td>
1244 $lxdebug->leave_sub();
1248 $lxdebug->enter_sub();
1250 $form->isblank("description", $locale->text('Description missing!'));
1251 AM->save_business(\%myconfig, \%$form);
1252 $form->redirect($locale->text('Business saved!'));
1254 $lxdebug->leave_sub();
1257 sub delete_business {
1258 $lxdebug->enter_sub();
1260 AM->delete_business(\%myconfig, \%$form);
1261 $form->redirect($locale->text('Business deleted!'));
1263 $lxdebug->leave_sub();
1267 $lxdebug->enter_sub();
1269 $form->{title} = "Add";
1272 "$form->{script}?action=add_sic&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1273 unless $form->{callback};
1278 $lxdebug->leave_sub();
1282 $lxdebug->enter_sub();
1284 $form->{title} = "Edit";
1286 AM->get_sic(\%myconfig, \%$form);
1290 $form->{orphaned} = 1;
1293 $lxdebug->leave_sub();
1297 $lxdebug->enter_sub();
1299 AM->sic(\%myconfig, \%$form);
1302 "$form->{script}?action=list_sic&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1304 $callback = $form->escape($form->{callback});
1306 $form->{title} = $locale->text('Standard Industrial Codes');
1308 @column_index = qw(code description);
1310 $column_header{code} =
1311 qq|<th class=listheading>| . $locale->text('Code') . qq|</th>|;
1312 $column_header{description} =
1313 qq|<th class=listheading>| . $locale->text('Description') . qq|</th>|;
1322 <th class=listtop>$form->{title}</th>
1324 <tr height="5"></tr>
1328 <tr class=listheading>
1331 map { print "$column_header{$_}\n" } @column_index;
1337 foreach $ref (@{ $form->{ALL} }) {
1342 if ($ref->{sictype} eq 'H') {
1344 <tr valign=top class=listheading>
1346 $column_data{code} =
1347 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>|;
1348 $column_data{description} = qq|<th>$ref->{description}</th>|;
1352 <tr valign=top class=listrow$i>
1355 $column_data{code} =
1356 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>|;
1357 $column_data{description} = qq|<td>$ref->{description}</td>|;
1361 map { print "$column_data{$_}\n" } @column_index;
1373 <td><hr size=3 noshade></td>
1378 <form method=post action=$form->{script}>
1380 <input name=callback type=hidden value="$form->{callback}">
1382 <input type=hidden name=type value=sic>
1384 <input type=hidden name=path value=$form->{path}>
1385 <input type=hidden name=login value=$form->{login}>
1386 <input type=hidden name=password value=$form->{password}>
1388 <input class=submit type=submit name=action value="|
1389 . $locale->text('Add') . qq|">|;
1391 if ($form->{menubar}) {
1392 require "$form->{path}/menu.pl";
1403 $lxdebug->leave_sub();
1407 $lxdebug->enter_sub();
1409 $form->{title} = $locale->text("$form->{title} SIC");
1411 # $locale->text('Add SIC')
1412 # $locale->text('Edit SIC')
1414 $form->{code} =~ s/\"/"/g;
1415 $form->{description} =~ s/\"/"/g;
1417 $checked = ($form->{sictype} eq 'H') ? "checked" : "";
1424 <form method=post action=$form->{script}>
1426 <input type=hidden name=type value=sic>
1427 <input type=hidden name=id value=$form->{code}>
1431 <th class=listtop colspan=2>$form->{title}</th>
1433 <tr height="5"></tr>
1435 <th align=right>| . $locale->text('Code') . qq|</th>
1436 <td><input name=code size=10 value=$form->{code}></td>
1440 <th align=left><input name=sictype type=checkbox style=checkbox value="H" $checked> |
1441 . $locale->text('Heading') . qq|</th>
1444 <th align=right>| . $locale->text('Description') . qq|</th>
1445 <td><input name=description size=60 value="$form->{description}"></td>
1447 <td colspan=2><hr size=3 noshade></td>
1452 $lxdebug->leave_sub();
1456 $lxdebug->enter_sub();
1458 $form->isblank("code", $locale->text('Code missing!'));
1459 $form->isblank("description", $locale->text('Description missing!'));
1460 AM->save_sic(\%myconfig, \%$form);
1461 $form->redirect($locale->text('SIC saved!'));
1463 $lxdebug->leave_sub();
1467 $lxdebug->enter_sub();
1469 AM->delete_sic(\%myconfig, \%$form);
1470 $form->redirect($locale->text('SIC deleted!'));
1472 $lxdebug->leave_sub();
1475 sub display_stylesheet {
1476 $lxdebug->enter_sub();
1478 $form->{file} = "css/$myconfig{stylesheet}";
1481 $lxdebug->leave_sub();
1485 $lxdebug->enter_sub();
1487 $form->{file} =~ s/^(.:)*?\/|\.\.\///g;
1488 $form->{file} =~ s/^\/*//g;
1489 $form->{file} =~ s/$userspath//;
1491 $form->error("$!: $form->{file}") unless -f $form->{file};
1493 AM->load_template(\%$form);
1495 $form->{title} = $form->{file};
1497 # if it is anything but html
1498 if ($form->{file} !~ /\.html$/) {
1499 $form->{body} = "<pre>\n$form->{body}\n</pre>";
1509 <form method=post action=$form->{script}>
1511 <input name=file type=hidden value=$form->{file}>
1512 <input name=type type=hidden value=template>
1514 <input type=hidden name=path value=$form->{path}>
1515 <input type=hidden name=login value=$form->{login}>
1516 <input type=hidden name=password value=$form->{password}>
1518 <input name=action type=submit class=submit value="|
1519 . $locale->text('Edit') . qq|">|;
1521 if ($form->{menubar}) {
1522 require "$form->{path}/menu.pl";
1533 $lxdebug->leave_sub();
1537 $lxdebug->enter_sub();
1539 AM->load_template(\%$form);
1541 $form->{title} = $locale->text('Edit Template');
1543 # convert   to &nbsp;
1544 $form->{body} =~ s/ /&nbsp;/gi;
1551 <form method=post action=$form->{script}>
1553 <input name=file type=hidden value=$form->{file}>
1554 <input name=type type=hidden value=template>
1556 <input type=hidden name=path value=$form->{path}>
1557 <input type=hidden name=login value=$form->{login}>
1558 <input type=hidden name=password value=$form->{password}>
1560 <input name=callback type=hidden value="$form->{script}?action=display_form&file=$form->{file}&path=$form->{path}&login=$form->{login}&password=$form->{password}">
1562 <textarea name=body rows=25 cols=70>
1567 <input type=submit class=submit name=action value="|
1568 . $locale->text('Save') . qq|">|;
1570 if ($form->{menubar}) {
1571 require "$form->{path}/menu.pl";
1583 $lxdebug->leave_sub();
1587 $lxdebug->enter_sub();
1589 AM->save_template(\%$form);
1590 $form->redirect($locale->text('Template saved!'));
1592 $lxdebug->leave_sub();
1596 $lxdebug->enter_sub();
1598 # get defaults for account numbers and last numbers
1599 AM->defaultaccounts(\%myconfig, \%$form);
1601 foreach $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
1603 ($item eq $myconfig{dateformat})
1604 ? "<option selected>$item\n"
1605 : "<option>$item\n";
1608 foreach $item (qw(1,000.00 1000.00 1.000,00 1000,00)) {
1610 ($item eq $myconfig{numberformat})
1611 ? "<option selected>$item\n"
1612 : "<option>$item\n";
1615 foreach $item (qw(name company address signature)) {
1616 $myconfig{$item} =~ s/\"/"/g;
1619 foreach $item (qw(address signature)) {
1620 $myconfig{$item} =~ s/\\n/\r\n/g;
1623 %countrycodes = User->country_codes;
1625 foreach $key (sort { $countrycodes{$a} cmp $countrycodes{$b} }
1629 ($myconfig{countrycode} eq $key)
1630 ? "<option selected value=$key>$countrycodes{$key}\n"
1631 : "<option value=$key>$countrycodes{$key}\n";
1633 $countrycodes = "<option>American English\n$countrycodes";
1635 # use an other input number format than output numberformat
1636 # look at Form.pm, sub parse_amount
1637 my $in_numberformat = '';
1638 $text1 = qq|value="0">| . $locale->text('equal Outputformat');
1639 $text2 = qq|value="1">| . $locale->text('1000,00 or 1000.00');
1640 @in_nf = ($text1, $text2);
1641 foreach $item (@in_nf) {
1643 (substr($item, 7, 1) eq $myconfig{in_numberformat})
1644 ? "<option selected $item\n"
1645 : "<option $item\n";
1648 foreach $key (keys %{ $form->{IC} }) {
1649 foreach $accno (sort keys %{ $form->{IC}{$key} }) {
1651 ($form->{IC}{$key}{$accno}{id} == $form->{defaults}{$key})
1652 ? "<option selected>$accno--$form->{IC}{$key}{$accno}{description}\n"
1653 : "<option>$accno--$form->{IC}{$key}{$accno}{description}\n";
1657 opendir CSS, "css/.";
1658 @all = grep /.*\.css$/, readdir CSS;
1661 foreach $item (@all) {
1662 if ($item eq $myconfig{stylesheet}) {
1663 $selectstylesheet .= qq|<option selected>$item\n|;
1665 $selectstylesheet .= qq|<option>$item\n|;
1668 $selectstylesheet .= "<option>\n";
1670 $form->{title} = $locale->text('Edit Preferences for') . qq| $form->{login}|;
1674 if ($myconfig{menustyle} eq "old") { $oldS = "checked"; }
1675 else { $newS = "checked"; }
1680 <form method=post action=$form->{script}>
1682 <input type=hidden name=old_password value=$myconfig{password}>
1683 <input type=hidden name=type value=preferences>
1684 <input type=hidden name=role value=$myconfig{role}>
1687 <tr><th class=listtop>$form->{title}</th></tr>
1692 <th align=right>| . $locale->text('Name') . qq|</th>
1693 <td><input name=name size=15 value="$myconfig{name}"></td>
1696 <th align=right>| . $locale->text('Password') . qq|</th>
1697 <td><input type=password name=new_password size=10 value=$myconfig{password}></td>
1700 <th align=right>| . $locale->text('E-mail') . qq|</th>
1701 <td><input name=email size=30 value="$myconfig{email}"></td>
1704 <th align=right>| . $locale->text('Signature') . qq|</th>
1705 <td><textarea name=signature rows=3 cols=50>$myconfig{signature}</textarea></td>
1708 <th align=right>| . $locale->text('Phone') . qq|</th>
1709 <td><input name=tel size=14 value="$myconfig{tel}"></td>
1712 <th align=right>| . $locale->text('Fax') . qq|</th>
1713 <td><input name=fax size=14 value="$myconfig{fax}"></td>
1716 <th align=right>| . $locale->text('Company') . qq|</th>
1717 <td><input name=company size=30 value="$myconfig{company}"></td>
1720 <th align=right>| . $locale->text('Address') . qq|</th>
1721 <td><textarea name=address rows=4 cols=50>$myconfig{address}</textarea></td>
1724 <th align=right>| . $locale->text('Date Format') . qq|</th>
1725 <td><select name=dateformat>$dateformat</select></td>
1728 <th align=right>| . $locale->text('Output Number Format') . qq|</th>
1729 <td><select name=numberformat>$numberformat</select></td>
1732 <th align=right>| . $locale->text('Input Number Format') . qq|</th>
1733 <td><select name=in_numberformat>$in_numberformat</select></td>
1737 <th align=right>| . $locale->text('Dropdown Limit') . qq|</th>
1738 <td><input name=vclimit size=10 value="$myconfig{vclimit}"></td>
1741 <th align=right>| . $locale->text('Language') . qq|</th>
1742 <td><select name=countrycode>$countrycodes</select></td>
1745 <th align=right>| . $locale->text('Stylesheet') . qq|</th>
1746 <td><select name=usestylesheet>$selectstylesheet</select></td>
1749 <th align=right>| . $locale->text('Setup Menu') . qq|</th>
1750 <td><input name=menustyle type=radio class=radio value=neu $newS> New
1751 <input name=menustyle type=radio class=radio value=old $oldS> Old</td>
1753 <input name=printer type=hidden value="$myconfig{printer}">
1754 <tr class=listheading>
1755 <th colspan=2> </th>
1758 <th align=right>| . $locale->text('Business Number') . qq|</th>
1759 <td><input name=businessnumber size=25 value="$myconfig{businessnumber}"></td>
1765 <th align=right>| . $locale->text('Year End') . qq| (mm/dd)</th>
1766 <td><input name=yearend size=5 value=$form->{defaults}{yearend}></td>
1767 <th align=right>| . $locale->text('Weight Unit') . qq|</th>
1768 <td><input name=weightunit size=5 value="$form->{defaults}{weightunit}"></td>
1773 <tr class=listheading>
1775 . $locale->text('Last Numbers & Default Accounts') . qq|</th>
1781 <th align=right nowrap>| . $locale->text('Inventory Account') . qq|</th>
1782 <td><select name=inventory_accno>$myconfig{IC}</select></td>
1785 <th align=right nowrap>| . $locale->text('Revenue Account') . qq|</th>
1786 <td><select name=income_accno>$myconfig{IC_income}</select></td>
1789 <th align=right nowrap>| . $locale->text('Expense Account') . qq|</th>
1790 <td><select name=expense_accno>$myconfig{IC_expense}</select></td>
1793 <th align=right nowrap>| . $locale->text('Foreign Exchange Gain') . qq|</th>
1794 <td><select name=fxgain_accno>$myconfig{FX_gain}</select></td>
1797 <th align=right nowrap>| . $locale->text('Foreign Exchange Loss') . qq|</th>
1798 <td><select name=fxloss_accno>$myconfig{FX_loss}</select></td>
1803 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies'
1805 . qq|<br><input name=curr size=40 value="$form->{defaults}{curr}"></td>
1814 <th align=right nowrap>| . $locale->text('Last Invoice Number') . qq|</th>
1815 <td><input name=invnumber size=10 value=$form->{defaults}{invnumber}></td>
1816 <th align=right nowrap>|
1817 . $locale->text('Last Customer Number') . qq|</th>
1818 <td><input name=customernumber size=10 value=$form->{defaults}{customernumber}></td>
1821 <th align=right nowrap>|
1822 . $locale->text('Last Sales Order Number') . qq|</th>
1823 <td><input name=sonumber size=10 value=$form->{defaults}{sonumber}></td>
1824 <th align=right nowrap>|
1825 . $locale->text('Last Vendor Number') . qq|</th>
1826 <td><input name=vendornumber size=10 value=$form->{defaults}{vendornumber}></td>
1829 <th align=right nowrap>|
1830 . $locale->text('Last Purchase Order Number') . qq|</th>
1831 <td><input name=ponumber size=10 value=$form->{defaults}{ponumber}></td>
1832 <th align=right nowrap>|
1833 . $locale->text('Last Article Number') . qq|</th>
1834 <td><input name=articlenumber size=10 value=$form->{defaults}{articlenumber}></td>
1837 <th align=right nowrap>|
1838 . $locale->text('Last Sales Quotation Number') . qq|</th>
1839 <td><input name=sqnumber size=10 value=$form->{defaults}{sqnumber}></td>
1840 <th align=right nowrap>|
1841 . $locale->text('Last Service Number') . qq|</th>
1842 <td><input name=servicenumber size=10 value=$form->{defaults}{servicenumber}></td>
1845 <th align=right nowrap>| . $locale->text('Last RFQ Number') . qq|</th>
1846 <td><input name=rfqnumber size=10 value=$form->{defaults}{rfqnumber}></td>
1847 <th align=right nowrap></th>
1853 <tr class=listheading>
1854 <th colspan=2>| . $locale->text('Tax Accounts') . qq|</th>
1861 <th>| . $locale->text('Rate') . qq| (%)</th>
1862 <th>| . $locale->text('Number') . qq|</th>
1866 foreach $accno (sort keys %{ $form->{taxrates} }) {
1869 <th align=right>$form->{taxrates}{$accno}{description}</th>
1870 <td><input name=$form->{taxrates}{$accno}{id} size=6 value=$form->{taxrates}{$accno}{rate}></td>
1871 <td><input name="taxnumber_$form->{taxrates}{$accno}{id}" value="$form->{taxrates}{$accno}{taxnumber}"></td>
1874 $form->{taxaccounts} .= "$form->{taxrates}{$accno}{id} ";
1877 chop $form->{taxaccounts};
1880 <input name=taxaccounts type=hidden value="$form->{taxaccounts}">
1889 <td><hr size=3 noshade></td>
1893 <input type=hidden name=path value=$form->{path}>
1894 <input type=hidden name=login value=$form->{login}>
1895 <input type=hidden name=password value=$form->{password}>
1898 <input type=submit class=submit name=action value="|
1899 . $locale->text('Save') . qq|">|;
1901 if ($form->{menubar}) {
1902 require "$form->{path}/menu.pl";
1913 $lxdebug->leave_sub();
1916 sub save_preferences {
1917 $lxdebug->enter_sub();
1919 $form->{stylesheet} = $form->{usestylesheet};
1921 $form->redirect($locale->text('Preferences saved!'))
1923 AM->save_preferences(\%myconfig, \%$form, $memberfile, $userspath, $webdav
1925 $form->error($locale->text('Cannot save preferences!'));
1927 $lxdebug->leave_sub();
1931 $lxdebug->enter_sub();
1933 if ($form->{media} eq 'email') {
1934 $form->error($locale->text('No email address for') . " $myconfig{name}")
1935 unless ($myconfig{email});
1937 $form->{OUT} = "$sendmail";
1941 AM->backup(\%myconfig, \%$form, $userspath);
1943 if ($form->{media} eq 'email') {
1944 $form->redirect($locale->text('Backup sent to') . qq| $myconfig{email}|);
1947 $lxdebug->leave_sub();
1951 $lxdebug->enter_sub();
1953 $form->{title} = $locale->text('Audit Control');
1955 AM->closedto(\%myconfig, \%$form);
1957 if ($form->{revtrans}) {
1958 $checked{Y} = "checked";
1960 $checked{N} = "checked";
1968 <form method=post action=$form->{script}>
1970 <input type=hidden name=path value=$form->{path}>
1971 <input type=hidden name=login value=$form->{login}>
1972 <input type=hidden name=password value=$form->{password}>
1975 <tr><th class=listtop>$form->{title}</th></tr>
1976 <tr height="5"></tr>
1982 . $locale->text('Enforce transaction reversal for all dates') . qq|</th>
1983 <td><input name=revtrans class=radio type=radio value="1" $checked{Y}> |
1984 . $locale->text('Yes')
1985 . qq| <input name=revtrans class=radio type=radio value="0" $checked{N}> |
1986 . $locale->text('No')
1990 <th>| . $locale->text('Close Books up to') . qq|</th>
1991 <td><input name=closedto size=11 title="$myconfig{dateformat}" value=$form->{closedto}></td>
2001 <input type=hidden name=nextsub value=doclose>
2003 <input type=submit class=submit name=action value="|
2004 . $locale->text('Continue') . qq|">
2012 $lxdebug->leave_sub();
2016 $lxdebug->enter_sub();
2018 AM->closebooks(\%myconfig, \%$form);
2020 if ($form->{revtrans}) {
2022 $locale->text('Transaction reversal enforced for all dates'));
2024 if ($form->{closedto}) {
2026 $locale->text('Transaction reversal enforced up to') . " "
2027 . $locale->date(\%myconfig, $form->{closedto}, 1));
2029 $form->redirect($locale->text('Books are open'));
2033 $lxdebug->leave_sub();
2037 $lxdebug->enter_sub();
2039 $form->{title} = "Add";
2042 "$form->{script}?action=add_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}"
2043 unless $form->{callback};
2048 $lxdebug->leave_sub();
2051 sub edit_warehouse {
2052 $lxdebug->enter_sub();
2054 $form->{title} = "Edit";
2056 AM->get_warehouse(\%myconfig, \%$form);
2061 $lxdebug->leave_sub();
2064 sub list_warehouse {
2065 $lxdebug->enter_sub();
2067 AM->warehouses(\%myconfig, \%$form);
2070 "$form->{script}?action=list_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}";
2072 $callback = $form->escape($form->{callback});
2074 $form->{title} = $locale->text('Warehouses');
2076 @column_index = qw(description);
2078 $column_header{description} =
2079 qq|<th class=listheading width=100%>|
2080 . $locale->text('Description')
2090 <th class=listtop>$form->{title}</th>
2092 <tr height="5"></tr>
2096 <tr class=listheading>
2099 map { print "$column_header{$_}\n" } @column_index;
2105 foreach $ref (@{ $form->{ALL} }) {
2111 <tr valign=top class=listrow$i>
2114 $column_data{description} =
2115 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>|;
2117 map { print "$column_data{$_}\n" } @column_index;
2129 <td><hr size=3 noshade></td>
2134 <form method=post action=$form->{script}>
2136 <input name=callback type=hidden value="$form->{callback}">
2138 <input type=hidden name=type value=warehouse>
2140 <input type=hidden name=path value=$form->{path}>
2141 <input type=hidden name=login value=$form->{login}>
2142 <input type=hidden name=password value=$form->{password}>
2144 <input class=submit type=submit name=action value="|
2145 . $locale->text('Add') . qq|">|;
2147 if ($form->{menubar}) {
2148 require "$form->{path}/menu.pl";
2159 $lxdebug->leave_sub();
2162 sub warehouse_header {
2163 $lxdebug->enter_sub();
2165 $form->{title} = $locale->text("$form->{title} Warehouse");
2167 # $locale->text('Add Warehouse')
2168 # $locale->text('Edit Warehouse')
2170 $form->{description} =~ s/\"/"/g;
2172 if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
2174 qq|<textarea name="description" rows=$rows cols=60 wrap=soft>$form->{description}</textarea>|;
2177 qq|<input name=description size=60 value="$form->{description}">|;
2185 <form method=post action=$form->{script}>
2187 <input type=hidden name=id value=$form->{id}>
2188 <input type=hidden name=type value=warehouse>
2192 <th class=listtop colspan=2>$form->{title}</th>
2194 <tr height="5"></tr>
2196 <th align=right>| . $locale->text('Description') . qq|</th>
2197 <td>$description</td>
2200 <td colspan=2><hr size=3 noshade></td>
2205 $lxdebug->leave_sub();
2208 sub save_warehouse {
2209 $lxdebug->enter_sub();
2211 $form->isblank("description", $locale->text('Description missing!'));
2212 AM->save_warehouse(\%myconfig, \%$form);
2213 $form->redirect($locale->text('Warehouse saved!'));
2215 $lxdebug->leave_sub();
2218 sub delete_warehouse {
2219 $lxdebug->enter_sub();
2221 AM->delete_warehouse(\%myconfig, \%$form);
2222 $form->redirect($locale->text('Warehouse deleted!'));
2224 $lxdebug->leave_sub();
2228 $lxdebug->enter_sub();
2230 &{ $form->{nextsub} };
2232 $lxdebug->leave_sub();