[Koha-patches] [PATCH] [SIGNED-OFF] Bug 10556: The delivery time is not inserted on adding a supplier.

Srdjan srdjan at catalyst.net.nz
Tue Jul 16 02:09:07 CEST 2013


From: Jonathan Druart <jonathan.druart at biblibre.com>

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.

Signed-off-by: Srdjan <srdjan at catalyst.net.nz>
---
 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.8.1.2


More information about the Koha-patches mailing list