From 8297a2d424a964c6ebc8f2878d931312a2836052 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Fri, 22 Feb 2013 10:14:15 +0100 Subject: [PATCH] Bug 7449: billingplace and freedeliveryplace not saved when creating a new basketgroup 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 Signed-off-by: Katrin Fischer 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 --- C4/Acquisition.pm | 10 ++++++++-- acqui/basketgroup.pl | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 5973456515..b78a51e967 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -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. diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index 8782a45938..d6bd5d1f4a 100755 --- a/acqui/basketgroup.pl +++ b/acqui/basketgroup.pl @@ -466,6 +466,7 @@ if ( $op eq "add" ) { name => $basketgroupname, booksellerid => $booksellerid, basketlist => \@baskets, + billingplace => $billingplace, deliveryplace => $deliveryplace, freedeliveryplace => $freedeliveryplace, deliverycomment => $deliverycomment, -- 2.39.5