Beim Drucken von noch nicht gespeicherten Angeboten etc sollte das vom Benutzer ausge...
[kivitendo-erp.git] / SL / Form.pm
index 49e0981..0d32e2d 100644 (file)
@@ -146,7 +146,7 @@ sub new {
   $self->{action} = lc $self->{action};
   $self->{action} =~ s/( |-|,|\#)/_/g;
 
-  $self->{version}   = "2.4.0";
+  $self->{version}   = "2.3.9";
 
   $main::lxdebug->leave_sub();
 
@@ -647,10 +647,11 @@ sub format_amount {
   $amount = $p[0];
   $amount .= $d[0].$p[1].(0 x ($places - length $p[1])) if ($places || $p[1] ne '');
  
-  $amount = ($neg) ? "($amount)"  : "$amount"    if $dash =~ ?-?;
-  $amount = ($neg) ? "$amount DR" : "$amount CR" if $dash =~ ?DRCR?;
-  $amount = ($neg) ? "-$amount"   : "$amount"    if $dash =~ ??;
-  reset;
+  $amount = do {
+    ($dash =~ /-/)    ? ($neg ? "($amount)"  : "$amount" )    :
+    ($dash =~ /DRCR/) ? ($neg ? "$amount DR" : "$amount CR" ) :
+                        ($neg ? "-$amount"   : "$amount" )    ;
+  };
   
   $main::lxdebug->leave_sub(2);
   return $amount;
@@ -777,6 +778,7 @@ sub parse_template {
       $mail->{to}     = qq|$self->{email}|;
       $mail->{from}   = qq|"$myconfig->{name}" <$myconfig->{email}>|;
       $mail->{fileid} = "$fileid.";
+      $myconfig->{signature} =~ s/\\r\\n/\\n/g;
 
       # if we send html or plain text inline
       if (($self->{format} eq 'html') && ($self->{sendmode} eq 'inline')) {
@@ -784,7 +786,7 @@ sub parse_template {
 
         $mail->{message}       =~ s/\r\n/<br>\n/g;
         $myconfig->{signature} =~ s/\\n/<br>\n/g;
-        $mail->{message} .= "<br>\n--<br>\n$myconfig->{signature}\n<br>";
+        $mail->{message} .= "<br>\n-- <br>\n$myconfig->{signature}\n<br>";
 
         open(IN, $self->{tmpfile})
           or $self->error($self->cleanup . "$self->{tmpfile} : $!");
@@ -798,8 +800,9 @@ sub parse_template {
 
         @{ $mail->{attachments} } = ($self->{tmpfile}) unless ($form->{do_not_attach});
 
-        $myconfig->{signature} =~ s/\\n/\r\n/g;
-        $mail->{message} .= "\r\n--\r\n$myconfig->{signature}";
+        $mail->{message}       =~ s/\r\n/\n/g;
+        $myconfig->{signature} =~ s/\\n/\n/g;
+        $mail->{message} .= "\n-- \n$myconfig->{signature}";
 
       }