X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FBookseller.pm;h=f14bd026005141a81841432021f70495dd275f9e;hb=937480abe03863215c8134e67f56e1b968aaf229;hp=4ad42cb6f24b05d3a7df29b5b96dee6c00e7b2f7;hpb=0d082204ea3c7d3d51a9bdc6eccc436910cdc455;p=koha_gimpoz diff --git a/C4/Bookseller.pm b/C4/Bookseller.pm index 4ad42cb6f2..f14bd02600 100644 --- a/C4/Bookseller.pm +++ b/C4/Bookseller.pm @@ -65,7 +65,7 @@ sub GetBookSeller { $searchstring = q{%} . $searchstring . q{%}; my $query = 'select aqbooksellers.*, count(*) as basketcount from aqbooksellers left join aqbasket ' - . 'on aqbasket.booksellerid = aqbooksellers.id where name lIke ? group by aqbooksellers.id order by name'; + . 'on aqbasket.booksellerid = aqbooksellers.id where name like ? group by aqbooksellers.id order by name'; my $dbh = C4::Context->dbh; my $sth = $dbh->prepare($query); @@ -84,6 +84,9 @@ sub GetBookSellerFromId { ( $vendor->{basketcount} ) = $dbh->selectrow_array( 'SELECT count(*) FROM aqbasket where booksellerid = ?', {}, $id ); + ( $vendor->{subscriptioncount} ) = $dbh->selectrow_array( + 'SELECT count(*) FROM subscription WHERE aqbooksellerid = ?', + {}, $id ); } return $vendor; } @@ -141,20 +144,22 @@ sub AddBookseller { INSERT INTO aqbooksellers ( name, address1, address2, address3, address4, - postal, phone, fax, url, contact, + postal, phone, accountnumber, fax, url, + contact, contpos, contphone, contfax, contaltphone, contemail, contnotes, active, listprice, invoiceprice, gstreg, listincgst,invoiceincgst, gstrate, discount, notes ) - VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) | + VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) | ; my $sth = $dbh->prepare($query); $sth->execute( $data->{'name'}, $data->{'address1'}, $data->{'address2'}, $data->{'address3'}, $data->{'address4'}, $data->{'postal'}, - $data->{'phone'}, $data->{'fax'}, + $data->{'phone'}, $data->{'accountnumber'}, + $data->{'fax'}, $data->{'url'}, $data->{'contact'}, $data->{'contpos'}, $data->{'contphone'}, $data->{'contfax'}, $data->{'contaltphone'}, @@ -192,7 +197,7 @@ sub ModBookseller { my $dbh = C4::Context->dbh; my $query = 'UPDATE aqbooksellers SET name=?,address1=?,address2=?,address3=?,address4=?, - postal=?,phone=?,fax=?,url=?,contact=?,contpos=?, + postal=?,phone=?,accountnumber=?,fax=?,url=?,contact=?,contpos=?, contphone=?,contfax=?,contaltphone=?,contemail=?, contnotes=?,active=?,listprice=?, invoiceprice=?, gstreg=?,listincgst=?,invoiceincgst=?, @@ -203,7 +208,8 @@ sub ModBookseller { $data->{'name'}, $data->{'address1'}, $data->{'address2'}, $data->{'address3'}, $data->{'address4'}, $data->{'postal'}, - $data->{'phone'}, $data->{'fax'}, + $data->{'phone'}, $data->{'accountnumber'}, + $data->{'fax'}, $data->{'url'}, $data->{'contact'}, $data->{'contpos'}, $data->{'contphone'}, $data->{'contfax'}, $data->{'contaltphone'},