X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fdn.pl;h=94af9502a6298605fe15295e3c9abe00004848d1;hb=232a9153b591c815dacc4b41c15135166be550f0;hp=c67e37e040b8905552ea69096a532558a33ef958;hpb=d7f060429e809653d45e93e86b3c5c8d7129e0a9;p=kivitendo-erp.git diff --git a/bin/mozilla/dn.pl b/bin/mozilla/dn.pl index c67e37e04..94af9502a 100644 --- a/bin/mozilla/dn.pl +++ b/bin/mozilla/dn.pl @@ -31,10 +31,11 @@ # #====================================================================== +use POSIX; + use SL::IS; use SL::PE; use SL::DN; -use Data::Dumper; require "bin/mozilla/common.pl"; require "bin/mozilla/io.pl"; @@ -46,6 +47,26 @@ sub edit_config { $lxdebug->enter_sub(); DN->get_config(\%myconfig, \%$form); + $form->get_lists('charts' => { 'key' => 'ALL_CHARTS', + 'transdate' => 'current_date' }); + + $form->{SELECT_AR_AMOUNT} = []; + $form->{SELECT_AR} = []; + + foreach my $chart (@{ $form->{ALL_CHARTS} }) { + $chart->{LINKS} = { map { $_, 1 } split m/:/, $chart->{link} }; + + if ($chart->{LINKS}->{AR}) { + $chart->{AR_selected} = "selected" if $chart->{id} == $form->{AR}; + push @{ $form->{SELECT_AR} }, $chart; + } + + if ($chart->{LINKS}->{AR_amount}) { + $chart->{AR_amount_fee_selected} = "selected" if $chart->{id} == $form->{AR_amount_fee}; + $chart->{AR_amount_interest_selected} = "selected" if $chart->{id} == $form->{AR_amount_interest}; + push @{ $form->{SELECT_AR_AMOUNT} }, $chart; + } + } $form->{title} = $locale->text('Edit Dunning Process Config'); $form->{callback} ||= build_std_url("action=edit_config"); @@ -95,11 +116,19 @@ sub show_invoices { map { $row->{$_} = $form->format_amount(\%myconfig, $row->{$_} * 1, -2) } qw(amount fee interest); } + $form->get_lists('printers' => 'printers', + 'languages' => 'languages'); + + $form->{type} = 'dunning'; $form->{rowcount} = scalar @{ $form->{DUNNINGS} }; $form->{jsscript} = 1; $form->{callback} ||= build_std_url("action=show_invoices", qw(login password customer invnumber ordnumber groupinvoices minamount dunning_level notes)); - $form->{PRINT_OPTIONS} = print_options(1); + $form->{PRINT_OPTIONS} = print_options({ 'inline' => 1, + 'no_queue' => 1, + 'no_postscript' => 1, + 'no_html' => 1, + 'no_opendocument' => 1, }); $form->header(); print $form->parse_html_template("dunning/show_invoices"); @@ -162,7 +191,7 @@ sub save_dunning { foreach my $level (values %{ $levels }) { next unless scalar @{ $level }; - DN->save_dunning(\%myconfig, \%$form, $level, $userspath, $spool, $sendmail); + DN->save_dunning(\%myconfig, $form, $level, $userspath, $spool, $sendmail); } } @@ -175,12 +204,12 @@ sub save_dunning { "customer_id" => $form->{"customer_id_$i"}, "next_dunning_config_id" => $form->{"next_dunning_config_id_$i"}, "email" => $form->{"email_$i"}, } ]; - DN->save_dunning(\%myconfig, \%$form, $level, $userspath, $spool, $sendmail); + DN->save_dunning(\%myconfig, $form, $level, $userspath, $spool, $sendmail); } } if($form->{DUNNING_PDFS}) { - DN->melt_pdfs(\%myconfig, \%$form,$spool); + DN->melt_pdfs(\%myconfig, $form); } # saving the history @@ -191,7 +220,7 @@ sub save_dunning { } # /saving the history - $form->redirect($locale->text('Dunning Process started for selected invoices!')); + $form->redirect($locale->text('Dunning Process started for selected invoices!')) if ($form->{media} eq 'printer'); $lxdebug->leave_sub(); } @@ -216,178 +245,27 @@ sub set_email { sub search { $lxdebug->enter_sub(); - # setup customer selection - $form->all_vc(\%myconfig, "customer", "AR"); + + $form->get_lists("customers" => "ALL_CUSTOMERS", + "departments" => "ALL_DEPARTMENTS"); DN->get_config(\%myconfig, \%$form); - if (@{ $form->{all_customer} }) { - map { $customer .= "\n" - } (@{ $form->{DUNNING} }); - } - $dunning_level = qq| - - | . $locale->text('Next Dunning Level') . qq| - - - | if $form->{selectdunning_level}; - - # departments - if (@{ $form->{all_departments} }) { - $form->{selectdepartment} = "