[freeside-commits] freeside/httemplate/view/cust_main payment_history.html, 1.35, 1.36 packages.html, 1.46, 1.47
Ivan,,,
ivan at wavetail.420.am
Sat Feb 7 00:23:12 PST 2009
Update of /home/cvs/cvsroot/freeside/httemplate/view/cust_main
In directory wavetail.420.am:/tmp/cvs-serv22661
Modified Files:
payment_history.html packages.html
Log Message:
optimize customer view: avoid looking up config values inside loops, RT#4728
Index: payment_history.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/payment_history.html,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- payment_history.html 16 Oct 2008 05:29:00 -0000 1.35
+++ payment_history.html 7 Feb 2009 08:23:09 -0000 1.36
@@ -157,7 +157,7 @@
<TR>
<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>Invoice</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>
@@ -344,11 +344,19 @@
#get payment history
my @history = ();
+my %opt =
+ ( map { $_ => scalar($conf->config($_)) }
+ qw( card_refund-days )
+ ),
+ ( map { $_ => $conf->exists($_) }
+ qw( deletepayments deleterefunds )
+ );
+
#invoices
foreach my $cust_bill ($cust_main->cust_bill) {
push @history, {
'date' => $cust_bill->_date,
- 'desc' => include('payment_history/invoice.html', $cust_bill),
+ 'desc' => include('payment_history/invoice.html', $cust_bill, %opt ),
'charge' => $cust_bill->charged,
};
}
@@ -357,7 +365,7 @@
foreach my $cust_pay ($cust_main->cust_pay) {
push @history, {
'date' => $cust_pay->_date,
- 'desc' => include('payment_history/payment.html', $cust_pay),
+ 'desc' => include('payment_history/payment.html', $cust_pay, %opt ),
'payment' => $cust_pay->paid,
#'target' => $target, #XXX
};
Index: packages.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/packages.html,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- packages.html 10 Jan 2009 00:43:05 -0000 1.46
+++ packages.html 7 Feb 2009 08:23:10 -0000 1.47
@@ -145,10 +145,24 @@
% $bgcolor = $bgcolor1;
% }
%
+% my $countrydefault = scalar($conf->config('countrydefault')) || 'US';
% my %iopt = (
-% 'bgcolor' => $bgcolor,
-% 'cust_pkg' => $cust_pkg,
-% 'part_pkg' => $cust_pkg->part_pkg,
+% 'bgcolor' => $bgcolor,
+% 'cust_pkg' => $cust_pkg,
+% 'part_pkg' => $cust_pkg->part_pkg,
+%
+% #for services.html and status.html
+% 'cust_pkg-display_times' => $conf->exists('cust_pkg-display_times'),
+%
+% #for location.html
+% 'countrydefault' => $countrydefault,
+% 'statedefault' => ( scalar($conf->config('statedefault'))
+% || ($countrydefault eq 'US' ? 'CA' : '') ),
+%
+% #for services.html
+% 'svc_external-skip_manual' => $conf->exists('svc_external-skip_manual'),
+% 'legacy_link' => $conf->exists('legacy_link'),
+%
% );
<!--pkgnum: <% $cust_pkg->pkgnum %>-->
More information about the freeside-commits
mailing list