Lines 93-98
sub delete {
Link Here
|
93 |
return $deleted; |
93 |
return $deleted; |
94 |
} |
94 |
} |
95 |
|
95 |
|
|
|
96 |
|
97 |
=head3 category |
98 |
|
99 |
my $patron_category = $patron->category |
100 |
|
101 |
Return the patron category for this patron |
102 |
|
103 |
=cut |
104 |
|
105 |
sub category { |
106 |
my ( $self ) = @_; |
107 |
return Koha::Patron::Category->_new_from_dbic( $self->_result->categorycode ); |
108 |
} |
109 |
|
96 |
=head3 guarantor |
110 |
=head3 guarantor |
97 |
|
111 |
|
98 |
Returns a Koha::Patron object for this patron's guarantor |
112 |
Returns a Koha::Patron object for this patron's guarantor |
Lines 200-207
sub wants_check_for_previous_checkout {
Link Here
|
200 |
return 0 if ($self->checkprevcheckout eq 'no'); |
214 |
return 0 if ($self->checkprevcheckout eq 'no'); |
201 |
|
215 |
|
202 |
# More complex: patron inherits -> determine category preference |
216 |
# More complex: patron inherits -> determine category preference |
203 |
my $checkPrevCheckoutByCat = Koha::Patron::Categories |
217 |
my $checkPrevCheckoutByCat = $self->category->checkprevcheckout; |
204 |
->find($self->categorycode)->checkprevcheckout; |
|
|
205 |
return 1 if ($checkPrevCheckoutByCat eq 'yes'); |
218 |
return 1 if ($checkPrevCheckoutByCat eq 'yes'); |
206 |
return 0 if ($checkPrevCheckoutByCat eq 'no'); |
219 |
return 0 if ($checkPrevCheckoutByCat eq 'no'); |
207 |
|
220 |
|
Lines 304-311
sub renew_account {
Link Here
|
304 |
? dt_from_string( $self->dateexpiry ) |
317 |
? dt_from_string( $self->dateexpiry ) |
305 |
: dt_from_string; |
318 |
: dt_from_string; |
306 |
} |
319 |
} |
307 |
my $patron_category = Koha::Patron::Categories->find( $self->categorycode ); # FIXME Should be $self->category |
320 |
my $expiry_date = $self->category->get_expiry_date($date); |
308 |
my $expiry_date = $patron_category->get_expiry_date($date); |
|
|
309 |
|
321 |
|
310 |
$self->dateexpiry($expiry_date)->store; |
322 |
$self->dateexpiry($expiry_date)->store; |
311 |
|
323 |
|
Lines 440-447
Add enrolment fee for a patron if needed.
Link Here
|
440 |
|
452 |
|
441 |
sub add_enrolment_fee_if_needed { |
453 |
sub add_enrolment_fee_if_needed { |
442 |
my ($self) = @_; |
454 |
my ($self) = @_; |
443 |
my $patron_category = Koha::Patron::Categories->find( $self->categorycode ); |
455 |
my $enrolment_fee = $self->category->enrolmentfee; |
444 |
my $enrolment_fee = $patron_category->enrolmentfee; |
|
|
445 |
if ( $enrolment_fee && $enrolment_fee > 0 ) { |
456 |
if ( $enrolment_fee && $enrolment_fee > 0 ) { |
446 |
# insert fee in patron debts |
457 |
# insert fee in patron debts |
447 |
C4::Accounts::manualinvoice( $self->borrowernumber, '', '', 'A', $enrolment_fee ); |
458 |
C4::Accounts::manualinvoice( $self->borrowernumber, '', '', 'A', $enrolment_fee ); |