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

(-)a/C4/Acquisition.pm (-10 / +11 lines)
Lines 1570-1576 sub SearchOrder { Link Here
1570
1570
1571
=head3 DelOrder
1571
=head3 DelOrder
1572
1572
1573
  &DelOrder($biblionumber, $ordernumber);
1573
  &DelOrder($ordernumber, $biblionumber);
1574
1574
1575
Cancel the order with the given order and biblio numbers. It does not
1575
Cancel the order with the given order and biblio numbers. It does not
1576
delete any entries in the aqorders table, it merely marks them as
1576
delete any entries in the aqorders table, it merely marks them as
Lines 1579-1599 cancelled. Link Here
1579
=cut
1579
=cut
1580
1580
1581
sub DelOrder {
1581
sub DelOrder {
1582
    my ( $bibnum, $ordernumber ) = @_;
1582
    my ($ordernumber,$bibnum) = @_;
1583
    my $dbh = C4::Context->dbh;
1583
    my $dbh = C4::Context->dbh;
1584
    my $query = "
1584
    my $query = "
1585
        UPDATE aqorders
1585
        UPDATE aqorders
1586
        SET    datecancellationprinted=now()
1586
        SET    datecancellationprinted=now()
1587
        WHERE  biblionumber=? AND ordernumber=?
1587
        WHERE  ordernumber=?
1588
    ";
1588
    ";    
1589
    my $sth = $dbh->prepare($query);
1589
    my $sth = $dbh->prepare($query);
1590
    $sth->execute( $bibnum, $ordernumber );
1590
    $sth->execute($ordernumber );
1591
    $sth->finish;
1591
    $sth->finish;
1592
    my @itemnumbers = GetItemnumbersFromOrder( $ordernumber );
1592
    if ($bibnum) {        
1593
    foreach my $itemnumber (@itemnumbers){
1593
        my @itemnumbers = GetItemnumbersFromOrder( $ordernumber );
1594
    	C4::Items::DelItem( $dbh, $bibnum, $itemnumber );
1594
        foreach my $itemnumber (@itemnumbers){
1595
    }
1595
    	   C4::Items::DelItem( $dbh, $bibnum, $itemnumber );
1596
    
1596
        }
1597
    }    
1597
}
1598
}
1598
1599
1599
=head2 FUNCTIONS ABOUT PARCELS
1600
=head2 FUNCTIONS ABOUT PARCELS
(-)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 (-26 / +33 lines)
Lines 330-337 Link Here
330
                    [% IF ( books_loo.order_received ) %]<tr class="disabled">[% ELSE %][% IF ( books_loo.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %][% END %]
330
                    [% IF ( books_loo.order_received ) %]<tr class="disabled">[% ELSE %][% IF ( books_loo.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %][% END %]
331
                        <td>
331
                        <td>
332
                            <p>[% IF ( books_loo.order_received ) %] (rcvd)[% END %]
332
                            <p>[% IF ( books_loo.order_received ) %] (rcvd)[% END %]
333
                                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% books_loo.biblionumber %]">[% books_loo.title |html %]</a> by [% books_loo.author %]
333
                               [% IF (order.biblionumber) %]
334
                                <br />
334
                                   <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% books_loo.biblionumber %]">[% books_loo.title |html %]</a> by [% books_loo.author %]
335
                                   <br />
336
                               [% ELSE %]
337
                                   <em>Deleted bibliographic record, can't find title</em><br />
338
                               [% END %]                                
335
                                [% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
339
                                [% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
336
                                [% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
340
                                [% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
337
                                [% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
341
                                [% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
Lines 365-391 Link Here
365
                                <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Modify</a>
369
                                <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Modify</a>
366
                            </td>
370
                            </td>
367
                            <td>
371
                            <td>
368
                            [% IF ( books_loo.left_holds_on_order ) %]
372
                            [% UNLESS (books_loo.biblionumber) %]
369
                            <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>
373
                                <a href="javascript:confirm_delete_item([% books_loo.ordernumber %])" class="button">Delete order</a><br>
370
                            [% ELSE %]
374
                            [% ELSE %]                            
371
                            <a href="javascript:confirm_delete_item([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order</a><br>
375
                                [% IF ( books_loo.left_holds_on_order ) %]
372
                            [% END %]
376
                                <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>
373
                            [% IF ( books_loo.can_del_bib ) %]
377
                                [% ELSE %]
374
                            <a href="javascript:confirm_delete_biblio([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order and catalog record</a><br>
378
                                <a href="javascript:confirm_delete_item([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order</a><br>
375
                            [% ELSE %]
379
                                [% END %]
376
                            <span class="button" title="Can't delete catalog record, see constraints below">Can't delete order and catalog record</span><br>
380
                                [% IF ( books_loo.can_del_bib ) %]
377
                            [% END %]
381
                                <a href="javascript:confirm_delete_biblio([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order and catalog record</a><br>
378
                            [% IF ( books_loo.left_item ) %]
382
                                [% ELSE %]
379
                            <b title="Can't delete catalog record, because of [% books_loo.items %] existing hold(s)" >[% books_loo.items %] item(s) left</b><br>
383
                                <span class="button" title="Can't delete catalog record, see constraints below">Can't delete order and catalog record</span><br>
380
                            [% END %]
384
                                [% END %]
381
                            [% IF ( books_loo.left_biblio ) %]
385
                                [% IF ( books_loo.left_item ) %]
382
                            <b title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios %] order(s) left</b><br>
386
                                <b title="Can't delete catalog record, because of [% books_loo.items %] existing hold(s)" >[% books_loo.items %] item(s) left</b><br>
383
                            [% END %]
387
                                [% END %]
384
                            [% IF ( books_loo.left_subscription ) %]
388
                                [% IF ( books_loo.left_biblio ) %]
385
                            <b title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions %] subscription(s) left</b><br>
389
                                <b title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios %] order(s) left</b><br>
386
                            [% END %]
390
                                [% END %]
387
                            [% IF ( books_loo.left_holds ) %]
391
                                [% IF ( books_loo.left_subscription ) %]
388
                            <b title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds %] hold(s) left</b>
392
                                <b title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions %] subscription(s) left</b><br>
393
                                [% END %]
394
                                [% IF ( books_loo.left_holds ) %]
395
                                <b title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds %] hold(s) left</b>
396
                                [% END %]                            
389
                            [% END %]
397
                            [% END %]
390
                            </td>
398
                            </td>
391
                            [% END %]
399
                            [% END %]
Lines 423-430 Link Here
423
                    <td>
431
                    <td>
424
                      <p>
432
                      <p>
425
                        [% IF ( order.order_received ) %] (rcvd)[% END %]
433
                        [% IF ( order.order_received ) %] (rcvd)[% END %]
426
                        [% IF (order.title) %]
434
                        [% IF (order.biblionumber) %]
427
                          [% order.title |html %] by [% order.author %]<br />
435
                          [% order.title |html %] bddy [% order.author %]<br />
428
                        [% ELSE %]
436
                        [% ELSE %]
429
                          <em>Deleted bibliographic record, can't find title</em><br />
437
                          <em>Deleted bibliographic record, can't find title</em><br />
430
                        [% END %]
438
                        [% END %]
431
- 

Return to bug 10869