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

(-)a/C4/Acquisition.pm (-8 / +9 lines)
Lines 1579-1585 sub SearchOrders { Link Here
1579
1579
1580
=head3 DelOrder
1580
=head3 DelOrder
1581
1581
1582
  &DelOrder($biblionumber, $ordernumber);
1582
  &DelOrder($ordernumber, $biblionumber);
1583
1583
1584
Cancel the order with the given order and biblio numbers. It does not
1584
Cancel the order with the given order and biblio numbers. It does not
1585
delete any entries in the aqorders table, it merely marks them as
1585
delete any entries in the aqorders table, it merely marks them as
Lines 1588-1608 cancelled. Link Here
1588
=cut
1588
=cut
1589
1589
1590
sub DelOrder {
1590
sub DelOrder {
1591
    my ( $bibnum, $ordernumber ) = @_;
1591
    my ($ordernumber,$bibnum) = @_;
1592
    my $dbh = C4::Context->dbh;
1592
    my $dbh = C4::Context->dbh;
1593
    my $query = "
1593
    my $query = "
1594
        UPDATE aqorders
1594
        UPDATE aqorders
1595
        SET    datecancellationprinted=now(), orderstatus='cancelled'
1595
        SET    datecancellationprinted=now(), orderstatus='cancelled'
1596
        WHERE  biblionumber=? AND ordernumber=?
1596
        WHERE  ordernumber=?
1597
    ";
1597
    ";
1598
    my $sth = $dbh->prepare($query);
1598
    my $sth = $dbh->prepare($query);
1599
    $sth->execute( $bibnum, $ordernumber );
1599
    $sth->execute($ordernumber );
1600
    $sth->finish;
1600
    $sth->finish;
1601
    my @itemnumbers = GetItemnumbersFromOrder( $ordernumber );
1601
    if ($bibnum) {
1602
    foreach my $itemnumber (@itemnumbers){
1602
        my @itemnumbers = GetItemnumbersFromOrder( $ordernumber );
1603
    	C4::Items::DelItem( $dbh, $bibnum, $itemnumber );
1603
        foreach my $itemnumber (@itemnumbers){
1604
	   C4::Items::DelItem( $dbh, $bibnum, $itemnumber );
1605
        }
1604
    }
1606
    }
1605
    
1606
}
1607
}
1607
1608
1608
=head3 TransferOrder
1609
=head3 TransferOrder
(-)a/acqui/addorder.pl (-1 / +1 lines)
Lines 251-257 if ( $orderinfo->{quantity} ne '0' ) { Link Here
251
251
252
else { # qty=0, delete the line
252
else { # qty=0, delete the line
253
    my $biblionumber = $input->param('biblionumber');
253
    my $biblionumber = $input->param('biblionumber');
254
    DelOrder( $biblionumber, $$orderinfo{ordernumber} );
254
    DelOrder($$orderinfo{ordernumber}, $biblionumber );
255
    if ($orderinfo->{delbiblio} == 1){
255
    if ($orderinfo->{delbiblio} == 1){
256
     DelBiblio($biblionumber);
256
     DelBiblio($biblionumber);
257
    }
257
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-24 / +31 lines)
Lines 336-343 Link Here
336
                    [% IF ( books_loo.order_received ) %]<tr class="disabled">[% ELSE %][% IF ( books_loo.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %][% END %]
336
                    [% IF ( books_loo.order_received ) %]<tr class="disabled">[% ELSE %][% IF ( books_loo.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %][% END %]
337
                        <td>
337
                        <td>
338
                            <p>[% IF ( books_loo.order_received ) %] (rcvd)[% END %]
338
                            <p>[% IF ( books_loo.order_received ) %] (rcvd)[% END %]
339
                                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% books_loo.biblionumber %]">[% books_loo.title |html %]</a> by [% books_loo.author %]
339
                               [% IF (books_loo.biblionumber) %]
340
                                <br />
340
                                   <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% books_loo.biblionumber %]">[% books_loo.title |html %]</a> by [% books_loo.author %]
341
                                   <br />
342
                               [% ELSE %]
343
                                   <em>Deleted bibliographic record, can't find title</em><br />
344
                               [% END %]
341
                                [% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
345
                                [% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
342
                                [% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
346
                                [% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
343
                                [% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
347
                                [% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
Lines 387-413 Link Here
387
                                [% END %]
391
                                [% END %]
388
                            </td>
392
                            </td>
389
                            <td>
393
                            <td>
390
                            [% IF ( books_loo.left_holds_on_order ) %]
394
                            [% UNLESS (books_loo.biblionumber) %]
391
                            <span class="button" title="Can't delete order, ([% books_loo.holds_on_order %]) holds are linked with this order cancel holds first">Can't delete order</span><br>
395
                                <a href="javascript:confirm_delete_item([% books_loo.ordernumber %])" class="button">Delete order</a><br>
392
                            [% ELSE %]
396
                            [% ELSE %]
393
                            <a href="javascript:confirm_delete_item([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order</a><br>
397
                                [% IF ( books_loo.left_holds_on_order ) %]
394
                            [% END %]
398
                                <span class="button" title="Can't delete order, ([% books_loo.holds_on_order %]) holds are linked with this order cancel holds first">Can't delete order</span><br>
395
                            [% IF ( books_loo.can_del_bib ) %]
399
                                [% ELSE %]
396
                            <a href="javascript:confirm_delete_biblio([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order and catalog record</a><br>
400
                                <a href="javascript:confirm_delete_item([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order</a><br>
397
                            [% ELSE %]
401
                                [% END %]
398
                            <span class="button" title="Can't delete catalog record, see constraints below">Can't delete order and catalog record</span><br>
402
                                [% IF ( books_loo.can_del_bib ) %]
399
                            [% END %]
403
                                <a href="javascript:confirm_delete_biblio([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order and catalog record</a><br>
400
                            [% IF ( books_loo.left_item ) %]
404
                                [% ELSE %]
401
                            <b title="Can't delete catalog record, because of [% books_loo.items %] existing hold(s)" >[% books_loo.items %] item(s) left</b><br>
405
                                <span class="button" title="Can't delete catalog record, see constraints below">Can't delete order and catalog record</span><br>
402
                            [% END %]
406
                                [% END %]
403
                            [% IF ( books_loo.left_biblio ) %]
407
                                [% IF ( books_loo.left_item ) %]
404
                            <b title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios %] order(s) left</b><br>
408
                                <b title="Can't delete catalog record, because of [% books_loo.items %] existing hold(s)" >[% books_loo.items %] item(s) left</b><br>
405
                            [% END %]
409
                                [% END %]
406
                            [% IF ( books_loo.left_subscription ) %]
410
                                [% IF ( books_loo.left_biblio ) %]
407
                            <b title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions %] subscription(s) left</b><br>
411
                                <b title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios %] order(s) left</b><br>
408
                            [% END %]
412
                                [% END %]
409
                            [% IF ( books_loo.left_holds ) %]
413
                                [% IF ( books_loo.left_subscription ) %]
410
                            <b title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds %] hold(s) left</b>
414
                                <b title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions %] subscription(s) left</b><br>
415
                                [% END %]
416
                                [% IF ( books_loo.left_holds ) %]
417
                                <b title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds %] hold(s) left</b>
418
                                [% END %]
411
                            [% END %]
419
                            [% END %]
412
                            </td>
420
                            </td>
413
                            [% END %]
421
                            [% END %]
Lines 445-451 Link Here
445
                    <td>
453
                    <td>
446
                      <p>
454
                      <p>
447
                        [% IF ( order.order_received ) %] (rcvd)[% END %]
455
                        [% IF ( order.order_received ) %] (rcvd)[% END %]
448
                        [% IF (order.title) %]
456
                        [% IF (order.biblionumber) %]
449
                          [% order.title |html %] by [% order.author %]<br />
457
                          [% order.title |html %] by [% order.author %]<br />
450
                        [% ELSE %]
458
                        [% ELSE %]
451
                          <em>Deleted bibliographic record, can't find title</em><br />
459
                          <em>Deleted bibliographic record, can't find title</em><br />
452
- 

Return to bug 10869