X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpayment_history%2Fpayment.html;h=a4a349bb8a54ea52082954325dbd8d807e1d6574;hb=4396080ed2829ae0595f1fd777f39d090c9bcd7c;hp=346c0d03d04e9227a73e990497c13cecd989b487;hpb=5e5c408ded395ae70c4ce3878ed260674253cccd;p=freeside.git
diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html
index 346c0d03d..a4a349bb8 100644
--- a/httemplate/view/cust_main/payment_history/payment.html
+++ b/httemplate/view/cust_main/payment_history/payment.html
@@ -4,7 +4,6 @@
my( $cust_pay, %opt ) = @_;
-my $conf = new FS::Conf;
my $curuser = $FS::CurrentUser::CurrentUser;
my $payby = $cust_pay->payby;
@@ -33,7 +32,13 @@ $payby =~ s/^MCRD$/Manual credit card/;
$payby =~ s/^BILL$//;
my $info = $payby ? "($payby$payinfo)" : '';
-my( $pre, $post, $desc, $apply, $ext ) = ( '', '', '', '', '' );
+my $desc = '';
+if ( $opt{'pkg-balances'} && $cust_pay->pkgnum ) {
+ my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_pay->pkgnum } );
+ $desc .= ' for '. $cust_pkg->pkg_label_long;
+}
+
+my( $pre, $post, $apply, $ext ) = ( '', '', '', '' );
if ( scalar(@cust_bill_pay) == 0
&& scalar(@cust_pay_refund) == 0 ) {
#completely unapplied
@@ -69,15 +74,15 @@ if ( scalar(@cust_bill_pay) == 0
&& scalar(@cust_pay_refund) == 0
&& $cust_pay->unapplied == 0 ) {
#applied to one invoice, the usual situation
- $desc = ' '. $cust_bill_pay[0]->applied_to_invoice;
+ $desc .= ' '. $cust_bill_pay[0]->applied_to_invoice;
} elsif ( scalar(@cust_bill_pay) == 0
&& scalar(@cust_pay_refund) == 1
&& $cust_pay->unapplied == 0 ) {
#applied to one refund
- $desc = ' refunded on '. time2str("%D", $cust_pay_refund[0]->_date);
+ $desc .= ' refunded on '. time2str("%D", $cust_pay_refund[0]->_date);
} else {
#complicated
- $desc = '
';
+ $desc .= '
';
foreach my $app ( sort { $a->_date <=> $b->_date }
( @cust_bill_pay, @cust_pay_refund ) ) {
if ( $app->isa('FS::cust_bill_pay') ) {
@@ -139,7 +144,7 @@ my $view =
')';
my $refund = '';
-my $refund_days = $conf->config('card_refund-days') || 120;
+my $refund_days = $opt{'card_refund-days'} || 120;
if ( $cust_pay->closed !~ /^Y/i
&& $cust_pay->payby =~ /^(CARD|CHEK)$/
&& time-$cust_pay->_date < $refund_days*86400
@@ -179,7 +184,7 @@ if ( $cust_pay->closed !~ /^Y/i
my $delete = '';
if ( $cust_pay->closed !~ /^Y/i
- && $conf->exists('deletepayments')
+ && $opt{'deletepayments'}
&& $curuser->access_right('Delete payment')
)
{