projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
better prepaid income reporting, with line item detail, RT#7776
[freeside.git]
/
FS
/
FS
/
cust_pay_refund.pm
diff --git
a/FS/FS/cust_pay_refund.pm
b/FS/FS/cust_pay_refund.pm
index
55a5eb7
..
cb9dbce
100644
(file)
--- a/
FS/FS/cust_pay_refund.pm
+++ b/
FS/FS/cust_pay_refund.pm
@@
-77,10
+77,11
@@
error, 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 payment"
+ if $self->cust_pay->closed =~ /^Y/i;
+ return "Can't apply payment to closed refund"
+ if $self->cust_refund->closed =~ /^Y/i;
+ $self->SUPER::insert(@_);
}
=item delete
}
=item delete
@@
-89,9
+90,9
@@
sub insert {
sub delete {
my $self = shift;
sub delete {
my $self = shift;
- return "Can't
apply refund to
closed payment"
+ return "Can't
remove refund from
closed payment"
if $self->cust_pay->closed =~ /^Y/i;
if $self->cust_pay->closed =~ /^Y/i;
- return "Can't
apply
closed refund"
+ return "Can't
remove payment from
closed refund"
if $self->cust_refund->closed =~ /^Y/i;
$self->SUPER::delete(@_);
}
if $self->cust_refund->closed =~ /^Y/i;
$self->SUPER::delete(@_);
}
@@
-148,26
+149,26
@@
sub check {
$self->SUPER::check;
}
$self->SUPER::check;
}
-=item sub cust_
credit
+=item sub cust_
pay
-Returns the
credit (see L<FS::cust_credit
>)
+Returns the
payment (see L<FS::cust_pay
>)
=cut
=cut
-sub cust_
credit
{
+sub cust_
pay
{
my $self = shift;
my $self = shift;
- qsearchs( 'cust_
credit', { 'crednum' => $self->cred
num } );
+ qsearchs( 'cust_
pay', { 'paynum' => $self->pay
num } );
}
}
-=item cust_
bill
+=item cust_
refund
-Returns the
invoice (see L<FS::cust_bill
>)
+Returns the
refund (see L<FS::cust_refund
>)
=cut
=cut
-sub cust_
bill
{
+sub cust_
refund
{
my $self = shift;
my $self = shift;
- qsearchs( 'cust_
bill', { 'invnum' => $self->inv
num } );
+ qsearchs( 'cust_
refund', { 'refundnum' => $self->refund
num } );
}
=back
}
=back