X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fam.pl;h=c6bb8e47c1ea6a6ca0bf4cfe6b30c7c4594adc0d;hb=27ae86579fb8833067e9d6c02cf5429d98b28449;hp=27b18e400fc77f1111e30112c5679d57d4fc7e6c;hpb=08c340d2caca21066fd8797e29f07facfde7a07c;p=kivitendo-erp.git diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 27b18e400..c6bb8e47c 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -31,7 +31,10 @@ # #====================================================================== +use utf8; + use SL::Auth; +use SL::Auth::PasswordPolicy; use SL::AM; use SL::CA; use SL::Form; @@ -39,6 +42,7 @@ use SL::User; use SL::USTVA; use SL::Iconv; use SL::TODO; +use SL::Printer; use CGI::Ajax; use CGI; @@ -212,29 +216,29 @@ sub account_header { my $select_eur = q|\n|; my %eur = ( - 1 => "Umsatzerlöse", - 2 => "sonstige Erlöse", + 1 => "Umsatzerlöse", + 2 => "sonstige Erlöse", 3 => "Privatanteile", - 4 => "Zinserträge", - 5 => "Ausserordentliche Erträge", + 4 => "Zinserträge", + 5 => "Ausserordentliche Erträge", 6 => "Vereinnahmte Umsatzst.", 7 => "Umsatzsteuererstattungen", - 8 => "Wareneingänge", - 9 => "Löhne und Gehälter", + 8 => "Wareneingänge", + 9 => "Löhne und Gehälter", 10 => "Gesetzl. sozialer Aufw.", 11 => "Mieten", 12 => "Gas, Strom, Wasser", 13 => "Instandhaltung", - 14 => "Steuern, Versich., Beiträge", + 14 => "Steuern, Versich., Beiträge", 15 => "Kfz-Steuern", 16 => "Kfz-Versicherungen", 17 => "Sonst. Fahrzeugkosten", 18 => "Werbe- und Reisekosten", 19 => "Instandhaltung u. Werkzeuge", - 20 => "Fachzeitschriften, Bücher", - 21 => "Miete für Einrichtungen", + 20 => "Fachzeitschriften, Bücher", + 21 => "Miete für Einrichtungen", 22 => "Rechts- und Beratungskosten", - 23 => "Bürobedarf, Porto, Telefon", + 23 => "Bürobedarf, Porto, Telefon", 24 => "Sonstige Aufwendungen", 25 => "Abschreibungen auf Anlagever.", 26 => "Abschreibungen auf GWG", @@ -244,7 +248,7 @@ sub account_header { 30 => "Ausserordentlicher Aufwand", 31 => "Betriebliche Steuern"); foreach my $item (sort({ $a <=> $b } keys(%eur))) { - my $text = H(SL::Iconv::convert("ISO-8859-15", $main::dbcharset, $eur{$item})); + my $text = H($::locale->{iconv_utf8}->convert($eur{$item})); if ($item == $form->{pos_eur}) { $select_eur .= qq|\n|; } else { @@ -256,30 +260,30 @@ sub account_header { my $select_bwa = q|\n|; my %bwapos = ( - 1 => 'Umsatzerlöse', + 1 => 'Umsatzerlöse', 2 => 'Best.Verdg.FE/UE', 3 => 'Aktiv.Eigenleistung', 4 => 'Mat./Wareneinkauf', - 5 => 'So.betr.Erlöse', + 5 => 'So.betr.Erlöse', 10 => 'Personalkosten', 11 => 'Raumkosten', 12 => 'Betriebl.Steuern', - 13 => 'Vers./Beiträge', + 13 => 'Vers./Beiträge', 14 => 'Kfz.Kosten o.St.', 15 => 'Werbe-Reisek.', 16 => 'Kosten Warenabgabe', 17 => 'Abschreibungen', 18 => 'Rep./instandhlt.', - 19 => 'Übrige Steuern', + 19 => 'Übrige Steuern', 20 => 'Sonst.Kosten', 30 => 'Zinsauwand', 31 => 'Sonst.neutr.Aufw.', - 32 => 'Zinserträge', + 32 => 'Zinserträge', 33 => 'Sonst.neutr.Ertrag', 34 => 'Verr.kalk.Kosten', 35 => 'Steuern Eink.u.Ertr.'); foreach my $item (sort({ $a <=> $b } keys %bwapos)) { - my $text = H(SL::Iconv::convert("ISO-8859-15", $main::dbcharset, $bwapos{$item})); + my $text = H($::locale->{iconv_utf8}->convert($bwapos{$item})); if ($item == $form->{pos_bwa}) { $select_bwa .= qq|\n|; foreach my $item ((1, 2, 3, 4)) { if ($item == $form->{pos_bilanz}) { @@ -331,7 +335,7 @@ sub account_header { my %charttype = ( 'A' => $locale->text('Account'), - 'H' => $locale->text('Header'), + 'H' => $locale->text('Heading'), ); foreach my $item ( sort({ $a <=> $b } keys %charttype) ) { @@ -500,7 +504,7 @@ sub list_account { push(@ { $form->{AJAX} }, $pjx); - $form->{stylesheets} = "list_accounts.css"; + $form->use_stylesheet("list_accounts.css"); $form->{title} = $locale->text('Chart of Accounts'); $form->header; @@ -727,7 +731,7 @@ sub list_department { map { print "$column_data{$_}\n" } @column_index; print qq| - + |; } @@ -929,7 +933,7 @@ sub list_lead { map { print "$column_header{$_}\n" } @column_index; print qq| - + |; my ($i, %column_data); @@ -939,17 +943,17 @@ sub list_lead { $i %= 2; print qq| - + |; -# $lead = $ref->{lead}; +# $lead = $ref->{lead}; $column_data{description} = qq|$ref->{lead}|; map { print "$column_data{$_}\n" } @column_index; print qq| - + |; } @@ -1107,6 +1111,7 @@ sub list_business { $form->{title} = $locale->text('Type of Business'); my @column_index = qw(description discount customernumberinit); + push @column_index, 'salesman' if $::lx_office_conf{features}->{vertreter}; my %column_header; $column_header{description} = qq|| @@ -1120,6 +1125,10 @@ sub list_business { qq|| . $locale->text('Customernumberinit') . qq||; + $column_header{salesman} = + qq|| + . $locale->text('Representative') + . qq||; $form->header; @@ -1159,11 +1168,12 @@ sub list_business { $column_data{discount} = qq|$discount|; $column_data{customernumberinit} = qq|$ref->{customernumberinit}|; + $column_data{salesman} = '' . ($ref->{salesman} ? $::locale->text('Yes') : $::locale->text('No')) . ''; map { print "$column_data{$_}\n" } @column_index; print qq| - + |; } @@ -1213,6 +1223,18 @@ sub business_header { $form->{discount} = $form->format_amount(\%myconfig, $form->{discount} * 100); + my $salesman_code; + if ($::lx_office_conf{features}->{vertreter}) { + $salesman_code = qq| + + | . $locale->text('Representative') . qq| + | . $::cgi->checkbox(-name => "salesman", -value => 1, -label => '', 'checked' => $form->{salesman} ? 1 : 0) . qq| + +|; + } else { + $salesman_code = $::cgi->hidden(-name => 'salesman', -value => $form->{salesman} ? 1 : 0); + } + $form->header; print qq| @@ -1240,6 +1262,7 @@ sub business_header { | . $locale->text('Customernumberinit') . qq| {customernumberinit}> +$salesman_code
@@ -1417,7 +1440,7 @@ sub list_language { map { print "$column_data{$_}\n" } @column_index; print qq| - + |; } @@ -1769,7 +1792,7 @@ sub list_buchungsgruppe { map { print "$column_data{$_}\n" } @column_index; print qq| - + |; $row++; @@ -1850,13 +1873,13 @@ sub buchungsgruppe_header { } my $linkaccounts; - if (!$main::eur) { + if (!$::lx_office_conf{system}->{eur}) { $linkaccounts = qq| - | . $locale->text('Inventory') . qq| - - - |; + | . $locale->text('Inventory') . qq| + + + |; } else { $linkaccounts = qq| {inventory_accno_id}>|; @@ -1864,28 +1887,28 @@ sub buchungsgruppe_header { $linkaccounts .= qq| - - | . $locale->text('National Revenues') . qq| - - - - | . $locale->text('National Expenses') . qq| - - |; + + | . $locale->text('National Revenues') . qq| + + + + | . $locale->text('National Expenses') . qq| + + |; if ($form->{id}) { $form->{selectIC_income} =~ s/selected//g; $form->{selectIC_income} =~ s/ value=\Q$form->{income_accno_id_1}\E/ value=$form->{income_accno_id_1} selected/; $form->{selectIC_expense} =~ s/selected//g; $form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_1}\E/ value=$form->{expense_accno_id_1} selected/; } - $linkaccounts .= qq| - | . $locale->text('Revenues EU with UStId') . qq| - - - - | . $locale->text('Expenses EU with UStId') . qq| - - |; + $linkaccounts .= qq| + | . $locale->text('Revenues EU with UStId') . qq| + + + + | . $locale->text('Expenses EU with UStId') . qq| + + |; if ($form->{id}) { $form->{selectIC_income} =~ s/selected//g; @@ -1894,14 +1917,14 @@ sub buchungsgruppe_header { $form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_2}\E/ value=$form->{expense_accno_id_2} selected/; } - $linkaccounts .= qq| - | . $locale->text('Revenues EU without UStId') . qq| - - - - | . $locale->text('Expenses EU without UStId') . qq| - - |; + $linkaccounts .= qq| + | . $locale->text('Revenues EU without UStId') . qq| + + + + | . $locale->text('Expenses EU without UStId') . qq| + + |; if ($form->{id}) { $form->{selectIC_income} =~ s/selected//g; @@ -1910,14 +1933,14 @@ sub buchungsgruppe_header { $form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_3}\E/ value=$form->{expense_accno_id_3} selected/; } - $linkaccounts .= qq| - | . $locale->text('Foreign Revenues') . qq| - - - - | . $locale->text('Foreign Expenses') . qq| - - + $linkaccounts .= qq| + | . $locale->text('Foreign Revenues') . qq| + + + + | . $locale->text('Foreign Expenses') . qq| + + |; @@ -1995,595 +2018,6 @@ sub swap_buchungsgruppen { $main::lxdebug->leave_sub(); } - -sub add_printer { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - - $main::auth->assert('config'); - - $form->{title} = "Add"; - - $form->{callback} = "am.pl?action=add_printer" unless $form->{callback}; - - &printer_header; - &form_footer; - - $main::lxdebug->leave_sub(); -} - -sub edit_printer { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - - $main::auth->assert('config'); - - $form->{title} = "Edit"; - - AM->get_printer(\%myconfig, \%$form); - - &printer_header; - - $form->{orphaned} = 1; - &form_footer; - - $main::lxdebug->leave_sub(); -} - -sub list_printer { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - AM->printer(\%myconfig, \%$form); - - $form->{callback} = "am.pl?action=list_printer"; - - my $callback = $form->escape($form->{callback}); - - $form->{title} = $locale->text('Printer'); - - my @column_index = qw(printer_description printer_command template_code); - my %column_header; - $column_header{printer_description} = - qq|| - . $locale->text('Printer Description') - . qq||; - $column_header{printer_command} = - qq|| - . $locale->text('Printer Command') - . qq||; - $column_header{template_code} = - qq|| - . $locale->text('Template Code') - . qq||; - - $form->header; - - print qq| - - - - - - - - - - - - - -
$form->{title}
- - -|; - - map { print "$column_header{$_}\n" } @column_index; - - print qq| - -|; - - my ($i, %column_data); - foreach my $ref (@{ $form->{ALL} }) { - - $i++; - $i %= 2; - - print qq| - -|; - - - $column_data{printer_description} = qq||; - $column_data{printer_command} = qq||; - $column_data{template_code} = - qq||; - - map { print "$column_data{$_}\n" } @column_index; - - print qq| - -|; - } - - print qq| -
$ref->{printer_description}$ref->{printer_command}$ref->{template_code}
-

- -
-
- - - - - - - -
- - - -|; - - $main::lxdebug->leave_sub(); -} - -sub printer_header { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my $locale = $main::locale; - - $main::auth->assert('config'); - - $form->{title} = $locale->text("$form->{title} Printer"); - - # $locale->text('Add Printer') - # $locale->text('Edit Printer') - - $form->{printer_description} =~ s/\"/"/g; - $form->{template_code} =~ s/\"/"/g; - $form->{printer_command} =~ s/\"/"/g; - - - $form->header; - - print qq| - - -
- -{id}> - - - - - - - - - - - - - - - - - - - - - -
$form->{title}
| . $locale->text('Printer') . qq|
| . $locale->text('Printer Command') . qq|
| . $locale->text('Template Code') . qq|

-|; - - $main::lxdebug->leave_sub(); -} - -sub save_printer { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - $form->isblank("printer_description", $locale->text('Description missing!')); - $form->isblank("printer_command", $locale->text('Printer Command missing!')); - AM->save_printer(\%myconfig, \%$form); - $form->redirect($locale->text('Printer saved!')); - - $main::lxdebug->leave_sub(); -} - -sub delete_printer { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - AM->delete_printer(\%myconfig, \%$form); - $form->redirect($locale->text('Printer deleted!')); - - $main::lxdebug->leave_sub(); -} - -sub add_payment { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - - $main::auth->assert('config'); - - $form->{title} = "Add"; - - $form->{callback} = "am.pl?action=add_payment" unless $form->{callback}; - - $form->{terms_netto} = 0; - $form->{terms_skonto} = 0; - $form->{percent_skonto} = 0; - my @languages = AM->language(\%myconfig, $form, 1); - map({ $_->{"language"} = $_->{"description"}; - $_->{"language_id"} = $_->{"id"}; } @languages); - $form->{"TRANSLATION"} = \@languages; - &payment_header; - &form_footer; - - $main::lxdebug->leave_sub(); -} - -sub edit_payment { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - - $main::auth->assert('config'); - - $form->{title} = "Edit"; - - AM->get_payment(\%myconfig, $form); - $form->{percent_skonto} = - $form->format_amount(\%myconfig, $form->{percent_skonto} * 100); - - &payment_header; - - $form->{orphaned} = 1; - &form_footer; - - $main::lxdebug->leave_sub(); -} - -sub list_payment { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - AM->payment(\%myconfig, \%$form); - - $form->{callback} = build_std_url("action=list_payment"); - - my $callback = $form->escape($form->{callback}); - - $form->{title} = $locale->text('Payment Terms'); - - my @column_index = qw(up down description description_long terms_netto - terms_skonto percent_skonto); - my %column_header; - $column_header{up} = - qq|| - . qq|| . $locale->text(| - . qq||; - $column_header{down} = - qq|| - . qq|| . $locale->text(| - . qq||; - $column_header{description} = - qq|| - . $locale->text('Description') - . qq||; - $column_header{description_long} = - qq|| - . $locale->text('Long Description') - . qq||; - $column_header{terms_netto} = - qq|| - . $locale->text('Netto Terms') - . qq||; - $column_header{terms_skonto} = - qq|| - . $locale->text('Skonto Terms') - . qq||; - $column_header{percent_skonto} = - qq|| - . $locale->text('Skonto') - . qq| %|; - - $form->header; - - print qq| - - - - - - - - - - - - - -
$form->{title}
- - -|; - - map { print "$column_header{$_}\n" } @column_index; - - print qq| - -|; - - my $swap_link = build_std_url("action=swap_payment_terms"); - - my $row = 0; - my ($i, %column_data); - foreach my $ref (@{ $form->{ALL} }) { - - $i++; - $i %= 2; - - print qq| - -|; - - if ($row) { - my $pref = $form->{ALL}->[$row - 1]; - $column_data{up} = - qq||; - } else { - $column_data{up} = qq||; - } - - if ($row == (scalar(@{ $form->{ALL} }) - 1)) { - $column_data{down} = qq||; - } else { - my $nref = $form->{ALL}->[$row + 1]; - $column_data{down} = - qq||; - } - - $column_data{description} = - qq||; - $column_data{description_long} = - qq||; - $column_data{terms_netto} = - qq||; - $column_data{terms_skonto} = - qq||; - $column_data{percent_skonto} = - qq||; - map { print "$column_data{$_}\n" } @column_index; - - print qq| - -|; - $row++; - } - - print qq| -
| . - qq|| . - qq|| . $locale->text(| . - qq|  | . - qq|| . - qq|| . $locale->text(| . - qq|{id}", "callback=$callback") . - qq|">| . H($ref->{description}) . qq|| . H($ref->{description_long}) . qq|$ref->{terms_netto}$ref->{terms_skonto}| . - $form->format_amount(\%myconfig, $ref->{percent_skonto} * 100) . - qq|%
-

- -
- - - - - - - - -
- - - -|; - - $main::lxdebug->leave_sub(); -} - -sub payment_header { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my $locale = $main::locale; - - $main::auth->assert('config'); - - $form->{title} = $locale->text("$form->{title} Payment Terms"); - - # $locale->text('Add Payment Terms') - # $locale->text('Edit Payment Terms') - - $form->{description} =~ s/\"/"/g; - - - - $form->header; - - print qq| - - -
- -{id}> - - - - - - - - - - - - - - - -|; - - foreach my $language (@{ $form->{"TRANSLATION"} }) { - print qq| - - - - -|; - } - - print qq| - - - - - - - - - - - - - - -
$form->{title}
| . $locale->text('Description') . qq|
| . $locale->text('Long Description') . qq|
| . - sprintf($locale->text('Translation (%s)'), - $language->{"language"}) - . qq|
| . $locale->text('Netto Terms') . qq|
| . $locale->text('Skonto Terms') . qq|
| . $locale->text('Skonto') . qq| %

- -

| . $locale->text("You can use the following strings in the long " . - "description and all translations. They will be " . - "replaced by their actual values by Lx-Office " . - "before they're output.") -. qq|

- -|; - - $main::lxdebug->leave_sub(); -} - -sub save_payment { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - $form->isblank("description", $locale->text('Description missing!')); - $form->{"percent_skonto"} = - $form->parse_amount(\%myconfig, $form->{percent_skonto}) / 100; - AM->save_payment(\%myconfig, \%$form); - $form->redirect($locale->text('Payment Terms saved!')); - - $main::lxdebug->leave_sub(); -} - -sub delete_payment { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - AM->delete_payment(\%myconfig, \%$form); - $form->redirect($locale->text('Payment terms deleted!')); - - $main::lxdebug->leave_sub(); -} - -sub swap_payment_terms { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - - $main::auth->assert('config'); - - AM->swap_sortkeys(\%myconfig, $form, "payment_terms"); - list_payment(); - - $main::lxdebug->leave_sub(); -} - sub edit_defaults { $main::lxdebug->enter_sub(); @@ -2660,20 +2094,21 @@ sub config { _build_cfg_options('numberformat', ('1,000.00', '1000.00', '1.000,00', '1000,00')); my @formats = (); - if ($main::opendocument_templates && $main::openofficeorg_writer_bin && - $main::xvfb_bin && (-x $main::openofficeorg_writer_bin) && (-x $main::xvfb_bin)) { + if ($::lx_office_conf{print_templates}->{opendocument} + && $::lx_office_conf{applications}->{openofficeorg_writer} && (-x $::lx_office_conf{applications}->{openofficeorg_writer}) + && $::lx_office_conf{applications}->{xvfb} && (-x $::lx_office_conf{applications}->{xvfb})) { push(@formats, { "name" => $locale->text("PDF (OpenDocument/OASIS)"), "value" => "opendocument_pdf" }); } - if ($main::latex_templates) { + if ($::lx_office_conf{print_templates}->{latex}) { push(@formats, { "name" => $locale->text("PDF"), "value" => "pdf" }); } push(@formats, { "name" => "HTML", "value" => "html" }); - if ($main::latex_templates) { + if ($::lx_office_conf{print_templates}->{latex}) { push(@formats, { "name" => $locale->text("Postscript"), "value" => "postscript" }); } - if ($main::opendocument_templates) { + if ($::lx_office_conf{print_templates}->{opendocument}) { push(@formats, { "name" => $locale->text("OpenDocument/OASIS"), "value" => "opendocument" }); } @@ -2701,10 +2136,8 @@ sub config { { 'name' => $locale->text('Queue'), 'value' => 'queue', 'selected' => $selected{queue}, }, ]; - AM->printer(\%myconfig, $form); - $form->{PRINTERS} = []; - foreach my $printer (@{$form->{"ALL"}}) { + foreach my $printer (SL::Printer->all_printers(%::myconfig)) { push @{ $form->{PRINTERS} }, { 'name' => $printer->{printer_description}, 'value' => $printer->{id}, @@ -2724,7 +2157,7 @@ sub config { } $form->{STYLESHEETS} = []; - foreach my $item (qw(lx-office-erp.css Win2000.css)) { + foreach my $item (qw(lx-office-erp.css Win2000.css Mobile.css)) { push @{ $form->{STYLESHEETS} }, { 'name' => $item, 'value' => $item, @@ -2755,7 +2188,27 @@ sub save_preferences { TODO->save_user_config('login' => $form->{login}, %{ $form->{todo_cfg} || { } }); - $form->redirect($locale->text('Preferences saved!')) if (AM->save_preferences(\%myconfig, \%$form, 0)); + if (AM->save_preferences(\%myconfig, $form)) { + if ($::auth->can_change_password() + && defined $form->{new_password} + && ($form->{new_password} ne '********')) { + my $verifier = SL::Auth::PasswordPolicy->new; + my $result = $verifier->verify($form->{new_password}); + + if ($result != SL::Auth::PasswordPolicy->OK()) { + $form->error($::locale->text('The settings were saved, but the password was not changed.') . ' ' . join(' ', $verifier->errors($result))); + } + + $::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!')); + } + $form->error($locale->text('Cannot save preferences!')); $main::lxdebug->leave_sub(); @@ -2787,10 +2240,10 @@ sub audit_control { - - - - + + + +
| . $locale->text('Close Books up to') . qq|{closedto}>
| . $locale->text('Close Books up to') . qq|{closedto}>
@@ -2871,15 +2324,13 @@ sub edit_units { $units = AM->retrieve_units(\%myconfig, $form); my $ddbox = AM->unit_select_data($units, undef, 1); - my $updownlink = build_std_url("action=swap_units"); - $form->{"title"} = $locale->text("Add and edit units"); $form->header(); print($form->parse_html_template("am/edit_units", { "UNITS" => \@unit_list, "NEW_BASE_UNIT_DDBOX" => $ddbox, "LANGUAGES" => \@languages, - "updownlink" => $updownlink })); + })); $main::lxdebug->leave_sub(); } @@ -3072,7 +2523,7 @@ sub show_am_history { my %searchNo = ( "Artikelnummer" => "partnumber", "Kundennummer" => "customernumber", "Lieferantennummer" => "vendornumber", - "Projektnummer" => "projectnummer", + "Projektnummer" => "projectnumber", "Buchungsnummer" => "ordnumber", "Eingangsrechnungnummer" => "invnumber", "Ausgangsrechnungnummer" => "invnumber", @@ -3117,22 +2568,6 @@ sub show_am_history { $main::lxdebug->leave_sub(); } -sub swap_units { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - - $main::auth->assert('config'); - - my $dir = $form->{"dir"} eq "down" ? "down" : "up"; - AM->swap_units(\%myconfig, $form, $dir, $form->{"name"}); - - edit_units(); - - $main::lxdebug->leave_sub(); -} - sub add_tax { $main::lxdebug->enter_sub(); @@ -3325,16 +2760,8 @@ sub list_price_factors { AM->get_all_price_factors(\%myconfig, \%$form); - my $previous; foreach my $current (@{ $form->{PRICE_FACTORS} }) { - if ($previous) { - $previous->{next_id} = $current->{id}; - $current->{previous_id} = $previous->{id}; - } - $current->{factor} = $form->format_amount(\%myconfig, $current->{factor} * 1); - - $previous = $current; } $form->{callback} = build_std_url('action=list_price_factors'); @@ -3388,20 +2815,6 @@ sub delete_price_factor { $main::lxdebug->leave_sub(); } -sub swap_price_factors { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - - $main::auth->assert('config'); - - AM->swap_sortkeys(\%myconfig, $form, 'price_factors'); - list_price_factors(); - - $main::lxdebug->leave_sub(); -} - sub add_warehouse { $main::lxdebug->enter_sub(); @@ -3454,16 +2867,6 @@ sub list_warehouses { AM->get_all_warehouses(\%myconfig, $form); - my $previous; - foreach my $current (@{ $form->{WAREHOUSES} }) { - if ($previous) { - $previous->{next_id} = $current->{id}; - $current->{previous_id} = $previous->{id}; - } - - $previous = $current; - } - $form->{callback} = build_std_url('action=list_warehouses'); $form->{title} = $locale->text('Warehouses'); $form->{url_base} = build_std_url('callback'); @@ -3496,20 +2899,6 @@ sub save_warehouse { $main::lxdebug->leave_sub(); } -sub swap_warehouses { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - - $main::auth->assert('config'); - - AM->swap_sortkeys(\%myconfig, $form, 'warehouse'); - list_warehouses(); - - $main::lxdebug->leave_sub(); -} - sub delete_warehouse { $main::lxdebug->enter_sub(); @@ -3524,7 +2913,7 @@ sub delete_warehouse { $form->header(); print $form->parse_html_template('am/confirm_delete_warehouse'); - exit 0; + ::end_of_request(); } if (AM->delete_warehouse(\%myconfig, $form)) {