|
Lines 17-37
Link Here
|
| 17 |
# You should have received a copy of the GNU General Public License |
17 |
# You should have received a copy of the GNU General Public License |
| 18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
| 19 |
|
19 |
|
| 20 |
use strict; |
20 |
use Modern::Perl; |
| 21 |
use warnings; |
21 |
|
| 22 |
use URI::Escape; |
22 |
use URI::Escape; |
|
|
23 |
use CGI qw ( -utf8 ); |
| 24 |
|
| 23 |
use C4::Context; |
25 |
use C4::Context; |
| 24 |
use C4::Auth; |
26 |
use C4::Auth; |
| 25 |
use C4::Output; |
27 |
use C4::Output; |
| 26 |
use CGI qw ( -utf8 ); |
|
|
| 27 |
use C4::Members; |
28 |
use C4::Members; |
| 28 |
use C4::Members::Attributes qw(GetBorrowerAttributes); |
29 |
use C4::Members::Attributes qw(GetBorrowerAttributes); |
| 29 |
use C4::Accounts; |
30 |
use C4::Accounts; |
| 30 |
use C4::Koha; |
31 |
use C4::Koha; |
|
|
32 |
|
| 31 |
use Koha::Patron::Images; |
33 |
use Koha::Patron::Images; |
| 32 |
use Koha::Account; |
34 |
use Koha::Account; |
| 33 |
|
|
|
| 34 |
use Koha::Patron::Categories; |
35 |
use Koha::Patron::Categories; |
|
|
36 |
use Koha::AuthorisedValues; |
| 35 |
|
37 |
|
| 36 |
my $input = CGI->new(); |
38 |
my $input = CGI->new(); |
| 37 |
|
39 |
|
|
Lines 61-66
my $writeoff = $input->param('writeoff_individual');
Link Here
|
| 61 |
my $select_lines = $input->param('selected'); |
63 |
my $select_lines = $input->param('selected'); |
| 62 |
my $select = $input->param('selected_accts'); |
64 |
my $select = $input->param('selected_accts'); |
| 63 |
my $payment_note = uri_unescape $input->param('payment_note'); |
65 |
my $payment_note = uri_unescape $input->param('payment_note'); |
|
|
66 |
my $payment_type = scalar $input->param('payment_type'); |
| 64 |
my $accountno; |
67 |
my $accountno; |
| 65 |
my $accountlines_id; |
68 |
my $accountlines_id; |
| 66 |
|
69 |
|
|
Lines 114-123
if ( $total_paid and $total_paid ne '0.00' ) {
Link Here
|
| 114 |
my $line = Koha::Account::Lines->find($accountlines_id); |
117 |
my $line = Koha::Account::Lines->find($accountlines_id); |
| 115 |
Koha::Account->new( { patron_id => $borrowernumber } )->pay( |
118 |
Koha::Account->new( { patron_id => $borrowernumber } )->pay( |
| 116 |
{ |
119 |
{ |
| 117 |
lines => [$line], |
120 |
lines => [$line], |
| 118 |
amount => $total_paid, |
121 |
amount => $total_paid, |
| 119 |
library_id => $branch, |
122 |
library_id => $branch, |
| 120 |
note => $payment_note |
123 |
note => $payment_note, |
|
|
124 |
payment_type => $payment_type, |
| 121 |
} |
125 |
} |
| 122 |
); |
126 |
); |
| 123 |
print $input->redirect( |
127 |
print $input->redirect( |
|
Lines 139-165
if ( $total_paid and $total_paid ne '0.00' ) {
Link Here
|
| 139 |
{ order_by => 'date' } |
143 |
{ order_by => 'date' } |
| 140 |
); |
144 |
); |
| 141 |
|
145 |
|
| 142 |
return Koha::Account->new( |
146 |
Koha::Account->new( |
| 143 |
{ |
147 |
{ |
| 144 |
patron_id => $borrowernumber, |
148 |
patron_id => $borrowernumber, |
| 145 |
} |
149 |
} |
| 146 |
)->pay( |
150 |
)->pay( |
| 147 |
{ |
151 |
{ |
| 148 |
amount => $total_paid, |
152 |
amount => $total_paid, |
| 149 |
lines => \@lines, |
153 |
lines => \@lines, |
| 150 |
note => $note, |
154 |
note => $note, |
|
|
155 |
payment_type => $payment_type, |
| 151 |
} |
156 |
} |
| 152 |
); |
157 |
); |
| 153 |
} |
158 |
} |
| 154 |
else { |
159 |
else { |
| 155 |
my $note = $input->param('selected_accts_notes'); |
160 |
my $note = $input->param('selected_accts_notes'); |
| 156 |
Koha::Account->new( { patron_id => $borrowernumber } ) |
161 |
Koha::Account->new( { patron_id => $borrowernumber } )->pay( |
| 157 |
->pay( { amount => $total_paid, note => $note } ); |
162 |
{ |
|
|
163 |
amount => $total_paid, |
| 164 |
note => $note, |
| 165 |
payment_type => $payment_type, |
| 166 |
} |
| 167 |
); |
| 158 |
} |
168 |
} |
| 159 |
|
169 |
|
| 160 |
print $input->redirect( |
170 |
print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber"); |
| 161 |
"/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber" |
|
|
| 162 |
); |
| 163 |
} |
171 |
} |
| 164 |
} |
172 |
} |
| 165 |
} else { |
173 |
} else { |