# 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";
"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} };
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;
}
# /saving the history
- $form->redirect($locale->text("AR transaction posted.")) unless $inline;
+ $form->redirect($locale->text('AR transaction posted.') . ' ' . $locale->text('ID') . ': ' . $form->{id}) unless $inline;
$main::lxdebug->leave_sub();
}
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 {
my @hidden_variables = map { "l_${_}" } @columns;
push @hidden_variables, "l_subtotal", qw(open closed customer invnumber ordnumber cusordnumber transaction_description notes project_id transdatefrom transdateto duedatefrom duedateto
- employee_id salesman_id business_id parts_partnumber parts_description department_id);
+ employee_id salesman_id business_id parts_partnumber parts_description department_id show_marked_as_closed);
push @hidden_variables, map { "cvar_$_->{name}" } @ct_searchable_custom_variables;
$href = build_std_url('action=ar_transactions', grep { $form->{$_} } @hidden_variables);
t8('Update'),
submit => [ '#form', { action => "update" } ],
id => 'update_button',
+ checks => [ 'kivi.validate_form' ],
accesskey => 'enter',
],
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.')
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.')
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"
], # end of combobox "more"
);
}
+ $::request->layout->add_javascripts('kivi.Validator.js');
}
1;