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 939-948
sub NewBasketgroup {
Link Here
|
939 |
push(@params, $basketgroupinfo->{$field}); |
940 |
push(@params, $basketgroupinfo->{$field}); |
940 |
} |
941 |
} |
941 |
} |
942 |
} |
|
|
943 |
|
944 |
if ($basketgroupinfo->{closed}) { |
945 |
$query .= "closeddate, "; |
946 |
} |
942 |
$query .= "booksellerid) VALUES ("; |
947 |
$query .= "booksellerid) VALUES ("; |
943 |
foreach (@params) { |
948 |
foreach (@params) { |
944 |
$query .= "?, "; |
949 |
$query .= "?, "; |
945 |
} |
950 |
} |
|
|
951 |
if ($basketgroupinfo->{closed}) { |
952 |
$query .= "CAST(NOW() AS DATE), "; |
953 |
} |
946 |
$query .= "?)"; |
954 |
$query .= "?)"; |
947 |
push(@params, $basketgroupinfo->{'booksellerid'}); |
955 |
push(@params, $basketgroupinfo->{'booksellerid'}); |
948 |
my $dbh = C4::Context->dbh; |
956 |
my $dbh = C4::Context->dbh; |
Lines 991-996
sub ModBasketgroup {
Link Here
|
991 |
my $dbh = C4::Context->dbh; |
999 |
my $dbh = C4::Context->dbh; |
992 |
my $query = "UPDATE aqbasketgroups SET "; |
1000 |
my $query = "UPDATE aqbasketgroups SET "; |
993 |
my @params; |
1001 |
my @params; |
|
|
1002 |
|
1003 |
if ($basketgroupinfo->{closed}) { |
1004 |
$query .= "closeddate = IF(closed = 0, CAST(NOW() AS DATE), closeddate), "; |
1005 |
} elsif (defined $basketgroupinfo->{closed}) { |
1006 |
$query .= "closeddate = NULL, "; |
1007 |
} |
1008 |
|
994 |
foreach my $field (qw(name billingplace deliveryplace freedeliveryplace deliverycomment closed)) { |
1009 |
foreach my $field (qw(name billingplace deliveryplace freedeliveryplace deliverycomment closed)) { |
995 |
if ( defined $basketgroupinfo->{$field} ) { |
1010 |
if ( defined $basketgroupinfo->{$field} ) { |
996 |
$query .= "$field=?, "; |
1011 |
$query .= "$field=?, "; |