'action' => "${p}edit/cust_pay.cgi?popup=1;payby=BILL",
'cust_main' => $cust_main,
'actionlabel' => emt('Enter check payment'),
- 'width' => 392,
+ 'width' => ( $opt{'pkg-balances'} ? 763 : 392),
'height' => 392,
&>
% }
'action' => "${p}edit/cust_pay.cgi?popup=1;payby=CASH",
'cust_main' => $cust_main,
'actionlabel' => emt('Enter cash payment'),
- 'width' => 392,
+ 'width' => ( $opt{'pkg-balances'} ? 763 : 392),
'height' => 392,
&>
% }
'action' => "${p}edit/cust_credit.cgi",
'cust_main' => $cust_main,
'actionlabel' => emt('Enter credit'),
- 'width' => 616, #make room for reasons #540 default
+ 'width' => ( $opt{'pkg-balances'} ? 763 : 616),
&>
% }
% if ( $curuser->access_right('Credit line items') ) {
my @history = ();
my %opt = (
+
+ #config
( map { $_ => scalar($conf->config($_)) }
qw( card_refund-days date_format )
),
( map { $_ => $conf->exists($_) }
- qw( deleteinvoices deletepayments deleterefunds pkg-balances )
- )
+ qw( deleteinvoices deletepayments deleterefunds pkg-balances
+ cust_credit_bill_pkg-manual cust_bill_pay_pkg-manual
+ )
+ ),
+ 'money_char ' => $money_char,
+
+ #rights
+ ( map { $_ => $curuser->access_right($_) }
+ (
+ 'View invoices', 'Void invoices', 'Unvoid invoices', 'Delete invoices',
+ 'Apply payment', 'Refund credit card payment', 'Refund Echeck payment',
+ 'Credit card void', 'Echeck void', 'Void payments', 'Unvoid payments',
+ 'Delete payment', 'Unapply payment',
+ 'Apply credit', 'Delete credit', 'Unapply 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,
);
$opt{'date_format'} ||= '%m/%d/%Y';
my $payby = $object->payby;
my $payinfo = $object->payinfo;
- my $conf = new FS::Conf;
-
if ( $payby eq 'CARD' ) {
$payinfo = $object->paymask;
} elsif ( $payby eq 'CHEK' ) {
+ #false laziness w/payinfo_Mixin::payby_payinfo_pretty, should use that
my( $account, $aba ) = split('@', $object->paymask );
- $payinfo = emt("ABA [_1], Acct #[_2]",$aba,$account);
+ if ( $aba =~ /^(\d{5})\.(\d{3})$/ ) { #blame canada
+ my($branch, $routing) = ($1, $2);
+ $payinfo = emt("Routing [_1], Branch [_2], Acct [_3]",
+ $routing, $branch, $account);
+ } else {
+ $payinfo = emt("Routing [_1], Acct [_2]", $aba, $account);
+ }
}
($payby,$payinfo);