X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fh_Common.pm;h=d55da8cfb3c529d36ab5a97a75a6dbd39a7aca23;hb=eb4ff7f73c5d4bdf74a3472448b5a195598ff4cd;hp=e575cffdbfae0c2eec1dff8a55d29e8eef1bee1c;hpb=3fee5d65aa1c555c53a991e9a9f9610b422670fe;p=freeside.git diff --git a/FS/FS/h_Common.pm b/FS/FS/h_Common.pm index e575cffdb..d55da8cfb 100644 --- a/FS/FS/h_Common.pm +++ b/FS/FS/h_Common.pm @@ -40,8 +40,9 @@ sub sql_h_search { my( $self, $end ) = ( shift, shift ); my $table = $self->table; - my $pkey = dbdef->table($table)->primary_key - or die "can't (yet) search history table $table without a primary key"; + my $real_table = ($table =~ /^h_(.*)$/) ? $1 : $table; + my $pkey = dbdef->table($real_table)->primary_key + or die "can't (yet) search history table $real_table without a primary key"; unless ($end) { confess 'Called sql_h_search without END_TIMESTAMP';