% if ( $item->{'balance_forward'} ) {
<& .balance_forward_row, $item->{'balance'}, $item->{'date'} &>
-% }
+% }
%} # foreach $item
+% if ( $old_history ) {
+<& .hide_history_row, $old_history++ &>
+% }
+
</TABLE>
</TD>
</TR>
</TABLE>
+<SCRIPT SRC="<% $fsurl %>elements/page_pref.js"></SCRIPT>
<SCRIPT TYPE="text/javascript">
-function show_history () {
- //alert('showing history!');
-
+function show_history(show) { // but don't update pref
var balance_forward_row = document.getElementById('balance_forward_row');
- balance_forward_row.style.display = 'none';
+ balance_forward_row.style.display = show ? 'none' : '';
for ( var i = 0; i < <% $old_history %>; i++ ) {
var oldRow = document.getElementById('old_history'+i);
- oldRow.style.display = '';
+ oldRow.style.display = show ? '' : 'none';
}
+}
+
+function update_show_history (show) {
+ show = show ? 1 : 0;
+ show_history(show);
+ // update user pref (blind post, don't care about the output here)
+ set_page_pref('expand_old_history', '<% $custnum %>', show);
}
+$().ready(function() {
+ show_history(<% get_page_pref('expand_old_history', $custnum) %>);
+});
+
</SCRIPT>
<%def .balance_forward_row>
% my( $b, $date ) = @_;
<TD CLASS="grid" BGCOLOR="#dddddd">
<I><% mt("Starting balance on [_1]", time2str($date_format, $date) ) |h %></I>
- (<A HREF="javascript:void(0);" onClick="show_history();"><% mt('show prior history') |h %></A>)
+ (<A HREF="javascript:void(0);" onClick="update_show_history(true);"><% mt('show prior history') |h %></A>)
</TD>
<TD CLASS="grid" BGCOLOR="#dddddd"></TD>
</TR>
</%def>
+<%def .hide_history_row>
+% my $num = shift;
+ <TR ID="old_history<% $num %>" STYLE="display: none">
+ <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
+ <TD CLASS="grid" BGCOLOR="#dddddd">
+ <I>(<A HREF="#" onclick="update_show_history(false)"><% mt('hide prior history') |h %></A>)</I>
+ </TD>
+ <TD CLASS="grid" BGCOLOR="#dddddd" COLSPAN=5></TD>
+ </TR>
+</%def>
+
<%shared>
my $conf = new FS::Conf;
my $date_format = $conf->config('date_format') || '%m/%d/%Y';
my $curuser = $FS::CurrentUser::CurrentUser;
-my @payby = grep /\w/, $conf->config('payby');
-#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP ))
-@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP ))
- unless @payby;
-my %payby = map { $_=>1 } @payby;
-
my %status = (
'Queued' => 'O', #Open
'In-transit' => 'I',
#rights
( map { $_ => $curuser->access_right($_) }
(
- 'View invoices', 'Void invoices', 'Unvoid invoices',
+ 'View invoices', 'Void invoices', 'Unvoid invoices', 'Resend invoices',
'Apply payment', 'Refund credit card payment', 'Refund Echeck payment',
'Post refund', 'Post check refund', 'Post cash refund ', 'Refund payment',
'Credit card void', 'Echeck void', 'Void payments', 'Unvoid payments',
- 'Delete payment', 'Unapply payment',
+ 'Unapply payment',
'Apply credit', 'Unapply credit', 'Void credit', 'Unvoid credit',
'Delete refund',
'Billing event reports', 'View customer billing events',
#customer information
'total_owed' => $cust_main->total_owed,
'total_unapplied_refunds' => $cust_main->total_unapplied_refunds,
+ 'has_email_address' => scalar($cust_main->invoicing_list_emailonly),
);
$opt{'date_format'} ||= '%m/%d/%Y';
sub areyousure_link {
my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
- ' (<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>)';
+ ' (<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'" STYLE="white-space: nowrap;">'.$label.'</A>)';
}
</%init>