}
if ( $amount ) {
- $error = $self->insert_prepay($amount, $prepay_identifier);
+ $error = $self->insert_cust_pay_prepay($amount, $prepay_identifier);
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
return "inserting prepayment (transaction rolled back): $error";
my $cust_pay = new FS::cust_pay {
'custnum' => $self->custnum,
- 'paid' => $amount,
+ 'paid' => sprintf('%.2f', $amount),
#'_date' => #date the prepaid card was purchased???
'payby' => 'PREP',
'payinfo' => $payinfo,
sub name {
my $self = shift;
- my $name = $self->get('last'). ', '. $self->first;
+ my $name = $self->contact;
$name = $self->company. " ($name)" if $self->company;
$name;
}
+=item ship_name
+
+Returns a name string for this (service/shipping) contact, either
+"Company (Last, First)" or "Last, First".
+
+=cut
+
+sub ship_name {
+ my $self = shift;
+ if ( $self->get('ship_last') ) {
+ my $name = $self->ship_contact;
+ $name = $self->ship_company. " ($name)" if $self->ship_company;
+ $name;
+ } else {
+ $self->name;
+ }
+}
+
+=item contact
+
+Returns this customer's full (billing) contact name only, "Last, First"
+
+=cut
+
+sub contact {
+ my $self = shift;
+ $self->get('last'). ', '. $self->first;
+}
+
+=item ship_contact
+
+Returns this customer's full (shipping) contact name only, "Last, First"
+
+=cut
+
+sub ship_contact {
+ my $self = shift;
+ $self->get('ship_last')
+ ? $self->get('ship_last'). ', '. $self->ship_first
+ : $self->contact;
+}
+
=item status
Returns a status string for this customer, currently: