From 6338bf19a861df01f38b11eb35361760909583ab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nazl=C4=B1=20=C3=87etin?= Date: Mon, 18 Feb 2019 09:50:10 +0000 Subject: [PATCH] Bug 19489: Detailed Description of charges in Patron accounting Signed-off-by: Josef Moravec Signed-off-by: Kyle M Hall Signed-off-by: Nick Clemens --- admin/columns_settings.yml | 12 +++++++++ .../en/modules/members/accountline-details.tt | 21 +++++++++++++++ .../prog/en/modules/members/boraccount.tt | 8 +++++- .../prog/en/modules/members/pay.tt | 27 ++++++++++++++++--- .../prog/en/modules/members/printinvoice.tt | 22 +++++++++------ members/pay.pl | 8 +----- members/printinvoice.pl | 5 +++- 7 files changed, 82 insertions(+), 21 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 6bc5c5502c..296103de45 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -357,6 +357,12 @@ modules: columnname: date - columnname: description + - + columnname: barcode + - + columnname: date_due + - + columnname: returndate - columnname: note - @@ -386,6 +392,12 @@ modules: columnname: description - columnname: date + - + columnname: barcode + - + columnname: date_due + - + columnname: returndate - columnname: note - 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 1e9855bbc2..b777370169 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 @@ -42,6 +42,9 @@ Date Description of charges + Barcode + Due date + Return date Note Amount Outstanding @@ -69,6 +72,24 @@ [% END %] + + [% IF ( accountline.itemnumber ) %] + [% accountline.item.barcode | html %] + [% END %] + + + + [% IF ( accountline.issue_id ) %] + [% accountline.issue.date_due | $KohaDates as_due_date => 1 %] + [% END %] + + + + [% IF ( accountline.issue_id ) %] + [% accountline.issue.returndate | $KohaDates with_hours => 1 %] + [% 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 bd54ec7260..8da829335c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -45,6 +45,9 @@ Date Description of charges + Barcode + Due date + Return date Home library Note Amount @@ -63,6 +66,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 as_due_date => 1 %][% END %] + [% IF ( account.issue_id ) %][% account.issue.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 %] @@ -83,7 +89,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 08350abe2b..354bab0fef 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -46,6 +46,9 @@ Actions Description Date + Barcode + Due date + Return date Payment note Account type Amount @@ -70,6 +73,7 @@ [% END %] + @@ -101,11 +105,26 @@ [% CASE %][% line.accounttype | html %] [%- END -%] [%- IF line.description %], [% line.description | html %][% END %] - [% IF line.title %]([% line.title | html %])[% END %] + [% IF line.itemnumber %]([% line.item.biblio.title | html %])[% END %] [% line.date | $KohaDates %] + + [% IF line.itemnumber %] + [% line.item.barcode | html %] + [% END %] + + + [% IF line.issue_id %] + [% line.issue.date_due | $KohaDates as_due_date => 1 %] + [% END %] + + + [% IF line.issue_id %] + [% line.issue.returndate | $KohaDates with_hours => 1 %] + [% END %] + Add note @@ -120,18 +139,18 @@ [% IF outstanding_credits.total_outstanding < 0 %] - Outstanding credits could be applied: + Outstanding credits could be applied: [% END %] [% IF ( account_grp.total ) %] - Sub total: + Sub total: [% account_grp.total | $Price %] [% END %] - Total due: + Total due: [% IF outstanding_credits.total_outstanding < 0 %] [% total + outstanding_credits.total_outstanding | $Price %] [% ELSE %] 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 a28ac03e34..27fc620713 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt @@ -21,23 +21,23 @@ [% IF ( LibraryName ) %] - [% END %] - + - - @@ -45,6 +45,9 @@ + + + @@ -57,6 +60,9 @@ [% PROCESS account_type_description account=account %] [%- IF account.description %], [% account.description | html %][% END %] + + + [% IF ( account.amountcredit ) %] [% IF ( account.amountoutstandingcredit ) %] @@ -65,7 +71,7 @@ [% END %] - + [% IF ( totalcredit ) %] diff --git a/members/pay.pl b/members/pay.pl index 848141906e..e33c12c9ed 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -147,13 +147,6 @@ sub add_accounts_to_template { my $total = $account_lines->total_outstanding; my @accounts; while ( my $account_line = $account_lines->next ) { - $account_line = $account_line->unblessed; - if ( $account_line->{itemnumber} ) { - my $item = Koha::Items->find( $account_line->{itemnumber} ); - my $biblio = $item->biblio; - $account_line->{biblionumber} = $biblio->biblionumber; - $account_line->{title} = $biblio->title; - } push @accounts, $account_line; } borrower_add_additional_fields($patron); @@ -198,6 +191,7 @@ sub redirect_to_paycollect { $redirect .= get_for_redirect( 'amountoutstanding', "amountoutstanding$line_no", 1 ); $redirect .= get_for_redirect( 'description', "description$line_no", 0 ); + $redirect .= get_for_redirect( 'issue_id', "issue_id$line_no", 0 ); $redirect .= get_for_redirect( 'title', "title$line_no", 0 ); $redirect .= get_for_redirect( 'itemnumber', "itemnumber$line_no", 0 ); $redirect .= get_for_redirect( 'accountlines_id', "accountlines_id$line_no", 0 ); diff --git a/members/printinvoice.pl b/members/printinvoice.pl index a6d92f7e3a..49e777ef77 100755 --- a/members/printinvoice.pl +++ b/members/printinvoice.pl @@ -55,7 +55,10 @@ output_and_exit_if_error( $input, $cookie, $template, { module => 'members', log #get account details my $total = $patron->account->balance; -my $accountline = Koha::Account::Lines->find($accountlines_id)->unblessed; +my $accountline_object = Koha::Account::Lines->find($accountlines_id); +my $accountline = $accountline_object->unblessed; +$accountline->{item} = $accountline_object->item || "" ; +$accountline->{issue} = $accountline_object->issue || ""; my $totalcredit; if ( $total <= 0 ) { -- 2.39.5
-

[% LibraryName | html %]

+
+

[% LibraryName | html %]

-

INVOICE

-
+

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.item.barcode | html %][% account.issue.date_due | $KohaDates as_due_date => 1 %][% account.issue.returndate | $KohaDates with_hours => 1 %] [% 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 %]