Lines 429-435
sub CloseBasketgroup {
Link Here
|
429 |
my $dbh = C4::Context->dbh; |
429 |
my $dbh = C4::Context->dbh; |
430 |
my $sth = $dbh->prepare(" |
430 |
my $sth = $dbh->prepare(" |
431 |
UPDATE aqbasketgroups |
431 |
UPDATE aqbasketgroups |
432 |
SET closed=1 |
432 |
SET closed=1, |
|
|
433 |
closeddate=CAST(NOW() AS DATE) |
433 |
WHERE id=? |
434 |
WHERE id=? |
434 |
"); |
435 |
"); |
435 |
$sth->execute($basketgroupno); |
436 |
$sth->execute($basketgroupno); |
Lines 450-456
sub ReOpenBasketgroup {
Link Here
|
450 |
my $dbh = C4::Context->dbh; |
451 |
my $dbh = C4::Context->dbh; |
451 |
my $sth = $dbh->prepare(" |
452 |
my $sth = $dbh->prepare(" |
452 |
UPDATE aqbasketgroups |
453 |
UPDATE aqbasketgroups |
453 |
SET closed=0 |
454 |
SET closed=0, closeddate=NULL |
454 |
WHERE id=? |
455 |
WHERE id=? |
455 |
"); |
456 |
"); |
456 |
$sth->execute($basketgroupno); |
457 |
$sth->execute($basketgroupno); |
Lines 882-891
sub NewBasketgroup {
Link Here
|
882 |
push(@params, $basketgroupinfo->{$field}); |
883 |
push(@params, $basketgroupinfo->{$field}); |
883 |
} |
884 |
} |
884 |
} |
885 |
} |
|
|
886 |
|
887 |
if ($basketgroupinfo->{closed}) { |
888 |
$query .= "closeddate, "; |
889 |
} |
885 |
$query .= "booksellerid) VALUES ("; |
890 |
$query .= "booksellerid) VALUES ("; |
886 |
foreach (@params) { |
891 |
foreach (@params) { |
887 |
$query .= "?, "; |
892 |
$query .= "?, "; |
888 |
} |
893 |
} |
|
|
894 |
if ($basketgroupinfo->{closed}) { |
895 |
$query .= "CAST(NOW() AS DATE), "; |
896 |
} |
889 |
$query .= "?)"; |
897 |
$query .= "?)"; |
890 |
push(@params, $basketgroupinfo->{'booksellerid'}); |
898 |
push(@params, $basketgroupinfo->{'booksellerid'}); |
891 |
my $dbh = C4::Context->dbh; |
899 |
my $dbh = C4::Context->dbh; |
Lines 934-939
sub ModBasketgroup {
Link Here
|
934 |
my $dbh = C4::Context->dbh; |
942 |
my $dbh = C4::Context->dbh; |
935 |
my $query = "UPDATE aqbasketgroups SET "; |
943 |
my $query = "UPDATE aqbasketgroups SET "; |
936 |
my @params; |
944 |
my @params; |
|
|
945 |
|
946 |
if ($basketgroupinfo->{closed}) { |
947 |
$query .= "closeddate = IF(closed = 0, CAST(NOW() AS DATE), closeddate), "; |
948 |
} elsif (defined $basketgroupinfo->{closed}) { |
949 |
$query .= "closeddate = NULL, "; |
950 |
} |
951 |
|
937 |
foreach my $field (qw(name billingplace deliveryplace freedeliveryplace deliverycomment closed)) { |
952 |
foreach my $field (qw(name billingplace deliveryplace freedeliveryplace deliverycomment closed)) { |
938 |
if ( defined $basketgroupinfo->{$field} ) { |
953 |
if ( defined $basketgroupinfo->{$field} ) { |
939 |
$query .= "$field=?, "; |
954 |
$query .= "$field=?, "; |