X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpayment_history%2Fpayment.html;h=e745864b77ad7d3534bb62825354eee75cb23c83;hb=74e058c8a010ef6feb539248a550d0bb169c1e94;hp=bcfa808db8104931e09870e70036287f7d3385d4;hpb=63a268637b2d51a8766412617724b9436439deb6;p=freeside.git diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html index bcfa808db..e745864b7 100644 --- a/httemplate/view/cust_main/payment_history/payment.html +++ b/httemplate/view/cust_main/payment_history/payment.html @@ -4,6 +4,8 @@ my( $cust_pay, %opt ) = @_; +my $date_format = $opt{'date_format'} || '%m/%d/%Y'; + my $conf = new FS::Conf; my $curuser = $FS::CurrentUser::CurrentUser; @@ -87,7 +89,7 @@ if ( 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($date_format, $cust_pay_refund[0]->_date); } else { #complicated $desc .= '
'; @@ -98,11 +100,11 @@ if ( scalar(@cust_bill_pay) == 0 '$'. $app->amount. ' '. $app->applied_to_invoice. '
'; - #' on '. time2str("%D", $cust_bill_pay->_date). + #' on '. time2str($date_format, $cust_bill_pay->_date). } elsif ( $app->isa('FS::cust_pay_refund') ) { $desc .= '  '. '$'. $app->amount. - ' refunded on '. time2str("%D", $app->_date). + ' refunded on '. time2str($date_format, $app->_date). '
'; } else { die "$app is not a FS::cust_bill_pay or FS::cust_pay_refund"; @@ -153,11 +155,14 @@ my $view = my $refund = ''; my $refund_days = $opt{'card_refund-days'} || 120; +my @rights = ('Refund payment'); +push @rights, 'Refund credit card payment' if $payby eq 'CARD'; +push @rights, 'Refund Echeck payment' if $payby eq 'CHEK'; if ( $cust_pay->closed !~ /^Y/i && $cust_pay->payby =~ /^(CARD|CHEK)$/ && time-$cust_pay->_date < $refund_days*86400 && $cust_pay->unrefunded > 0 - && $curuser->access_right('Refund payment') + && $curuser->access_right(\@rights) ) { $refund = qq! (