diff options
author | ivan <ivan> | 2002-04-16 10:47:35 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-04-16 10:47:35 +0000 |
commit | 4201aaaae8a957bc98ce345d3ee0e599da354766 (patch) | |
tree | 1f4cc956f932b9b301900928343ece96955a6b31 /httemplate/search/cust_bill_event.cgi | |
parent | 17ddcceb66e4c5c45abe890403d2ca98b128d375 (diff) |
report on failed billing events...
Diffstat (limited to 'httemplate/search/cust_bill_event.cgi')
-rw-r--r-- | httemplate/search/cust_bill_event.cgi | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/httemplate/search/cust_bill_event.cgi b/httemplate/search/cust_bill_event.cgi new file mode 100644 index 000000000..9cb36d28e --- /dev/null +++ b/httemplate/search/cust_bill_event.cgi @@ -0,0 +1,62 @@ +<!-- mason kludge --> +<% + +#false laziness with view/cust_bill.cgi + +$cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/; +my $beginning = str2time($1); + +$cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/; +my $ending = str2time($1) + 86400; + +my @cust_bill_event = + sort { $a->_date <=> $b->_date } + qsearch('cust_bill_event', { + _date => { op=> '>=', value=>$beginning }, + statustext => { op=> '!=', value=>'' }, +# i wish... +# _date => { op=> '<=', value=>$ending }, + }, '', "AND _date <= $ending"); + +%> + +<%= header('Failed billing events') %> + +<%= table() %> +<TR> + <TH>Event</TH> + <TH>Date</TH> + <TH>Status</TH> + <TH>Invoice</TH> + <TH>(bill) name</TH> + <TH>company</TH> +<% if ( defined dbdef->table('cust_main')->column('ship_last') ) { %> + <TH>(service) name</TH> + <TH>company</TH> +<% } %> +</TR> + +<% foreach my $cust_bill_event ( @cust_bill_event ) { + my $status = $cust_bill_event->status; + $status .= ': '.$cust_bill_event->statustext if $cust_bill_event->statustext; + my $cust_bill = $cust_bill_event->cust_bill; + my $cust_main = $cust_bill->cust_main; + my $invlink = "${p}view/cust_bill.cgi?". $cust_bill->invnum; + my $custlink = "${p}view/cust_main.cgi?". $cust_main->custnum; +%> +<TR> + <TD><%= $cust_bill_event->part_bill_event->event %></TD> + <TD><%= time2str("%a %b %e %T %Y", $cust_bill_event->_date) %></TD> + <TD><%= $status %></TD> + <TD><A HREF="<%=$invlink%>">Invoice #<%= $cust_bill->invnum %> (<%= time2str("%D", $cust_bill->_date ) %>)</A></TD> + <TD><A HREF="<%=$custlink%>"><%= $cust_main->last. ', '. $cust_main->first %></A></TD> + <TD><A HREF="<%=$custlink%>"><%= $cust_main->company %></A></TD> + <% if ( defined dbdef->table('cust_main')->column('ship_last') ) { %> + <TD><A HREF="<%=$custlink%>"><%= $cust_main->ship_last. ', '. $cust_main->ship_first %></A></TD> + <TD><A HREF="<%=$custlink%>"><%= $cust_main->ship_company %></A></TD> + <% } %> +</TR> +<% } %> +</TABLE> + +</BODY></HTML> |