Bugzilla – Attachment 72024 Details for
Bug 2696
Fine payments should show what was paid for
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 2696 - Fine Payments Should Show What Was Paid For
Bug-2696---Fine-Payments-Should-Show-What-Was-Paid.patch (text/plain), 5.35 KB, created by
Kyle M Hall (khall)
on 2018-02-21 15:03:40 UTC
(
hide
)
Description:
Bug 2696 - Fine Payments Should Show What Was Paid For
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-02-21 15:03:40 UTC
Size:
5.35 KB
patch
obsolete
>From 243cab0f1841c83ac5ad45450796e8a0ba2f34c5 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 21 Dec 2017 14:15:52 +0000 >Subject: [PATCH] Bug 2696 - Fine Payments Should Show What Was Paid For > >Test Plan: >1) Apply this patch and its' dependencies >2) Create and pay some various fees and fines >3) View the payments for fees, and fees paid by payments by > using the new 'Details' button available on boraccount.pl > >Signed-off-by: Lee Jamison <ldjamison@marywood.edu> >Running updatedatabase.pl after patch application makes dependencies >happy. Passes QA Tools and works as intended. > >Rebased (2017-12-21): Alex Arnaud <alex.arnaud@biblibre.com> >--- > Koha/Account/Offset.pm | 23 +++++++++++++++++++ > .../prog/en/modules/members/boraccount.tt | 26 ++-------------------- > t/db_dependent/Accounts.t | 8 ++++++- > 3 files changed, 32 insertions(+), 25 deletions(-) > >diff --git a/Koha/Account/Offset.pm b/Koha/Account/Offset.pm >index b411653..3110d6a 100644 >--- a/Koha/Account/Offset.pm >+++ b/Koha/Account/Offset.pm >@@ -20,6 +20,7 @@ use Modern::Perl; > use Carp; > > use Koha::Database; >+use Koha::Account::Line; > > use base qw(Koha::Object); > >@@ -35,6 +36,28 @@ Account offsets are used to track the changes in account lines > > =cut > >+=head3 debit >+ >+=cut >+ >+sub debit { >+ my ( $self ) = @_; >+ my $debit_rs = $self->_result->debit; >+ return unless $debit_rs; >+ return Koha::Account::Line->_new_from_dbic( $debit_rs ); >+} >+ >+=head3 credit >+ >+=cut >+ >+sub credit { >+ my ( $self ) = @_; >+ my $credit_rs = $self->_result->credit; >+ return unless $credit_rs; >+ return Koha::Account::Line->_new_from_dbic( $credit_rs ); >+} >+ > =head3 _type > > =cut >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 ceb503e..d719e1c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -55,30 +55,7 @@ > <tr> > <td><span title="[% account.date %]">[% account.date |$KohaDates %]</span></td> > <td> >- [% SWITCH account.accounttype %] >- [% CASE 'Pay' %]Payment, thanks >- [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) >- [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) >- [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) >- [% CASE 'VOID' %]Payment, Voided >- [% CASE 'N' %]New card >- [% CASE 'F' %]Fine >- [% CASE 'A' %]Account management fee >- [% CASE 'M' %]Sundry >- [% CASE 'L' %]Lost item >- [% CASE 'W' %]Writeoff >- [% CASE 'FU' %]Accruing fine >- [% CASE 'HE' %]Hold waiting too long >- [% CASE 'Rent' %]Rental fee >- [% CASE 'FOR' %]Forgiven >- [% CASE 'LR' %]Lost item fee refund >- [% CASE 'PF' %]Processing fee >- [% CASE 'PAY' %]Payment >- [% CASE 'WO' %]Writeoff >- [% CASE 'C' %]Credit >- [% CASE 'CR' %]Credit >- [% CASE %][% account.accounttype %] >- [%- END -%] >+ [% INCLUDE 'accounttype.inc' accountline => account %] > [%- IF account.payment_type %], [% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) %][% END %] > [%- IF account.description %], [% account.description %][% END %] > [% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&itemnumber=[% account.itemnumber %]">[% account.title |html %]</a>[% END %]</td> >@@ -91,6 +68,7 @@ > [% ELSE %] > <a target="_blank" href="printinvoice.pl?action=print&accountlines_id=[% account.accountlines_id %]&borrowernumber=[% account.borrowernumber %]" class="btn btn-default btn-xs"><i class="fa fa-print"></i> Print</a> > [% END %] >+ <a href="accountline-details.pl?accountlines_id=[% account.accountlines_id %]" class="btn btn-default btn-xs"><i class="fa fa-list"></i> Details</a> > [% IF ( reverse_col) %] > [% IF ( account.payment ) %] > <a href="boraccount.pl?action=reverse&accountlines_id=[% account.accountlines_id %]&borrowernumber=[% account.borrowernumber %]" class="btn btn-default btn-xs"><i class="fa fa-undo"></i> Reverse</a> >diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t >index 2ce9474..29611cd 100644 >--- a/t/db_dependent/Accounts.t >+++ b/t/db_dependent/Accounts.t >@@ -632,7 +632,7 @@ subtest "Koha::Account::chargelostitem tests" => sub { > > subtest "Koha::Account::Line::void tests" => sub { > >- plan tests => 12; >+ plan tests => 14; > > # Create a borrower > my $categorycode = $builder->build({ source => 'Category' })->{ categorycode }; >@@ -662,6 +662,12 @@ subtest "Koha::Account::Line::void tests" => sub { > amount => 30, > } > ); >+ >+ # Test debit and credit methods fo Koha::Account::Offset >+ my $account_offset = Koha::Account::Offsets->find( { credit_id => $id, debit_id => $line1->id } ); >+ is( $account_offset->debit->id, $line1->id, "Koha::Account::Offset->debit gets correct accountline" ); >+ is( $account_offset->credit->id, $id, "Koha::Account::Offset->credit gets correct accountline" ); >+ > my $account_payment = Koha::Account::Lines->find( $id ); > > is( $account->balance(), "0.000000", "Account balance is 0" ); >-- >2.10.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 2696
:
800
|
3069
|
9583
|
64287
|
64293
|
64342
|
64345
|
64346
|
64350
|
67479
|
70031
|
72024
|
72088
|
72263
|
74672
|
74673
|
74674
|
74765
|
74817