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 570-583 sub ModBasket { Link Here
570
568
571
    # Log the basket update
569
    # Log the basket update
572
    if (C4::Context->preference("AcqLog")) {
570
    if (C4::Context->preference("AcqLog")) {
573
        my $infos = $basketinfo->{borrowernumber} ?
574
            sprintf("%010d", $basketinfo->{borrowernumber}) :
575
            undef;
576
        logaction(
571
        logaction(
577
            'ACQUISITIONS',
572
            'ACQUISITIONS',
578
            'MODIFY_BASKET',
573
            'MODIFY_BASKET',
579
            $basketinfo->{'basketno'},
574
            $basketinfo->{'basketno'}
580
            $infos
581
        );
575
        );
582
    }
576
    }
583
577
Lines 620-626 case the AcqCreateItem syspref takes precedence). Link Here
620
=cut
614
=cut
621
615
622
sub ModBasketHeader {
616
sub ModBasketHeader {
623
    my ($basketno, $basketname, $note, $booksellernote, $contractnumber, $booksellerid, $deliveryplace, $billingplace, $is_standing, $create_items, $borrowernumber) = @_;
617
    my ($basketno, $basketname, $note, $booksellernote, $contractnumber, $booksellerid, $deliveryplace, $billingplace, $is_standing, $create_items) = @_;
624
618
625
    $is_standing ||= 0;
619
    $is_standing ||= 0;
626
    my $query = qq{
620
    my $query = qq{
(-)a/Koha/EDI.pm (-1 / +1 lines)
Lines 576-582 sub process_quote { Link Here
576
            );
576
            );
577
            # Close the basket, passing a flag indicating that this action
577
            # Close the basket, passing a flag indicating that this action
578
            # originated from an approval
578
            # originated from an approval
579
            CloseBasket($b, undef, 1);
579
            CloseBasket($b, 1);
580
        }
580
        }
581
    }
581
    }
582
582
(-)a/acqui/addorder.pl (-2 / +1 lines)
Lines 361-368 if (C4::Context->preference("AcqLog") && $basketno) { Link Here
361
    logaction(
361
    logaction(
362
        'ACQUISITIONS',
362
        'ACQUISITIONS',
363
        'MODIFY_BASKET',
363
        'MODIFY_BASKET',
364
        $basketno,
364
        $basketno
365
        sprintf("%010d", $loggedinuser)
366
    );
365
    );
367
}
366
}
368
367
(-)a/acqui/basket.pl (-8 / +5 lines)
Lines 195-201 if ( $op eq 'delete_confirm' ) { Link Here
195
    if ($confirm) {
195
    if ($confirm) {
196
        my $basketno = $query->param('basketno');
196
        my $basketno = $query->param('basketno');
197
        my $booksellerid = $query->param('booksellerid');
197
        my $booksellerid = $query->param('booksellerid');
198
        $basketno =~ /^\d+$/ and CloseBasket($basketno, $loggedinuser);
198
        $basketno =~ /^\d+$/ and CloseBasket($basketno);
199
        # if requested, create basket group, close it and attach the basket
199
        # if requested, create basket group, close it and attach the basket
200
        if ($query->param('createbasketgroup')) {
200
        if ($query->param('createbasketgroup')) {
201
            my $branchcode;
201
            my $branchcode;
Lines 210-217 if ( $op eq 'delete_confirm' ) { Link Here
210
                            closed => 1,
210
                            closed => 1,
211
                            });
211
                            });
212
            ModBasket( { basketno => $basketno,
212
            ModBasket( { basketno => $basketno,
213
                         basketgroupid => $basketgroupid,
213
                         basketgroupid => $basketgroupid } );
214
                         borrowernumber => $loggedinuser } );
215
            print $query->redirect('/cgi-bin/koha/acqui/basketgroup.pl?booksellerid='.$booksellerid.'&closed=1');
214
            print $query->redirect('/cgi-bin/koha/acqui/basketgroup.pl?booksellerid='.$booksellerid.'&closed=1');
216
        } else {
215
        } else {
217
            print $query->redirect('/cgi-bin/koha/acqui/booksellers.pl?booksellerid=' . $booksellerid);
216
            print $query->redirect('/cgi-bin/koha/acqui/booksellers.pl?booksellerid=' . $booksellerid);
Lines 244-251 elsif ( $op eq 'ediorder' ) { Link Here
244
    $branch = undef if(defined $branch and $branch eq '');
243
    $branch = undef if(defined $branch and $branch eq '');
245
    ModBasket({
244
    ModBasket({
246
        basketno => $basket->{basketno},
245
        basketno => $basket->{basketno},
247
        branch   => $branch,
246
        branch   => $branch
248
        borrowernumber => $loggedinuser
249
    });
247
    });
250
    print $query->redirect("/cgi-bin/koha/acqui/basket.pl?basketno=$basketno");
248
    print $query->redirect("/cgi-bin/koha/acqui/basket.pl?basketno=$basketno");
251
    exit;
249
    exit;
Lines 538-544 sub edi_close_and_order { Link Here
538
            if ( create_edi_order($edi_params) ) {
536
            if ( create_edi_order($edi_params) ) {
539
                #$template->param( edifile => 1 );
537
                #$template->param( edifile => 1 );
540
            }
538
            }
541
        CloseBasket($basketno, $loggedinuser);
539
        CloseBasket($basketno);
542
540
543
        # if requested, create basket group, close it and attach the basket
541
        # if requested, create basket group, close it and attach the basket
544
        if ( $query->param('createbasketgroup') ) {
542
        if ( $query->param('createbasketgroup') ) {
Lines 561-568 sub edi_close_and_order { Link Here
561
            ModBasket(
559
            ModBasket(
562
                {
560
                {
563
                    basketno       => $basketno,
561
                    basketno       => $basketno,
564
                    basketgroupid  => $basketgroupid,
562
                    basketgroupid  => $basketgroupid
565
                    borrowernumber => $loggedinuser
566
                }
563
                }
567
            );
564
            );
568
            print $query->redirect(
565
            print $query->redirect(
(-)a/acqui/basketheader.pl (-3 / +1 lines)
Lines 154-161 if ( $op eq 'add_form' ) { Link Here
154
            scalar $input->param('deliveryplace'),
154
            scalar $input->param('deliveryplace'),
155
            scalar $input->param('billingplace'),
155
            scalar $input->param('billingplace'),
156
            scalar $input->param('is_standing') ? 1 : undef,
156
            scalar $input->param('is_standing') ? 1 : undef,
157
            scalar $input->param('create_items'),
157
            scalar $input->param('create_items')
158
            $loggedinuser
159
        );
158
        );
160
    } else { #New basket
159
    } else { #New basket
161
        $basketno = NewBasket(
160
        $basketno = NewBasket(
162
- 

Return to bug 23971