X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fdn.pl;h=338d86a2348207c2337948c1b599cc33c9423357;hb=8c7e44938a661e035f62840e1e177353240ace5d;hp=b3459358ab5aa9ba50a9a5eed09c078facd521be;hpb=afe6d1f6a6af704ffa5a0a633d92080ae784f817;p=kivitendo-erp.git diff --git a/bin/mozilla/dn.pl b/bin/mozilla/dn.pl index b3459358a..338d86a23 100644 --- a/bin/mozilla/dn.pl +++ b/bin/mozilla/dn.pl @@ -39,15 +39,16 @@ use SL::DN; use SL::ReportGenerator; require "bin/mozilla/common.pl"; -require "bin/mozilla/report_generator.pl"; +require "bin/mozilla/reportgenerator.pl"; require "bin/mozilla/io.pl"; -require "bin/mozilla/arap.pl"; 1; sub edit_config { $lxdebug->enter_sub(); + $auth->assert('config'); + DN->get_config(\%myconfig, \%$form); $form->get_lists('charts' => { 'key' => 'ALL_CHARTS', 'transdate' => 'current_date' }); @@ -70,10 +71,8 @@ sub edit_config { } } - $form->{title} = $locale->text('Edit Dunning Process Config'); - $form->{callback} ||= build_std_url("action=edit_config"); - $form->{rowcount} = 1 + scalar @{ $form->{DUNNING} }; - $form->{rowcount_odd} = $form->{rowcount} % 2; + $form->{title} = $locale->text('Edit Dunning Process Config'); + $form->{callback} ||= build_std_url("action=edit_config"); $form->header(); print $form->parse_html_template("dunning/edit_config"); @@ -84,6 +83,8 @@ sub edit_config { sub add { $lxdebug->enter_sub(); + $auth->assert('dunning_edit'); + # setup customer selection $form->all_vc(\%myconfig, "customer", "AR"); @@ -106,6 +107,8 @@ sub add { sub show_invoices { $lxdebug->enter_sub(); + $auth->assert('dunning_edit'); + DN->get_invoices(\%myconfig, \%$form); $form->{title} = $locale->text('Start Dunning Process'); @@ -124,13 +127,13 @@ sub show_invoices { $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->{callback} ||= build_std_url("action=show_invoices", qw(customer invnumber ordnumber groupinvoices minamount dunning_level notes)); - $form->{PRINT_OPTIONS} = print_options({ 'inline' => 1, - 'no_queue' => 1, - 'no_postscript' => 1, - 'no_html' => 1, - 'no_opendocument' => 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"); @@ -141,6 +144,8 @@ sub show_invoices { sub save { $lxdebug->enter_sub(); + $auth->assert('config'); + for my $i (1 .. $form->{rowcount}) { if ($form->{"dunning_description_$i"} ne "") { $form->isblank("dunning_level_$i", $locale->text('Dunning Level missing in row '). $i); @@ -166,6 +171,8 @@ sub save { sub save_dunning { $lxdebug->enter_sub(); + $auth->assert('dunning_edit'); + my $active=1; my @rows = (); undef($form->{DUNNING_PDFS}); @@ -193,7 +200,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); } } @@ -206,7 +213,7 @@ 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); } } @@ -233,6 +240,8 @@ sub save_dunning { sub set_email { $lxdebug->enter_sub(); + $auth->assert('dunning_edit'); + $form->{"title"} = $locale->text("Set eMail text"); $form->header(); print($form->parse_html_template("dunning/set_email")); @@ -243,6 +252,8 @@ sub set_email { sub search { $lxdebug->enter_sub(); + $auth->assert('dunning_edit'); + $form->get_lists("customers" => "ALL_CUSTOMERS", "departments" => "ALL_DEPARTMENTS"); @@ -271,6 +282,8 @@ sub search { sub show_dunning { $lxdebug->enter_sub(); + $auth->assert('dunning_edit'); + my @filter_field_list = qw(customer_id customer dunning_level department_id invnumber ordnumber transdatefrom transdateto dunningfrom dunningto notes showold); @@ -284,11 +297,11 @@ sub show_dunning { 'languages' => 'languages'); $form->{type} = 'dunning'; - $form->{PRINT_OPTIONS} = print_options({ 'inline' => 1, - 'no_queue' => 1, - 'no_postscript' => 1, - 'no_html' => 1, - 'no_opendocument' => 1, }); + $form->{PRINT_OPTIONS} = print_options('inline' => 1, + 'no_queue' => 1, + 'no_postscript' => 1, + 'no_html' => 1, + 'no_opendocument' => 1,); $form->{title} = $locale->text('Dunning overview'); my $report = SL::ReportGenerator->new(\%myconfig, $form); @@ -348,7 +361,7 @@ sub show_dunning { }; } - $row->{checkbox} = { + $row->{checkbox} = !$first_row_for_dunning ? { } : { 'raw_data' => $cgi->hidden('-name' => "dunning_id_$i", '-value' => $ref->{dunning_id}) . $cgi->checkbox('-name' => "selected_$i", '-value' => 1, '-label' => ''), 'valign' => 'center', @@ -380,6 +393,8 @@ sub show_dunning { sub print_dunning { $lxdebug->enter_sub(); + $auth->assert('dunning_edit'); + $form->{rowcount} = 1; $form->{selected_1} = 1; $form->{dunning_id_1} = $form->{dunning_id}; @@ -392,6 +407,8 @@ sub print_dunning { sub print_multiple { $lxdebug->enter_sub(); + $auth->assert('dunning_edit'); + $form->{title} = $locale->text('Print dunnings'); my @dunning_ids = map { $form->{"dunning_id_$_"} } grep { $form->{"selected_$_"} } (1..$form->{rowcount}); @@ -423,4 +440,8 @@ sub print_multiple { $lxdebug->leave_sub(); } +sub continue { + call_sub($form->{nextsub}); +} + # end of main