X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_refund.pm;h=abc131e4492f78be01dea0281434d21c33bd02a8;hb=5f0e4d1d57c18d5bb8a52de4f7d4f519db5327f0;hp=53c6bac2519f3875f4b3c26e67cd8532626a884e;hpb=9509e5bfb7f9331303153cac24d7bfecbe2ea9f1;p=freeside.git diff --git a/FS/FS/cust_refund.pm b/FS/FS/cust_refund.pm index 53c6bac25..abc131e44 100644 --- a/FS/FS/cust_refund.pm +++ b/FS/FS/cust_refund.pm @@ -3,15 +3,16 @@ package FS::cust_refund; use strict; use vars qw( @ISA @encrypted_fields ); use Business::CreditCard; -use FS::Record qw( qsearch qsearchs dbh ); use FS::UID qw(getotaker); +use FS::Record qw( qsearch qsearchs dbh ); +use FS::cust_main_Mixin; +use FS::payinfo_transaction_Mixin; use FS::cust_credit; use FS::cust_credit_refund; use FS::cust_pay_refund; use FS::cust_main; -use FS::payinfo_Mixin; -@ISA = qw( FS::Record FS::payinfo_Mixin ); +@ISA = qw( FS::payinfo_transaction_Mixin FS::cust_main_Mixin FS::Record ); @encrypted_fields = ('payinfo'); @@ -216,7 +217,7 @@ sub delete { =item replace OLD_RECORD -Currently unimplemented (accounting reasons). +Modifying a refund? Well, don't say I didn't warn you. =cut @@ -235,10 +236,13 @@ returns the error, otherwise returns false. Called by the insert method. sub check { my $self = shift; + $self->otaker(getotaker) unless ($self->otaker); + my $error = $self->ut_numbern('refundnum') || $self->ut_numbern('custnum') || $self->ut_money('refund') + || $self->ut_alpha('otaker') || $self->ut_text('reason') || $self->ut_numbern('_date') || $self->ut_textn('paybatch') @@ -257,8 +261,6 @@ sub check { $error = $self->payinfo_check; return $error if $error; - $self->otaker(getotaker); - $self->SUPER::check; }