From 76702184b8e5c4626b06f6375ff273002674a436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nazl=C4=B1=20=C3=87etin?= Date: Mon, 5 Nov 2018 14:05:45 +0000 Subject: [PATCH] Bug 19489 - Development for fines and Fees Module - Detailed Description of charges in Patron Account Tab/Fines Tab --- admin/columns_settings.yml | 6 ++++++ .../prog/en/modules/members/accountline-details.tt | 13 ++++++++++++- .../intranet-tmpl/prog/en/modules/members/boraccount.tt | 8 +++++++- koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt | 12 +++++++++++- .../prog/en/modules/members/printinvoice.tt | 16 +++++++++++----- members/accountline-details.pl | 12 +++++++++++- members/boraccount.pl | 6 ++++++ members/pay.pl | 10 ++++++++++ members/printinvoice.pl | 11 +++++++++++ 9 files changed, 85 insertions(+), 9 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 14800190c3..81b72104d1 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -264,6 +264,12 @@ modules: - columnname: description - + columnname: barcode + - + columnname: date_due + - + columnname: returndate + - columnname: note - columnname: amount 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 dc5ad32a74..9a20a57fd7 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 @@ -29,6 +29,9 @@ Date Description of charges + Barcode + Due date + Return date Note Amount Outstanding @@ -55,7 +58,15 @@ [% biblio.title | html %] [% END %] - + + [% IF ( accountline.itemnumber ) %][% accountline.item.barcode | html %][% END %] + + + [% IF ( accountline.issue_id ) %][% issue.date_due | $KohaDates with_hours => 1 | html %][% END %] + + + [% IF ( accountline.issue_id ) %][% issue.returndate | $KohaDates with_hours => 1 | html %][% END %] + [% accountline.note | html_line_break %] 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 44015bb14c..66d3edbeeb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -43,6 +43,9 @@ Date Description of charges + Barcode + Due date + Return date Home library Note Amount @@ -65,6 +68,9 @@ [%- IF account.payment_type %], [% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) | html %][% END %] [%- 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 with_hours => 1 | html %][% END %] + [% IF ( account.issue_id ) %][% account.issue.returndate | $KohaDates with_hours => 1 | html %][% END %] [% IF account.itemnumber %][% Branches.GetName( account.item.homebranch ) | html %][% END %] [% account.note | html_line_break %] [% IF ( account.amountcredit ) %][% ELSE %][% END %][% account.amount | $Price %] @@ -94,7 +100,7 @@ [% END %] - Total due + Total due [% IF ( totalcredit ) %] [% total | $Price %] [% ELSE %] 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 cb49492a94..cca7b3d042 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -1,6 +1,7 @@ [% USE raw %] [% USE Asset %] [% USE Koha %] +[% USE KohaDates %] [% USE AuthorisedValues %] [% USE Branches %] [% USE Price %] @@ -43,6 +44,9 @@   Fines & charges Description + Barcode + Due date + Return date Payment note Account type Amount @@ -51,7 +55,7 @@ - Total due: + Total due: [% total | $Price %] @@ -70,6 +74,9 @@ [% END %] + + + @@ -103,6 +110,9 @@ [%- IF line.description %], [% line.description | html %][% END %] [% IF line.title %]([% line.title | html %])[% END %] + [% IF line.itemnumber %][% line.barcode | html %][% END %] + [% IF line.issue_id %][% line.issue.date_due | $KohaDates with_hours => 1 | html %][% END %] + [% IF line.issue_id %][% line.issue.returndate | $KohaDates with_hours => 1 | html %][% END %] [% line.accounttype | html %] [% line.amount | $Price %] 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 33ae62cfdf..14cf2d79db 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt @@ -18,23 +18,23 @@ [% IF ( LibraryName ) %] - [% END %] - - - @@ -42,6 +42,9 @@ + + + @@ -54,6 +57,9 @@ [% INCLUDE 'accounttype.inc' account => account %] [%- IF account.description %], [% account.description | html %][% END %] + + + [% IF ( account.amountcredit ) %] [% IF ( account.amountoutstandingcredit ) %] @@ -62,7 +68,7 @@ [% END %] - + [% IF ( totalcredit ) %] diff --git a/members/accountline-details.pl b/members/accountline-details.pl index 1ac40a0210..c1d1fd4d8d 100755 --- a/members/accountline-details.pl +++ b/members/accountline-details.pl @@ -24,6 +24,8 @@ use C4::Auth; use C4::Output; use C4::Context; use Koha::Patrons; +use Koha::Checkouts; +use Koha::Old::Checkouts; use Koha::Account::Lines; my $input = new CGI; @@ -63,7 +65,15 @@ if ($accountline) { ); my $patron = Koha::Patrons->find( $accountline->borrowernumber ); - $template->param( patron => $patron ); + my $issues; + if ( $accountline->issue_id ) { + $issues = Koha::Checkouts->find($accountline->issue_id ); + $issues = Koha::Old::Checkouts->find($accountline->issue_id ) unless $issues; + } + $template->param( + patron => $patron, + issue => $issues, + ); } output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/boraccount.pl b/members/boraccount.pl index 582264a6fe..5073c11299 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -109,6 +109,12 @@ while ( my $line = $accts->next ) { # Because we will not have access to the object from the template $accountline->{item} = $line->item; } + + if ( $accountline->{issue_id} ) { + my $issues = Koha::Checkouts->find($accountline->{issue_id} ); + $issues = Koha::Old::Checkouts->find($accountline->{issue_id} ) unless $issues; + $accountline->{issue} = $issues; + } push @accountlines, $accountline; } diff --git a/members/pay.pl b/members/pay.pl index b2216aa511..f72314c70d 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -148,7 +148,14 @@ sub add_accounts_to_template { my $biblio = $item->biblio; $account_line->{biblionumber} = $biblio->biblionumber; $account_line->{title} = $biblio->title; + $account_line->{barcode} = $item->barcode; } + if ( $account_line->{issue_id} ) { + my $issues = Koha::Checkouts->find($account_line->{issue_id} ); + $issues = Koha::Old::Checkouts->find($account_line->{issue_id} ) unless $issues; + $account_line->{issue} = $issues; + } + push @accounts, $account_line; } borrower_add_additional_fields($patron); @@ -192,6 +199,9 @@ sub redirect_to_paycollect { get_for_redirect( 'amountoutstanding', "amountoutstanding$line_no", 1 ); $redirect .= get_for_redirect( 'description', "description$line_no", 0 ); $redirect .= get_for_redirect( 'title', "title$line_no", 0 ); + $redirect .= get_for_redirect( 'barcode', "barcode$line_no", 0 ); + $redirect .= get_for_redirect( 'date_due', "date_due$line_no", 0 ); + $redirect .= get_for_redirect( 'returndate', "returndate$line_no", 0 ); $redirect .= get_for_redirect( 'itemnumber', "itemnumber$line_no", 0 ); $redirect .= get_for_redirect( 'accountlines_id', "accountlines_id$line_no", 0 ); $redirect .= q{&} . 'payment_note' . q{=} . uri_escape_utf8( scalar $input->param("payment_note_$line_no") ); diff --git a/members/printinvoice.pl b/members/printinvoice.pl index a6d92f7e3a..10102df4de 100755 --- a/members/printinvoice.pl +++ b/members/printinvoice.pl @@ -57,6 +57,17 @@ output_and_exit_if_error( $input, $cookie, $template, { module => 'members', log my $total = $patron->account->balance; my $accountline = Koha::Account::Lines->find($accountlines_id)->unblessed; +if ( $accountline->{itemnumber} ) { + my $item = Koha::Items->find( $accountline->{itemnumber} ); + $accountline->{barcode} = $item->barcode; +} + +if ( $accountline->{issue_id} ) { + my $issues = Koha::Checkouts->find($accountline->{issue_id} ); + $issues = Koha::Old::Checkouts->find($accountline->{issue_id} ) unless $issues; + $accountline->{issue} = $issues; +} + my $totalcredit; if ( $total <= 0 ) { $totalcredit = 1; -- 2.11.0
+

[% LibraryName | html %]

+

INVOICE

+

[% Branches.GetName( patron.branchcode ) | html %]

+ Bill to: [% patron.firstname | html %] [% patron.surname | html %]
Card number: [% patron.cardnumber | html %]
Date Description of chargesBarcodeDue dateReturn date Note Amount Amount outstanding[% account.barcode | html %][% account.issue.date_due | $KohaDates with_hours => 1 | html %][% account.issue.returndate | $KohaDates with_hours => 1 | html %] [% account.note | html %][% ELSE %][% END %][% account.amount | $Price %][% ELSE %][% END %][% account.amountoutstanding | $Price %]
Total outstanding dues as on date: Total outstanding dues as on date: [% ELSE %][% END %][% total | $Price %]