View | Details | Raw Unified | Return to bug 10698
Collapse All | Expand All

(-)a/C4/Circulation.pm (-1 / +2 lines)
Lines 2826-2838 sub GetTransfersFromTo { Link Here
2826
2826
2827
sub DeleteTransfer {
2827
sub DeleteTransfer {
2828
    my ($itemnumber) = @_;
2828
    my ($itemnumber) = @_;
2829
    return unless $itemnumber;
2829
    my $dbh          = C4::Context->dbh;
2830
    my $dbh          = C4::Context->dbh;
2830
    my $sth          = $dbh->prepare(
2831
    my $sth          = $dbh->prepare(
2831
        "DELETE FROM branchtransfers
2832
        "DELETE FROM branchtransfers
2832
         WHERE itemnumber=?
2833
         WHERE itemnumber=?
2833
         AND datearrived IS NULL "
2834
         AND datearrived IS NULL "
2834
    );
2835
    );
2835
    $sth->execute($itemnumber);
2836
    return $sth->execute($itemnumber);
2836
}
2837
}
2837
2838
2838
=head2 AnonymiseIssueHistory
2839
=head2 AnonymiseIssueHistory
(-)a/t/db_dependent/Circulation_transfers.t (-4 / +3 lines)
Lines 9-15 use C4::Circulation; Link Here
9
use Koha::DateUtils;
9
use Koha::DateUtils;
10
use DateTime::Duration;
10
use DateTime::Duration;
11
11
12
use Test::More tests => 12;
12
use Test::More tests => 14;
13
13
14
BEGIN {
14
BEGIN {
15
    use_ok('C4::Circulation');
15
    use_ok('C4::Circulation');
Lines 191-198 is( Link Here
191
is( C4::Circulation::DeleteTransfer($item_id1),
191
is( C4::Circulation::DeleteTransfer($item_id1),
192
    1, "A the item1's transfer has been deleted" );
192
    1, "A the item1's transfer has been deleted" );
193
#FIXME :The following tests should pass but don't because currently the routine DeleteTransfer returns nothing
193
#FIXME :The following tests should pass but don't because currently the routine DeleteTransfer returns nothing
194
#is(C4::Circulation::DeleteTransfer(),undef,"Without itemid DeleteTransfer returns undef");
194
is(C4::Circulation::DeleteTransfer(),undef,"Without itemid DeleteTransfer returns undef");
195
#is(C4::Circulation::DeleteTransfer(-1),0,"with a wrong itemid DeleteTranfer returns 0");
195
is(C4::Circulation::DeleteTransfer(-1),'0E0',"with a wrong itemid DeleteTranfer returns 0E0");
196
196
197
#End transaction
197
#End transaction
198
$dbh->rollback;
198
$dbh->rollback;
199
- 

Return to bug 10698