Bug 7449: billingplace and freedeliveryplace not saved when creating a new basketgroup
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Fri, 22 Feb 2013 09:14:15 +0000 (10:14 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Sun, 7 Apr 2013 17:08:28 +0000 (13:08 -0400)
billingplace and freedeliveryplace are missing in C4::Acquisition::NewBasketgroup.

Test plan :
- Go to a vendor basket groups
- Create a new basket group
- Enter a name
- Choose a billing place
- Do not choose a delivery place in combobox but enter a text in delivery place textarea
- Enter a comment
- Save
- Edit created basket group
=> Check that billing place and free delivery place are ok

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works according to test plan, delivery place is now
correctly saved into the databas and was before lost.
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
C4/Acquisition.pm
acqui/basketgroup.pl

index 5973456..b78a51e 100644 (file)
@@ -643,8 +643,12 @@ $hashref->{'name'} is the 'name' field of the basketgroup in the aqbasketgroups
 
 $hashref->{'basketlist'} is a list reference of the 'id's of the baskets that belong to this group,
 
+$hashref->{'billingplace'} is the 'billingplace' field of the basketgroup in the aqbasketgroups table,
+
 $hashref->{'deliveryplace'} is the 'deliveryplace' field of the basketgroup in the aqbasketgroups table,
 
+$hashref->{'freedeliveryplace'} is the 'freedeliveryplace' field of the basketgroup in the aqbasketgroups table,
+
 $hashref->{'deliverycomment'} is the 'deliverycomment' field of the basketgroup in the aqbasketgroups table,
 
 $hashref->{'closed'} is the 'closed' field of the aqbasketgroups table, it is false if 0, true otherwise.
@@ -656,8 +660,8 @@ sub NewBasketgroup {
     die "booksellerid is required to create a basketgroup" unless $basketgroupinfo->{'booksellerid'};
     my $query = "INSERT INTO aqbasketgroups (";
     my @params;
-    foreach my $field ('name', 'deliveryplace', 'deliverycomment', 'closed') {
-        if ( $basketgroupinfo->{$field} ) {
+    foreach my $field (qw(name billingplace deliveryplace freedeliveryplace deliverycomment closed)) {
+        if ( defined $basketgroupinfo->{$field} ) {
             $query .= "$field, ";
             push(@params, $basketgroupinfo->{$field});
         }
@@ -700,6 +704,8 @@ $hashref->{'billingplace'} is the 'billingplace' field of the basketgroup in the
 
 $hashref->{'deliveryplace'} is the 'deliveryplace' field of the basketgroup in the aqbasketgroups table,
 
+$hashref->{'freedeliveryplace'} is the 'freedeliveryplace' field of the basketgroup in the aqbasketgroups table,
+
 $hashref->{'deliverycomment'} is the 'deliverycomment' field of the basketgroup in the aqbasketgroups table,
 
 $hashref->{'closed'} is the 'closed' field of the aqbasketgroups table, it is false if 0, true otherwise.
index 8782a45..d6bd5d1 100755 (executable)
@@ -466,6 +466,7 @@ if ( $op eq "add" ) {
             name              => $basketgroupname,
             booksellerid      => $booksellerid,
             basketlist        => \@baskets,
+            billingplace      => $billingplace,
             deliveryplace     => $deliveryplace,
             freedeliveryplace => $freedeliveryplace,
             deliverycomment   => $deliverycomment,