Lines 36-41
use C4::Letters;
Link Here
|
36 |
use C4::SQLHelper qw(InsertInTable UpdateInTable SearchInTable); |
36 |
use C4::SQLHelper qw(InsertInTable UpdateInTable SearchInTable); |
37 |
use C4::Members::Attributes qw(SearchIdMatchingAttribute); |
37 |
use C4::Members::Attributes qw(SearchIdMatchingAttribute); |
38 |
use C4::NewsChannels; #get slip news |
38 |
use C4::NewsChannels; #get slip news |
|
|
39 |
use C4::VirtualShelves qw(HandleDelBorrower); |
39 |
use DateTime; |
40 |
use DateTime; |
40 |
use DateTime::Format::DateParse; |
41 |
use DateTime::Format::DateParse; |
41 |
use Koha::DateUtils; |
42 |
use Koha::DateUtils; |
Lines 1819-1837
sub MoveMemberToDeleted {
Link Here
|
1819 |
|
1820 |
|
1820 |
=head2 DelMember |
1821 |
=head2 DelMember |
1821 |
|
1822 |
|
1822 |
DelMember($borrowernumber); |
1823 |
DelMember({ borrowernumber => $borrowernumber [, permanently => 1 ]); |
1823 |
|
1824 |
|
1824 |
This function remove directly a borrower whitout writing it on deleteborrower. |
1825 |
* Deletes reserves for the borrower |
1825 |
+ Deletes reserves for the borrower |
1826 |
* Calls C4::VirtualShelfs::HandleDelBorrower |
|
|
1827 |
* Calls MoveMemberToDelete unless the parameter 'permanently' is true |
1826 |
|
1828 |
|
1827 |
=cut |
1829 |
=cut |
1828 |
|
1830 |
|
1829 |
sub DelMember { |
1831 |
sub DelMember { |
1830 |
my $dbh = C4::Context->dbh; |
1832 |
my ( $params ) = @_; |
1831 |
my $borrowernumber = shift; |
1833 |
|
1832 |
#warn "in delmember with $borrowernumber"; |
1834 |
my $borrowernumber = $params->{borrowernumber}; |
|
|
1835 |
my $permanently = $params->{permanently}; |
1836 |
|
1837 |
my $dbh = C4::Context->dbh; |
1838 |
|
1833 |
return unless $borrowernumber; # borrowernumber is mandatory. |
1839 |
return unless $borrowernumber; # borrowernumber is mandatory. |
1834 |
|
1840 |
|
|
|
1841 |
MoveMemberToDeleted( $borrowernumber ) unless $permanently; |
1842 |
C4::VirtualShelves::HandleDelBorrower( $borrowernumber ); |
1843 |
|
1835 |
my $query = qq|DELETE |
1844 |
my $query = qq|DELETE |
1836 |
FROM reserves |
1845 |
FROM reserves |
1837 |
WHERE borrowernumber=?|; |
1846 |
WHERE borrowernumber=?|; |