Lines 113-119
BEGIN {
Link Here
|
113 |
&AddMember |
113 |
&AddMember |
114 |
&AddMember_Opac |
114 |
&AddMember_Opac |
115 |
&MoveMemberToDeleted |
115 |
&MoveMemberToDeleted |
116 |
&ExtendMemberSubscriptionTo |
|
|
117 |
); |
116 |
); |
118 |
|
117 |
|
119 |
#Check data |
118 |
#Check data |
Lines 1577-1615
sub HandleDelBorrower {
Link Here
|
1577 |
#Koha::Virtualshelf->new->delete too. |
1576 |
#Koha::Virtualshelf->new->delete too. |
1578 |
} |
1577 |
} |
1579 |
|
1578 |
|
1580 |
=head2 ExtendMemberSubscriptionTo (OUEST-PROVENCE) |
|
|
1581 |
|
1582 |
$date = ExtendMemberSubscriptionTo($borrowerid, $date); |
1583 |
|
1584 |
Extending the subscription to a given date or to the expiry date calculated on ISO date. |
1585 |
Returns ISO date. |
1586 |
|
1587 |
=cut |
1588 |
|
1589 |
sub ExtendMemberSubscriptionTo { |
1590 |
my ( $borrowerid,$date) = @_; |
1591 |
my $dbh = C4::Context->dbh; |
1592 |
my $borrower = GetMember('borrowernumber'=>$borrowerid); |
1593 |
unless ($date){ |
1594 |
$date = (C4::Context->preference('BorrowerRenewalPeriodBase') eq 'dateexpiry') ? |
1595 |
eval { output_pref( { dt => dt_from_string( $borrower->{'dateexpiry'} ), dateonly => 1, dateformat => 'iso' } ); } |
1596 |
: |
1597 |
output_pref( { dt => dt_from_string, dateonly => 1, dateformat => 'iso' } ); |
1598 |
$date = Koha::Patron::Categories->find( $borrower->{categorycode} )->get_expiry_date( $date ); |
1599 |
} |
1600 |
my $sth = $dbh->do(<<EOF); |
1601 |
UPDATE borrowers |
1602 |
SET dateexpiry='$date' |
1603 |
WHERE borrowernumber='$borrowerid' |
1604 |
EOF |
1605 |
|
1606 |
AddEnrolmentFeeIfNeeded( $borrower->{categorycode}, $borrower->{borrowernumber} ); |
1607 |
|
1608 |
logaction("MEMBERS", "RENEW", $borrower->{'borrowernumber'}, "Membership renewed")if C4::Context->preference("BorrowersLog"); |
1609 |
return $date if ($sth); |
1610 |
return 0; |
1611 |
} |
1612 |
|
1613 |
=head2 GetHideLostItemsPreference |
1579 |
=head2 GetHideLostItemsPreference |
1614 |
|
1580 |
|
1615 |
$hidelostitemspref = &GetHideLostItemsPreference($borrowernumber); |
1581 |
$hidelostitemspref = &GetHideLostItemsPreference($borrowernumber); |