Lines 424-430
sub CloseBasketgroup {
Link Here
|
424 |
my $dbh = C4::Context->dbh; |
424 |
my $dbh = C4::Context->dbh; |
425 |
my $sth = $dbh->prepare(" |
425 |
my $sth = $dbh->prepare(" |
426 |
UPDATE aqbasketgroups |
426 |
UPDATE aqbasketgroups |
427 |
SET closed=1 |
427 |
SET closed=1, |
|
|
428 |
closeddate=CAST(NOW() AS DATE) |
428 |
WHERE id=? |
429 |
WHERE id=? |
429 |
"); |
430 |
"); |
430 |
$sth->execute($basketgroupno); |
431 |
$sth->execute($basketgroupno); |
Lines 445-451
sub ReOpenBasketgroup {
Link Here
|
445 |
my $dbh = C4::Context->dbh; |
446 |
my $dbh = C4::Context->dbh; |
446 |
my $sth = $dbh->prepare(" |
447 |
my $sth = $dbh->prepare(" |
447 |
UPDATE aqbasketgroups |
448 |
UPDATE aqbasketgroups |
448 |
SET closed=0 |
449 |
SET closed=0, closeddate=NULL |
449 |
WHERE id=? |
450 |
WHERE id=? |
450 |
"); |
451 |
"); |
451 |
$sth->execute($basketgroupno); |
452 |
$sth->execute($basketgroupno); |
Lines 877-886
sub NewBasketgroup {
Link Here
|
877 |
push(@params, $basketgroupinfo->{$field}); |
878 |
push(@params, $basketgroupinfo->{$field}); |
878 |
} |
879 |
} |
879 |
} |
880 |
} |
|
|
881 |
|
882 |
if ($basketgroupinfo->{closed}) { |
883 |
$query .= "closeddate, "; |
884 |
} |
880 |
$query .= "booksellerid) VALUES ("; |
885 |
$query .= "booksellerid) VALUES ("; |
881 |
foreach (@params) { |
886 |
foreach (@params) { |
882 |
$query .= "?, "; |
887 |
$query .= "?, "; |
883 |
} |
888 |
} |
|
|
889 |
if ($basketgroupinfo->{closed}) { |
890 |
$query .= "CAST(NOW() AS DATE), "; |
891 |
} |
884 |
$query .= "?)"; |
892 |
$query .= "?)"; |
885 |
push(@params, $basketgroupinfo->{'booksellerid'}); |
893 |
push(@params, $basketgroupinfo->{'booksellerid'}); |
886 |
my $dbh = C4::Context->dbh; |
894 |
my $dbh = C4::Context->dbh; |
Lines 929-934
sub ModBasketgroup {
Link Here
|
929 |
my $dbh = C4::Context->dbh; |
937 |
my $dbh = C4::Context->dbh; |
930 |
my $query = "UPDATE aqbasketgroups SET "; |
938 |
my $query = "UPDATE aqbasketgroups SET "; |
931 |
my @params; |
939 |
my @params; |
|
|
940 |
|
941 |
if ($basketgroupinfo->{closed}) { |
942 |
$query .= "closeddate = IF(closed = 0, CAST(NOW() AS DATE), closeddate), "; |
943 |
} elsif (defined $basketgroupinfo->{closed}) { |
944 |
$query .= "closeddate = NULL, "; |
945 |
} |
946 |
|
932 |
foreach my $field (qw(name billingplace deliveryplace freedeliveryplace deliverycomment closed)) { |
947 |
foreach my $field (qw(name billingplace deliveryplace freedeliveryplace deliverycomment closed)) { |
933 |
if ( defined $basketgroupinfo->{$field} ) { |
948 |
if ( defined $basketgroupinfo->{$field} ) { |
934 |
$query .= "$field=?, "; |
949 |
$query .= "$field=?, "; |