X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fdn.pl;h=3124362e2211ebc7f39874784aac94be96d89185;hb=a206eca6ec7beb6a4344a56df5c8ddb17b50c877;hp=0ba9d3960b91fad8c52f9764416eb50ef46faf13;hpb=8a8629cf302fba798e79ed34e12853edc0e87ba4;p=kivitendo-erp.git diff --git a/bin/mozilla/dn.pl b/bin/mozilla/dn.pl index 0ba9d3960..3124362e2 100644 --- a/bin/mozilla/dn.pl +++ b/bin/mozilla/dn.pl @@ -84,6 +84,8 @@ sub edit_config { $form->{title} = $locale->text('Edit Dunning Process Config'); $form->{callback} ||= build_std_url("action=edit_config"); + setup_dn_edit_config_action_bar(); + $form->header(); print $form->parse_html_template("dunning/edit_config"); @@ -101,8 +103,10 @@ sub add { DN->get_config(\%myconfig, \%$form); + $form->get_lists("departments" => "ALL_DEPARTMENTS"); + $form->{SHOW_DUNNING_LEVEL_SELECTION} = $form->{DUNNING} && scalar @{ $form->{DUNNING} }; - $form->{SHOW_DEPARTMENT_SELECTION} = $form->{all_departments} && scalar @{ $form->{all_departments} || [] }; + $form->{SHOW_DEPARTMENT_SELECTION} = $form->{ALL_DEPARTMENTS} && scalar @{ $form->{ALL_DEPARTMENTS} || [] }; $form->{title} = $locale->text('Start Dunning Process'); @@ -205,7 +209,7 @@ sub save_dunning { my $saved_language_id = $form->{language_id}; - if ($form->{groupinvoices}) { + if ($form->{groupinvoices} || $form->{l_include_credit_notes}) { my %dunnings_for; for my $i (1 .. $form->{rowcount}) { @@ -219,9 +223,11 @@ sub save_dunning { push @{ $level }, { "row" => $i, "invoice_id" => $form->{"inv_id_$i"}, + "credit_note" => $form->{"credit_note_$i"}, "customer_id" => $form->{"customer_id_$i"}, "language_id" => $form->{"language_id_$i"}, "next_dunning_config_id" => $form->{"next_dunning_config_id_$i"}, + "print_invoice" => $form->{"include_invoice_$i"}, "email" => $form->{"email_$i"}, }; } @@ -244,6 +250,7 @@ sub save_dunning { "customer_id" => $form->{"customer_id_$i"}, "language_id" => $form->{"language_id_$i"}, "next_dunning_config_id" => $form->{"next_dunning_config_id_$i"}, + "print_invoice" => $form->{"include_invoice_$i"}, "email" => $form->{"email_$i"}, } ]; if (!$form->{force_lang}) { $form->{language_id} = @{$level}[0]->{language_id}; @@ -360,6 +367,7 @@ sub show_dunning { 'checkbox' => { 'text' => '', 'visible' => 'HTML' }, 'dunning_description' => { 'text' => $locale->text('Dunning Level') }, 'customername' => { 'text' => $locale->text('Customername') }, + 'departmentname' => { 'text' => $locale->text('Department') }, 'language' => { 'text' => $locale->text('Language') }, 'invnumber' => { 'text' => $locale->text('Invnumber') }, 'transdate' => { 'text' => $locale->text('Invdate') }, @@ -453,7 +461,7 @@ sub show_dunning { $report->set_options_from_form(); setup_dn_show_dunning_action_bar(); - $report->generate_with_headers(action_bar => 1); + $report->generate_with_headers(); $main::lxdebug->leave_sub(); @@ -569,7 +577,7 @@ sub setup_dn_add_action_bar { for my $bar ($::request->layout->get('actionbar')) { $bar->add( action => [ - t8('Continue'), + t8('Search'), submit => [ '#form', { action => "show_invoices" } ], accesskey => 'enter', ], @@ -583,7 +591,7 @@ sub setup_dn_show_invoices_action_bar { for my $bar ($::request->layout->get('actionbar')) { $bar->add( action => [ - t8('Continue'), + t8('Create'), submit => [ '#form', { action => "save_dunning" } ], checks => [ [ 'kivi.check_if_entries_selected', '[name^=active_]' ] ], accesskey => 'enter', @@ -599,7 +607,7 @@ sub setup_dn_search_action_bar { for my $bar ($::request->layout->get('actionbar')) { $bar->add( action => [ - t8('Continue'), + t8('Search'), submit => [ '#form', { action => "show_dunning" } ], accesskey => 'enter', ], @@ -629,4 +637,18 @@ sub setup_dn_show_dunning_action_bar { } } +sub setup_dn_edit_config_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Save'), + submit => [ '#form', { action => "save" } ], + accesskey => 'enter', + ], + ); + } +} + # end of main