diff options
| author | levinse <levinse> | 2011-07-21 03:42:55 +0000 | 
|---|---|---|
| committer | levinse <levinse> | 2011-07-21 03:42:55 +0000 | 
| commit | a07658a484990b848a88bbfe0c3251e11f3f593d (patch) | |
| tree | eafa0def17cab3cb450bb6810101b7ad118753f2 /FS/FS | |
| parent | 5418c73e5a15b5f030de732b6558f4c8a316220a (diff) | |
fix BILL payinfo encrypted unnecessarily, RT13190
Diffstat (limited to 'FS/FS')
| -rw-r--r-- | FS/FS/Upgrade.pm | 18 | 
1 files changed, 18 insertions, 0 deletions
diff --git a/FS/FS/Upgrade.pm b/FS/FS/Upgrade.pm index 3ea554e4a..40d347327 100644 --- a/FS/FS/Upgrade.pm +++ b/FS/FS/Upgrade.pm @@ -129,6 +129,24 @@ sub upgrade {    } +  # decrypt all payinfo where payby = BILL +  # kind of a weird spot for this, but it's better than duplicating +  # all this code in each class... +  my @decrypt_tables = qw( cust_main cust_pay_void cust_pay cust_refund cust_pay_pending ); +  foreach my $table ( @decrypt_tables ) { +      my @objects = qsearch({   'table'     => $table, +                                'hashref'   => { 'payby' => 'BILL', }, +                                'extra_sql' => 'AND LENGTH(payinfo) > 100', +                              }); +      foreach my $object ( @objects ) { +          my $payinfo = $object->decrypt($object->payinfo); +          die "error decrypting payinfo" if $payinfo eq $object->payinfo; +          $object->payinfo($payinfo); +          my $error = $object->replace; +          die $error if $error; +      } +  } +  }  =item upgrade_data  | 
