X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fam.pl;h=c6bb8e47c1ea6a6ca0bf4cfe6b30c7c4594adc0d;hb=f742983addf80ee40aecd76b6602faa452ece91e;hp=bcf934ed1ac1fc624df7dd9553d559caa94eb122;hpb=1072cd08c6f5b1905a34dcb3eeab3ddec98d6905;p=kivitendo-erp.git diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index bcf934ed1..c6bb8e47c 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -504,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; @@ -1111,7 +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{system}->{vertreter}; + push @column_index, 'salesman' if $::lx_office_conf{features}->{vertreter}; my %column_header; $column_header{description} = qq|| @@ -1224,7 +1224,7 @@ sub business_header { $form->format_amount(\%myconfig, $form->{discount} * 100); my $salesman_code; - if ($::lx_office_conf{system}->{vertreter}) { + if ($::lx_office_conf{features}->{vertreter}) { $salesman_code = qq| | . $locale->text('Representative') . qq| @@ -2018,369 +2018,6 @@ sub swap_buchungsgruppen { $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(); @@ -2687,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(); } @@ -2933,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(); @@ -3141,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'); @@ -3204,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(); @@ -3270,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'); @@ -3312,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();