projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix floating point error
[freeside.git]
/
FS
/
FS
/
cust_pay_void.pm
diff --git
a/FS/FS/cust_pay_void.pm
b/FS/FS/cust_pay_void.pm
index
de05f71
..
e18a4f6
100644
(file)
--- a/
FS/FS/cust_pay_void.pm
+++ b/
FS/FS/cust_pay_void.pm
@@
-1,6
+1,8
@@
package FS::cust_pay_void;
package FS::cust_pay_void;
+
use strict;
use strict;
-use vars qw( @ISA @encrypted_fields );
+use base qw( FS::otaker_Mixin FS::payinfo_Mixin FS::Record );
+use vars qw( @encrypted_fields $otaker_upgrade_kludge );
use Business::CreditCard;
use FS::UID qw(getotaker);
use FS::Record qw(qsearchs dbh fields); # qsearch );
use Business::CreditCard;
use FS::UID qw(getotaker);
use FS::Record qw(qsearchs dbh fields); # qsearch );
@@
-9,10
+11,10
@@
use FS::cust_pay;
#use FS::cust_bill_pay;
#use FS::cust_pay_refund;
#use FS::cust_main;
#use FS::cust_bill_pay;
#use FS::cust_pay_refund;
#use FS::cust_main;
-
-@ISA = qw( FS::Record FS::payinfo_Mixin );
+use FS::cust_pkg;
@encrypted_fields = ('payinfo');
@encrypted_fields = ('payinfo');
+$otaker_upgrade_kludge = 0;
=head1 NAME
=head1 NAME
@@
-40,24
+42,48
@@
are currently supported:
=over 4
=over 4
-=item paynum - primary key (assigned automatically for new payments)
+=item paynum
+
+primary key (assigned automatically for new payments)
+
+=item custnum
-
=item custnum -
customer (see L<FS::cust_main>)
+customer (see L<FS::cust_main>)
-=item paid
- Amount of this payment
+=item paid
-=item _date - specified as a UNIX timestamp; see L<perlfunc/"time">. Also see
+Amount of this payment
+
+=item _date
+
+specified as a UNIX timestamp; see L<perlfunc/"time">. Also see
L<Time::Local> and L<Date::Parse> for conversion functions.
L<Time::Local> and L<Date::Parse> for conversion functions.
-=item payby - `CARD' (credit cards), `CHEK' (electronic check/ACH),
+=item otaker
+
+order taker (see L<FS::access_user>)
+
+=item payby
+
+`CARD' (credit cards), `CHEK' (electronic check/ACH),
`LECB' (phone bill billing), `BILL' (billing), `CASH' (cash),
`WEST' (Western Union), `MCRD' (Manual credit card), or `COMP' (free)
`LECB' (phone bill billing), `BILL' (billing), `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
+=item payinfo
+
+card number, check #, or comp issuer (4-8 lowercase alphanumerics; think username), respectively
+
+=item paybatch
+
+text field for tracking card processing
-=item
paybatch - text field for tracking card processing
+=item
closed
-=item closed - books closed flag, empty or `Y'
+books closed flag, empty or `Y'
+
+=item pkgnum
+
+Desired pkgnum when using experimental package balances.
=item void_date
=item void_date
@@
-135,7
+161,8
@@
Currently unimplemented.
=cut
sub replace {
=cut
sub replace {
- return "Can't modify voided payments!";
+ return "Can't modify voided payments!" unless $otaker_upgrade_kludge;
+ shift->SUPER::replace(@_);
}
=item check
}
=item check
@@
-156,6
+183,7
@@
sub check {
|| $self->ut_number('_date')
|| $self->ut_textn('paybatch')
|| $self->ut_enum('closed', [ '', 'Y' ])
|| $self->ut_number('_date')
|| $self->ut_textn('paybatch')
|| $self->ut_enum('closed', [ '', 'Y' ])
+ || $self->ut_foreign_keyn('pkgnum', 'cust_pkg', 'pkgnum')
|| $self->ut_numbern('void_date')
|| $self->ut_textn('reason')
;
|| $self->ut_numbern('void_date')
|| $self->ut_textn('reason')
;
@@
-193,7
+221,7
@@
sub check {
return $error if $error;
}
return $error if $error;
}
- $self->otaker(getotaker);
+ $self->otaker(getotaker)
unless $self->otaker
;
$self->SUPER::check;
}
$self->SUPER::check;
}
@@
-209,6
+237,13
@@
sub cust_main {
qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
}
qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
}
+# Used by FS::Upgrade to migrate to a new database.
+sub _upgrade_data { # class method
+ my ($class, %opts) = @_;
+ local($otaker_upgrade_kludge) = 1;
+ $class->_upgrade_otaker(%opts);
+}
+
=back
=head1 BUGS
=back
=head1 BUGS