X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Far.pl;h=2c74018c3c7964a0e034535bf05b86396c2bcf2f;hb=5a55ac869e35f61a8ae018d0e54b4fe6dc89c6a7;hp=5f290f6535698c7776307e67050beaacaae4d44c;hpb=db3dfa92492a68cff00f953d5992998299277267;p=kivitendo-erp.git diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 5f290f653..2c74018c3 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -310,7 +310,7 @@ sub create_links { # currencies $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); - $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all; + $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted; # build the popup menus $form->{taxincluded} = ($form->{id}) ? $form->{taxincluded} : "checked"; @@ -371,7 +371,7 @@ sub form_header { "taxcharts" => { "key" => "ALL_TAXCHARTS", "module" => "AR" },); - $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all; + $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted; $_->{link_split} = { map { $_ => 1 } split/:/, $_->{link} } for @{ $form->{ALL_CHARTS} }; @@ -393,7 +393,7 @@ sub form_header { my $follow_up_vc = $form->{customer_id} ? SL::DB::Customer->load_cached($form->{customer_id})->name : ''; my $follow_up_trans_info = "$form->{invnumber} ($follow_up_vc)"; - $::request->layout->add_javascripts("autocomplete_chart.js", "autocomplete_customer.js", "show_vc_details.js", "show_history.js", "follow_up.js", "kivi.Draft.js", "kivi.GL.js", "kivi.File.js", "kivi.RecordTemplate.js", "kivi.AR.js"); + $::request->layout->add_javascripts("autocomplete_chart.js", "show_vc_details.js", "show_history.js", "follow_up.js", "kivi.Draft.js", "kivi.GL.js", "kivi.File.js", "kivi.RecordTemplate.js", "kivi.AR.js", "kivi.CustomerVendor.js", "kivi.Validator.js"); my $transdate = $::form->{transdate} ? DateTime->from_kivitendo($::form->{transdate}) : DateTime->today_local; my $first_taxchart; @@ -874,10 +874,12 @@ sub setup_ar_search_action_bar { action => [ $::locale->text('Search'), submit => [ '#form' ], + checks => [ 'kivi.validate_form' ], accesskey => 'enter', ], ); } + $::request->layout->add_javascripts('kivi.Validator.js'); } sub setup_ar_transactions_action_bar { @@ -1257,6 +1259,7 @@ sub setup_ar_form_header_action_bar { t8('Update'), submit => [ '#form', { action => "update" } ], id => 'update_button', + checks => [ 'kivi.validate_form' ], accesskey => 'enter', ], @@ -1264,7 +1267,7 @@ sub setup_ar_form_header_action_bar { action => [ t8('Post'), submit => [ '#form', { action => "post" } ], - checks => [ 'kivi.AR.check_fields_before_posting' ], + checks => [ 'kivi.validate_form', 'kivi.AR.check_fields_before_posting' ], disabled => $is_closed ? t8('The billing period has already been locked.') : $is_storno ? t8('A canceled invoice cannot be posted.') : ($::form->{id} && $change_never) ? t8('Changing invoices has been disabled in the configuration.') @@ -1287,7 +1290,7 @@ sub setup_ar_form_header_action_bar { combobox => [ action => [ t8('Storno'), submit => [ '#form', { action => "storno" } ], - checks => [ 'kivi.AR.check_fields_before_posting' ], + checks => [ 'kivi.validate_form', 'kivi.AR.check_fields_before_posting' ], confirm => t8('Do you really want to cancel this invoice?'), disabled => !$::form->{id} ? t8('This invoice has not been posted yet.') : $has_storno ? t8('This invoice has been canceled already.') @@ -1313,6 +1316,7 @@ sub setup_ar_form_header_action_bar { action => [ t8('Use As New'), submit => [ '#form', { action => "use_as_new" } ], + checks => [ 'kivi.validate_form' ], disabled => !$::form->{id} ? t8('This invoice has not been posted yet.') : undef, ], ], # end of combobox "Workflow" @@ -1343,6 +1347,7 @@ sub setup_ar_form_header_action_bar { ], # end of combobox "more" ); } + $::request->layout->add_javascripts('kivi.Validator.js'); } 1;