Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
[kivitendo-erp.git] / bin / mozilla / am.pl
index 0672e7c..5005475 100644 (file)
@@ -336,7 +336,7 @@ sub account_header {
 
   # account where AR_tax or AP_tax is set are not orphaned if they are used as
   # tax-o-matic account
-  if ( $form->{id} && !$form->{orphaned} && ($form->{link} =~ m/(AP_tax|AR_tax)/) ) {
+  if ( $form->{id} && $form->{orphaned} && ($form->{link} =~ m/(AP_tax|AR_tax)/) ) {
     if (SL::DB::Manager::Tax->find_by(chart_id => $form->{id})) {
       $form->{orphaned} = 0;
     }
@@ -426,10 +426,6 @@ sub save_as_new_account {
   }
 
   $form->{id} = 0;
-  if ($form->{"original_accno"} &&
-      ($form->{"accno"} eq $form->{"original_accno"})) {
-    $form->error($locale->text('Account Number already used!'));
-  }
   $form->redirect($locale->text('Account saved!'))
     if (AM->save_account(\%myconfig, \%$form));
   $form->error($locale->text('Cannot save account!'));
@@ -466,7 +462,7 @@ sub list_account {
     $ca->{link_edit_account} = $link_edit_account . '&id=' . E($ca->{id});
   }
 
-  $form->use_stylesheet("list_accounts.css");
+  $::request->{layout}->use_stylesheet("list_accounts.css");
   $form->{title}       = $locale->text('Chart of Accounts');
 
   $form->header;
@@ -742,7 +738,7 @@ sub language_header {
 
   print $::form->parse_html_template('am/language_header', {
     numberformats => [ '1,000.00', '1000.00', '1.000,00', '1000,00' ],
-    dateformats => [ qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd) ],
+    dateformats => [ qw(mm/dd/yy dd/mm/yy dd.mm.yy yyyy-mm-dd) ],
   });
 
   $::lxdebug->leave_sub;
@@ -944,7 +940,7 @@ sub edit_defaults {
   # default language
   my $all_languages = SL::DB::Manager::Language->get_all;
 
-# EÜR = cash, Bilanzierung = accrual
+# cash = IST-Versteuerung, accrual = SOLL-Versteuerung
 
   foreach my $key (keys %{ $form->{IC} }) {
     foreach my $accno (sort keys %{ $form->{IC}->{$key} }) {
@@ -1006,7 +1002,7 @@ sub config {
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
 
-  _build_cfg_options('dateformat', qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd));
+  _build_cfg_options('dateformat', qw(mm/dd/yy dd/mm/yy dd.mm.yy yyyy-mm-dd));
   _build_cfg_options('numberformat', ('1,000.00', '1000.00', '1.000,00', '1000,00'));
 
   my @formats = ();
@@ -1066,7 +1062,7 @@ sub config {
   }
 
   $form->{STYLESHEETS} = [];
-  foreach my $item (qw(lx-office-erp.css Win2000.css Mobile.css)) {
+  foreach my $item (qw(lx-office-erp.css Win2000.css Mobile.css kivitendo.css)) {
     push @{ $form->{STYLESHEETS} }, {
       'name'     => $item,
       'value'    => $item,
@@ -1124,55 +1120,17 @@ sub save_preferences {
 }
 
 sub audit_control {
-  $main::lxdebug->enter_sub();
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-  my $locale   = $main::locale;
-
-  $main::auth->assert('config');
-
-  $form->{title} = $locale->text('Audit Control');
-
-  AM->closedto(\%myconfig, \%$form);
-
-  $form->header;
-
-  print qq|
-<body>
-
-<form method=post action=am.pl>
-
-<table width=100%>
-  <tr><th class=listtop>$form->{title}</th></tr>
-  <tr height="5"></tr>
-  <tr>
-    <td>
-      <table>
-        <tr>
-          <th>| . $locale->text('Close Books up to') . qq|</th>
-          <td><input name=closedto size=11 title="$myconfig{dateformat}" value=$form->{closedto}></td>
-        </tr>
-      </table>
-    </td>
-  </tr>
-</table>
-
-<hr size=3 noshade>
-
-<br>
-<input type=hidden name=nextsub value=doclose>
+  $::lxdebug->enter_sub;
+  $::auth->assert('config');
 
-<input type=submit class=submit name=action value="|
-    . $locale->text('Continue') . qq|">
+  $::form->{title} = $::locale->text('Audit Control');
 
-</form>
+  AM->closedto(\%::myconfig, $::form);
 
-</body>
-</html>
-|;
+  $::form->header;
+  print $::form->parse_html_template('am/audit_control');
 
-  $main::lxdebug->leave_sub();
+  $::lxdebug->leave_sub;
 }
 
 sub doclose {
@@ -1628,7 +1586,7 @@ sub add_price_factor {
 
   $form->{title}      = $locale->text('Add Price Factor');
   $form->{callback} ||= build_std_url('action=add_price_factor');
-  $form->{fokus}      = 'description';
+  $::request->{layout}->focus('#description');
 
   $form->header();
   print $form->parse_html_template('am/edit_price_factor');
@@ -1647,7 +1605,7 @@ sub edit_price_factor {
 
   $form->{title}      = $locale->text('Edit Price Factor');
   $form->{callback} ||= build_std_url('action=add_price_factor');
-  $form->{fokus}      = 'description';
+  $::request->{layout}->focus('#description');
 
   AM->get_price_factor(\%myconfig, $form);
 
@@ -1735,7 +1693,7 @@ sub add_warehouse {
 
   $form->{title}      = $locale->text('Add Warehouse');
   $form->{callback} ||= build_std_url('action=add_warehouse');
-  $form->{fokus}      = 'description';
+  $::request->{layout}->focus('#description');
 
   $form->header();
   print $form->parse_html_template('am/edit_warehouse');
@@ -1758,7 +1716,7 @@ sub edit_warehouse {
 
   $form->{title}      = $locale->text('Edit Warehouse');
   $form->{callback} ||= build_std_url('action=list_warehouses');
-  $form->{fokus}      = 'description';
+  $::request->{layout}->focus('#description');
 
   $form->header();
   print $form->parse_html_template('am/edit_warehouse');