From b8f4ef37fc630502a45b5ec5d67d2901187a0584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nazl=C4=B1=20=C3=87etin?= Date: Tue, 19 Feb 2019 12:45:56 +0000 Subject: [PATCH] Bug 19489: Change method name issue --> checkout Signed-off-by: Josef Moravec --- Koha/Account/Line.pm | 12 ++++++------ .../prog/en/modules/members/accountline-details.tt | 4 ++-- .../intranet-tmpl/prog/en/modules/members/boraccount.tt | 4 ++-- koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt | 4 ++-- .../intranet-tmpl/prog/en/modules/members/printinvoice.tt | 4 ++-- members/printinvoice.pl | 2 +- t/db_dependent/Koha/Account/Lines.t | 14 +++++++------- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm index cf7e595..e5b8d6c 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt index b777370..c98dbb8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt @@ -80,13 +80,13 @@ [% IF ( accountline.issue_id ) %] - [% accountline.issue.date_due | $KohaDates as_due_date => 1 %] + [% accountline.checkout.date_due | $KohaDates as_due_date => 1 %] [% END %] [% IF ( accountline.issue_id ) %] - [% accountline.issue.returndate | $KohaDates with_hours => 1 %] + [% accountline.checkout.returndate | $KohaDates with_hours => 1 %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt index 8da8293..22b796e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -67,8 +67,8 @@ [%- IF account.description %], [% account.description | html %][% END %]  [% IF ( account.itemnumber ) %][% account.item.biblio.title | html %][% END %] [% IF ( account.itemnumber ) %][% account.item.barcode | html %][% END %] - [% IF ( account.issue_id ) %][% account.issue.date_due | $KohaDates as_due_date => 1 %][% END %] - [% IF ( account.issue_id ) %][% account.issue.returndate | $KohaDates with_hours => 1 %][% END %] + [% IF ( account.issue_id ) %][% account.checkout.date_due | $KohaDates as_due_date => 1 %][% END %] + [% IF ( account.issue_id ) %][% account.checkout.returndate | $KohaDates with_hours => 1 %][% END %] [% IF account.itemnumber %][% Branches.GetName( account.item.homebranch ) | html %][% END %] [% account.note | html_line_break %] [% IF account.amount <= 0 %][% ELSE %][% END %][% account.amount | $Price %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt index 354bab0..1a67ca3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -117,12 +117,12 @@ [% IF line.issue_id %] - [% line.issue.date_due | $KohaDates as_due_date => 1 %] + [% line.checkout.date_due | $KohaDates as_due_date => 1 %] [% END %] [% IF line.issue_id %] - [% line.issue.returndate | $KohaDates with_hours => 1 %] + [% line.checkout.returndate | $KohaDates with_hours => 1 %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt index 27fc620..65d21b3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt @@ -61,8 +61,8 @@ [%- IF account.description %], [% account.description | html %][% END %] [% account.item.barcode | html %] - [% account.issue.date_due | $KohaDates as_due_date => 1 %] - [% account.issue.returndate | $KohaDates with_hours => 1 %] + [% account.checkout.date_due | $KohaDates as_due_date => 1 %] + [% account.checkout.returndate | $KohaDates with_hours => 1 %] [% account.note | html %] [% IF ( account.amountcredit ) %][% ELSE %][% END %][% account.amount | $Price %] [% IF ( account.amountoutstandingcredit ) %][% ELSE %][% END %][% account.amountoutstanding | $Price %] diff --git a/members/printinvoice.pl b/members/printinvoice.pl index 49e777e..f13b4f8 100755 --- a/members/printinvoice.pl +++ b/members/printinvoice.pl @@ -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 ) { diff --git a/t/db_dependent/Koha/Account/Lines.t b/t/db_dependent/Koha/Account/Lines.t index e00841c..222807e 100755 --- a/t/db_dependent/Koha/Account/Lines.t +++ b/t/db_dependent/Koha/Account/Lines.t @@ -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; }; -- 2.1.4