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

(-)a/Koha/Account/Line.pm (-4 / +6 lines)
Lines 62-72 Return the checkout linked to this account line if exists Link Here
62
62
63
sub checkout {
63
sub checkout {
64
    my ( $self ) = @_;
64
    my ( $self ) = @_;
65
    return unless $self->issue_id ;
65
    return unless $self->issue_id;
66
    my $issue_rs = $self->_result->issue;
67
    return Koha::Checkout->_new_from_dbic( $issue_rs ) if $issue_rs;
66
68
67
    $self->{_checkout} ||= Koha::Checkouts->find( $self->issue_id );
69
    my $old_issue_rs = $self->_result->old_issue;
68
    $self->{_checkout} ||= Koha::Old::Checkouts->find( $self->issue_id );
70
    return Koha::Old::Checkout->_new_from_dbic( $old_issue_rs ) if $old_issue_rs;
69
    return $self->{_checkout};
71
    return;
70
}
72
}
71
73
72
=head3 void
74
=head3 void
(-)a/Koha/Schema/Result/Accountline.pm (-1 / +44 lines)
Lines 295-298 sub koha_object_class { Link Here
295
    'Koha::Account::Line';
295
    'Koha::Account::Line';
296
}
296
}
297
297
298
=head2 issue
299
300
Type: belongs_to
301
302
Related object: L<Koha::Schema::Result::Issue>
303
304
Note: This DBIC only relationship should be removed (as it will get automatically recreated)
305
if we add a proper foreign key for accountlines.issue_id
306
307
=cut
308
309
__PACKAGE__->belongs_to(
310
  "issue",
311
  "Koha::Schema::Result::Issue",
312
  { "foreign.issue_id" => "self.issue_id" },
313
  {
314
    is_deferrable => 1,
315
    join_type     => "LEFT"
316
  },
317
);
318
319
=head2 old_issue
320
321
Type: belongs_to
322
323
Related object: L<Koha::Schema::Result::OldIssue>
324
325
Note: This DBIC only relationship should be removed (as it will get automatically recreated)
326
if we add a proper foreign key for accountlines.issue_id
327
328
=cut
329
330
__PACKAGE__->belongs_to(
331
  "old_issue",
332
  "Koha::Schema::Result::OldIssue",
333
  { "foreign.issue_id" => "self.issue_id" },
334
  {
335
    is_deferrable => 1,
336
    join_type     => "LEFT",
337
    on_delete     => "SET NULL",
338
    on_update     => "CASCADE",
339
  },
340
);
341
298
1;
342
1;
299
- 

Return to bug 22683