diff options
Diffstat (limited to 'httemplate/view')
-rwxr-xr-x | httemplate/view/cust_main.cgi | 19 | ||||
-rw-r--r-- | httemplate/view/cust_main/billing.html | 14 | ||||
-rw-r--r-- | httemplate/view/cust_main/misc.html | 30 | ||||
-rwxr-xr-x | httemplate/view/cust_main/packages.html | 100 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history.html | 178 | ||||
-rw-r--r-- | httemplate/view/cust_main/tickets.html | 46 |
6 files changed, 261 insertions, 126 deletions
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 89ddc38f2..8267fea51 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -2,24 +2,6 @@ my $conf = new FS::Conf; -my %uiview = (); -my %uiadd = (); -foreach my $part_svc ( qsearch('part_svc',{}) ) { - $uiview{$part_svc->svcpart} = $p. "view/". $part_svc->svcdb . ".cgi"; - $uiadd{$part_svc->svcpart}= $p. "edit/". $part_svc->svcdb . ".cgi"; -} - -%> - - -<%= include("/elements/header.html","Customer View", - include("/elements/menubar.html", - 'Main Menu' => $p, -)) %> - - -<% - my $curuser = $FS::CurrentUser::CurrentUser; die "No customer specified (bad URL)!" unless $cgi->keywords; @@ -31,6 +13,7 @@ die "Customer not found!" unless $cust_main; %> +<%= include("/elements/header.html","Customer View: ". $cust_main->name ) %> <% if ( $curuser->access_right('Edit customer') ) { %> <A HREF="<%= $p %>edit/cust_main.cgi?<%= $custnum %>">Edit this customer</A> | diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index 895814cc2..191d3092f 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -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 @@ if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format <%= 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> diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index 69e120573..f06a4fbd2 100644 --- a/httemplate/view/cust_main/misc.html +++ b/httemplate/view/cust_main/misc.html @@ -1,13 +1,20 @@ <% my( $cust_main ) = @_; + my $conf = new FS::Conf; %> <%= 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; @@ -25,8 +32,18 @@ $agent = $agents[0]; } - my @referrals = qsearch( 'part_referral', {} ); - unless ( scalar(@referrals) == 1 ) { + if ( $cust_main->agent_custid ) { +%> + +<TR> + <TD ALIGN="right">Agent customer ref#</TD> + <TD BGCOLOR="#ffffff"><%= $cust_main->agent_custid %></TD> +</TR> + +<% + } + + unless ( FS::part_referral->num_part_referral == 1 ) { my $referral = qsearchs('part_referral', { 'refnum' => $cust_main->refnum } ); @@ -40,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"> @@ -71,5 +84,10 @@ </TD> </TR> +<TR> + <TD ALIGN="right">Order taker</TD> + <TD BGCOLOR="#ffffff"><%= $cust_main->otaker %></TD> +</TR> + </TABLE></TD></TR></TABLE> diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index beb67f325..9cd1e284f 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -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 @@ Current packages <% 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 @@ foreach my $pkg (sort pkgsort_pkgnum_cancel @$packages) { <% } %> </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 @@ foreach my $pkg (sort pkgsort_pkgnum_cancel @$packages) { </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> <% } %> diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 5c2aa24c9..aef5fb8f8 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -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> @@ -135,7 +135,7 @@ foreach my $cust_pay ($cust_main->cust_pay) { $post = '</FONT></B>'; $apply = qq! (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('${p}edit/cust_bill_pay.cgi?!. $cust_pay->paynum. - qq!', 392, 336, 'cust_credit_popup' ), CAPTION, 'Post credit', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">apply</A>)!; + qq!', 392, 336, 'cust_bill_pay_popup' ), CAPTION, 'Apply payment', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">apply</A>)!; } elsif ( scalar(@cust_bill_pay) == 1 && scalar(@cust_pay_refund) == 0 @@ -161,7 +161,7 @@ foreach my $cust_pay ($cust_main->cust_pay) { } elsif ( $app->isa('FS::cust_pay_refund') ) { $desc .= ' '. '$'. $app->amount. - ' refunded on'. time2str("%D", $app->_date). + ' refunded on '. time2str("%D", $app->_date). '<BR>'; } else { die "$app is not a FS::cust_bill_pay or FS::cust_pay_refund"; @@ -173,7 +173,7 @@ foreach my $cust_pay ($cust_main->cust_pay) { $cust_pay->unapplied. ' unapplied</FONT></B>'. qq! (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('${p}edit/cust_bill_pay.cgi?!. $cust_pay->paynum. - qq!', 392, 336, 'cust_credit_popup' ), CAPTION, 'Post credit', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">apply</A>)!. + qq!', 392, 336, 'cust_bill_pay_popup' ), CAPTION, 'Apply payment', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">apply</A>)!. '<BR>'; } } @@ -195,13 +195,14 @@ foreach my $cust_pay ($cust_main->cust_pay) { my $void = ''; if ( $cust_pay->closed !~ /^Y/i && ( ( $cust_pay->payby eq 'CARD' - && $conf->exists('cc-void') - && $curuser->acccess_right('Credit card void') + && $curuser->access_right('Credit card void') ) || ( $cust_pay->payby eq 'CHEK' - && $conf->exists('echeck-void') - && $curuser->acccess_right('Echeck void') - ) + && $curuser->access_right('Echeck void') + ) + || ( $cust_pay->payby !~ /^(CARD|CHEK)$/ + && $curuser->access_right('Regular void') + ) ) ) { @@ -231,7 +232,6 @@ foreach my $cust_pay ($cust_main->cust_pay) { my $unapply = ''; if ( $cust_pay->closed !~ /^Y/i - && $conf->exists('unapplypayments') && scalar(@cust_bill_pay) && $curuser->access_right('Unapply payment') ) @@ -268,7 +268,6 @@ foreach my $cust_pay_void ($cust_main->cust_pay_void) { my $unvoid = ''; if ( $cust_pay_void->closed !~ /^Y/i - && $conf->exists('unvoid') && $curuser->access_right('Unvoid') ) { @@ -307,7 +306,7 @@ foreach my $cust_credit ($cust_main->cust_credit) { $post = '</FONT></B>'; $apply = qq! (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('${p}edit/cust_credit_bill.cgi?!. $cust_credit->crednum. - qq!', 392, 336, 'cust_credit_popup' ), CAPTION, 'Post credit', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">apply</A>)!; + qq!', 392, 336, 'cust_credit_bill_popup' ), CAPTION, 'Apply credit', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">apply</A>)!; } elsif ( scalar(@cust_credit_bill) == 1 && scalar(@cust_credit_refund) == 0 && $cust_credit->credited == 0 ) { @@ -332,7 +331,7 @@ foreach my $cust_credit ($cust_main->cust_credit) { } elsif ( $app->isa('FS::cust_credit_refund') ) { $desc .= ' '. '$'. $app->amount. - ' refunded on'. time2str("%D", $app->_date). + ' refunded on '. time2str("%D", $app->_date). '<BR>'; } else { die "$app is not a FS::cust_credit_bill or a FS::cust_credit_refund"; @@ -343,14 +342,18 @@ foreach my $cust_credit ($cust_main->cust_credit) { $cust_credit->credited. ' unapplied</FONT></B>'. qq! (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('${p}edit/cust_credit_bill.cgi?!. $cust_credit->crednum. - qq!', 392, 336, 'cust_credit_popup' ), CAPTION, 'Post credit', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">apply</A>)!. + qq!', 392, 336, 'cust_credit_bill_popup' ), CAPTION, 'Apply credit', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">apply</A>)!. '<BR>'; } } # my $delete = ''; if ( $cust_credit->closed !~ /^Y/i - && $conf->exists('deletecredits') + + #s'pose deleting a credit isn't bad like deleting a payment + # and this needs to be generally available until we have credit voiding.. + #&& $conf->exists('deletecredits') + && $curuser->access_right('Delete credit') ) { @@ -362,7 +365,6 @@ foreach my $cust_credit ($cust_main->cust_credit) { my $unapply = ''; if ( $cust_credit->closed !~ /^Y/i - && $conf->exists('unapplycredits') && scalar(@cust_credit_bill) && $curuser->access_right('Unapply credit') ) @@ -408,37 +410,98 @@ foreach my $cust_refund ($cust_main->cust_refund) { %> -<%= include("/elements/table.html") %> +<%= include("/elements/table-grid.html") %> + +<% my $bgcolor1 = '#eeeeee'; + my $bgcolor2 = '#ffffff'; + my $bgcolor = ''; +%> + <TR> - <TH>Date</TH> - <TH>Description</TH> - <TH><FONT SIZE=-1>Charge</FONT></TH> - <TH><FONT SIZE=-1>Payment</FONT></TH> - <TH><FONT SIZE=-1>In-house<BR>Credit</FONT></TH> - <TH><FONT SIZE=-1>Refund</FONT></TH> - <TH><FONT SIZE=-1>Balance</FONT></TH> + <TH CLASS="grid" BGCOLOR="#cccccc">Date</TH> + <TH CLASS="grid" BGCOLOR="#cccccc">Description</TH> + <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Charge</FONT></TH> + <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Payment</FONT></TH> + <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>In-house<BR>Credit</FONT></TH> + <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Refund</FONT></TH> + <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Balance</FONT></TH> </TR> <% #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 { + $bgcolor = $bgcolor1; + } + 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'} : ''; @@ -449,12 +512,12 @@ foreach my $item ( sort { $a->{'date'} <=> $b->{'date'} } @history ) { $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> - <TD> + <TR <%= $display ? $display.' ID="old_history'.$old_history++.'"' : ''%>> + <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"> <% unless ( !$target || $target{$target}++ ) { %> <A NAME="<%= $target %>"> <% } %> @@ -464,15 +527,44 @@ foreach my $item ( sort { $a->{'date'} <=> $b->{'date'} } @history ) { <% } %> </FONT> </TD> - <TD><%= $item->{'desc'} %></TD> - <TD ALIGN="right"><%= $charge %></TD> - <TD ALIGN="right"><%= $payment %></TD> - <TD ALIGN="right"><%= $credit %></TD> - <TD ALIGN="right"><%= $refund %></TD> - <TD ALIGN="right"><%= $showbalance %></TD> + <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"> + <%= $item->{'desc'} %> + </TD> + <TD ALIGN="right" CLASS="grid" BGCOLOR="<%= $bgcolor %>"> + <%= $charge %> + </TD> + <TD ALIGN="right" CLASS="grid" BGCOLOR="<%= $bgcolor %>"> + <%= $payment %> + </TD> + <TD ALIGN="right" CLASS="grid" BGCOLOR="<%= $bgcolor %>"> + <%= $credit %> + </TD> + <TD ALIGN="right" CLASS="grid" BGCOLOR="<%= $bgcolor %>"> + <%= $refund %> + </TD> + <TD ALIGN="right" CLASS="grid" BGCOLOR="<%= $bgcolor %>"> + <%= $showbalance %> + </TD> </TR> <% } %> </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> + diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html index 5c1d94ee1..93cb51f25 100644 --- a/httemplate/view/cust_main/tickets.html +++ b/httemplate/view/cust_main/tickets.html @@ -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> |