X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fchange_history.html;h=09c1d6c6c41d12ad50f8c13575f3e46128345ee4;hb=1354ae82ecc6638211bf4b1dcf7a130c7502478b;hp=ea84b8f75608e04143900796c3fa8551eb217c79;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924;p=freeside.git diff --git a/httemplate/view/cust_main/change_history.html b/httemplate/view/cust_main/change_history.html index ea84b8f75..09c1d6c6c 100644 --- a/httemplate/view/cust_main/change_history.html +++ b/httemplate/view/cust_main/change_history.html @@ -42,11 +42,14 @@ tie my %tables, 'Tie::IxHash', 'svc_broadband' => 'Broadband', 'svc_external' => 'External service', 'svc_phone' => 'Phone', + 'svc_cable' => 'Cable', 'phone_device' => 'Phone device', + 'cust_pkg_discount' => 'Discount', #? it gets provisioned anyway 'phone_avail' => 'Phone', ; -my $svc_join = 'JOIN cust_svc USING ( svcnum ) JOIN cust_pkg USING ( pkgnum )'; +my $pkg_join = "JOIN cust_pkg USING ( pkgnum )"; +my $svc_join = "JOIN cust_svc USING ( svcnum ) $pkg_join"; my %table_join = ( 'svc_acct' => $svc_join, @@ -57,7 +60,9 @@ my %table_join = ( 'svc_broadband' => $svc_join, 'svc_external' => $svc_join, 'svc_phone' => $svc_join, + 'svc_cable' => $svc_join, 'phone_device' => $svc_join, + 'cust_pkg_discount'=> $pkg_join, ); @@ -104,7 +109,7 @@ my $conf = new FS::Conf; my $curuser = $FS::CurrentUser::CurrentUser; -die "access deined" +die "access denied" unless $curuser->access_right('View customer history'); # find out the beginning of this customer history, if possible @@ -137,7 +142,13 @@ foreach my $table ( keys %tables ) { 'extra_sql' => ' AND custnum = '. $cust_main->custnum, }); push @history, @items; - } +my @legacy_items = qsearch({ + 'table' => 'legacy_cust_history', + 'hashref' => { 'history_date' => { op=>'>=', value=>$newer_than }, }, + 'extra_sql' => ' AND custnum = '. $cust_main->custnum, +}); +push @history, @legacy_items; +