diff options
| author | ivan <ivan> | 2008-03-04 21:06:43 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2008-03-04 21:06:43 +0000 | 
| commit | 0a49b71a8da637e475b2429a7bf39943c6faebee (patch) | |
| tree | c37c0ee8a506e45ea609e9c1aab532181417a0b4 /FS | |
| parent | bb16b9e20ddeb6b3ee7837bc9ea664bf75892c8d (diff) | |
fix cust_pay.otaker population
Diffstat (limited to 'FS')
| -rw-r--r-- | FS/FS/cust_pay.pm | 9 | 
1 files changed, 4 insertions, 5 deletions
| diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index 90a14ea02..acb284429 100644 --- a/FS/FS/cust_pay.pm +++ b/FS/FS/cust_pay.pm @@ -432,8 +432,6 @@ sub check {  #           " already exists";  #  } -  $self->otaker(getotaker); -    $self->SUPER::check;  } @@ -675,8 +673,9 @@ sub _upgrade_data {  #class method    #not the most efficient, but hey, it only has to run once -  my $count_sql = -    "SELECT COUNT(*) FROM cust_pay WHERE otaker IS NULL OR otaker = ''"; +  my $where = "WHERE otaker IS NULL OR otaker = '' OR otaker = 'ivan' "; + +  my $count_sql = "SELECT COUNT(*) FROM cust_pay $where";    my $sth = dbh->prepare($count_sql) or die dbh->errstr;    $sth->execute or die $sth->errstr; @@ -691,7 +690,7 @@ sub _upgrade_data {  #class method      my $cust_pay = qsearchs( {        'table'     => 'cust_pay',        'hashref'   => {}, -      'extra_sql' => "WHERE otaker IS NULL OR otaker = ''", +      'extra_sql' => $where,        'order_by'  => 'ORDER BY paynum LIMIT 1',      } ); | 
