Bugzilla – Attachment 52153 Details for
Bug 15909
Remove the use of makepartialpayment
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15909 - Remove the use of makepartialpayment
Bug-15909---Remove-the-use-of-makepartialpayment.patch (text/plain), 3.90 KB, created by
Kyle M Hall (khall)
on 2016-06-07 15:13:00 UTC
(
hide
)
Description:
Bug 15909 - Remove the use of makepartialpayment
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-06-07 15:13:00 UTC
Size:
3.90 KB
patch
obsolete
>From 56fbff3af2c582205265d3df23dd5c432293084f Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 24 Feb 2016 16:34:23 +0000 >Subject: [PATCH] Bug 15909 - Remove the use of makepartialpayment > >Test Plan: >1) Apply this patch >2) prove t/db_dependent/Accounts.t >3) Test fine payment via the "Pay" button, > but make the payment for less then the full amount >--- > C4/Accounts.pm | 21 --------------------- > members/paycollect.pl | 15 ++++++++++++--- > t/db_dependent/Accounts.t | 12 ++++-------- > 3 files changed, 16 insertions(+), 32 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index 79a47a6..f20ea2f 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -43,7 +43,6 @@ BEGIN { > &getrefunds > &chargelostitem > &ReversePayment >- &makepartialpayment > &WriteOffFee > &purge_zero_balance_fees > ); >@@ -350,26 +349,6 @@ sub ReversePayment { > > } > >-sub makepartialpayment { >- my ( $accountlines_id, $borrowernumber, $accountno, $amount, $user, $branch, $payment_note ) = @_; >- >- my $line = Koha::Account::Lines->find( $accountlines_id ); >- >- return Koha::Account->new( >- { >- patron_id => $borrowernumber, >- } >- )->pay( >- { >- amount => $amount, >- lines => [ $line ], >- note => $payment_note, >- library_id => $branch, >- } >- ); >- >-} >- > =head2 WriteOffFee > > WriteOffFee( $borrowernumber, $accountline_id, $itemnum, $accounttype, $amount, $branch, $payment_note ); >diff --git a/members/paycollect.pl b/members/paycollect.pl >index 9dc8860..56751e9 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -119,9 +119,18 @@ if ( $total_paid and $total_paid ne '0.00' ) { > note => $payment_note > } > ); >- } else { >- makepartialpayment( $accountlines_id, $borrowernumber, $accountno, $total_paid, >- $user, $branch, $payment_note ); >+ } >+ else { >+ my $line = Koha::Account::Lines->find($accountlines_id); >+ >+ Koha::Account->new( { patron_id => $borrowernumber, } )->pay( >+ { >+ amount => $total_paid, >+ lines => [$line], >+ note => $payment_note, >+ library_id => $branch, >+ } >+ ); > } > print $input->redirect( > "/cgi-bin/koha/members/pay.pl?borrowernumber=$borrowernumber"); >diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t >index cbd0eb8..c928a3b 100644 >--- a/t/db_dependent/Accounts.t >+++ b/t/db_dependent/Accounts.t >@@ -45,7 +45,6 @@ can_ok( 'C4::Accounts', > getcredits > getrefunds > ReversePayment >- makepartialpayment > WriteOffFee > purge_zero_balance_fees ) > ); >@@ -303,7 +302,7 @@ subtest "More Koha::Account::pay tests" => sub { > } > }; > >-subtest "makepartialpayment() tests" => sub { >+subtest "Even more Koha::Account::pay tests" => sub { > > plan tests => 6; > >@@ -331,13 +330,10 @@ subtest "makepartialpayment() tests" => sub { > > is( $rs->count(), 1, 'Accountline created' ); > >+ my $account = Koha::Account->new( { patron_id => $borrowernumber } ); >+ my $line = Koha::Account::Lines->find( $accountline->{ accountlines_id } ); > # make the full payment >- makepartialpayment( >- $accountline->{ accountlines_id }, $borrowernumber, >- $accountline->{ accountno }, $partialamount, >- $borrowernumber, $branch, 'A payment note' ); >- >- # TODO: someone should write actual tests for makepartialpayment() >+ $account->pay({ lines => [$line], amount => $partialamount, library_id => $branch, note => 'A payment note' }); > > my $stat = $schema->resultset('Statistic')->search({ > branch => $branch, >-- >1.7.10.4
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 15909
:
48353
|
52133
|
52153
|
58751
|
58753
|
58756
|
58766