projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
eliminate harmless "Use of uninitialized value $enc in string eq" warnings
[freeside.git]
/
FS
/
FS
/
cust_credit_refund.pm
diff --git
a/FS/FS/cust_credit_refund.pm
b/FS/FS/cust_credit_refund.pm
index
ff2454d
..
9fc03f2
100644
(file)
--- a/
FS/FS/cust_credit_refund.pm
+++ b/
FS/FS/cust_credit_refund.pm
@@
-3,11
+3,11
@@
package FS::cust_credit_refund;
use strict;
use vars qw( @ISA );
use FS::Record qw( qsearch qsearchs dbh );
use strict;
use vars qw( @ISA );
use FS::Record qw( qsearch qsearchs dbh );
-
#use FS::UID qw(getotaker)
;
+
use FS::cust_main_Mixin
;
use FS::cust_credit;
use FS::cust_refund;
use FS::cust_credit;
use FS::cust_refund;
-@ISA = qw( FS::Record );
+@ISA = qw( FS::
cust_main_Mixin FS::
Record );
=head1 NAME
=head1 NAME
@@
-70,20
+70,27
@@
otherwise returns false.
sub insert {
my $self = shift;
sub insert {
my $self = shift;
- my $error = $self->SUPER::insert;
- return $error if $error;
-
- '';
+ return "Can't apply refund to closed credit"
+ if $self->cust_credit->closed =~ /^Y/i;
+ return "Can't apply credit to closed refund"
+ if $self->cust_refund->closed =~ /^Y/i;
+ $self->SUPER::insert(@_);
}
=item delete
}
=item delete
-Currently unimplemented (accounting reasons).
+Remove this cust_credit_refund from the database. If there is an error,
+returns the error, otherwise returns false.
=cut
sub delete {
=cut
sub delete {
- return "Can't (yet?) delete cust_credit_refund records!";
+ my $self = shift;
+ return "Can't remove refund from closed credit"
+ if $self->cust_credit->closed =~ /^Y/i;
+ return "Can't remove credit from closed refund"
+ if $self->cust_refund->closed =~ /^Y/i;
+ $self->SUPER::delete(@_);
}
=item replace OLD_RECORD
}
=item replace OLD_RECORD
@@
-161,10
+168,6
@@
sub cust_credit {
=back
=back
-=head1 VERSION
-
-$Id: cust_credit_refund.pm,v 1.11 2004-06-29 04:02:44 ivan Exp $
-
=head1 BUGS
Delete and replace methods.
=head1 BUGS
Delete and replace methods.