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

(-)a/Koha/Booking.pm (-15 / +18 lines)
Lines 336-363 $booking->delete(); Link Here
336
=cut
336
=cut
337
337
338
sub delete {
338
sub delete {
339
    my ( $self ) = @_;
339
    my ( $self, $params ) = @_;
340
340
341
    my $deleted = $self->SUPER::delete($self);
341
    my $deleted = $self->SUPER::delete($self);
342
    my $patron  = Koha::Patrons->find( $self->patron_id );
342
    my $patron  = Koha::Patrons->find( $self->patron_id );
343
    my $item    = Koha::Items->find( $self->item_id );
343
    my $item    = Koha::Items->find( $self->item_id );
344
    my $library = Koha::Libraries->find( $self->pickup_library_id );
344
    my $library = Koha::Libraries->find( $self->pickup_library_id );
345
345
346
    if ( not  defined( $params->{'transform_to_checkout'} ) ) {
346
    my $letter = C4::Letters::GetPreparedLetter(
347
    my $letter = C4::Letters::GetPreparedLetter(
347
            module                 => 'bookings',
348
        module                 => 'bookings',
348
            letter_code            => 'BOOKING_CANCELLATION',
349
        letter_code            => 'BOOKING_CANCELLATION',
349
            message_transport_type => 'email',
350
        message_transport_type => 'email',
350
            branchcode             => $patron->branchcode,
351
        branchcode             => $patron->branchcode,
351
            lang                   => $patron->lang,
352
        lang                   => $patron->lang,
352
            tables                 => {
353
        tables                 => {
353
                branches    => $library->branchcode,
354
            branches    => $library->branchcode,
354
                borrowers   => $patron->borrowernumber,
355
            borrowers   => $patron->borrowernumber,
355
                items       => $item->itemnumber,
356
            items       => $item->itemnumber,
356
                biblio      => $item->biblionumber,
357
            biblio      => $item->biblionumber,
357
                biblioitems => $item->biblionumber,
358
            biblioitems => $item->biblionumber,
358
                bookings    => $self->unblessed,
359
            bookings    => $self->unblessed,
359
            }
360
        }
360
        );
361
    );
361
362
362
        if ($letter) {
363
        if ($letter) {
363
            C4::Letters::EnqueueLetter(
364
            C4::Letters::EnqueueLetter(
Lines 368-373 sub delete { Link Here
368
                }
369
                }
369
            );
370
            );
370
        }
371
        }
372
    }
373
371
    return $deleted;
374
    return $deleted;
372
}
375
}
373
376
(-)a/circ/circulation.pl (-2 / +1 lines)
Lines 558-564 if (@$barcodes && $op eq 'cud-checkout') { Link Here
558
  }
558
  }
559
  if($from_booking){
559
  if($from_booking){
560
    my $booking = Koha::Bookings->find( $query->param('booking_id') );
560
    my $booking = Koha::Bookings->find( $query->param('booking_id') );
561
    $booking->delete;
561
    $booking->delete( { 'transform_to_checkout' => 1 } );
562
  }
562
  }
563
}
563
}
564
564
565
- 

Return to bug 36789