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