Lines 476-482
sub CloseBasketgroup {
Link Here
|
476 |
my $dbh = C4::Context->dbh; |
476 |
my $dbh = C4::Context->dbh; |
477 |
my $sth = $dbh->prepare(" |
477 |
my $sth = $dbh->prepare(" |
478 |
UPDATE aqbasketgroups |
478 |
UPDATE aqbasketgroups |
479 |
SET closed=1 |
479 |
SET closed=1, |
|
|
480 |
closeddate=CAST(NOW() AS DATE) |
480 |
WHERE id=? |
481 |
WHERE id=? |
481 |
"); |
482 |
"); |
482 |
$sth->execute($basketgroupno); |
483 |
$sth->execute($basketgroupno); |
Lines 497-503
sub ReOpenBasketgroup {
Link Here
|
497 |
my $dbh = C4::Context->dbh; |
498 |
my $dbh = C4::Context->dbh; |
498 |
my $sth = $dbh->prepare(" |
499 |
my $sth = $dbh->prepare(" |
499 |
UPDATE aqbasketgroups |
500 |
UPDATE aqbasketgroups |
500 |
SET closed=0 |
501 |
SET closed=0, closeddate=NULL |
501 |
WHERE id=? |
502 |
WHERE id=? |
502 |
"); |
503 |
"); |
503 |
$sth->execute($basketgroupno); |
504 |
$sth->execute($basketgroupno); |
Lines 937-946
sub NewBasketgroup {
Link Here
|
937 |
push(@params, $basketgroupinfo->{$field}); |
938 |
push(@params, $basketgroupinfo->{$field}); |
938 |
} |
939 |
} |
939 |
} |
940 |
} |
|
|
941 |
|
942 |
if ($basketgroupinfo->{closed}) { |
943 |
$query .= "closeddate, "; |
944 |
} |
940 |
$query .= "booksellerid) VALUES ("; |
945 |
$query .= "booksellerid) VALUES ("; |
941 |
foreach (@params) { |
946 |
foreach (@params) { |
942 |
$query .= "?, "; |
947 |
$query .= "?, "; |
943 |
} |
948 |
} |
|
|
949 |
if ($basketgroupinfo->{closed}) { |
950 |
$query .= "CAST(NOW() AS DATE), "; |
951 |
} |
944 |
$query .= "?)"; |
952 |
$query .= "?)"; |
945 |
push(@params, $basketgroupinfo->{'booksellerid'}); |
953 |
push(@params, $basketgroupinfo->{'booksellerid'}); |
946 |
my $dbh = C4::Context->dbh; |
954 |
my $dbh = C4::Context->dbh; |
Lines 989-994
sub ModBasketgroup {
Link Here
|
989 |
my $dbh = C4::Context->dbh; |
997 |
my $dbh = C4::Context->dbh; |
990 |
my $query = "UPDATE aqbasketgroups SET "; |
998 |
my $query = "UPDATE aqbasketgroups SET "; |
991 |
my @params; |
999 |
my @params; |
|
|
1000 |
|
1001 |
if ($basketgroupinfo->{closed}) { |
1002 |
$query .= "closeddate = IF(closed = 0, CAST(NOW() AS DATE), closeddate), "; |
1003 |
} elsif (defined $basketgroupinfo->{closed}) { |
1004 |
$query .= "closeddate = NULL, "; |
1005 |
} |
1006 |
|
992 |
foreach my $field (qw(name billingplace deliveryplace freedeliveryplace deliverycomment closed)) { |
1007 |
foreach my $field (qw(name billingplace deliveryplace freedeliveryplace deliverycomment closed)) { |
993 |
if ( defined $basketgroupinfo->{$field} ) { |
1008 |
if ( defined $basketgroupinfo->{$field} ) { |
994 |
$query .= "$field=?, "; |
1009 |
$query .= "$field=?, "; |