summaryrefslogtreecommitdiff
path: root/FS/FS/cust_pay_refund.pm
diff options
context:
space:
mode:
authorjeff <jeff>2007-01-08 17:36:53 +0000
committerjeff <jeff>2007-01-08 17:36:53 +0000
commitb89c7f126690704c8d1558dba06d5fabd7470528 (patch)
tree7a1ce8e2d5675952f4a06472897cab9d19e01037 /FS/FS/cust_pay_refund.pm
parent704992901b980cd3d41568d7fec0842b2a64bdf7 (diff)
refund deletion
Diffstat (limited to 'FS/FS/cust_pay_refund.pm')
-rw-r--r--FS/FS/cust_pay_refund.pm15
1 files changed, 13 insertions, 2 deletions
diff --git a/FS/FS/cust_pay_refund.pm b/FS/FS/cust_pay_refund.pm
index 15e0e53..cb9dbce 100644
--- a/FS/FS/cust_pay_refund.pm
+++ b/FS/FS/cust_pay_refund.pm
@@ -73,15 +73,26 @@ sub table { 'cust_pay_refund'; }
Adds this cust_pay_refund to the database. If there is an error, returns the
error, otherwise returns false.
+=cut
+
+sub insert {
+ my $self = shift;
+ 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
=cut
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;
- return "Can't apply closed refund"
+ return "Can't remove payment from closed refund"
if $self->cust_refund->closed =~ /^Y/i;
$self->SUPER::delete(@_);
}