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

(-)a/C4/Bookseller.pm (-2 / +2 lines)
Lines 225-230 C<&ModBookseller> with the result. Link Here
225
225
226
sub ModBookseller {
226
sub ModBookseller {
227
    my ($data) = @_;
227
    my ($data) = @_;
228
    return unless $data->{'id'};
228
    my $dbh    = C4::Context->dbh;
229
    my $dbh    = C4::Context->dbh;
229
    my $query  = 'UPDATE aqbooksellers
230
    my $query  = 'UPDATE aqbooksellers
230
        SET name=?,address1=?,address2=?,address3=?,address4=?,
231
        SET name=?,address1=?,address2=?,address3=?,address4=?,
Lines 235-241 sub ModBookseller { Link Here
235
            discount=?,notes=?,gstrate=?,deliverytime=?
236
            discount=?,notes=?,gstrate=?,deliverytime=?
236
        WHERE id=?';
237
        WHERE id=?';
237
    my $sth = $dbh->prepare($query);
238
    my $sth = $dbh->prepare($query);
238
    $sth->execute(
239
    return $sth->execute(
239
        $data->{'name'},         $data->{'address1'},
240
        $data->{'name'},         $data->{'address1'},
240
        $data->{'address2'},     $data->{'address3'},
241
        $data->{'address2'},     $data->{'address3'},
241
        $data->{'address4'},     $data->{'postal'},
242
        $data->{'address4'},     $data->{'postal'},
Lines 253-259 sub ModBookseller { Link Here
253
        $data->{deliverytime},
254
        $data->{deliverytime},
254
        $data->{'id'}
255
        $data->{'id'}
255
    );
256
    );
256
    return;
257
}
257
}
258
258
259
=head2 DelBookseller
259
=head2 DelBookseller
(-)a/t/db_dependent/Bookseller.t (-5 / +2 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Test::More tests => 54;
5
use Test::More tests => 55;
6
use C4::Context;
6
use C4::Context;
7
use Koha::DateUtils;
7
use Koha::DateUtils;
8
use DateTime::Duration;
8
use DateTime::Duration;
Lines 247-259 $sample_supplier2 = { Link Here
247
    deliverytime  => 2,
247
    deliverytime  => 2,
248
};
248
};
249
249
250
#FIXME : ModBookseller always returns undef, even if the id isn't given
251
#or doesn't exist
252
my $modif1 = C4::Bookseller::ModBookseller();
250
my $modif1 = C4::Bookseller::ModBookseller();
253
is( $modif1, undef,
251
is( $modif1, undef,
254
    "ModBookseller returns undef if no params given - Nothing happened" );
252
    "ModBookseller returns undef if no params given - Nothing happened" );
255
$modif1 = C4::Bookseller::ModBookseller($sample_supplier2);
253
$modif1 = C4::Bookseller::ModBookseller($sample_supplier2);
256
#is( $modif1, 1, "ModBookseller modifies only the supplier2" );
254
is( $modif1, 1, "ModBookseller modifies only the supplier2" );
257
is( scalar( C4::Bookseller::GetBookSeller('') ),
255
is( scalar( C4::Bookseller::GetBookSeller('') ),
258
    $count + 2, "Supplier2 has been modified - Nothing added" );
256
    $count + 2, "Supplier2 has been modified - Nothing added" );
259
257
260
- 

Return to bug 10640