View | Details | Raw Unified | Return to bug 23971
Collapse All | Expand All

(-)a/C4/Acquisition.pm (-10 / +4 lines)
Lines 224-230 close a basket (becomes unmodifiable, except for receives) Link Here
224
=cut
224
=cut
225
225
226
sub CloseBasket {
226
sub CloseBasket {
227
    my ($basketno, $user, $edi_approval) = @_;
227
    my ($basketno, $edi_approval) = @_;
228
    my $dbh        = C4::Context->dbh;
228
    my $dbh        = C4::Context->dbh;
229
    $dbh->do('UPDATE aqbasket SET closedate=now() WHERE basketno=?', {}, $basketno );
229
    $dbh->do('UPDATE aqbasket SET closedate=now() WHERE basketno=?', {}, $basketno );
230
230
Lines 236-247 q{UPDATE aqorders SET orderstatus = 'ordered' WHERE basketno = ? AND orderstatus Link Here
236
    # Log the closure
236
    # Log the closure
237
    if (C4::Context->preference("AcqLog")) {
237
    if (C4::Context->preference("AcqLog")) {
238
        my $action = $edi_approval ? 'APPROVE_BASKET' : 'CLOSE_BASKET';
238
        my $action = $edi_approval ? 'APPROVE_BASKET' : 'CLOSE_BASKET';
239
        my $infos = $user ? sprintf("%010d", $user) : undef;
240
        logaction(
239
        logaction(
241
            'ACQUISITIONS',
240
            'ACQUISITIONS',
242
            $action,
241
            $action,
243
            $basketno,
242
            $basketno
244
            $infos
245
        );
243
        );
246
    }
244
    }
247
245
Lines 544-557 sub ModBasket { Link Here
544
542
545
    # Log the basket update
543
    # Log the basket update
546
    if (C4::Context->preference("AcqLog")) {
544
    if (C4::Context->preference("AcqLog")) {
547
        my $infos = $basketinfo->{borrowernumber} ?
548
            sprintf("%010d", $basketinfo->{borrowernumber}) :
549
            undef;
550
        logaction(
545
        logaction(
551
            'ACQUISITIONS',
546
            'ACQUISITIONS',
552
            'MODIFY_BASKET',
547
            'MODIFY_BASKET',
553
            $basketinfo->{'basketno'},
548
            $basketinfo->{'basketno'}
554
            $infos
555
        );
549
        );
556
    }
550
    }
557
551
Lines 594-600 case the AcqCreateItem syspref takes precedence). Link Here
594
=cut
588
=cut
595
589
596
sub ModBasketHeader {
590
sub ModBasketHeader {
597
    my ($basketno, $basketname, $note, $booksellernote, $contractnumber, $booksellerid, $deliveryplace, $billingplace, $is_standing, $create_items, $borrowernumber) = @_;
591
    my ($basketno, $basketname, $note, $booksellernote, $contractnumber, $booksellerid, $deliveryplace, $billingplace, $is_standing, $create_items) = @_;
598
592
599
    $is_standing ||= 0;
593
    $is_standing ||= 0;
600
    my $query = qq{
594
    my $query = qq{
(-)a/Koha/EDI.pm (-1 / +1 lines)
Lines 594-600 sub process_quote { Link Here
594
            );
594
            );
595
            # Close the basket, passing a flag indicating that this action
595
            # Close the basket, passing a flag indicating that this action
596
            # originated from an approval
596
            # originated from an approval
597
            CloseBasket($b, undef, 1);
597
            CloseBasket($b, 1);
598
        }
598
        }
599
    }
599
    }
600
600
(-)a/acqui/addorder.pl (-2 / +1 lines)
Lines 365-372 if (C4::Context->preference("AcqLog") && $basketno) { Link Here
365
    logaction(
365
    logaction(
366
        'ACQUISITIONS',
366
        'ACQUISITIONS',
367
        'MODIFY_BASKET',
367
        'MODIFY_BASKET',
368
        $basketno,
368
        $basketno
369
        sprintf("%010d", $loggedinuser)
370
    );
369
    );
371
}
370
}
372
371
(-)a/acqui/basket.pl (-8 / +5 lines)
Lines 193-199 if ( $op eq 'delete_confirm' ) { Link Here
193
    if ($confirm) {
193
    if ($confirm) {
194
        my $basketno = $query->param('basketno');
194
        my $basketno = $query->param('basketno');
195
        my $booksellerid = $query->param('booksellerid');
195
        my $booksellerid = $query->param('booksellerid');
196
        $basketno =~ /^\d+$/ and CloseBasket($basketno, $loggedinuser);
196
        $basketno =~ /^\d+$/ and CloseBasket($basketno);
197
        # if requested, create basket group, close it and attach the basket
197
        # if requested, create basket group, close it and attach the basket
198
        if ($query->param('createbasketgroup')) {
198
        if ($query->param('createbasketgroup')) {
199
            my $branchcode;
199
            my $branchcode;
Lines 207-214 if ( $op eq 'delete_confirm' ) { Link Here
207
                            closed => 1,
207
                            closed => 1,
208
                            });
208
                            });
209
            ModBasket( { basketno => $basketno,
209
            ModBasket( { basketno => $basketno,
210
                         basketgroupid => $basketgroupid,
210
                         basketgroupid => $basketgroupid } );
211
                         borrowernumber => $loggedinuser } );
212
            print $query->redirect('/cgi-bin/koha/acqui/basketgroup.pl?booksellerid='.$booksellerid.'&closed=1');
211
            print $query->redirect('/cgi-bin/koha/acqui/basketgroup.pl?booksellerid='.$booksellerid.'&closed=1');
213
        } else {
212
        } else {
214
            print $query->redirect('/cgi-bin/koha/acqui/booksellers.pl?booksellerid=' . $booksellerid);
213
            print $query->redirect('/cgi-bin/koha/acqui/booksellers.pl?booksellerid=' . $booksellerid);
Lines 241-248 elsif ( $op eq 'ediorder' ) { Link Here
241
    $branch = undef if(defined $branch and $branch eq '');
240
    $branch = undef if(defined $branch and $branch eq '');
242
    ModBasket({
241
    ModBasket({
243
        basketno => $basket->{basketno},
242
        basketno => $basket->{basketno},
244
        branch   => $branch,
243
        branch   => $branch
245
        borrowernumber => $loggedinuser
246
    });
244
    });
247
    print $query->redirect("/cgi-bin/koha/acqui/basket.pl?basketno=$basketno");
245
    print $query->redirect("/cgi-bin/koha/acqui/basket.pl?basketno=$basketno");
248
    exit;
246
    exit;
Lines 536-542 sub edi_close_and_order { Link Here
536
            if ( create_edi_order($edi_params) ) {
534
            if ( create_edi_order($edi_params) ) {
537
                #$template->param( edifile => 1 );
535
                #$template->param( edifile => 1 );
538
            }
536
            }
539
        CloseBasket($basketno, $loggedinuser);
537
        CloseBasket($basketno);
540
538
541
        # if requested, create basket group, close it and attach the basket
539
        # if requested, create basket group, close it and attach the basket
542
        if ( $query->param('createbasketgroup') ) {
540
        if ( $query->param('createbasketgroup') ) {
Lines 558-565 sub edi_close_and_order { Link Here
558
            ModBasket(
556
            ModBasket(
559
                {
557
                {
560
                    basketno       => $basketno,
558
                    basketno       => $basketno,
561
                    basketgroupid  => $basketgroupid,
559
                    basketgroupid  => $basketgroupid
562
                    borrowernumber => $loggedinuser
563
                }
560
                }
564
            );
561
            );
565
            print $query->redirect(
562
            print $query->redirect(
(-)a/acqui/basketheader.pl (-3 / +1 lines)
Lines 153-160 if ( $op eq 'add_form' ) { Link Here
153
            scalar $input->param('deliveryplace'),
153
            scalar $input->param('deliveryplace'),
154
            scalar $input->param('billingplace'),
154
            scalar $input->param('billingplace'),
155
            scalar $input->param('is_standing') ? 1 : undef,
155
            scalar $input->param('is_standing') ? 1 : undef,
156
            scalar $input->param('create_items'),
156
            scalar $input->param('create_items')
157
            $loggedinuser
158
        );
157
        );
159
    } else { #New basket
158
    } else { #New basket
160
        $basketno = NewBasket(
159
        $basketno = NewBasket(
161
- 

Return to bug 23971