Merge remote-tracking branch 'refs/remotes/origin/master'
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 31 Oct 2012 15:14:19 +0000 (16:14 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 31 Oct 2012 15:14:19 +0000 (16:14 +0100)
SL/AM.pm
SL/DN.pm
config/kivitendo.conf.default

index 1a085b8..6862eb7 100644 (file)
--- a/SL/AM.pm
+++ b/SL/AM.pm
@@ -243,6 +243,18 @@ sub save_account {
     $form->{id} = "";
   }
 
+  $query = '
+    SELECT
+    accno
+    FROM chart
+    WHERE accno = ?';
+  my ($accno) = selectrow_query($form, $dbh, $query, $form->{accno});
+
+  if ($accno) {
+    $form->error($::locale->text('Account number not unique!'));
+  }
+
+
   if (!$form->{id} || $form->{id} eq "") {
     $query = qq|SELECT nextval('id')|;
     ($form->{"id"}) = selectrow_query($form, $dbh, $query);
@@ -269,17 +281,6 @@ sub save_account {
       $form->{valid_from} = '';
     };
 
-    $query = '
-      SELECT
-        accno
-      FROM chart
-      WHERE accno = ?';
-    my ($accno) = selectrow_query($form, $dbh, $query, $form->{accno});
-
-    if ($accno) {
-      $form->error($::locale->text('Account number not unique!'));
-    }
-
     $query = qq|UPDATE chart SET
                   accno = ?,
                   description = ?,
index 94e5b77..46749ab 100644 (file)
--- a/SL/DN.pm
+++ b/SL/DN.pm
@@ -368,6 +368,7 @@ sub send_email {
 
   my $template     = SL::Template::create(type => 'PlainText', form => $form, myconfig => $myconfig);
   my $mail         = Mailer->new();
+  $mail->{charset} = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
   $mail->{from}    = $myconfig->{email};
   $mail->{to}      = $ref->{recipient};
   $mail->{subject} = $template->parse_block($ref->{email_subject});
index 5d6524b..c031631 100644 (file)
@@ -121,7 +121,7 @@ port = 25
 # Security can be 'tls', 'ssl' or 'none'. Unset equals 'none'. This
 # determines whether or not encryption is used and which kind. For
 # 'tls' the module 'Net::SMTP::TLS' is required; for 'ssl'
-# 'Net::SMTP::TLS' is required and 'none' only uses 'Net::SMTP'.
+# 'Net::SMTP::SSL' is required and 'none' only uses 'Net::SMTP'.
 security = none
 # Authentication is only used if 'login' is set. You should only use
 # that with 'tls' or 'ssl' encryption.