1 #=====================================================================
2 # SQL-Ledger Accounting
3 # Copyright (c) 1998-2002
5 # Author: Dieter Simader
6 # Email: dsimader@sql-ledger.org
7 # Web: http://www.sql-ledger.org
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #======================================================================
26 #======================================================================
42 $form->{title} = "Add";
43 $form->{charttype} = "A";
45 $form->{callback} = "$form->{script}?action=list&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback};
54 $form->{title} = "Edit";
58 $form->{type} = "template";
63 AM->get_account(\%myconfig, \%$form);
65 foreach my $item (split(/:/, $form->{link})) {
66 $form->{$item} = "checked";
77 $form->{title} = $locale->text("$form->{title} Account");
79 $checked{$form->{charttype}} = "checked";
80 $checked{"$form->{category}_"} = "checked";
81 $checked{CT_tax} = ($form->{CT_tax}) ? "" : "checked";
83 $form->{description} =~ s/"/"/g;
85 # this is for our parser only!
86 # type=submit $locale->text('Add Account')
87 # type=submit $locale->text('Edit Account')
94 <form method=post action=$form->{script}>
96 <input type=hidden name=id value=$form->{id}>
97 <input type=hidden name=type value=account>
99 <input type=hidden name=inventory_accno_id value=$form->{inventory_accno_id}>
100 <input type=hidden name=income_accno_id value=$form->{income_accno_id}>
101 <input type=hidden name=expense_accno_id value=$form->{expense_accno_id}>
102 <input type=hidden name=fxgain_accno_id values=$form->{fxgain_accno_id}>
103 <input type=hidden name=fxloss_accno_id values=$form->{fxloss_accno_id}>
105 <input type=hidden name=amount value=$form->{amount}>
107 <table border=0 width=100%>
109 <th class=listtop>$form->{title}</th>
116 <th align=right>|.$locale->text('Account Number').qq|</th>
117 <td><input name=accno size=20 value=$form->{accno}></td>
120 <th align=right>|.$locale->text('Description').qq|</th>
121 <td><input name=description size=40 value="$form->{description}"></td>
124 <th align=right>|.$locale->text('Account Type').qq|</th>
128 <td><input name=category type=radio class=radio value=A $checked{A_}> |.$locale->text('Asset').qq|\n<br>
129 <input name=category type=radio class=radio value=L $checked{L_}> |.$locale->text('Liability').qq|\n<br>
130 <input name=category type=radio class=radio value=Q $checked{Q_}> |.$locale->text('Equity').qq|\n<br>
131 <input name=category type=radio class=radio value=I $checked{I_}> |.$locale->text('Income').qq|\n<br>
132 <input name=category type=radio class=radio value=E $checked{E_}> |.$locale->text('Expense')
135 <input name=charttype type=radio class=radio value="H" $checked{H}> |.$locale->text('Heading').qq|<br>
136 <input name=charttype type=radio class=radio value="A" $checked{A}> |.$locale->text('Account')
145 if ($form->{charttype} eq "A") {
151 <th align=left>|.$locale->text('Is this a summary account to record').qq|</th>
153 <input name=AR type=checkbox class=checkbox value=AR $form->{AR}> |.$locale->text('AR')
154 .qq| <input name=AP type=checkbox class=checkbox value=AP $form->{AP}> |.$locale->text('AP')
155 .qq| <input name=IC type=checkbox class=checkbox value=IC $form->{IC}> |.$locale->text('Inventory')
162 <th colspan=2>|.$locale->text('Include in drop-down menus').qq|</th>
168 <th align=left>|.$locale->text('Receivables').qq|</th>
169 <th align=left>|.$locale->text('Payables').qq|</th>
170 <th align=left>|.$locale->text('Parts Inventory').qq|</th>
171 <th align=left>|.$locale->text('Service Items').qq|</th>
175 <input name=AR_amount type=checkbox class=checkbox value=AR_amount $form->{AR_amount}> |.$locale->text('Income').qq|\n<br>
176 <input name=AR_paid type=checkbox class=checkbox value=AR_paid $form->{AR_paid}> |.$locale->text('Payment').qq|\n<br>
177 <input name=AR_tax type=checkbox class=checkbox value=AR_tax $form->{AR_tax}> |.$locale->text('Tax')
181 <input name=AP_amount type=checkbox class=checkbox value=AP_amount $form->{AP_amount}> |.$locale->text('Expense/Asset').qq|\n<br>
182 <input name=AP_paid type=checkbox class=checkbox value=AP_paid $form->{AP_paid}> |.$locale->text('Payment').qq|\n<br>
183 <input name=AP_tax type=checkbox class=checkbox value=AP_tax $form->{AP_tax}> |.$locale->text('Tax')
187 <input name=IC_sale type=checkbox class=checkbox value=IC_sale $form->{IC_sale}> |.$locale->text('Sales').qq|\n<br>
188 <input name=IC_cogs type=checkbox class=checkbox value=IC_cogs $form->{IC_cogs}> |.$locale->text('COGS').qq|\n<br>
189 <input name=IC_taxpart type=checkbox class=checkbox value=IC_taxpart $form->{IC_taxpart}> |.$locale->text('Tax')
193 <input name=IC_income type=checkbox class=checkbox value=IC_income $form->{IC_income}> |.$locale->text('Income').qq|\n<br>
194 <input name=IC_expense type=checkbox class=checkbox value=IC_expense $form->{IC_expense}> |.$locale->text('Expense').qq|\n<br>
195 <input name=IC_taxservice type=checkbox class=checkbox value=IC_taxservice $form->{IC_taxservice}> |.$locale->text('Tax')
206 <th align=left>|.$locale->text('Include this account on the customer/vendor forms to flag customer/vendor as taxable?').qq|</th>
208 <input name=CT_tax type=radio class=radio value=CT_tax $form->{CT_tax}> |.$locale->text('Yes').qq|
209 <input name=CT_tax type=radio class=radio value="" $checked{CT_tax}> |.$locale->text('No')
221 <th align=right>|.$locale->text('GIFI').qq|</th>
222 <td><input name=gifi_accno size=9 value=$form->{gifi_accno}></td>
228 <td><hr size=3 noshade></td>
240 <input name=callback type=hidden value="$form->{callback}">
242 <input type=hidden name=path value=$form->{path}>
243 <input type=hidden name=login value=$form->{login}>
244 <input type=hidden name=password value=$form->{password}>
247 <input type=submit class=submit name=action value="|.$locale->text('Save').qq|">
251 print qq|<input type=submit class=submit name=action value="|.$locale->text('Delete').qq|">|;
264 sub save { &{ "save_$form->{type}" } };
268 $form->isblank("accno", $locale->text('Account Number missing!'));
269 $form->isblank("category", $locale->text('Account Type missing!'));
271 $form->redirect($locale->text('Account saved!')) if (AM->save_account(\%myconfig, \%$form));
272 $form->error($locale->text('Cannot save account!'));
279 CA->all_accounts(\%myconfig, \%$form);
281 $form->{title} = $locale->text('Chart of Accounts');
284 $callback = "$form->{script}?action=list&path=$form->{path}&login=$form->{login}&password=$form->{password}";
286 @column_index = qw(accno gifi_accno description debit credit link);
288 $column_header{accno} = qq|<th class=listheading>|.$locale->text('Account').qq|</a></th>|;
289 $column_header{gifi_accno} = qq|<th class=listheading>|.$locale->text('GIFI').qq|</a></th>|;
290 $column_header{description} = qq|<th class=listheading>|.$locale->text('Description').qq|</a></th>|;
291 $column_header{debit} = qq|<th class=listheading>|.$locale->text('Debit').qq|</a></th>|;
292 $column_header{credit} = qq|<th class=listheading>|.$locale->text('Credit').qq|</a></th>|;
293 $column_header{link} = qq|<th class=listheading>|.$locale->text('Link').qq|</a></th>|;
297 $colspan = $#column_index + 1;
302 <table border=0 width=100%>
303 <tr><th class=listtop colspan=$colspan>$form->{title}</th></tr>
305 <tr class=listheading>
308 map { print "$column_header{$_}\n" } @column_index;
315 $callback = $form->escape($callback);
317 foreach $ca (@{ $form->{CA} }) {
319 $ca->{debit} = " ";
320 $ca->{credit} = " ";
322 # needed if we can delete an account
325 if ($ca->{amount} > 0) {
326 $amount = $ca->{amount};
327 $ca->{credit} = $form->format_amount(\%myconfig, $ca->{amount}, 2, " ");
329 if ($ca->{amount} < 0) {
330 $amount = -$ca->{amount};
331 $ca->{debit} = $form->format_amount(\%myconfig, -$ca->{amount}, 2, " ");
334 $ca->{link} =~ s/:/<br>/og;
336 if ($ca->{charttype} eq "H") {
337 print qq|<tr class=listheading>|;
339 $column_data{accno} = qq|<th><a class=listheading href=$form->{script}?action=edit&id=$ca->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}</a></th>|;
340 $column_data{gifi_accno} = qq|<th><a class=listheading 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>|;
341 $column_data{description} = qq|<th class=listheading>$ca->{description} </th>|;
342 $column_data{debit} = qq|<th> </th>|;
343 $column_data{credit} = qq| <th> </th>|;
344 $column_data{link} = qq|<th> </th>|;
349 <tr valign=top class=listrow$i>|;
350 $column_data{accno} = qq|<td><a href=$form->{script}?action=edit&id=$ca->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback&amount=$amount>$ca->{accno}</a></td>|;
351 $column_data{gifi_accno} = qq|<td><a href=$form->{script}?action=edit_gifi&accno=$ca->{gifi_accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback&amount=$amount>$ca->{gifi_accno}</a> </td>|;
352 $column_data{description} = qq|<td>$ca->{description} </td>|;
353 $column_data{debit} = qq|<td align=right>$ca->{debit}</td>|;
354 $column_data{credit} = qq|<td align=right>$ca->{credit}</td>|;
355 $column_data{link} = qq|<td>$ca->{link} </td>|;
359 map { print "$column_data{$_}\n" } @column_index;
365 <tr><td colspan=$colspan><hr size=3 noshade></td></tr>
375 sub delete { &{ "delete_$form->{type}" } };
379 $form->{title} = $locale->text('Delete Account');
381 if ($form->{amount} != 0) {
382 $form->error($locale->text('Transactions exist; cannot delete account!'));
385 foreach $id (qw(inventory_accno_id income_accno_id expense_accno_id fxgain_accno_id fxloss_accno_id)) {
386 if ($form->{id} == $form->{$id}) {
387 $form->error($locale->text('Cannot delete default account!'));
391 $form->redirect($locale->text('Account deleted!')) if (AM->delete_account(\%myconfig, \%$form));
392 $form->error($locale->text('Cannot delete account!'));
399 @{ $form->{fields} } = (accno, description);
400 $form->{table} = "gifi";
401 $form->{sortorder} = "accno";
403 AM->gifi_accounts(\%myconfig, \%$form);
405 $form->{title} = $locale->text('GIFI');
408 $callback = "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
410 @column_index = qw(accno description);
412 $column_header{accno} = qq|<th class=listheading>|.$locale->text('GIFI').qq|</a></th>|;
413 $column_header{description} = qq|<th class=listheading>|.$locale->text('Description').qq|</a></th>|;
417 $colspan = $#column_index + 1;
422 <table border=0 width=100%>
423 <tr><th class=listtop colspan=$colspan>$form->{title}</th></tr>
425 <tr class=listheading>
428 map { print "$column_header{$_}\n" } @column_index;
435 $callback = $form->escape($callback);
437 foreach $ca (@{ $form->{ALL} }) {
442 <tr valign=top class=listrow$i>|;
444 $column_data{accno} = qq|<td><a href=$form->{script}?action=edit_gifi&coa=1&accno=$ca->{accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}</td>|;
445 $column_data{description} = qq|<td>$ca->{description} </td>|;
447 map { print "$column_data{$_}\n" } @column_index;
454 <td colspan=$colspan><hr size=3 noshade></td>
466 $form->{title} = "Add";
469 $form->{callback} = "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
481 $form->{title} = "Edit";
483 AM->get_gifi(\%myconfig, \%$form);
493 $form->{title} = $locale->text("$form->{title} GIFI");
495 # $locale->text('Add GIFI')
496 # $locale->text('Edit GIFI')
498 $form->{description} =~ s/"/"/g;
505 <form method=post action=$form->{script}>
507 <input type=hidden name=id value=$form->{accno}>
508 <input type=hidden name=type value=gifi>
512 <th class=listtop>$form->{title}</th>
519 <th align=right>|.$locale->text('GIFI').qq|</th>
520 <td><input name=accno size=20 value=$form->{accno}></td>
523 <th align=right>|.$locale->text('Description').qq|</th>
524 <td><input name=description size=60 value="$form->{description}"></td>
530 <td colspan=2><hr size=3 noshade></td>
542 <input name=callback type=hidden value="$form->{callback}">
544 <input type=hidden name=path value=$form->{path}>
545 <input type=hidden name=login value=$form->{login}>
546 <input type=hidden name=password value=$form->{password}>
548 <br><input type=submit class=submit name=action value="|.$locale->text('Save').qq|">
553 <input type=submit class=submit name=action value="|.$locale->text('Copy to COA').qq|">
556 if ($form->{accno}) {
557 print qq|<input type=submit class=submit name=action value="|.$locale->text('Delete').qq|">|;
573 $form->isblank("accno", $locale->text('GIFI missing!'));
574 AM->save_gifi(\%myconfig, \%$form);
575 $form->redirect($locale->text('GIFI saved!'));
582 $form->isblank("accno", $locale->text('GIFI missing!'));
584 AM->save_gifi(\%myconfig, \%$form);
587 $form->{gifi_accno} = $form->{accno};
588 $form->{title} = "Add";
589 $form->{charttype} = "A";
599 AM->delete_gifi(\%myconfig, \%$form);
600 $form->redirect($locale->text('GIFI deleted!'));
605 sub display_stylesheet {
607 $form->{file} = "css/$myconfig{stylesheet}";
615 $form->{file} =~ s/^(.:)*?\/|\.\.\///g;
616 $form->{file} =~ s/^\/*//g;
617 $form->{file} =~ s/$userspath//;
619 $form->error("$!: $form->{file}") unless -f $form->{file};
621 AM->load_template(\%$form);
623 $form->{title} = $form->{file};
625 # if it is anything but html
626 if ($form->{file} !~ /\.html$/) {
627 $form->{body} = "<pre>\n$form->{body}\n</pre>";
637 <form method=post action=$form->{script}>
639 <input name=file type=hidden value=$form->{file}>
641 <input type=hidden name=path value=$form->{path}>
642 <input type=hidden name=login value=$form->{login}>
643 <input type=hidden name=password value=$form->{password}>
645 <input name=action type=submit class=submit value="|.$locale->text('Edit').qq|">
658 AM->load_template(\%$form);
660 $form->{title} = $locale->text('Edit Template');
661 # convert   to &nbsp;
662 $form->{body} =~ s/ /&nbsp;/gi;
670 <form method=post action=$form->{script}>
672 <input name=file type=hidden value=$form->{file}>
673 <input name=type type=hidden value=template>
675 <input type=hidden name=path value=$form->{path}>
676 <input type=hidden name=login value=$form->{login}>
677 <input type=hidden name=password value=$form->{password}>
679 <input name=callback type=hidden value="$form->{script}?action=display_form&file=$form->{file}&path=$form->{path}&login=$form->{login}&password=$form->{password}">
681 <textarea name=body rows=25 cols=70>
686 <input type=submit class=submit name=action value="|.$locale->text('Save').qq|">
700 AM->save_template(\%$form);
701 $form->redirect($locale->text('Template saved!'));
708 # get defaults for account numbers and last numbers
709 AM->defaultaccounts(\%myconfig, \%$form);
711 foreach $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
712 $dateformat .= ($item eq $myconfig{dateformat}) ? "<option selected>$item\n" : "<option>$item\n";
715 foreach $item (qw(1,000.00 1000.00 1.000,00 1000,00)) {
716 $numberformat .= ($item eq $myconfig{numberformat}) ? "<option selected>$item\n" : "<option>$item\n";
719 foreach $item (qw(name company address signature shippingpoint)) {
720 $myconfig{$item} =~ s/"/"/g;
723 foreach $item (qw(address signature)) {
724 $myconfig{$item} =~ s/\\n/\r\n/g;
727 %countrycodes = User->country_codes;
729 foreach $key (sort { $countrycodes{$a} cmp $countrycodes{$b} } keys %countrycodes) {
730 $countrycodes .= ($myconfig{countrycode} eq $key) ? "<option selected value=$key>$countrycodes{$key}\n" : "<option value=$key>$countrycodes{$key}\n";
732 $countrycodes = "<option>American English\n$countrycodes";
734 foreach $key (keys %{ $form->{IC} }) {
735 foreach $accno (sort keys %{ $form->{IC}{$key} }) {
736 $myconfig{$key} .= ($form->{IC}{$key}{$accno}{id} == $form->{defaults}{$key}) ? "<option selected>$accno--$form->{IC}{$key}{$accno}{description}\n" : "<option>$accno--$form->{IC}{$key}{$accno}{description}\n";
740 $form->{title} = $locale->text('Edit Preferences for').qq| $form->{login}|;
747 <form method=post action=$form->{script}>
749 <input type=hidden name=old_password value=$myconfig{password}>
750 <input type=hidden name=type value=preferences>
753 <tr><th class=listtop>$form->{title}</th></tr>
758 <th align=right>|.$locale->text('Name').qq|</th>
759 <td><input name=name size=15 value="$myconfig{name}"></td>
762 <th align=right>|.$locale->text('Password').qq|</th>
763 <td><input type=password name=password size=10 value=$myconfig{password}></td>
766 <th align=right>|.$locale->text('E-mail').qq|</th>
767 <td><input name=email size=30 value="$myconfig{email}"></td>
770 <th align=right>|.$locale->text('Signature').qq|</th>
771 <td><textarea name=signature rows=3 cols=50>$myconfig{signature}</textarea></td>
774 <th align=right>|.$locale->text('Phone').qq|</th>
775 <td><input name=tel size=14 value="$myconfig{tel}"></td>
778 <th align=right>|.$locale->text('Fax').qq|</th>
779 <td><input name=fax size=14 value="$myconfig{fax}"></td>
782 <th align=right>|.$locale->text('Company').qq|</th>
783 <td><input name=company size=30 value="$myconfig{company}"></td>
786 <th align=right>|.$locale->text('Address').qq|</th>
787 <td><textarea name=address rows=4 cols=50>$myconfig{address}</textarea></td>
790 <th align=right>|.$locale->text('Date Format').qq|</th>
791 <td><select name=dateformat>$dateformat</select></td>
794 <th align=right>|.$locale->text('Number Format').qq|</th>
795 <td><select name=numberformat>$numberformat</select></td>
798 <th align=right>|.$locale->text('Dropdown Limit').qq|</th>
799 <td><input name=vclimit size=10 value="$myconfig{vclimit}"></td>
802 <th align=right>|.$locale->text('Language').qq|</th>
803 <td><select name=countrycode>$countrycodes</select></td>
806 <th align=right>|.$locale->text('Character Set').qq|</th>
807 <td><input name=charset size=20 value="$myconfig{charset}"></td>
810 <th align=right>|.$locale->text('Stylesheet').qq|</th>
811 <td><input name=stylesheet size=20 value="$myconfig{stylesheet}"></td>
813 <input name=printer type=hidden value="$myconfig{printer}">
815 <th align=right>|.$locale->text('Ship via').qq|</th>
816 <td><input name=shippingpoint size=25 value="$myconfig{shippingpoint}"></td>
818 <tr class=listheading>
819 <th colspan=2> </th>
822 <th align=right>|.$locale->text('Business Number').qq|</th>
823 <td><input name=businessnumber size=25 value="$myconfig{businessnumber}"></td>
829 <th align=right>|.$locale->text('Year End').qq| (mm/dd)</th>
830 <td><input name=yearend size=5 maxsize=5 value=$form->{defaults}{yearend}></td>
831 <th align=right>|.$locale->text('Weight Unit').qq|</th>
832 <td><input name=weightunit size=5 value="$form->{defaults}{weightunit}"></td>
837 <tr class=listheading>
838 <th class=listheading colspan=2>|.$locale->text('Last Numbers & Default Accounts').qq|</th>
844 <th width=1% align=right nowrap>|.$locale->text('Inventory Account').qq|</th>
845 <td><select name=inventory_accno>$myconfig{IC}</select></td>
848 <th align=right nowrap>|.$locale->text('Income Account').qq|</th>
849 <td><select name=income_accno>$myconfig{IC_income}</select></td>
852 <th align=right nowrap>|.$locale->text('Expense Account').qq|</th>
853 <td><select name=expense_accno>$myconfig{IC_expense}</select></td>
856 <th align=right nowrap>|.$locale->text('Foreign Exchange Gain').qq|</th>
857 <td><select name=fxgain_accno>$myconfig{FX_gain}</select></td>
860 <th align=right nowrap>|.$locale->text('Foreign Exchange Loss').qq|</th>
861 <td><select name=fxloss_accno>$myconfig{FX_loss}</select></td>
864 <td colspan=2>|.$locale->text('Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies').qq|<br><input name=curr size=40 value="$form->{defaults}{curr}"></td>
867 <th align=right nowrap>|.$locale->text('Last Invoice Number').qq|</th>
868 <td><input name=invnumber size=10 value=$form->{defaults}{invnumber}></td>
871 <th align=right nowrap>|.$locale->text('Last Sales Order Number').qq|</th>
872 <td><input name=sonumber size=10 value=$form->{defaults}{sonumber}></td>
875 <th align=right nowrap>|.$locale->text('Last Purchase Order Number').qq|</th>
876 <td><input name=ponumber size=10 value=$form->{defaults}{ponumber}></td>
881 <tr class=listheading>
882 <th class=listheading colspan=2>|.$locale->text('Tax Accounts').qq|</th>
889 <th>|.$locale->text('Rate').qq| (%)</th>
890 <th>|.$locale->text('Number').qq|</th>
894 foreach $accno (sort keys %{ $form->{taxrates} }) {
897 <th align=right>$form->{taxrates}{$accno}{description}</th>
898 <td><input name=$form->{taxrates}{$accno}{id} size=6 value=$form->{taxrates}{$accno}{rate}></td>
899 <td><input name="taxnumber_$form->{taxrates}{$accno}{id}" value="$form->{taxrates}{$accno}{taxnumber}"></td>
902 $form->{taxaccounts} .= "$form->{taxrates}{$accno}{id} ";
905 chop $form->{taxaccounts};
908 <input name=taxaccounts type=hidden value="$form->{taxaccounts}">
917 <td><hr size=3 noshade></td>
921 <input type=hidden name=path value=$form->{path}>
922 <input type=hidden name=login value=$form->{login}>
923 <input type=hidden name=password value=$form->{password}>
926 <input type=submit class=submit name=action value="|.$locale->text('Save').qq|">
936 sub save_preferences {
938 # does stylesheet exist
939 if ($form->{stylesheet}) {
940 $form->error($locale->text('Stylesheet').": css/$form->{stylesheet} ".$locale->text('does not exist')) unless (-f "css/$form->{stylesheet}");
943 $form->redirect($locale->text('Preferences saved!')) if (AM->save_preferences(\%myconfig, \%$form, $memberfile, $userspath));
944 $form->error($locale->text('Cannot save preferences!'));
951 if ($form->{media} eq 'email') {
952 $form->error($locale->text('No email address for')." $myconfig{name}") unless ($myconfig{email});
954 $form->{OUT} = "$sendmail";
958 AM->backup(\%myconfig, \%$form, $userspath);
960 if ($form->{media} eq 'email') {
961 $form->redirect($locale->text('Backup sent to').qq| $myconfig{email}|);
970 $form->{title} = $locale->text('Audit Control');
972 AM->closedto(\%myconfig, \%$form);
974 if ($form->{revtrans}) {
975 $checked{Y} = "checked";
977 $checked{N} = "checked";
985 <form method=post action=$form->{script}>
987 <input type=hidden name=path value=$form->{path}>
988 <input type=hidden name=login value=$form->{login}>
989 <input type=hidden name=password value=$form->{password}>
992 <tr><th class=listtop>$form->{title}</th></tr>
998 <td>|.$locale->text('Enforce transaction reversal for all dates').qq|</th>
999 <td><input name=revtrans class=radio type=radio value="1" $checked{Y}> |.$locale->text('Yes').qq| <input name=revtrans class=radio type=radio value="0" $checked{N}> |.$locale->text('No').qq|</td>
1002 <td>|.$locale->text('Close Books up to').qq|</th>
1003 <td><input name=closedto size=11 title="$myconfig{dateformat}" value=$form->{closedto}></td>
1013 <input type=hidden name=nextsub value=doclose>
1015 <input type=submit class=submit name=action value="|.$locale->text('Continue').qq|">
1028 AM->closebooks(\%myconfig, \%$form);
1030 if ($form->{revtrans}) {
1031 $form->redirect($locale->text('Transaction reversal enforced for all dates'));
1033 if ($form->{closedto}) {
1034 $form->redirect($locale->text('Transaction reversal enforced up to')
1035 ." ".$locale->date(\%myconfig, $form->{closedto}, 1));
1037 $form->redirect($locale->text('Books are open'));
1047 &{ $form->{nextsub} };