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