X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fam.pl;h=c918770b0c79ab5402b15e71f4007e8c7b13ab3a;hb=8abd9ce32e946691e0953f9a8e2c183183d7854e;hp=68f8e162b7789b530ee4d2f0e0618b4b0c5c4ff7;hpb=fc44ab06e84d2546c7eb9c7c5f0586db17f01242;p=kivitendo-erp.git diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 68f8e162b..c918770b0 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -42,7 +42,7 @@ use SL::User; use SL::USTVA; use SL::Iconv; use SL::TODO; -use SL::Printer; +use SL::DB::Printer; use CGI; require "bin/mozilla/common.pl"; @@ -935,60 +935,6 @@ sub swap_buchungsgruppen { $main::lxdebug->leave_sub(); } -sub edit_defaults { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - # get defaults for account numbers and last numbers - AM->defaultaccounts(\%myconfig, \%$form); - $form->{ALL_UNITS} = AM->convertible_units(AM->retrieve_all_units(), 'g'); - - map { $form->{"defaults_${_}"} = $form->{defaults}->{$_} } keys %{ $form->{defaults} }; - - # default language - my $all_languages = SL::DB::Manager::Language->get_all; - -# cash = IST-Versteuerung, accrual = SOLL-Versteuerung - - foreach my $key (keys %{ $form->{IC} }) { - foreach my $accno (sort keys %{ $form->{IC}->{$key} }) { - my $array = "ACCNOS_" . uc($key); - $form->{$array} ||= []; - - my $value = "${accno}--" . $form->{IC}->{$key}->{$accno}->{description}; - push @{ $form->{$array} }, { - 'name' => $value, - 'value' => $value, - 'selected' => $form->{IC}->{$key}->{$accno}->{id} == $form->{defaults}->{$key}, - }; - } - } - - $form->{title} = $locale->text('Ranges of numbers and default accounts'); - - $form->header(); - print $form->parse_html_template('am/edit_defaults', - { ALL_LANGUAGES => $all_languages, }); - - $main::lxdebug->leave_sub(); -} - -sub save_defaults { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my $locale = $main::locale; - - AM->save_defaults(); - - $form->redirect($locale->text('Defaults saved.')); - - $main::lxdebug->leave_sub(); -} - sub _build_cfg_options { my $form = $main::form; my %myconfig = %main::myconfig; @@ -1059,7 +1005,7 @@ sub config { { 'name' => $locale->text('Queue'), 'value' => 'queue', 'selected' => $selected{queue}, }, ]; - $form->{PRINTERS} = [ SL::Printer->all_printers(%::myconfig) ]; + $form->{PRINTERS} = SL::DB::Manager::Printer->get_all_sorted; my %countrycodes = User->country_codes; @@ -1104,7 +1050,7 @@ sub save_preferences { TODO->save_user_config('login' => $form->{login}, %{ $form->{todo_cfg} || { } }); - if (AM->save_preferences(\%myconfig, $form)) { + if (AM->save_preferences($form)) { if ($::auth->can_change_password() && defined $form->{new_password} && ($form->{new_password} ne '********')) { @@ -1116,10 +1062,6 @@ sub save_preferences { } $::auth->change_password($form->{login}, $form->{new_password}); - - $form->{password} = $form->{new_password}; - $::auth->set_session_value('password', $form->{password}); - $::auth->create_or_refresh_session(); } $form->redirect($locale->text('Preferences saved!')); @@ -1461,6 +1403,13 @@ sub add_tax { _get_taxaccount_selection(); + $form->{asset} = 1; + $form->{liability} = 1; + $form->{equity} = 1; + $form->{revenue} = 1; + $form->{expense} = 1; + $form->{costs} = 1; + $form->header(); my $parameters_ref = { @@ -1485,8 +1434,16 @@ sub edit_tax { $form->{title} = $locale->text('Edit'); AM->get_tax(\%myconfig, \%$form); + _get_taxaccount_selection(); + $form->{asset} = $form->{chart_categories} =~ 'A' ? 1 : 0; + $form->{liability} = $form->{chart_categories} =~ 'L' ? 1 : 0; + $form->{equity} = $form->{chart_categories} =~ 'Q' ? 1 : 0; + $form->{revenue} = $form->{chart_categories} =~ 'I' ? 1 : 0; + $form->{expense} = $form->{chart_categories} =~ 'E' ? 1 : 0; + $form->{costs} = $form->{chart_categories} =~ 'C' ? 1 : 0; + $form->{rate} = $form->format_amount(\%myconfig, $form->{rate}, 2); $form->header(); @@ -1601,7 +1558,6 @@ sub add_price_factor { $form->{title} = $locale->text('Add Price Factor'); $form->{callback} ||= build_std_url('action=add_price_factor'); - $::request->{layout}->focus('#description'); $form->header(); print $form->parse_html_template('am/edit_price_factor'); @@ -1620,7 +1576,6 @@ sub edit_price_factor { $form->{title} = $locale->text('Edit Price Factor'); $form->{callback} ||= build_std_url('action=add_price_factor'); - $::request->{layout}->focus('#description'); AM->get_price_factor(\%myconfig, $form); @@ -1708,7 +1663,6 @@ sub add_warehouse { $form->{title} = $locale->text('Add Warehouse'); $form->{callback} ||= build_std_url('action=add_warehouse'); - $::request->{layout}->focus('#description'); $form->header(); print $form->parse_html_template('am/edit_warehouse'); @@ -1731,7 +1685,6 @@ sub edit_warehouse { $form->{title} = $locale->text('Edit Warehouse'); $form->{callback} ||= build_std_url('action=list_warehouses'); - $::request->{layout}->focus('#description'); $form->header(); print $form->parse_html_template('am/edit_warehouse');