1 <& elements/search.html,
2 'title' => 'Billing event fees',
3 'html_init' => include('.init'),
5 'name' => 'billing events',
7 'count_query' => $count_sql,
13 FS::UI::Web::cust_header(),
17 sub { time2str("%b %d %Y %T", $_[0]->_date) },
20 sub { my $d = $_[0]->fee_cust_bill_date;
21 $d ? time2str("%b %d %Y %T", $d) : '' },
22 \&FS::UI::Web::cust_fields,
24 'align' => 'lrlrr'.FS::UI::Web::cust_aligns(),
31 ( map { $_ ne 'Cust. Status' ? $link_cust : '' }
32 FS::UI::Web::cust_header()
41 FS::UI::Web::cust_colors(),
49 FS::UI::Web::cust_styles(),
55 my $cust_event_fee = shift;
56 my $fee_invnum = $cust_event_fee->fee_invnum;
57 $fee_invnum || ( $cust_event_fee->nextbill ? '(next bill)' : '(not yet)' );
62 ? [ "${p}view/cust_bill.cgi?", 'fee_invnum' ]
67 my $cust_event_fee = shift;
68 $cust_event_fee->custnum
69 ? [ "${p}view/cust_main.cgi?", 'custnum' ]
75 my @scalars = qw( billpkgnum ); #qw( agentnum status custnum invnum pkgnum failed );
76 my @lists = qw( eventpart );
81 my $curuser = $FS::CurrentUser::CurrentUser;
84 unless $curuser->access_right('Billing event reports');
86 for my $param (@scalars) {
87 $search{$param} = scalar( $cgi->param($param) )
88 if $cgi->param($param);
92 foreach my $param (@lists) {
93 $search{$param} = [ $cgi->param($param) ];
96 my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
97 $search{'beginning'} = $beginning;
98 $search{'ending'} = $ending;
100 my $where = ' WHERE '. FS::cust_event_fee->search_sql_where( \%search );
102 my $join = FS::cust_event_fee->join_sql();
105 'table' => 'cust_event_fee',
106 'select' => join(', ',
110 'cust_bill_pkg.invnum AS fee_invnum',
111 'fee_cust_bill._date AS fee_cust_bill_date',
114 FS::UI::Web::cust_sql_fields(),
117 'extra_sql' => $where,
118 'order_by' => 'ORDER BY eventfeenum ASC', #'ORDER BY _date ASC',
119 'addl_from' => $join,
122 my $count_sql = "SELECT COUNT(*) FROM cust_event_fee $join $where";
124 my $conf = new FS::Conf;
127 push @$menubar, 'Delete these fees' => "javascript:confirm_delete_fees()"
128 if $curuser->access_right('Delete fees');
132 <& /elements/progress-init.html,
134 [ @scalars, @lists, 'beginning', 'ending' ],
135 "../misc/delete_fees.cgi",
136 { 'message' => 'Fees deleted', #would be nice to show the number of them...
137 #what we were just displaying is gone, so where to go?
138 # woudl be nice to not keep displaying the deleted data
142 <FORM NAME="delete_fees_form">
143 % foreach my $param (@scalars, 'beginning', 'ending') {
144 <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $search{$param} |h %>">
146 % foreach my $param (@lists) {
147 % foreach my $value (@{ $search{$param} }) {
148 <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $value |h %>">
152 <SCRIPT TYPE="text/javascript">
154 function confirm_delete_fees() {
155 if ( ! confirm("Are you sure you want to delete these fees?") ) {