Lines 55-65
my $patron = Koha::Patrons->find( $borrowernumber );
Link Here
|
55 |
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); |
55 |
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); |
56 |
|
56 |
|
57 |
my $borrower = $patron->unblessed; |
57 |
my $borrower = $patron->unblessed; |
|
|
58 |
my $account = $patron->account; |
58 |
my $category = $patron->category; |
59 |
my $category = $patron->category; |
59 |
my $user = $input->remote_user; |
60 |
my $user = $input->remote_user; |
60 |
|
61 |
|
61 |
my $branch = C4::Context->userenv->{'branch'}; |
62 |
my $library_id = C4::Context->userenv->{'branch'}; |
62 |
my $total_due = $patron->account->outstanding_debits->total_outstanding; |
63 |
my $total_due = $account->outstanding_debits->total_outstanding; |
63 |
|
64 |
|
64 |
my $total_paid = $input->param('paid'); |
65 |
my $total_paid = $input->param('paid'); |
65 |
|
66 |
|
Lines 120-130
if ( $total_paid and $total_paid ne '0.00' ) {
Link Here
|
120 |
|
121 |
|
121 |
if ($individual) { |
122 |
if ($individual) { |
122 |
my $line = Koha::Account::Lines->find($accountlines_id); |
123 |
my $line = Koha::Account::Lines->find($accountlines_id); |
123 |
Koha::Account->new( { patron_id => $borrowernumber } )->pay( |
124 |
$account->pay( |
124 |
{ |
125 |
{ |
125 |
lines => [$line], |
126 |
lines => [$line], |
126 |
amount => $total_paid, |
127 |
amount => $total_paid, |
127 |
library_id => $branch, |
128 |
library_id => $library_id, |
128 |
note => $payment_note, |
129 |
note => $payment_note, |
129 |
payment_type => $payment_type, |
130 |
payment_type => $payment_type, |
130 |
} |
131 |
} |
Lines 148-162
if ( $total_paid and $total_paid ne '0.00' ) {
Link Here
|
148 |
{ order_by => 'date' } |
149 |
{ order_by => 'date' } |
149 |
); |
150 |
); |
150 |
|
151 |
|
151 |
Koha::Account->new( |
152 |
$account->pay( |
152 |
{ |
|
|
153 |
patron_id => $borrowernumber, |
154 |
} |
155 |
)->pay( |
156 |
{ |
153 |
{ |
157 |
type => $type, |
154 |
type => $type, |
158 |
amount => $total_paid, |
155 |
amount => $total_paid, |
159 |
library_id => $branch, |
156 |
library_id => $library_id, |
160 |
lines => \@lines, |
157 |
lines => \@lines, |
161 |
note => $note, |
158 |
note => $note, |
162 |
payment_type => $payment_type, |
159 |
payment_type => $payment_type, |
Lines 165-174
if ( $total_paid and $total_paid ne '0.00' ) {
Link Here
|
165 |
} |
162 |
} |
166 |
else { |
163 |
else { |
167 |
my $note = $input->param('selected_accts_notes'); |
164 |
my $note = $input->param('selected_accts_notes'); |
168 |
Koha::Account->new( { patron_id => $borrowernumber } )->pay( |
165 |
$account->pay( |
169 |
{ |
166 |
{ |
170 |
amount => $total_paid, |
167 |
amount => $total_paid, |
171 |
library_id => $branch, |
168 |
library_id => $library_id, |
172 |
note => $note, |
169 |
note => $note, |
173 |
payment_type => $payment_type, |
170 |
payment_type => $payment_type, |
174 |
} |
171 |
} |
175 |
- |
|
|