Bug 19489: Change method name issue --> checkout
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
parent
6338bf19a8
commit
add47bf472
|
|
@ -54,19 +54,19 @@ sub item {
|
|||
return Koha::Item->_new_from_dbic( $rs );
|
||||
}
|
||||
|
||||
=head3 issue
|
||||
=head3 checkout
|
||||
|
||||
Return the item linked to this account line if exists
|
||||
Return the checkout linked to this account line if exists
|
||||
|
||||
=cut
|
||||
|
||||
sub issue {
|
||||
sub checkout {
|
||||
my ( $self ) = @_;
|
||||
return unless $self->issue_id ;
|
||||
|
||||
my $issue = Koha::Checkouts->find( $self->issue_id );
|
||||
$issue = Koha::Old::Checkouts->find( $self->issue_id ) unless $issue;
|
||||
return $issue;
|
||||
my $checkout = Koha::Checkouts->find( $self->issue_id );
|
||||
$checkout = Koha::Old::Checkouts->find( $self->issue_id ) unless $checkout;
|
||||
return $checkout;
|
||||
}
|
||||
|
||||
=head3 void
|
||||
|
|
|
|||
|
|
@ -80,13 +80,13 @@
|
|||
|
||||
<td>
|
||||
[% IF ( accountline.issue_id ) %]
|
||||
[% accountline.issue.date_due | $KohaDates as_due_date => 1 %]
|
||||
[% accountline.checkout.date_due | $KohaDates as_due_date => 1 %]
|
||||
[% END %]
|
||||
</td>
|
||||
|
||||
<td>
|
||||
[% IF ( accountline.issue_id ) %]
|
||||
[% accountline.issue.returndate | $KohaDates with_hours => 1 %]
|
||||
[% accountline.checkout.returndate | $KohaDates with_hours => 1 %]
|
||||
[% END %]
|
||||
</td>
|
||||
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@
|
|||
[%- IF account.description %], [% account.description | html %][% END %]
|
||||
[% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.item.biblionumber | uri %]&itemnumber=[% account.itemnumber | uri %]">[% account.item.biblio.title | html %]</a>[% END %]</td>
|
||||
<td>[% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% account.itemnumber | uri %]&biblionumber=[% account.item.biblionumber | uri %]#item[% account.itemnumber | uri %]">[% account.item.barcode | html %]</a>[% END %]</td>
|
||||
<td>[% IF ( account.issue_id ) %][% account.issue.date_due | $KohaDates as_due_date => 1 %][% END %]</td>
|
||||
<td>[% IF ( account.issue_id ) %][% account.issue.returndate | $KohaDates with_hours => 1 %][% END %]</td>
|
||||
<td>[% IF ( account.issue_id ) %][% account.checkout.date_due | $KohaDates as_due_date => 1 %][% END %]</td>
|
||||
<td>[% IF ( account.issue_id ) %][% account.checkout.returndate | $KohaDates with_hours => 1 %][% END %]</td>
|
||||
<td>[% IF account.itemnumber %][% Branches.GetName( account.item.homebranch ) | html %][% END %]</td>
|
||||
<td>[% account.note | html_line_break %]</td>
|
||||
[% IF account.amount <= 0 %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amount | $Price %]</td>
|
||||
|
|
|
|||
|
|
@ -117,12 +117,12 @@
|
|||
</td>
|
||||
<td>
|
||||
[% IF line.issue_id %]
|
||||
[% line.issue.date_due | $KohaDates as_due_date => 1 %]
|
||||
[% line.checkout.date_due | $KohaDates as_due_date => 1 %]
|
||||
[% END %]
|
||||
</td>
|
||||
<td>
|
||||
[% IF line.issue_id %]
|
||||
[% line.issue.returndate | $KohaDates with_hours => 1 %]
|
||||
[% line.checkout.returndate | $KohaDates with_hours => 1 %]
|
||||
[% END %]
|
||||
</td>
|
||||
<td class="actions">
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@
|
|||
[%- IF account.description %], [% account.description | html %][% END %]
|
||||
</td>
|
||||
<td>[% account.item.barcode | html %]</td>
|
||||
<td>[% account.issue.date_due | $KohaDates as_due_date => 1 %]</td>
|
||||
<td>[% account.issue.returndate | $KohaDates with_hours => 1 %]</td>
|
||||
<td>[% account.checkout.date_due | $KohaDates as_due_date => 1 %]</td>
|
||||
<td>[% account.checkout.returndate | $KohaDates with_hours => 1 %]</td>
|
||||
<td>[% account.note | html %]</td>
|
||||
[% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount | $Price %]</td>
|
||||
[% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding | $Price %]</td>
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ my $total = $patron->account->balance;
|
|||
my $accountline_object = Koha::Account::Lines->find($accountlines_id);
|
||||
my $accountline = $accountline_object->unblessed;
|
||||
$accountline->{item} = $accountline_object->item || "" ;
|
||||
$accountline->{issue} = $accountline_object->issue || "";
|
||||
$accountline->{checkout} = $accountline_object->checkout || "";
|
||||
|
||||
my $totalcredit;
|
||||
if ( $total <= 0 ) {
|
||||
|
|
|
|||
|
|
@ -438,19 +438,19 @@ subtest 'issue() tests' => sub {
|
|||
amount => 10,
|
||||
})->store;
|
||||
|
||||
my $line_issue = $line->issue;
|
||||
is( ref($line_issue), 'Koha::Checkout', 'Result type is correct' );
|
||||
is( $line_issue->issue_id, $checkout->issue_id, 'Koha::Account::Line->issue should return the correct issue');
|
||||
my $line_checkout = $line->checkout;
|
||||
is( ref($line_checkout), 'Koha::Checkout', 'Result type is correct' );
|
||||
is( $line_checkout->issue_id, $checkout->issue_id, 'Koha::Account::Line->issue should return the correct issue');
|
||||
|
||||
my ( $returned, undef, $old_checkout) = C4::Circulation::AddReturn( $item->{barcode} ,$library->{branchcode} );
|
||||
is( $returned, 1, 'The item should have been returned' );
|
||||
|
||||
my $old_line_issue = $line->issue;
|
||||
is( ref($old_line_issue), 'Koha::Old::Checkout', 'Result type is correct' );
|
||||
is( $old_line_issue->issue_id, $old_checkout->issue_id, 'Koha::Account::Line->issue should return the correct old_issue' );
|
||||
my $old_line_checkout = $line->checkout;
|
||||
is( ref($old_line_checkout), 'Koha::Old::Checkout', 'Result type is correct' );
|
||||
is( $old_line_checkout->issue_id, $old_checkout->issue_id, 'Koha::Account::Line->issue should return the correct old_issue' );
|
||||
|
||||
$line->issue_id(undef)->store;
|
||||
is( $line->issue, undef, 'Koha::Account::Line->issue should return undef if no issue linked' );
|
||||
is( $line->checkout, undef, 'Koha::Account::Line->issue should return undef if no issue linked' );
|
||||
|
||||
$schema->storage->txn_rollback;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue