From 2719bb1c75ee5644c72de50db884957056cc74a5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 9 Jul 2013 11:52:31 +0200 Subject: [PATCH] Bug 10556: The delivery time is not inserted on adding a supplier. Test plan: Add/edit a supplier and check that the delivery time is set in DB. Note: This patch cleans the code (sql query) in order to see easily if a problem occurred. --- C4/Bookseller.pm | 92 +++++++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/C4/Bookseller.pm b/C4/Bookseller.pm index c8389a3..10f4d80 100644 --- a/C4/Bookseller.pm +++ b/C4/Bookseller.pm @@ -175,32 +175,31 @@ sub AddBookseller { my $query = q| INSERT INTO aqbooksellers ( - name, address1, address2, address3, address4, - postal, phone, accountnumber, fax, url, - contact, - contpos, contphone, contfax, contaltphone, contemail, - contnotes, active, listprice, invoiceprice, gstreg, - listincgst,invoiceincgst, gstrate, discount, - notes + name, address1, address2, address3, address4, + postal, phone, accountnumber,fax, url, + contact, contpos, contphone, contfax, contaltphone, + contemail, contnotes, active, listprice, invoiceprice, + gstreg, listincgst, invoiceincgst,gstrate, discount, + notes, deliverytime ) - VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) | + VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) | ; my $sth = $dbh->prepare($query); $sth->execute( - $data->{'name'}, $data->{'address1'}, - $data->{'address2'}, $data->{'address3'}, - $data->{'address4'}, $data->{'postal'}, - $data->{'phone'}, $data->{'accountnumber'}, - $data->{'fax'}, - $data->{'url'}, $data->{'contact'}, - $data->{'contpos'}, $data->{'contphone'}, - $data->{'contfax'}, $data->{'contaltphone'}, - $data->{'contemail'}, $data->{'contnotes'}, - $data->{'active'}, $data->{'listprice'}, - $data->{'invoiceprice'}, $data->{'gstreg'}, - $data->{'listincgst'}, $data->{'invoiceincgst'}, - $data->{'gstrate'}, - $data->{'discount'}, $data->{'notes'} + $data->{name} ,$data->{address1}, + $data->{address2} ,$data->{address3}, + $data->{address4} ,$data->{postal}, + $data->{phone} ,$data->{accountnumber}, + $data->{fax}, + $data->{url} ,$data->{contact}, + $data->{contpos} ,$data->{contphone}, + $data->{contfax} ,$data->{contaltphone}, + $data->{contemail} ,$data->{contnotes}, + $data->{active} ,$data->{listprice}, + $data->{invoiceprice} ,$data->{gstreg}, + $data->{listincgst} ,$data->{invoiceincgst}, + $data->{gstrate} ,$data->{discount}, + $data->{notes} ,$data->{deliverytime}, ); # return the id of this new supplier @@ -227,32 +226,33 @@ C<&ModBookseller> with the result. sub ModBookseller { my ($data) = @_; my $dbh = C4::Context->dbh; - my $query = 'UPDATE aqbooksellers - SET name=?,address1=?,address2=?,address3=?,address4=?, - postal=?,phone=?,accountnumber=?,fax=?,url=?,contact=?,contpos=?, - contphone=?,contfax=?,contaltphone=?,contemail=?, - contnotes=?,active=?,listprice=?, invoiceprice=?, - gstreg=?,listincgst=?,invoiceincgst=?, - discount=?,notes=?,gstrate=?,deliverytime=? - WHERE id=?'; + my $query = q| + UPDATE aqbooksellers + SET name = ?, address1 = ?, address2 = ?, address3 = ?, address4 = ?, + postal = ?, phone = ?, accountnumber = ?, fax = ?, url = ?, + contact = ?, contpos = ?, contphone = ?, contfax = ?, contaltphone = ?, + contemail = ?, contnotes = ?, active = ?, listprice = ?, invoiceprice = ?, + gstreg = ?, listincgst = ?, invoiceincgst = ?, gstrate = ?, discount = ?, + notes = ?, deliverytime = ? + WHERE id=? + |; my $sth = $dbh->prepare($query); $sth->execute( - $data->{'name'}, $data->{'address1'}, - $data->{'address2'}, $data->{'address3'}, - $data->{'address4'}, $data->{'postal'}, - $data->{'phone'}, $data->{'accountnumber'}, - $data->{'fax'}, - $data->{'url'}, $data->{'contact'}, - $data->{'contpos'}, $data->{'contphone'}, - $data->{'contfax'}, $data->{'contaltphone'}, - $data->{'contemail'}, $data->{'contnotes'}, - $data->{'active'}, $data->{'listprice'}, - $data->{'invoiceprice'}, $data->{'gstreg'}, - $data->{'listincgst'}, $data->{'invoiceincgst'}, - $data->{'discount'}, $data->{'notes'}, - $data->{'gstrate'}, - $data->{deliverytime}, - $data->{'id'} + $data->{name} ,$data->{address1}, + $data->{address2} ,$data->{address3}, + $data->{address4} ,$data->{postal}, + $data->{phone} ,$data->{accountnumber}, + $data->{fax}, + $data->{url} ,$data->{contact}, + $data->{contpos} ,$data->{contphone}, + $data->{contfax} ,$data->{contaltphone}, + $data->{contemail} ,$data->{contnotes}, + $data->{active} ,$data->{listprice}, + $data->{invoiceprice} ,$data->{gstreg}, + $data->{listincgst} ,$data->{invoiceincgst}, + $data->{gstrate} ,$data->{discount}, + $data->{notes} ,$data->{deliverytime}, + $data->{id}, ); return; } -- 1.7.10.4