[freeside-commits]
freeside/httemplate/view/cust_main misc.html, 1.2,
1.3 billing.html, 1.5, 1.6 payment_history.html, 1.12,
1.13 packages.html, 1.6, 1.7 tickets.html, 1.5, 1.6
Ivan,,,
ivan at wavetail.420.am
Sun Aug 13 03:26:00 PDT 2006
Update of /home/cvs/cvsroot/freeside/httemplate/view/cust_main
In directory wavetail:/tmp/cvs-serv20875/httemplate/view/cust_main
Modified Files:
misc.html billing.html payment_history.html packages.html
tickets.html
Log Message:
customer view work:
DONE 1. add status and balance to top
DONE 2. add some sort of oldest date thing so the history doesn't get too
big (# years and a link to "show older")
3. make the rest of the action links into js popups? maybe later,
weird IENess when closing em
DONE (finished) - so revert out or finish/commit the Enter check payment one
- Process page can wait until another day.. it should be more of an *action*
DONE 4. Ticket list config knobs for wtxs (grid it too)
DONE 5. grid the package list
Index: tickets.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/tickets.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- tickets.html 9 Apr 2006 23:41:01 -0000 1.5
+++ tickets.html 13 Aug 2006 10:25:58 -0000 1.6
@@ -2,7 +2,7 @@
my( $cust_main ) = @_;
my $conf = new FS::Conf;
- my $num = 10;
+ my $num = $conf->config('cust_main-max_tickets') || 10;
my @tickets = ();
unless ( $conf->config('ticket_system-custom_priority_field') ) {
@@ -31,24 +31,46 @@
Highest priority tickets
(<A HREF="<%= FS::TicketSystem->href_customer_tickets($cust_main->custnum) %>">View all tickets for this customer</A>)
(<A HREF="<%= FS::TicketSystem->href_new_ticket($cust_main, join(', ', grep { $_ !~ /^(POST|FAX)$/ } $cust_main->invoicing_list ) ) %>">New ticket for this customer</A>)
-<%= include("/elements/table.html") %>
+
+<%= include("/elements/table-grid.html") %>
+
+<% my $bgcolor1 = '#eeeeee';
+ my $bgcolor2 = '#ffffff';
+ my $bgcolor = '';
+%>
+
<TR>
- <TH>#</TH>
- <TH>Subject</TH>
- <TH>Priority</TH>
- <TH>Queue</TH>
- <TH>Status</TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">#</TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">Subject</TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">Priority</TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">Queue</TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">Status</TH>
</TR>
+
<% foreach my $ticket ( @tickets ) {
my $href = FS::TicketSystem->href_ticket($ticket->{id});
+ if ( $bgcolor eq $bgcolor1 ) {
+ $bgcolor = $bgcolor2;
+ } else {
+ $bgcolor = $bgcolor1;
+ }
%>
+
<TR>
- <TD><A HREF=<%=$href%>><%= $ticket->{id} %></A></TD>
- <TD><A HREF=<%=$href%>><%= $ticket->{subject} %></A></TD>
- <TD ALIGN="right"><%= $ticket->{content} || $ticket->{priority} %></TD>
- <TD><%= $ticket->{name} %></TD>
- <TD><%= $ticket->{status} %></TD>
+
+ <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"><A HREF=<%=$href%>><%= $ticket->{id} %></A></TD>
+
+ <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"><A HREF=<%=$href%>><%= $ticket->{subject} %></A></TD>
+
+ <TD ALIGN="right" CLASS="grid" BGCOLOR="<%= $bgcolor %>"><%= $ticket->{content} || $ticket->{priority} %></TD>
+
+ <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"><%= $ticket->{name} %></TD>
+
+ <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"><%= $ticket->{status} %></TD>
+
</TR>
+
<% } %>
+
</TABLE>
Index: payment_history.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/payment_history.html,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- payment_history.html 12 Aug 2006 10:47:51 -0000 1.12
+++ payment_history.html 13 Aug 2006 10:25:58 -0000 1.13
@@ -21,21 +21,21 @@
<% if ( $payby{'BILL'} && $curuser->access_right('Post payment') ) { %>
<%= $s++ ? ' | ' : '' %>
- <A HREF="<%= $p %>edit/cust_pay.cgi?payby=BILL;custnum=<%= $custnum %>">Post check payment</A>
+ <A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('<%= $p %>edit/cust_pay.cgi?popup=1;payby=BILL;custnum=<%= $custnum %>', 392, 336, 'cust_pay_popup' ), CAPTION, 'Enter check payment', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">Enter check payment</A>
<% } %>
<% if ( $payby{'CASH'} && $curuser->access_right('Post payment') ) { %>
<%= $s++ ? ' | ' : '' %>
- <A HREF="<%= $p %>edit/cust_pay.cgi?payby=CASH;custnum=<%= $custnum %>">Post cash payment</A>
+ <A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('<%= $p %>edit/cust_pay.cgi?popup=1;payby=CASH;custnum=<%= $custnum %>', 392, 336, 'cust_pay_popup' ), CAPTION, 'Enter cash payment', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">Enter cash payment</A>
<% } %>
<% if ( $payby{'WEST'} && $curuser->access_right('Post payment') ) { %>
<%= $s++ ? ' | ' : '' %>
- <A HREF="<%= $p %>edit/cust_pay.cgi?payby=WEST;custnum=<%= $custnum %>">Post Western Union payment</A>
+ <A HREF="<%= $p %>edit/cust_pay.cgi?payby=WEST;custnum=<%= $custnum %>">Enter Western Union payment</A>
<% } %>
@@ -62,7 +62,7 @@
<% if ( $payby{'MCRD'} && $curuser->access_right('Post payment') ) { %>
<%= $s++ ? ' | ' : '' %>
- <A HREF="<%= $p %>edit/cust_pay.cgi?payby=MCRD;custnum=<%= $custnum %>">Post manual credit card payment</A>
+ <A HREF="<%= $p %>edit/cust_pay.cgi?payby=MCRD;custnum=<%= $custnum %>">Post manual (offline) credit card payment</A>
<% } %>
@@ -70,7 +70,7 @@
<% if ( $curuser->access_right('Post credit') ) { %>
- <A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('<%= $p %>edit/cust_credit.cgi?<%= $custnum %>', 392, 336, 'cust_credit_popup' ), CAPTION, 'Post credit', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">Post credit</A>
+ <A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('<%= $p %>edit/cust_credit.cgi?<%= $custnum %>', 392, 336, 'cust_credit_popup' ), CAPTION, 'Enter credit', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">Enter credit</A>
<BR>
@@ -430,10 +430,53 @@
<%
#display payment history
-my %target;
my $balance = 0;
+my %target = ();
+my $money_char = $conf->config('money_char') || '$';
+
+my $years = $conf->config('payment_history-years') || 2;
+my $older_than = time - $years * 31556736; #60*60*24*365.24
+my $hidden = 0;
+my $seen = 0;
+my $old_history = 0;
+
foreach my $item ( sort { $a->{'date'} <=> $b->{'date'} } @history ) {
+ my $display;
+ if ( $item->{'date'} < $older_than ) {
+ $display = ' STYLE="display:none" ';
+ $hidden = 1;
+ } else {
+
+ $display = '';
+
+ if ( $hidden && ! $seen++ ) {
+ ( my $balance_forward = $money_char. $balance ) =~ s/^\$\-/- \$/;
+ %>
+
+ <TR ID="balance_forward_row">
+ <TD CLASS="grid" BGCOLOR="#dddddd">
+ <%= time2str("%D",$item->{'date'}) %>
+ </TD>
+
+ <TD CLASS="grid" BGCOLOR="#dddddd">
+ <I>Starting balance on <%= time2str("%D",$item->{'date'}) %></I>
+ (<A HREF="javascript:void(0);" onClick="show_history();">show prior history</A>)
+ </TD>
+
+ <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
+ <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
+ <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
+ <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
+ <TD CLASS="grid" BGCOLOR="#dddddd"><I><%= $balance_forward %></I></TD>
+
+ </TR>
+
+ <%
+ }
+
+ }
+
if ( $bgcolor eq $bgcolor1 ) {
$bgcolor = $bgcolor2;
} else {
@@ -441,18 +484,24 @@
}
my $charge = exists($item->{'charge'})
- ? sprintf('$%.2f', $item->{'charge'})
+ ? sprintf("$money_char\%.2f", $item->{'charge'})
: '';
+
my $payment = exists($item->{'payment'})
- ? sprintf('- $%.2f', $item->{'payment'})
+ ? sprintf("- $money_char\%.2f", $item->{'payment'})
: '';
- $payment ||= sprintf('<DEL>- $%.2f</DEL>', $item->{'void_payment'})
+
+ $payment ||= sprintf( "<DEL>- $money_char\%.2f</DEL>",
+ $item->{'void_payment'}
+ )
if exists($item->{'void_payment'});
+
my $credit = exists($item->{'credit'})
- ? sprintf('- $%.2f', $item->{'credit'})
+ ? sprintf("- $money_char\%.2f", $item->{'credit'})
: '';
+
my $refund = exists($item->{'refund'})
- ? sprintf('$%.2f', $item->{'refund'})
+ ? sprintf("$money_char\%.2f", $item->{'refund'})
: '';
my $target = exists($item->{'target'}) ? $item->{'target'} : '';
@@ -463,11 +512,11 @@
$balance += $item->{'refund'} if exists $item->{'refund'};
$balance = sprintf("%.2f", $balance);
$balance =~ s/^\-0\.00$/0.00/; #yay ieee fp
- ( my $showbalance = '$'. $balance ) =~ s/^\$\-/- \$/;
+ ( my $showbalance = $money_char. $balance ) =~ s/^\$\-/- \$/;
%>
- <TR>
+ <TR <%= $display ? $display.' ID="old_history'.$old_history++.'"' : ''%>>
<TD CLASS="grid" BGCOLOR="<%= $bgcolor %>">
<% unless ( !$target || $target{$target}++ ) { %>
<A NAME="<%= $target %>">
@@ -502,3 +551,20 @@
</TABLE>
+<SCRIPT TYPE="text/javascript">
+
+function show_history () {
+ //alert('showing history!');
+
+ var balance_forward_row = document.getElementById('balance_forward_row');
+
+ balance_forward_row.style.display = 'none';
+ for ( var i = 0; i < <%= $old_history %>; i++ ) {
+ var oldRow = document.getElementById('old_history'+i);
+ oldRow.style.display = '';
+ }
+
+}
+
+</SCRIPT>
+
Index: billing.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/billing.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- billing.html 20 Mar 2006 19:13:27 -0000 1.5
+++ billing.html 13 Aug 2006 10:25:58 -0000 1.6
@@ -1,12 +1,24 @@
<%
my( $cust_main ) = @_;
my @invoicing_list = $cust_main->invoicing_list;
+ my $conf = new FS::Conf;
+ my $money_char = $conf->config('money_char') || '$';
%>
Billing information
(<A HREF="<%= $p %>misc/bill.cgi?<%= $cust_main->custnum %>">Bill now</A>)
<%= ntable("#cccccc") %><TR><TD><%= ntable("#cccccc",2) %>
+<%
+( my $balance = $cust_main->balance )
+ =~ s/^(\-?)(.*)$/<FONT SIZE=+1>$1<\/FONT>$money_char$2/;
+%>
+
+<TR>
+ <TD ALIGN="right">Balance due</TD>
+ <TD BGCOLOR="#ffffff"><B><%= $balance %></B></TD>
+</TR>
+
<TR>
<TD ALIGN="right">Billing type</TD>
<TD BGCOLOR="#ffffff">
@@ -159,7 +171,7 @@
<%= join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || 'no' %>
</TD>
</TR>
-<% my $conf = new FS::Conf; if ( $conf->exists('voip-cust_cdr_spools') ) { %>
+<% if ( $conf->exists('voip-cust_cdr_spools') ) { %>
<TR>
<TD ALIGN="right">Spool CDRs</TD>
<TD BGCOLOR="#ffffff"><%= $cust_main->spool_cdr ? 'yes' : 'no' %></TD>
Index: misc.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/misc.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- misc.html 10 Aug 2006 13:50:45 -0000 1.2
+++ misc.html 13 Aug 2006 10:25:58 -0000 1.3
@@ -4,11 +4,17 @@
%>
<%= ntable("#cccccc") %><TR><TD><%= &ntable("#cccccc",2) %>
+
<TR>
<TD ALIGN="right">Customer number</TD>
<TD BGCOLOR="#ffffff"><%= $cust_main->custnum %></TD>
</TR>
+<TR>
+ <TD ALIGN="right">Status</TD>
+ <TD BGCOLOR="#ffffff"><FONT COLOR="#<%= $cust_main->statuscolor %>"><B><%= ucfirst($cust_main->status) %></B></FONT></TD>
+</TR>
+
<%
my @agents = qsearch( 'agent', {} );
my $agent;
@@ -51,10 +57,6 @@
<% } %>
<TR>
- <TD ALIGN="right">Order taker</TD>
- <TD BGCOLOR="#ffffff"><%= $cust_main->otaker %></TD>
-</TR>
-<TR>
<TD ALIGN="right">Referring Customer</TD>
<TD BGCOLOR="#ffffff">
@@ -82,5 +84,10 @@
</TD>
</TR>
+<TR>
+ <TD ALIGN="right">Order taker</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->otaker %></TD>
+</TR>
+
</TABLE></TD></TR></TABLE>
Index: packages.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/packages.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- packages.html 19 Jun 2006 13:09:14 -0000 1.6
+++ packages.html 13 Aug 2006 10:25:58 -0000 1.7
@@ -7,10 +7,6 @@
my $packages = get_packages($cust_main, $conf);
%>
-<STYLE TYPE="text/css">
-.package .provision { font-weight: bold }
-</STYLE>
-
<A NAME="cust_pkg"><FONT SIZE="+2">Packages</FONT></A>
<% if ( $curuser->access_right('Order customer package') ) { %>
@@ -54,30 +50,33 @@
<% if ( @$packages ) { %>
-<TABLE CLASS="package" BORDER=1 CELLSPACING=0 CELLPADDING=2 BORDERCOLOR="#999999">
+<%= include('/elements/table-grid.html') %>
+
+<% my $bgcolor1 = '#eeeeee';
+ my $bgcolor2 = '#ffffff';
+ my $bgcolor = '';
+%>
+
<TR>
- <TH>Package</TH>
- <TH>Status</TH>
- <TH COLSPAN=2>Services</TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">Package</TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">Status</TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">Services</TH>
</TR>
<%
foreach my $pkg (sort pkgsort_pkgnum_cancel @$packages) {
- my $rowspan = 0;
- if ($pkg->{cancel}) {
- $rowspan = 0;
+ if ( $bgcolor eq $bgcolor1 ) {
+ $bgcolor = $bgcolor2;
} else {
- foreach my $svcpart (@{$pkg->{svcparts}}) {
- $rowspan += $svcpart->{count};
- $rowspan++ if ($svcpart->{count} < $svcpart->{quantity});
- }
- }
+ $bgcolor = $bgcolor1;
+ }
+
%>
<!--pkgnum: <%=$pkg->{pkgnum}%>-->
<TR>
- <TD ROWSPAN=<%= $rowspan || 1 %>>
+ <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>">
<A NAME="cust_pkg<%=$pkg->{pkgnum}%>"><%=$pkg->{pkgnum}%></A>:
<%=$pkg->{pkg}%> - <%=$pkg->{comment}%><BR>
<FONT SIZE=-1>
@@ -94,8 +93,8 @@
<% } %>
</FONT>
</TD>
- <TD ROWSPAN=<%= $rowspan || 1 %>>
- <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
+ <TD CLASS="inv" BGCOLOR="<%= $bgcolor %>">
+ <TABLE CLASS="inv" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
<%
sub myfreq {
@@ -315,42 +314,51 @@
</TABLE>
</TD>
-<%
- if ($rowspan == 0) { print qq!</TR>\n!; next; }
+<TD CLASS="inv" BGCOLOR="<%= $bgcolor %>">
+ <TABLE CLASS="inv" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
- my $cnt = 0;
+
+<%
foreach my $svcpart (sort {$a->{svcpart} <=> $b->{svcpart}} @{$pkg->{svcparts}}) {
foreach my $service (@{$svcpart->{services}}) {
- print '<TR>' if ($cnt > 0);
%>
- <TD><%=svc_link($svcpart,$service)%></TD>
- <TD><%=svc_label_link($svcpart,$service)%>
- <% if ( $curuser->access_right('Unprovision customer service') ) { %>
- <BR>( <%=svc_unprovision_link($service)%> )
+ <TR>
+ <TD ALIGN="right" VALIGN="top" ROWSPAN=2><%=svc_link($svcpart,$service)%></TD>
+ <TD STYLE="padding-bottom:0px"><B><%=svc_label_link($svcpart,$service)%></B></TD>
+ </TR>
+
+ <% if ( $curuser->access_right('Unprovision customer service') ) { %>
+ <TR>
+ <TD ALIGN="right" VALIGN="top" STYLE="padding-bottom:5px;padding-top:0px"><FONT SIZE="-2">( <%=svc_unprovision_link($service)%> )</FONT></TD>
+ </TR>
+ <% } %>
+
<% } %>
- </TD>
-</TR>
-<%
- $cnt++;
- }
- if ( $svcpart->{count} < $svcpart->{quantity} ) {
- print '<TR>' if ($cnt > 0);
- if ( $curuser->access_right('Provision customer service') ) {
- print '<TD COLSPAN=2>'.
- svc_provision_link($pkg, $svcpart, $conf, $curuser).
- '</TD></TR>';
- } else {
- #print '<TD COLSPAN=2> </TD></TR>';
- print '<TD COLSPAN=2></TD></TR>';
- }
- }
- }
-}
-#end display packages
+ <% if ( $curuser->access_right('Provision customer service')
+ && $svcpart->{count} < $svcpart->{quantity}
+ )
+ {
+ %>
+
+ <TR>
+ <TD COLSPAN=2 ALIGN="center" STYLE="padding-bottom:4px;padding-top:0px">
+ <B><%= svc_provision_link($pkg, $svcpart, $conf, $curuser) %></B>
+ </TD>
+ </TR>
+
+ <% } %>
+
+<% } %>
+
+</TABLE>
+</TD>
+
+<% } #end display packages
%>
</TABLE>
+
<% } else { %>
<BR>
<% } %>
More information about the freeside-commits
mailing list