some cleanup while i'm here
[freeside.git] / FS / FS / cust_pay.pm
index 3772473..bc5fbab 100644 (file)
@@ -62,7 +62,8 @@ L<Time::Local> and L<Date::Parse> for conversion functions.
 
 =item payby - `CARD' (credit cards), `CHEK' (electronic check/ACH),
 `LECB' (phone bill billing), `BILL' (billing), `PREP` (prepaid card),
-`CASH' (cash), `WEST' (Western Union) or `COMP' (free)
+`CASH' (cash), `WEST' (Western Union), `MCRD' (Manual credit card), or
+`COMP' (free)
 
 =item payinfo - card number, check #, or comp issuer (4-8 lowercase alphanumerics; think username), respectively
 
@@ -271,12 +272,14 @@ sub void {
 
 =item delete
 
-Deletes this payment and all associated applications (see L<FS::cust_bill_pay>),
-unless the closed flag is set.  In most cases, you want to use the void
-method instead to leave a record of the deleted payment.
+Unless the closed flag is set, deletes this payment and all associated
+applications (see L<FS::cust_bill_pay> and L<FS::cust_pay_refund>).  In most
+cases, you want to use the void method instead to leave a record of the
+deleted payment.
 
 =cut
 
+# very similar to FS::cust_credit::delete
 sub delete {
   my $self = shift;
   return "Can't delete closed payment" if $self->closed =~ /^Y/i;
@@ -344,7 +347,16 @@ sub delete {
 
 =item replace OLD_RECORD
 
-You probably shouldn't modify payments...
+You can, but probably shouldn't modify payments...
+
+=cut
+
+sub replace {
+  #return "Can't modify payment!"
+  my $self = shift;
+  return "Can't modify closed payment" if $self->closed =~ /^Y/i;
+  $self->SUPER::replace(@_);
+}
 
 =item check
 
@@ -374,7 +386,7 @@ sub check {
 
   $self->_date(time) unless $self->_date;
 
-  $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP|PREP|CASH|WEST)$/
+  $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP|PREP|CASH|WEST|MCRD)$/
     or return "Illegal payby";
   $self->payby($1);