this should fix credits pushing typeset invoices off the right
[freeside.git] / FS / FS / cust_credit.pm
index d5b6ff4..47a8119 100644 (file)
@@ -87,6 +87,10 @@ Text ( deprecated )
 
 Reason (see L<FS::reason>)
 
+=item addlinfo
+
+Text
+
 =item closed
 
 Books closed flag, empty or `Y'
@@ -225,7 +229,8 @@ sub delete {
     my $cust_main = $self->cust_main;
 
     my $error = send_email(
-      'from'    => $conf->config('invoice_from'), #??? well as good as any
+      'from'    => $conf->config('invoice_from', $self->cust_main->agentnum),
+                                 #invoice_from??? well as good as any
       'to'      => $conf->config('deletecredits'),
       'subject' => 'FREESIDE NOTIFICATION: Credit deleted',
       'body'    => [
@@ -288,6 +293,7 @@ sub check {
     || $self->ut_alpha('otaker')
     || $self->ut_textn('reason')
     || $self->ut_foreign_key('reasonnum', 'reason', 'reasonnum')
+    || $self->ut_textn('addlinfo')
     || $self->ut_enum('closed', [ '', 'Y' ])
   ;
   return $error if $error;
@@ -412,7 +418,8 @@ sub reason {
 
   $dbh->commit or die $dbh->errstr if $oldAutoCommit;
 
-  $reason ? $reason->reason : '';
+  ( $reason ? $reason->reason : '' ).
+  ( $self->addlinfo ? ' '.$self->addlinfo : '' );
 }
 
 # _upgrade_data