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 # Entfernt bis es ordentlich umgesetzt wird (hli) 30.03.2006
263 # $form->{selectbilanz} = "<option>\n";
264 # foreach $item ((1, 2, 3, 4)) {
265 # if ($item == $form->{pos_bilanz}) {
266 # $form->{selectbilanz} .= "<option value=$item selected>$item\n";
268 # $form->{selectbilanz} .= "<option value=$item>$item\n";
275 # <th align=right>| . $locale->text('Bilanz') . qq|</th>
276 # <td><select name=pos_bilanz>$form->{selectbilanz}</select></td>
277 # <input type=hidden name=selectbilanz value="$form->{selectbilanz}">
280 # this is for our parser only!
281 # type=submit $locale->text('Add Account')
282 # type=submit $locale->text('Edit Account')
289 <form method=post action=$form->{script}>
291 <input type=hidden name=id value=$form->{id}>
292 <input type=hidden name=type value=account>
294 <input type=hidden name=inventory_accno_id value=$form->{inventory_accno_id}>
295 <input type=hidden name=income_accno_id value=$form->{income_accno_id}>
296 <input type=hidden name=expense_accno_id value=$form->{expense_accno_id}>
297 <input type=hidden name=fxgain_accno_id value=$form->{fxgain_accno_id}>
298 <input type=hidden name=fxloss_accno_id value=$form->{fxloss_accno_id}>
300 <table border=0 width=100%>
302 <th class=listtop>$form->{title}</th>
309 <th align=right>| . $locale->text('Account Number') . qq|</th>
310 <td><input name=accno size=20 value=$form->{accno}></td>
313 <th align=right>| . $locale->text('Description') . qq|</th>
314 <td><input name=description size=40 value="$form->{description}"></td>
317 <th align=right>| . $locale->text('Account Type') . qq|</th>
321 <td><input name=category type=radio class=radio value=A $checked{A_}> |
322 . $locale->text('Asset') . qq|\n<br>
323 <input name=category type=radio class=radio value=L $checked{L_}> |
324 . $locale->text('Liability') . qq|\n<br>
325 <input name=category type=radio class=radio value=Q $checked{Q_}> |
326 . $locale->text('Equity') . qq|\n<br>
327 <input name=category type=radio class=radio value=I $checked{I_}> |
328 . $locale->text('Revenue') . qq|\n<br>
329 <input name=category type=radio class=radio value=E $checked{E_}> |
330 . $locale->text('Expense') . qq|</td>
331 <td width=50> </td>
333 <input name=charttype type=radio class=radio value="H" $checked{H}> |
334 . $locale->text('Heading') . qq|<br>
335 <input name=charttype type=radio class=radio value="A" $checked{A}> |
336 . $locale->text('Account') . qq|</td>
343 if ($form->{charttype} eq "A") {
350 . $locale->text('Is this a summary account to record') . qq|</th>
352 <input name=AR type=checkbox class=checkbox value=AR $form->{AR}> |
353 . $locale->text('AR')
354 . qq| <input name=AP type=checkbox class=checkbox value=AP $form->{AP}> |
355 . $locale->text('AP')
356 . qq| <input name=IC type=checkbox class=checkbox value=IC $form->{IC}> |
357 . $locale->text('Inventory')
364 <th colspan=2>| . $locale->text('Include in drop-down menus') . qq|</th>
370 <th align=left>| . $locale->text('Receivables') . qq|</th>
371 <th align=left>| . $locale->text('Payables') . qq|</th>
372 <th align=left>| . $locale->text('Parts Inventory') . qq|</th>
373 <th align=left>| . $locale->text('Service Items') . qq|</th>
377 <input name=AR_amount type=checkbox class=checkbox value=AR_amount $form->{AR_amount}> |
378 . $locale->text('Revenue') . qq|\n<br>
379 <input name=AR_paid type=checkbox class=checkbox value=AR_paid $form->{AR_paid}> |
380 . $locale->text('Receipt') . qq|\n<br>
381 <input name=AR_tax type=checkbox class=checkbox value=AR_tax $form->{AR_tax}> |
382 . $locale->text('Tax') . qq|
385 <input name=AP_amount type=checkbox class=checkbox value=AP_amount $form->{AP_amount}> |
386 . $locale->text('Expense/Asset') . qq|\n<br>
387 <input name=AP_paid type=checkbox class=checkbox value=AP_paid $form->{AP_paid}> |
388 . $locale->text('Payment') . qq|\n<br>
389 <input name=AP_tax type=checkbox class=checkbox value=AP_tax $form->{AP_tax}> |
390 . $locale->text('Tax') . qq|
393 <input name=IC_sale type=checkbox class=checkbox value=IC_sale $form->{IC_sale}> |
394 . $locale->text('Revenue') . qq|\n<br>
395 <input name=IC_cogs type=checkbox class=checkbox value=IC_cogs $form->{IC_cogs}> |
396 . $locale->text('Expense') . qq|\n<br>
397 <input name=IC_taxpart type=checkbox class=checkbox value=IC_taxpart $form->{IC_taxpart}> |
398 . $locale->text('Tax') . qq|
401 <input name=IC_income type=checkbox class=checkbox value=IC_income $form->{IC_income}> |
402 . $locale->text('Revenue') . qq|\n<br>
403 <input name=IC_expense type=checkbox class=checkbox value=IC_expense $form->{IC_expense}> |
404 . $locale->text('Expense') . qq|\n<br>
405 <input name=IC_taxservice type=checkbox class=checkbox value=IC_taxservice $form->{IC_taxservice}> |
406 . $locale->text('Tax') . qq|
425 <td><hr size=3 noshade></td>
430 $lxdebug->leave_sub();
434 $lxdebug->enter_sub();
438 <input name=callback type=hidden value="$form->{callback}">
440 <input type=hidden name=path value=$form->{path}>
441 <input type=hidden name=login value=$form->{login}>
442 <input type=hidden name=password value=$form->{password}>
445 <input type=submit class=submit name=action value="|
446 . $locale->text('Save') . qq|">
449 if ($form->{id} && $form->{orphaned}) {
450 print qq|<input type=submit class=submit name=action value="|
451 . $locale->text('Delete') . qq|">|;
454 if ($form->{menubar}) {
455 require "$form->{path}/menu.pl";
466 $lxdebug->leave_sub();
470 $lxdebug->enter_sub();
472 $form->isblank("accno", $locale->text('Account Number missing!'));
473 $form->isblank("category", $locale->text('Account Type missing!'));
475 $form->redirect($locale->text('Account saved!'))
476 if (AM->save_account(\%myconfig, \%$form));
477 $form->error($locale->text('Cannot save account!'));
479 $lxdebug->leave_sub();
483 $lxdebug->enter_sub();
485 CA->all_accounts(\%myconfig, \%$form);
487 $form->{title} = $locale->text('Chart of Accounts');
491 "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}";
493 @column_index = qw(accno gifi_accno description debit credit link);
495 $column_header{accno} = qq|<th>| . $locale->text('Account') . qq|</a></th>|;
496 $column_header{gifi_accno} =
497 qq|<th>| . $locale->text('GIFI') . qq|</a></th>|;
498 $column_header{description} =
499 qq|<th>| . $locale->text('Description') . qq|</a></th>|;
500 $column_header{debit} = qq|<th>| . $locale->text('Debit') . qq|</a></th>|;
501 $column_header{credit} = qq|<th>| . $locale->text('Credit') . qq|</a></th>|;
502 $column_header{link} = qq|<th>| . $locale->text('Link') . qq|</a></th>|;
505 $colspan = $#column_index + 1;
512 <th class=listtop colspan=$colspan>$form->{title}</th>
515 <tr class=listheading>
518 map { print "$column_header{$_}\n" } @column_index;
525 $callback = $form->escape($callback);
527 foreach $ca (@{ $form->{CA} }) {
529 $ca->{debit} = " ";
530 $ca->{credit} = " ";
532 if ($ca->{amount} > 0) {
534 $form->format_amount(\%myconfig, $ca->{amount}, 2, " ");
536 if ($ca->{amount} < 0) {
538 $form->format_amount(\%myconfig, -$ca->{amount}, 2, " ");
541 $ca->{link} =~ s/:/<br>/og;
543 if ($ca->{charttype} eq "H") {
544 print qq|<tr class=listheading>|;
546 $column_data{accno} =
547 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>|;
548 $column_data{gifi_accno} =
549 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>|;
550 $column_data{description} = qq|<th>$ca->{description} </th>|;
551 $column_data{debit} = qq|<th> </th>|;
552 $column_data{credit} = qq| <th> </th>|;
553 $column_data{link} = qq|<th> </th>|;
559 <tr valign=top class=listrow$i>|;
560 $column_data{accno} =
561 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>|;
562 $column_data{gifi_accno} =
563 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>|;
564 $column_data{description} = qq|<td>$ca->{description} </td>|;
565 $column_data{debit} = qq|<td align=right>$ca->{debit}</td>|;
566 $column_data{credit} = qq|<td align=right>$ca->{credit}</td>|;
567 $column_data{link} = qq|<td>$ca->{link} </td>|;
571 map { print "$column_data{$_}\n" } @column_index;
577 <tr><td colspan=$colspan><hr size=3 noshade></td></tr>
584 $lxdebug->leave_sub();
588 $lxdebug->enter_sub();
590 $form->{title} = $locale->text('Delete Account');
593 qw(inventory_accno_id income_accno_id expense_accno_id fxgain_accno_id fxloss_accno_id)
595 if ($form->{id} == $form->{$id}) {
596 $form->error($locale->text('Cannot delete default account!'));
600 $form->redirect($locale->text('Account deleted!'))
601 if (AM->delete_account(\%myconfig, \%$form));
602 $form->error($locale->text('Cannot delete account!'));
604 $lxdebug->leave_sub();
608 $lxdebug->enter_sub();
610 @{ $form->{fields} } = (accno, description);
611 $form->{table} = "gifi";
612 $form->{sortorder} = "accno";
614 AM->gifi_accounts(\%myconfig, \%$form);
616 $form->{title} = $locale->text('GIFI');
620 "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
622 @column_index = qw(accno description);
624 $column_header{accno} = qq|<th>| . $locale->text('GIFI') . qq|</a></th>|;
625 $column_header{description} =
626 qq|<th>| . $locale->text('Description') . qq|</a></th>|;
629 $colspan = $#column_index + 1;
636 <th class=listtop colspan=$colspan>$form->{title}</th>
639 <tr class=listheading>
642 map { print "$column_header{$_}\n" } @column_index;
649 $callback = $form->escape($callback);
651 foreach $ca (@{ $form->{ALL} }) {
657 <tr valign=top class=listrow$i>|;
659 $column_data{accno} =
660 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>|;
661 $column_data{description} = qq|<td>$ca->{description} </td>|;
663 map { print "$column_data{$_}\n" } @column_index;
670 <td colspan=$colspan><hr size=3 noshade></td>
678 $lxdebug->leave_sub();
682 $lxdebug->enter_sub();
684 $form->{title} = "Add";
688 "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
695 $lxdebug->leave_sub();
699 $lxdebug->enter_sub();
701 $form->{title} = "Edit";
703 AM->get_gifi(\%myconfig, \%$form);
708 $lxdebug->leave_sub();
712 $lxdebug->enter_sub();
714 $form->{title} = $locale->text("$form->{title} GIFI");
716 # $locale->text('Add GIFI')
717 # $locale->text('Edit GIFI')
719 $form->{description} =~ s/\"/"/g;
726 <form method=post action=$form->{script}>
728 <input type=hidden name=id value=$form->{accno}>
729 <input type=hidden name=type value=gifi>
733 <th class=listtop>$form->{title}</th>
740 <th align=right>| . $locale->text('GIFI') . qq|</th>
741 <td><input name=accno size=20 value=$form->{accno}></td>
744 <th align=right>| . $locale->text('Description') . qq|</th>
745 <td><input name=description size=60 value="$form->{description}"></td>
751 <td colspan=2><hr size=3 noshade></td>
756 $lxdebug->leave_sub();
760 $lxdebug->enter_sub();
764 <input name=callback type=hidden value="$form->{callback}">
766 <input type=hidden name=path value=$form->{path}>
767 <input type=hidden name=login value=$form->{login}>
768 <input type=hidden name=password value=$form->{password}>
770 <br><input type=submit class=submit name=action value="|
771 . $locale->text('Save') . qq|">|;
775 <input type=submit class=submit name=action value="|
776 . $locale->text('Copy to COA') . qq|">
779 if ($form->{accno} && $form->{orphaned}) {
780 print qq|<input type=submit class=submit name=action value="|
781 . $locale->text('Delete') . qq|">|;
785 if ($form->{menubar}) {
786 require "$form->{path}/menu.pl";
797 $lxdebug->leave_sub();
801 $lxdebug->enter_sub();
803 $form->isblank("accno", $locale->text('GIFI missing!'));
804 AM->save_gifi(\%myconfig, \%$form);
805 $form->redirect($locale->text('GIFI saved!'));
807 $lxdebug->leave_sub();
811 $lxdebug->enter_sub();
813 $form->isblank("accno", $locale->text('GIFI missing!'));
815 AM->save_gifi(\%myconfig, \%$form);
818 $form->{gifi_accno} = $form->{accno};
819 $form->{title} = "Add";
820 $form->{charttype} = "A";
825 $lxdebug->leave_sub();
829 $lxdebug->enter_sub();
831 AM->delete_gifi(\%myconfig, \%$form);
832 $form->redirect($locale->text('GIFI deleted!'));
834 $lxdebug->leave_sub();
838 $lxdebug->enter_sub();
840 $form->{title} = "Add";
844 "$form->{script}?action=add_department&path=$form->{path}&login=$form->{login}&password=$form->{password}"
845 unless $form->{callback};
850 $lxdebug->leave_sub();
853 sub edit_department {
854 $lxdebug->enter_sub();
856 $form->{title} = "Edit";
858 AM->get_department(\%myconfig, \%$form);
863 $lxdebug->leave_sub();
866 sub list_department {
867 $lxdebug->enter_sub();
869 AM->departments(\%myconfig, \%$form);
872 "$form->{script}?action=list_department&path=$form->{path}&login=$form->{login}&password=$form->{password}";
874 $callback = $form->escape($form->{callback});
876 $form->{title} = $locale->text('Departments');
878 @column_index = qw(description cost profit);
880 $column_header{description} =
881 qq|<th class=listheading width=90%>|
882 . $locale->text('Description')
884 $column_header{cost} =
885 qq|<th class=listheading nowrap>|
886 . $locale->text('Cost Center')
888 $column_header{profit} =
889 qq|<th class=listheading nowrap>|
890 . $locale->text('Profit Center')
900 <th class=listtop>$form->{title}</th>
906 <tr class=listheading>
909 map { print "$column_header{$_}\n" } @column_index;
915 foreach $ref (@{ $form->{ALL} }) {
921 <tr valign=top class=listrow$i>
924 $costcenter = ($ref->{role} eq "C") ? "X" : "";
925 $profitcenter = ($ref->{role} eq "P") ? "X" : "";
927 $column_data{description} =
928 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>|;
929 $column_data{cost} = qq|<td align=center>$costcenter</td>|;
930 $column_data{profit} = qq|<td align=center>$profitcenter</td>|;
932 map { print "$column_data{$_}\n" } @column_index;
944 <td><hr size=3 noshade></td>
949 <form method=post action=$form->{script}>
951 <input name=callback type=hidden value="$form->{callback}">
953 <input type=hidden name=type value=department>
955 <input type=hidden name=path value=$form->{path}>
956 <input type=hidden name=login value=$form->{login}>
957 <input type=hidden name=password value=$form->{password}>
959 <input class=submit type=submit name=action value="|
960 . $locale->text('Add') . qq|">|;
962 if ($form->{menubar}) {
963 require "$form->{path}/menu.pl";
974 $lxdebug->leave_sub();
977 sub department_header {
978 $lxdebug->enter_sub();
980 $form->{title} = $locale->text("$form->{title} Department");
982 # $locale->text('Add Department')
983 # $locale->text('Edit Department')
985 $form->{description} =~ s/\"/"/g;
987 if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
989 qq|<textarea name="description" rows=$rows cols=60 wrap=soft>$form->{description}</textarea>|;
992 qq|<input name=description size=60 value="$form->{description}">|;
995 $costcenter = "checked" if $form->{role} eq "C";
996 $profitcenter = "checked" if $form->{role} eq "P";
1003 <form method=post action=$form->{script}>
1005 <input type=hidden name=id value=$form->{id}>
1006 <input type=hidden name=type value=department>
1010 <th class=listtop colspan=2>$form->{title}</th>
1012 <tr height="5"></tr>
1014 <th align=right>| . $locale->text('Description') . qq|</th>
1015 <td>$description</td>
1019 <td><input type=radio style=radio name=role value="C" $costcenter> |
1020 . $locale->text('Cost Center') . qq|
1021 <input type=radio style=radio name=role value="P" $profitcenter> |
1022 . $locale->text('Profit Center') . qq|
1025 <td colspan=2><hr size=3 noshade></td>
1030 $lxdebug->leave_sub();
1033 sub save_department {
1034 $lxdebug->enter_sub();
1036 $form->isblank("description", $locale->text('Description missing!'));
1037 AM->save_department(\%myconfig, \%$form);
1038 $form->redirect($locale->text('Department saved!'));
1040 $lxdebug->leave_sub();
1043 sub delete_department {
1044 $lxdebug->enter_sub();
1046 AM->delete_department(\%myconfig, \%$form);
1047 $form->redirect($locale->text('Department deleted!'));
1049 $lxdebug->leave_sub();
1053 $lxdebug->enter_sub();
1055 $form->{title} = "Add";
1058 "$form->{script}?action=add_business&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1059 unless $form->{callback};
1064 $lxdebug->leave_sub();
1068 $lxdebug->enter_sub();
1070 $form->{title} = "Edit";
1072 AM->get_business(\%myconfig, \%$form);
1076 $form->{orphaned} = 1;
1079 $lxdebug->leave_sub();
1083 $lxdebug->enter_sub();
1085 AM->business(\%myconfig, \%$form);
1088 "$form->{script}?action=list_business&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1090 $callback = $form->escape($form->{callback});
1092 $form->{title} = $locale->text('Type of Business');
1094 @column_index = qw(description discount customernumberinit);
1096 $column_header{description} =
1097 qq|<th class=listheading width=60%>|
1098 . $locale->text('Description')
1100 $column_header{discount} =
1101 qq|<th class=listheading width=10%>|
1102 . $locale->text('Discount')
1104 $column_header{customernumberinit} =
1105 qq|<th class=listheading>|
1106 . $locale->text('Customernumberinit')
1116 <th class=listtop>$form->{title}</th>
1118 <tr height="5"></tr>
1122 <tr class=listheading>
1125 map { print "$column_header{$_}\n" } @column_index;
1131 foreach $ref (@{ $form->{ALL} }) {
1137 <tr valign=top class=listrow$i>
1141 $form->format_amount(\%myconfig, $ref->{discount} * 100, 1, " ");
1144 ? "<b>$ref->{description}</b>"
1145 : "$ref->{description}";
1146 $column_data{description} =
1147 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>|;
1148 $column_data{discount} = qq|<td align=right>$discount</td>|;
1149 $column_data{customernumberinit} =
1150 qq|<td align=right>$ref->{customernumberinit}</td>|;
1152 map { print "$column_data{$_}\n" } @column_index;
1164 <td><hr size=3 noshade></td>
1169 <form method=post action=$form->{script}>
1171 <input name=callback type=hidden value="$form->{callback}">
1173 <input type=hidden name=type value=business>
1175 <input type=hidden name=path value=$form->{path}>
1176 <input type=hidden name=login value=$form->{login}>
1177 <input type=hidden name=password value=$form->{password}>
1179 <input class=submit type=submit name=action value="|
1180 . $locale->text('Add') . qq|">|;
1182 if ($form->{menubar}) {
1183 require "$form->{path}/menu.pl";
1195 $lxdebug->leave_sub();
1198 sub business_header {
1199 $lxdebug->enter_sub();
1201 $form->{title} = $locale->text("$form->{title} Business");
1202 $form->{salesman} = "checked" if $form->{salesman};
1204 # $locale->text('Add Business')
1205 # $locale->text('Edit Business')
1207 $form->{description} =~ s/\"/"/g;
1209 $form->format_amount(\%myconfig, $form->{discount} * 100);
1216 <form method=post action=$form->{script}>
1218 <input type=hidden name=id value=$form->{id}>
1219 <input type=hidden name=type value=business>
1223 <th class=listtop colspan=2>$form->{title}</th>
1225 <tr height="5"></tr>
1227 <th align=right>| . $locale->text('Type of Business') . qq|</th>
1228 <td><input name=description size=30 value="$form->{description}"></td>
1231 <th align=right>| . $locale->text('Discount') . qq| %</th>
1232 <td><input name=discount size=5 value=$form->{discount}></td>
1235 <th align=right>| . $locale->text('Customernumberinit') . qq|</th>
1236 <td><input name=customernumberinit size=10 value=$form->{customernumberinit}></td>
1239 <td align=right>| . $locale->text('Salesman') . qq|</td>
1240 <td><input name=salesman class=checkbox type=checkbox value=1 $form->{salesman}></td>
1242 <td colspan=2><hr size=3 noshade></td>
1247 $lxdebug->leave_sub();
1251 $lxdebug->enter_sub();
1253 $form->isblank("description", $locale->text('Description missing!'));
1254 AM->save_business(\%myconfig, \%$form);
1255 $form->redirect($locale->text('Business saved!'));
1257 $lxdebug->leave_sub();
1260 sub delete_business {
1261 $lxdebug->enter_sub();
1263 AM->delete_business(\%myconfig, \%$form);
1264 $form->redirect($locale->text('Business deleted!'));
1266 $lxdebug->leave_sub();
1270 $lxdebug->enter_sub();
1272 $form->{title} = "Add";
1275 "$form->{script}?action=add_sic&path=$form->{path}&login=$form->{login}&password=$form->{password}"
1276 unless $form->{callback};
1281 $lxdebug->leave_sub();
1285 $lxdebug->enter_sub();
1287 $form->{title} = "Edit";
1289 AM->get_sic(\%myconfig, \%$form);
1293 $form->{orphaned} = 1;
1296 $lxdebug->leave_sub();
1300 $lxdebug->enter_sub();
1302 AM->sic(\%myconfig, \%$form);
1305 "$form->{script}?action=list_sic&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1307 $callback = $form->escape($form->{callback});
1309 $form->{title} = $locale->text('Standard Industrial Codes');
1311 @column_index = qw(code description);
1313 $column_header{code} =
1314 qq|<th class=listheading>| . $locale->text('Code') . qq|</th>|;
1315 $column_header{description} =
1316 qq|<th class=listheading>| . $locale->text('Description') . qq|</th>|;
1325 <th class=listtop>$form->{title}</th>
1327 <tr height="5"></tr>
1331 <tr class=listheading>
1334 map { print "$column_header{$_}\n" } @column_index;
1340 foreach $ref (@{ $form->{ALL} }) {
1345 if ($ref->{sictype} eq 'H') {
1347 <tr valign=top class=listheading>
1349 $column_data{code} =
1350 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>|;
1351 $column_data{description} = qq|<th>$ref->{description}</th>|;
1355 <tr valign=top class=listrow$i>
1358 $column_data{code} =
1359 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>|;
1360 $column_data{description} = qq|<td>$ref->{description}</td>|;
1364 map { print "$column_data{$_}\n" } @column_index;
1376 <td><hr size=3 noshade></td>
1381 <form method=post action=$form->{script}>
1383 <input name=callback type=hidden value="$form->{callback}">
1385 <input type=hidden name=type value=sic>
1387 <input type=hidden name=path value=$form->{path}>
1388 <input type=hidden name=login value=$form->{login}>
1389 <input type=hidden name=password value=$form->{password}>
1391 <input class=submit type=submit name=action value="|
1392 . $locale->text('Add') . qq|">|;
1394 if ($form->{menubar}) {
1395 require "$form->{path}/menu.pl";
1406 $lxdebug->leave_sub();
1410 $lxdebug->enter_sub();
1412 $form->{title} = $locale->text("$form->{title} SIC");
1414 # $locale->text('Add SIC')
1415 # $locale->text('Edit SIC')
1417 $form->{code} =~ s/\"/"/g;
1418 $form->{description} =~ s/\"/"/g;
1420 $checked = ($form->{sictype} eq 'H') ? "checked" : "";
1427 <form method=post action=$form->{script}>
1429 <input type=hidden name=type value=sic>
1430 <input type=hidden name=id value=$form->{code}>
1434 <th class=listtop colspan=2>$form->{title}</th>
1436 <tr height="5"></tr>
1438 <th align=right>| . $locale->text('Code') . qq|</th>
1439 <td><input name=code size=10 value=$form->{code}></td>
1443 <th align=left><input name=sictype type=checkbox style=checkbox value="H" $checked> |
1444 . $locale->text('Heading') . qq|</th>
1447 <th align=right>| . $locale->text('Description') . qq|</th>
1448 <td><input name=description size=60 value="$form->{description}"></td>
1450 <td colspan=2><hr size=3 noshade></td>
1455 $lxdebug->leave_sub();
1459 $lxdebug->enter_sub();
1461 $form->isblank("code", $locale->text('Code missing!'));
1462 $form->isblank("description", $locale->text('Description missing!'));
1463 AM->save_sic(\%myconfig, \%$form);
1464 $form->redirect($locale->text('SIC saved!'));
1466 $lxdebug->leave_sub();
1470 $lxdebug->enter_sub();
1472 AM->delete_sic(\%myconfig, \%$form);
1473 $form->redirect($locale->text('SIC deleted!'));
1475 $lxdebug->leave_sub();
1478 sub display_stylesheet {
1479 $lxdebug->enter_sub();
1481 $form->{file} = "css/$myconfig{stylesheet}";
1484 $lxdebug->leave_sub();
1488 $lxdebug->enter_sub();
1490 $form->{file} =~ s/^(.:)*?\/|\.\.\///g;
1491 $form->{file} =~ s/^\/*//g;
1492 $form->{file} =~ s/$userspath//;
1494 $form->error("$!: $form->{file}") unless -f $form->{file};
1496 AM->load_template(\%$form);
1498 $form->{title} = $form->{file};
1500 # if it is anything but html
1501 if ($form->{file} !~ /\.html$/) {
1502 $form->{body} = "<pre>\n$form->{body}\n</pre>";
1512 <form method=post action=$form->{script}>
1514 <input name=file type=hidden value=$form->{file}>
1515 <input name=type type=hidden value=template>
1517 <input type=hidden name=path value=$form->{path}>
1518 <input type=hidden name=login value=$form->{login}>
1519 <input type=hidden name=password value=$form->{password}>
1521 <input name=action type=submit class=submit value="|
1522 . $locale->text('Edit') . qq|">|;
1524 if ($form->{menubar}) {
1525 require "$form->{path}/menu.pl";
1536 $lxdebug->leave_sub();
1540 $lxdebug->enter_sub();
1542 AM->load_template(\%$form);
1544 $form->{title} = $locale->text('Edit Template');
1546 # convert   to &nbsp;
1547 $form->{body} =~ s/ /&nbsp;/gi;
1554 <form method=post action=$form->{script}>
1556 <input name=file type=hidden value=$form->{file}>
1557 <input name=type type=hidden value=template>
1559 <input type=hidden name=path value=$form->{path}>
1560 <input type=hidden name=login value=$form->{login}>
1561 <input type=hidden name=password value=$form->{password}>
1563 <input name=callback type=hidden value="$form->{script}?action=display_form&file=$form->{file}&path=$form->{path}&login=$form->{login}&password=$form->{password}">
1565 <textarea name=body rows=25 cols=70>
1570 <input type=submit class=submit name=action value="|
1571 . $locale->text('Save') . qq|">|;
1573 if ($form->{menubar}) {
1574 require "$form->{path}/menu.pl";
1586 $lxdebug->leave_sub();
1590 $lxdebug->enter_sub();
1592 AM->save_template(\%$form);
1593 $form->redirect($locale->text('Template saved!'));
1595 $lxdebug->leave_sub();
1599 $lxdebug->enter_sub();
1601 # get defaults for account numbers and last numbers
1602 AM->defaultaccounts(\%myconfig, \%$form);
1604 foreach $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
1606 ($item eq $myconfig{dateformat})
1607 ? "<option selected>$item\n"
1608 : "<option>$item\n";
1611 foreach $item (qw(1,000.00 1000.00 1.000,00 1000,00)) {
1613 ($item eq $myconfig{numberformat})
1614 ? "<option selected>$item\n"
1615 : "<option>$item\n";
1618 foreach $item (qw(name company address signature)) {
1619 $myconfig{$item} =~ s/\"/"/g;
1622 foreach $item (qw(address signature)) {
1623 $myconfig{$item} =~ s/\\n/\r\n/g;
1626 %countrycodes = User->country_codes;
1628 foreach $key (sort { $countrycodes{$a} cmp $countrycodes{$b} }
1632 ($myconfig{countrycode} eq $key)
1633 ? "<option selected value=$key>$countrycodes{$key}\n"
1634 : "<option value=$key>$countrycodes{$key}\n";
1636 $countrycodes = "<option>American English\n$countrycodes";
1638 # use an other input number format than output numberformat
1639 # look at Form.pm, sub parse_amount
1640 my $in_numberformat = '';
1641 $text1 = qq|value="0">| . $locale->text('equal Outputformat');
1642 $text2 = qq|value="1">| . $locale->text('1000,00 or 1000.00');
1643 @in_nf = ($text1, $text2);
1644 foreach $item (@in_nf) {
1646 (substr($item, 7, 1) eq $myconfig{in_numberformat})
1647 ? "<option selected $item\n"
1648 : "<option $item\n";
1651 foreach $key (keys %{ $form->{IC} }) {
1652 foreach $accno (sort keys %{ $form->{IC}{$key} }) {
1654 ($form->{IC}{$key}{$accno}{id} == $form->{defaults}{$key})
1655 ? "<option selected>$accno--$form->{IC}{$key}{$accno}{description}\n"
1656 : "<option>$accno--$form->{IC}{$key}{$accno}{description}\n";
1660 opendir CSS, "css/.";
1661 @all = grep /.*\.css$/, readdir CSS;
1664 foreach $item (@all) {
1665 if ($item eq $myconfig{stylesheet}) {
1666 $selectstylesheet .= qq|<option selected>$item\n|;
1668 $selectstylesheet .= qq|<option>$item\n|;
1671 $selectstylesheet .= "<option>\n";
1673 $form->{title} = $locale->text('Edit Preferences for') . qq| $form->{login}|;
1677 if ($myconfig{menustyle} eq "old") { $oldS = "checked"; }
1678 else { $newS = "checked"; }
1683 <form method=post action=$form->{script}>
1685 <input type=hidden name=old_password value=$myconfig{password}>
1686 <input type=hidden name=type value=preferences>
1687 <input type=hidden name=role value=$myconfig{role}>
1690 <tr><th class=listtop>$form->{title}</th></tr>
1695 <th align=right>| . $locale->text('Name') . qq|</th>
1696 <td><input name=name size=15 value="$myconfig{name}"></td>
1699 <th align=right>| . $locale->text('Password') . qq|</th>
1700 <td><input type=password name=new_password size=10 value=$myconfig{password}></td>
1703 <th align=right>| . $locale->text('E-mail') . qq|</th>
1704 <td><input name=email size=30 value="$myconfig{email}"></td>
1707 <th align=right>| . $locale->text('Signature') . qq|</th>
1708 <td><textarea name=signature rows=3 cols=50>$myconfig{signature}</textarea></td>
1711 <th align=right>| . $locale->text('Phone') . qq|</th>
1712 <td><input name=tel size=14 value="$myconfig{tel}"></td>
1715 <th align=right>| . $locale->text('Fax') . qq|</th>
1716 <td><input name=fax size=14 value="$myconfig{fax}"></td>
1719 <th align=right>| . $locale->text('Company') . qq|</th>
1720 <td><input name=company size=30 value="$myconfig{company}"></td>
1723 <th align=right>| . $locale->text('Address') . qq|</th>
1724 <td><textarea name=address rows=4 cols=50>$myconfig{address}</textarea></td>
1727 <th align=right>| . $locale->text('Date Format') . qq|</th>
1728 <td><select name=dateformat>$dateformat</select></td>
1731 <th align=right>| . $locale->text('Output Number Format') . qq|</th>
1732 <td><select name=numberformat>$numberformat</select></td>
1735 <th align=right>| . $locale->text('Input Number Format') . qq|</th>
1736 <td><select name=in_numberformat>$in_numberformat</select></td>
1740 <th align=right>| . $locale->text('Dropdown Limit') . qq|</th>
1741 <td><input name=vclimit size=10 value="$myconfig{vclimit}"></td>
1744 <th align=right>| . $locale->text('Language') . qq|</th>
1745 <td><select name=countrycode>$countrycodes</select></td>
1748 <th align=right>| . $locale->text('Stylesheet') . qq|</th>
1749 <td><select name=usestylesheet>$selectstylesheet</select></td>
1752 <th align=right>| . $locale->text('Setup Menu') . qq|</th>
1753 <td><input name=menustyle type=radio class=radio value=neu $newS> New
1754 <input name=menustyle type=radio class=radio value=old $oldS> Old</td>
1756 <input name=printer type=hidden value="$myconfig{printer}">
1757 <tr class=listheading>
1758 <th colspan=2> </th>
1761 <th align=right>| . $locale->text('Business Number') . qq|</th>
1762 <td><input name=businessnumber size=25 value="$myconfig{businessnumber}"></td>
1768 <th align=right>| . $locale->text('Year End') . qq| (mm/dd)</th>
1769 <td><input name=yearend size=5 value=$form->{defaults}{yearend}></td>
1770 <th align=right>| . $locale->text('Weight Unit') . qq|</th>
1771 <td><input name=weightunit size=5 value="$form->{defaults}{weightunit}"></td>
1776 <tr class=listheading>
1778 . $locale->text('Last Numbers & Default Accounts') . qq|</th>
1784 <th align=right nowrap>| . $locale->text('Inventory Account') . qq|</th>
1785 <td><select name=inventory_accno>$myconfig{IC}</select></td>
1788 <th align=right nowrap>| . $locale->text('Revenue Account') . qq|</th>
1789 <td><select name=income_accno>$myconfig{IC_income}</select></td>
1792 <th align=right nowrap>| . $locale->text('Expense Account') . qq|</th>
1793 <td><select name=expense_accno>$myconfig{IC_expense}</select></td>
1796 <th align=right nowrap>| . $locale->text('Foreign Exchange Gain') . qq|</th>
1797 <td><select name=fxgain_accno>$myconfig{FX_gain}</select></td>
1800 <th align=right nowrap>| . $locale->text('Foreign Exchange Loss') . qq|</th>
1801 <td><select name=fxloss_accno>$myconfig{FX_loss}</select></td>
1806 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies'
1808 . qq|<br><input name=curr size=40 value="$form->{defaults}{curr}"></td>
1817 <th align=right nowrap>| . $locale->text('Last Invoice Number') . qq|</th>
1818 <td><input name=invnumber size=10 value=$form->{defaults}{invnumber}></td>
1819 <th align=right nowrap>|
1820 . $locale->text('Last Customer Number') . qq|</th>
1821 <td><input name=customernumber size=10 value=$form->{defaults}{customernumber}></td>
1824 <th align=right nowrap>|
1825 . $locale->text('Last Sales Order Number') . qq|</th>
1826 <td><input name=sonumber size=10 value=$form->{defaults}{sonumber}></td>
1827 <th align=right nowrap>|
1828 . $locale->text('Last Vendor Number') . qq|</th>
1829 <td><input name=vendornumber size=10 value=$form->{defaults}{vendornumber}></td>
1832 <th align=right nowrap>|
1833 . $locale->text('Last Purchase Order Number') . qq|</th>
1834 <td><input name=ponumber size=10 value=$form->{defaults}{ponumber}></td>
1835 <th align=right nowrap>|
1836 . $locale->text('Last Article Number') . qq|</th>
1837 <td><input name=articlenumber size=10 value=$form->{defaults}{articlenumber}></td>
1840 <th align=right nowrap>|
1841 . $locale->text('Last Sales Quotation Number') . qq|</th>
1842 <td><input name=sqnumber size=10 value=$form->{defaults}{sqnumber}></td>
1843 <th align=right nowrap>|
1844 . $locale->text('Last Service Number') . qq|</th>
1845 <td><input name=servicenumber size=10 value=$form->{defaults}{servicenumber}></td>
1848 <th align=right nowrap>| . $locale->text('Last RFQ Number') . qq|</th>
1849 <td><input name=rfqnumber size=10 value=$form->{defaults}{rfqnumber}></td>
1850 <th align=right nowrap></th>
1856 <tr class=listheading>
1857 <th colspan=2>| . $locale->text('Tax Accounts') . qq|</th>
1864 <th>| . $locale->text('Rate') . qq| (%)</th>
1865 <th>| . $locale->text('Number') . qq|</th>
1869 foreach $accno (sort keys %{ $form->{taxrates} }) {
1872 <th align=right>$form->{taxrates}{$accno}{description}</th>
1873 <td><input name=$form->{taxrates}{$accno}{id} size=6 value=$form->{taxrates}{$accno}{rate}></td>
1874 <td><input name="taxnumber_$form->{taxrates}{$accno}{id}" value="$form->{taxrates}{$accno}{taxnumber}"></td>
1877 $form->{taxaccounts} .= "$form->{taxrates}{$accno}{id} ";
1880 chop $form->{taxaccounts};
1883 <input name=taxaccounts type=hidden value="$form->{taxaccounts}">
1892 <td><hr size=3 noshade></td>
1896 <input type=hidden name=path value=$form->{path}>
1897 <input type=hidden name=login value=$form->{login}>
1898 <input type=hidden name=password value=$form->{password}>
1901 <input type=submit class=submit name=action value="|
1902 . $locale->text('Save') . qq|">|;
1904 if ($form->{menubar}) {
1905 require "$form->{path}/menu.pl";
1916 $lxdebug->leave_sub();
1919 sub save_preferences {
1920 $lxdebug->enter_sub();
1922 $form->{stylesheet} = $form->{usestylesheet};
1924 $form->redirect($locale->text('Preferences saved!'))
1926 AM->save_preferences(\%myconfig, \%$form, $memberfile, $userspath, $webdav
1928 $form->error($locale->text('Cannot save preferences!'));
1930 $lxdebug->leave_sub();
1934 $lxdebug->enter_sub();
1936 if ($form->{media} eq 'email') {
1937 $form->error($locale->text('No email address for') . " $myconfig{name}")
1938 unless ($myconfig{email});
1940 $form->{OUT} = "$sendmail";
1944 AM->backup(\%myconfig, \%$form, $userspath);
1946 if ($form->{media} eq 'email') {
1947 $form->redirect($locale->text('Backup sent to') . qq| $myconfig{email}|);
1950 $lxdebug->leave_sub();
1954 $lxdebug->enter_sub();
1956 $form->{title} = $locale->text('Audit Control');
1958 AM->closedto(\%myconfig, \%$form);
1960 if ($form->{revtrans}) {
1961 $checked{Y} = "checked";
1963 $checked{N} = "checked";
1971 <form method=post action=$form->{script}>
1973 <input type=hidden name=path value=$form->{path}>
1974 <input type=hidden name=login value=$form->{login}>
1975 <input type=hidden name=password value=$form->{password}>
1978 <tr><th class=listtop>$form->{title}</th></tr>
1979 <tr height="5"></tr>
1985 . $locale->text('Enforce transaction reversal for all dates') . qq|</th>
1986 <td><input name=revtrans class=radio type=radio value="1" $checked{Y}> |
1987 . $locale->text('Yes')
1988 . qq| <input name=revtrans class=radio type=radio value="0" $checked{N}> |
1989 . $locale->text('No')
1993 <th>| . $locale->text('Close Books up to') . qq|</th>
1994 <td><input name=closedto size=11 title="$myconfig{dateformat}" value=$form->{closedto}></td>
2004 <input type=hidden name=nextsub value=doclose>
2006 <input type=submit class=submit name=action value="|
2007 . $locale->text('Continue') . qq|">
2015 $lxdebug->leave_sub();
2019 $lxdebug->enter_sub();
2021 AM->closebooks(\%myconfig, \%$form);
2023 if ($form->{revtrans}) {
2025 $locale->text('Transaction reversal enforced for all dates'));
2027 if ($form->{closedto}) {
2029 $locale->text('Transaction reversal enforced up to') . " "
2030 . $locale->date(\%myconfig, $form->{closedto}, 1));
2032 $form->redirect($locale->text('Books are open'));
2036 $lxdebug->leave_sub();
2040 $lxdebug->enter_sub();
2042 $form->{title} = "Add";
2045 "$form->{script}?action=add_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}"
2046 unless $form->{callback};
2051 $lxdebug->leave_sub();
2054 sub edit_warehouse {
2055 $lxdebug->enter_sub();
2057 $form->{title} = "Edit";
2059 AM->get_warehouse(\%myconfig, \%$form);
2064 $lxdebug->leave_sub();
2067 sub list_warehouse {
2068 $lxdebug->enter_sub();
2070 AM->warehouses(\%myconfig, \%$form);
2073 "$form->{script}?action=list_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}";
2075 $callback = $form->escape($form->{callback});
2077 $form->{title} = $locale->text('Warehouses');
2079 @column_index = qw(description);
2081 $column_header{description} =
2082 qq|<th class=listheading width=100%>|
2083 . $locale->text('Description')
2093 <th class=listtop>$form->{title}</th>
2095 <tr height="5"></tr>
2099 <tr class=listheading>
2102 map { print "$column_header{$_}\n" } @column_index;
2108 foreach $ref (@{ $form->{ALL} }) {
2114 <tr valign=top class=listrow$i>
2117 $column_data{description} =
2118 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>|;
2120 map { print "$column_data{$_}\n" } @column_index;
2132 <td><hr size=3 noshade></td>
2137 <form method=post action=$form->{script}>
2139 <input name=callback type=hidden value="$form->{callback}">
2141 <input type=hidden name=type value=warehouse>
2143 <input type=hidden name=path value=$form->{path}>
2144 <input type=hidden name=login value=$form->{login}>
2145 <input type=hidden name=password value=$form->{password}>
2147 <input class=submit type=submit name=action value="|
2148 . $locale->text('Add') . qq|">|;
2150 if ($form->{menubar}) {
2151 require "$form->{path}/menu.pl";
2162 $lxdebug->leave_sub();
2165 sub warehouse_header {
2166 $lxdebug->enter_sub();
2168 $form->{title} = $locale->text("$form->{title} Warehouse");
2170 # $locale->text('Add Warehouse')
2171 # $locale->text('Edit Warehouse')
2173 $form->{description} =~ s/\"/"/g;
2175 if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
2177 qq|<textarea name="description" rows=$rows cols=60 wrap=soft>$form->{description}</textarea>|;
2180 qq|<input name=description size=60 value="$form->{description}">|;
2188 <form method=post action=$form->{script}>
2190 <input type=hidden name=id value=$form->{id}>
2191 <input type=hidden name=type value=warehouse>
2195 <th class=listtop colspan=2>$form->{title}</th>
2197 <tr height="5"></tr>
2199 <th align=right>| . $locale->text('Description') . qq|</th>
2200 <td>$description</td>
2203 <td colspan=2><hr size=3 noshade></td>
2208 $lxdebug->leave_sub();
2211 sub save_warehouse {
2212 $lxdebug->enter_sub();
2214 $form->isblank("description", $locale->text('Description missing!'));
2215 AM->save_warehouse(\%myconfig, \%$form);
2216 $form->redirect($locale->text('Warehouse saved!'));
2218 $lxdebug->leave_sub();
2221 sub delete_warehouse {
2222 $lxdebug->enter_sub();
2224 AM->delete_warehouse(\%myconfig, \%$form);
2225 $form->redirect($locale->text('Warehouse deleted!'));
2227 $lxdebug->leave_sub();
2231 $lxdebug->enter_sub();
2233 &{ $form->{nextsub} };
2235 $lxdebug->leave_sub();