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