diff options
author | Christopher Burger <burgerc@freeside.biz> | 2018-05-18 11:41:21 -0400 |
---|---|---|
committer | Christopher Burger <burgerc@freeside.biz> | 2018-05-18 11:46:11 -0400 |
commit | 9baab880cb616a2b9bd7812306563e2f13a4880d (patch) | |
tree | 76e36daf716c00fca001d8056be27e6d662c39ae /FS/FS/cust_main.pm | |
parent | e96f711e84bba96db24a91a1053e8a48e807b816 (diff) |
RT# 77792 - Created method to decide if batch payname should be name on card or personal name or business name.
Diffstat (limited to 'FS/FS/cust_main.pm')
-rw-r--r-- | FS/FS/cust_main.pm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index d71ade0..22d0dcc 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -4080,6 +4080,27 @@ sub name { $name; } +=item batch_payment_payname + +Returns a name string for this customer, either "cust_batch_payment->payname" or "First Last" or "Company, +based on if a company name exists and is the account being used a business account. + +=cut + +sub batch_payment_payname { + my $self = shift; + my $cust_pay_batch = shift; + my $name; + + if ($cust_pay_batch->{Hash}->{payby} eq "CARD") { $name = $cust_pay_batch->payname; } + else { $name = $self->first .' '. $self->last; } + + $name = $self->company + if (($cust_pay_batch->{Hash}->{paytype} eq "Business checking" || $cust_pay_batch->{Hash}->{paytype} eq "Business savings") && $self->company); + + $name; +} + =item service_contact Returns the L<FS::contact> object for this customer that has the 'Service' |