]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Form.pm
Merge branch 'master' of github.com:kivitendo/kivitendo-erp
[mfinanz.git] / SL / Form.pm
index 4d26c2552948d25da88958148156a52b5a08e403..141233d94c94735f3f1efbec418441508cfc4bcc 100644 (file)
@@ -471,14 +471,12 @@ sub header {
     jquery.multiselect2side frame_header/header
     ui-lightness/jquery-ui
     jquery-ui.custom
-    js/jscalendar/calendar-win2k-1
   );
 
-  $layout->use_javascript("$_.js") for qw(
-    jquery common jscalendar/calendar jscalendar/lang/calendar-de
-    jscalendar/calendar-setup part_selection jquery-ui jquery.cookie jqModal jquery.checkall
-    switchmenuframe
-  );
+  $layout->use_javascript("$_.js") for (qw(
+    jquery jquery-ui jquery.cookie jqModal jquery.checkall
+    common part_selection switchmenuframe
+  ), "jquery/ui/i18n/jquery.ui.datepicker-$::myconfig{countrycode}");
 
   $self->{favicon} ||= "favicon.ico";
   $self->{titlebar} = join ' - ', grep $_, $self->{title}, $self->{login}, $::myconfig{dbname}, $self->{version} if $self->{title} || !$self->{titlebar};
@@ -706,6 +704,14 @@ sub show_generic_error {
     return;
   }
 
+  if ($::request->is_ajax) {
+    $::lxdebug->message(0, "trying to render AJAX response...");
+    SL::ClientJS->new
+      ->error($error)
+      ->render(SL::Controller::Base->new);
+    ::end_of_request();
+  }
+
   my $add_params = {
     'title_error' => $params{title},
     'label_error' => $error,
@@ -925,6 +931,11 @@ sub parse_amount {
 
   my ($self, $myconfig, $amount) = @_;
 
+  if (!defined($amount) || ($amount eq '')) {
+    $main::lxdebug->leave_sub(2);
+    return 0;
+  }
+
   if (   ($myconfig->{numberformat} eq '1.000,00')
       || ($myconfig->{numberformat} eq '1000,00')) {
     $amount =~ s/\.//g;