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

(-)a/C4/Bookseller.pm (-2 / +2 lines)
Lines 226-231 C<&ModBookseller> with the result. Link Here
226
sub ModBookseller {
226
sub ModBookseller {
227
    my ($data) = @_;
227
    my ($data) = @_;
228
    my $dbh    = C4::Context->dbh;
228
    my $dbh    = C4::Context->dbh;
229
    return unless $data->{'id'};
229
    my $query  = 'UPDATE aqbooksellers
230
    my $query  = 'UPDATE aqbooksellers
230
        SET name=?,address1=?,address2=?,address3=?,address4=?,
231
        SET name=?,address1=?,address2=?,address3=?,address4=?,
231
            postal=?,phone=?,accountnumber=?,fax=?,url=?,contact=?,contpos=?,
232
            postal=?,phone=?,accountnumber=?,fax=?,url=?,contact=?,contpos=?,
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 => 53;
5
use Test::More tests => 54;
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 248-260 $sample_supplier2 = { Link Here
248
    deliverytime  => 2,
248
    deliverytime  => 2,
249
};
249
};
250
250
251
#FIXME : ModBookseller always returns undef, even if the id isn't given
252
#or doesn't exist
253
my $modif1 = C4::Bookseller::ModBookseller();
251
my $modif1 = C4::Bookseller::ModBookseller();
254
is( $modif1, undef,
252
is( $modif1, undef,
255
    "ModBookseller returns undef if no params given - Nothing happened" );
253
    "ModBookseller returns undef if no params given - Nothing happened" );
256
$modif1 = C4::Bookseller::ModBookseller($sample_supplier2);
254
$modif1 = C4::Bookseller::ModBookseller($sample_supplier2);
257
#is( $modif1, 1, "ModBookseller modifies only the supplier2" );
255
is( $modif1, 1, "ModBookseller modifies only the supplier2" );
258
is( scalar( C4::Bookseller::GetBookSeller('') ),
256
is( scalar( C4::Bookseller::GetBookSeller('') ),
259
    $count + 2, "Supplier2 has been modified - Nothing added" );
257
    $count + 2, "Supplier2 has been modified - Nothing added" );
260
258
261
- 

Return to bug 10640