X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fcust_pay.pm;h=e8f9aee8e4f850a04cddafd1a42449a224c08dbf;hb=0870a4c1fb02be43ea5524f58650d99c81477681;hp=0020a824d368c62a5ca6935322c669a9fb327878;hpb=0b07929c5a6f2654d91db7f7ba8951e3c2a46093;p=freeside.git diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index 0020a824d..e8f9aee8e 100644 --- a/FS/FS/cust_pay.pm +++ b/FS/FS/cust_pay.pm @@ -694,10 +694,7 @@ sub send_receipt { 'msgtype' => 'receipt', }; $error = $queue->insert( - 'from' => $conf->config('invoice_from_name', $cust_main->agentnum ) ? - $conf->config('invoice_from_name', $cust_main->agentnum ) . ' <' . - $conf->config('invoice_from', $cust_main->agentnum ) . '>' : - $conf->config('invoice_from', $cust_main->agentnum ), + 'from' => $conf->invoice_from_full( $cust_main->agentnum ), #invoice_from??? well as good as any 'to' => \@invoicing_list, 'subject' => 'Payment receipt', @@ -945,10 +942,11 @@ sub _upgrade_data { #class method #not the most efficient, but hey, it only has to run once - my $where = "WHERE ( otaker IS NULL OR otaker = '' OR otaker = 'ivan' ) ". - " AND usernum IS NULL ". - " AND 0 < ( SELECT COUNT(*) FROM cust_main ". - " WHERE cust_main.custnum = cust_pay.custnum ) "; + my $where = " WHERE ( otaker IS NULL OR otaker = '' OR otaker = 'ivan' ) + AND usernum IS NULL + AND EXISTS ( SELECT 1 FROM cust_main + WHERE cust_main.custnum = cust_pay.custnum ) + "; my $count_sql = "SELECT COUNT(*) FROM cust_pay $where"; @@ -980,7 +978,6 @@ sub _upgrade_data { #class method $cust_pay->set('otaker', 'legacy'); } - delete $FS::payby::hash{'COMP'}->{cust_pay}; #quelle kludge my $error = $cust_pay->replace; if ( $error ) { @@ -989,8 +986,6 @@ sub _upgrade_data { #class method next; } - $FS::payby::hash{'COMP'}->{cust_pay} = ''; #restore it - $count++; if ( $DEBUG > 1 && $lastprog + 30 < time ) { warn "$me $count/$total (".sprintf('%.2f',100*$count/$total). '%)'."\n"; @@ -1044,9 +1039,7 @@ sub _upgrade_data { #class method # otaker->usernum upgrade ### - delete $FS::payby::hash{'COMP'}->{cust_pay}; #quelle kludge $class->_upgrade_otaker(%opt); - $FS::payby::hash{'COMP'}->{cust_pay} = ''; #restore it # if we do this anywhere else, it should become an FS::Upgrade method my $num_to_upgrade = $class->count('paybatch is not null');