Lines 35-40
use C4::Letters;
Link Here
|
35 |
use C4::SQLHelper qw(InsertInTable UpdateInTable SearchInTable); |
35 |
use C4::SQLHelper qw(InsertInTable UpdateInTable SearchInTable); |
36 |
use C4::Members::Attributes qw(SearchIdMatchingAttribute); |
36 |
use C4::Members::Attributes qw(SearchIdMatchingAttribute); |
37 |
use C4::NewsChannels; #get slip news |
37 |
use C4::NewsChannels; #get slip news |
|
|
38 |
use C4::VirtualShelves qw(HandleDelBorrower); |
38 |
use DateTime; |
39 |
use DateTime; |
39 |
use DateTime::Format::DateParse; |
40 |
use DateTime::Format::DateParse; |
40 |
use Koha::DateUtils; |
41 |
use Koha::DateUtils; |
Lines 1799-1817
sub MoveMemberToDeleted {
Link Here
|
1799 |
|
1800 |
|
1800 |
=head2 DelMember |
1801 |
=head2 DelMember |
1801 |
|
1802 |
|
1802 |
DelMember($borrowernumber); |
1803 |
DelMember({ borrowernumber => $borrowernumber [, permanently => 1 ]); |
1803 |
|
1804 |
|
1804 |
This function remove directly a borrower whitout writing it on deleteborrower. |
1805 |
* Deletes reserves for the borrower |
1805 |
+ Deletes reserves for the borrower |
1806 |
* Calls C4::VirtualShelfs::HandleDelBorrower |
|
|
1807 |
* Calls MoveMemberToDelete unless the parameter 'permanently' is true |
1806 |
|
1808 |
|
1807 |
=cut |
1809 |
=cut |
1808 |
|
1810 |
|
1809 |
sub DelMember { |
1811 |
sub DelMember { |
1810 |
my $dbh = C4::Context->dbh; |
1812 |
my ( $params ) = @_; |
1811 |
my $borrowernumber = shift; |
1813 |
|
1812 |
#warn "in delmember with $borrowernumber"; |
1814 |
my $borrowernumber = $params->{borrowernumber}; |
|
|
1815 |
my $permanently = $params->{permanently}; |
1816 |
|
1817 |
my $dbh = C4::Context->dbh; |
1818 |
|
1813 |
return unless $borrowernumber; # borrowernumber is mandatory. |
1819 |
return unless $borrowernumber; # borrowernumber is mandatory. |
1814 |
|
1820 |
|
|
|
1821 |
MoveMemberToDeleted( $borrowernumber ) unless $permanently; |
1822 |
C4::VirtualShelves::HandleDelBorrower( $borrowernumber ); |
1823 |
|
1815 |
my $query = qq|DELETE |
1824 |
my $query = qq|DELETE |
1816 |
FROM reserves |
1825 |
FROM reserves |
1817 |
WHERE borrowernumber=?|; |
1826 |
WHERE borrowernumber=?|; |