Lines 413-419
sub CloseBasketgroup {
Link Here
|
413 |
my $dbh = C4::Context->dbh; |
413 |
my $dbh = C4::Context->dbh; |
414 |
my $sth = $dbh->prepare(" |
414 |
my $sth = $dbh->prepare(" |
415 |
UPDATE aqbasketgroups |
415 |
UPDATE aqbasketgroups |
416 |
SET closed=1 |
416 |
SET closed=1, |
|
|
417 |
closeddate=CAST(NOW() AS DATE) |
417 |
WHERE id=? |
418 |
WHERE id=? |
418 |
"); |
419 |
"); |
419 |
$sth->execute($basketgroupno); |
420 |
$sth->execute($basketgroupno); |
Lines 434-440
sub ReOpenBasketgroup {
Link Here
|
434 |
my $dbh = C4::Context->dbh; |
435 |
my $dbh = C4::Context->dbh; |
435 |
my $sth = $dbh->prepare(" |
436 |
my $sth = $dbh->prepare(" |
436 |
UPDATE aqbasketgroups |
437 |
UPDATE aqbasketgroups |
437 |
SET closed=0 |
438 |
SET closed=0, closeddate=NULL |
438 |
WHERE id=? |
439 |
WHERE id=? |
439 |
"); |
440 |
"); |
440 |
$sth->execute($basketgroupno); |
441 |
$sth->execute($basketgroupno); |
Lines 866-875
sub NewBasketgroup {
Link Here
|
866 |
push(@params, $basketgroupinfo->{$field}); |
867 |
push(@params, $basketgroupinfo->{$field}); |
867 |
} |
868 |
} |
868 |
} |
869 |
} |
|
|
870 |
|
871 |
if ($basketgroupinfo->{closed}) { |
872 |
$query .= "closeddate, "; |
873 |
} |
869 |
$query .= "booksellerid) VALUES ("; |
874 |
$query .= "booksellerid) VALUES ("; |
870 |
foreach (@params) { |
875 |
foreach (@params) { |
871 |
$query .= "?, "; |
876 |
$query .= "?, "; |
872 |
} |
877 |
} |
|
|
878 |
if ($basketgroupinfo->{closed}) { |
879 |
$query .= "CAST(NOW() AS DATE), "; |
880 |
} |
873 |
$query .= "?)"; |
881 |
$query .= "?)"; |
874 |
push(@params, $basketgroupinfo->{'booksellerid'}); |
882 |
push(@params, $basketgroupinfo->{'booksellerid'}); |
875 |
my $dbh = C4::Context->dbh; |
883 |
my $dbh = C4::Context->dbh; |
Lines 918-923
sub ModBasketgroup {
Link Here
|
918 |
my $dbh = C4::Context->dbh; |
926 |
my $dbh = C4::Context->dbh; |
919 |
my $query = "UPDATE aqbasketgroups SET "; |
927 |
my $query = "UPDATE aqbasketgroups SET "; |
920 |
my @params; |
928 |
my @params; |
|
|
929 |
|
930 |
if ($basketgroupinfo->{closed}) { |
931 |
$query .= "closeddate = IF(closed = 0, CAST(NOW() AS DATE), closeddate), "; |
932 |
} elsif (defined $basketgroupinfo->{closed}) { |
933 |
$query .= "closeddate = NULL, "; |
934 |
} |
935 |
|
921 |
foreach my $field (qw(name billingplace deliveryplace freedeliveryplace deliverycomment closed)) { |
936 |
foreach my $field (qw(name billingplace deliveryplace freedeliveryplace deliverycomment closed)) { |
922 |
if ( defined $basketgroupinfo->{$field} ) { |
937 |
if ( defined $basketgroupinfo->{$field} ) { |
923 |
$query .= "$field=?, "; |
938 |
$query .= "$field=?, "; |