Anpassung Rose-Funktionen auf Umstellung currencies
[kivitendo-erp.git] / SL / DB.pm
index 491a033..dd55163 100644 (file)
--- a/SL/DB.pm
+++ b/SL/DB.pm
@@ -4,11 +4,14 @@ use strict;
 
 use Carp;
 use Data::Dumper;
+use SL::DBConnect;
 use English qw(-no_match_vars);
 use Rose::DB;
+use Rose::DBx::Cache::Anywhere;
 
 use base qw(Rose::DB);
 
+__PACKAGE__->db_cache_class('Rose::DBx::Cache::Anywhere');
 __PACKAGE__->use_private_registry;
 
 my (%_db_registered, %_initial_sql_executed);
@@ -35,9 +38,7 @@ sub create {
 my %_dateformats = ( 'yy-mm-dd'   => 'ISO',
                      'yyyy-mm-dd' => 'ISO',
                      'mm/dd/yy'   => 'SQL, US',
-                     'mm-dd-yy'   => 'POSTGRES, US',
                      'dd/mm/yy'   => 'SQL, EUROPEAN',
-                     'dd-mm-yy'   => 'POSTGRES, EUROPEAN',
                      'dd.mm.yy'   => 'GERMAN'
                    );
 
@@ -64,7 +65,8 @@ sub _register_db {
   } else {
     my $european_dates = 0;
     if ($::myconfig{dateformat}) {
-      $european_dates = 1 if $_dateformats{ $::myconfig{dateformat} } =~ m/european/i;
+      $european_dates = 1 if $_dateformats{ $::myconfig{dateformat} }
+                          && $_dateformats{ $::myconfig{dateformat} } =~ m/european/i;
     }
 
     %connect_settings = ( driver          => $::myconfig{dbdriver} || 'Pg',