summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/index.html2
-rw-r--r--httemplate/search/cust_bill_event.cgi62
-rwxr-xr-xhttemplate/search/cust_bill_event.html23
-rwxr-xr-xhttemplate/search/report_cc.html4
-rwxr-xr-xhttemplate/search/report_credit.html4
-rwxr-xr-xhttemplate/search/report_tax.html4
-rwxr-xr-xhttemplate/view/cust_bill.cgi2
7 files changed, 95 insertions, 6 deletions
diff --git a/httemplate/index.html b/httemplate/index.html
index 934767dde..b562a2280 100644
--- a/httemplate/index.html
+++ b/httemplate/index.html
@@ -58,6 +58,7 @@
<BR><A HREF="browse/cust_pay_batch.cgi">View pending credit card batch</A>
<BR><BR>Invoice reports
<UL>
+ <LI><a href="search/cust_bill_event.html">Invoice event errors (failed credit cards)</a>
<LI>open invoices (<A HREF="search/cust_bill.cgi?OPEN_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN_custnum">by customer number</A>)
<LI>30 day open invoices (<A HREF="search/cust_bill.cgi?OPEN30_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN30_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN30_custnum">by customer number</A>)
<LI>60 day open invoices (<A HREF="search/cust_bill.cgi?OPEN60_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN60_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN60_custnum">by customer number</A>)
@@ -122,6 +123,7 @@
</UL>
Invoices
<UL>
+ <LI><a href="search/cust_bill_event.html">Invoice event errors (failed credit cards)</a>
<LI>open invoices (<A HREF="search/cust_bill.cgi?OPEN_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN_custnum">by customer number</A>)
<LI>30 day open invoices (<A HREF="search/cust_bill.cgi?OPEN30_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN30_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN30_custnum">by customer number</A>)
<LI>60 day open invoices (<A HREF="search/cust_bill.cgi?OPEN60_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN60_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN60_custnum">by customer number</A>)
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>
diff --git a/httemplate/search/cust_bill_event.html b/httemplate/search/cust_bill_event.html
new file mode 100755
index 000000000..d76ce3c8c
--- /dev/null
+++ b/httemplate/search/cust_bill_event.html
@@ -0,0 +1,23 @@
+<HTML>
+ <HEAD>
+ <TITLE>Failed billing events</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>Failed billing events</H1>
+ </CENTER>
+ <HR>
+ <FORM ACTION="cust_bill_event.cgi" METHOD="post">
+ Return <B>failed billing events</B> for period:
+ from <INPUT TYPE="text" NAME="beginning"> <i>m/d/y</i>
+ to <INPUT TYPE="text" NAME="ending"> <i>m/d/y</i>
+
+ <P><INPUT TYPE="submit" VALUE="Get Report">
+
+ </FORM>
+
+ <HR>
+
+ </BODY>
+</HTML>
+
diff --git a/httemplate/search/report_cc.html b/httemplate/search/report_cc.html
index a028a87df..8653dcc69 100755
--- a/httemplate/search/report_cc.html
+++ b/httemplate/search/report_cc.html
@@ -9,8 +9,8 @@
<HR>
<FORM ACTION="report_cc.cgi" METHOD="post">
Return <B>credit card receipt report</B> for period:
- from <INPUT TYPE="text" NAME="beginning">
- to <INPUT TYPE="text" NAME="ending">
+ from <INPUT TYPE="text" NAME="beginning"> <i>m/d/y</i>
+ to <INPUT TYPE="text" NAME="ending"> <i>m/d/y</i>
<P><INPUT TYPE="submit" VALUE="Get Report">
diff --git a/httemplate/search/report_credit.html b/httemplate/search/report_credit.html
index bda08e31d..df9b9581f 100755
--- a/httemplate/search/report_credit.html
+++ b/httemplate/search/report_credit.html
@@ -9,8 +9,8 @@
<HR>
<FORM ACTION="report_credit.cgi" METHOD="post">
Return <B>in house credit report</B> for period:
- from <INPUT TYPE="text" NAME="beginning">
- to <INPUT TYPE="text" NAME="ending">
+ from <INPUT TYPE="text" NAME="beginning"> <i>m/d/y</i>
+ to <INPUT TYPE="text" NAME="ending"> <i>m/d/y</i>
<P><INPUT TYPE="submit" VALUE="Get Report">
diff --git a/httemplate/search/report_tax.html b/httemplate/search/report_tax.html
index a7beb2471..7bf681b42 100755
--- a/httemplate/search/report_tax.html
+++ b/httemplate/search/report_tax.html
@@ -9,8 +9,8 @@
<HR>
<FORM ACTION="report_tax.cgi" METHOD="post">
Return <B>tax report</B> for period:
- from <INPUT TYPE="text" NAME="beginning">
- to <INPUT TYPE="text" NAME="ending">
+ from <INPUT TYPE="text" NAME="beginning"> <i>m/d/y</i>
+ to <INPUT TYPE="text" NAME="ending"> <i>m/d/y</i>
<P><INPUT TYPE="submit" VALUE="Get Report">
diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi
index 95f1a0af8..53d7bc051 100755
--- a/httemplate/view/cust_bill.cgi
+++ b/httemplate/view/cust_bill.cgi
@@ -22,6 +22,8 @@ print qq!<A HREF="${p}edit/cust_pay.cgi?$invnum">Enter payments (check/cash) aga
print qq!<A HREF="${p}misc/print-invoice.cgi?$invnum">Reprint this invoice</A>!. '<BR><BR>';
+#false laziness with search/cust_bill_event.cgi
+
print table(). '<TR><TH>Event</TH><TH>Date</TH><TH>Status</TH></TR>';
foreach my $cust_bill_event (
sort { $a->_date <=> $b->_date } $cust_bill->cust_bill_event