|
Lines 36-42
use Koha::Token;
Link Here
|
| 36 |
|
36 |
|
| 37 |
my $input = CGI->new(); |
37 |
my $input = CGI->new(); |
| 38 |
|
38 |
|
| 39 |
my $updatecharges_permissions = $input->param('writeoff_individual') ? 'writeoff' : 'remaining_permissions'; |
39 |
my $writeoff_individual = $input->param('writeoff_individual'); |
|
|
40 |
my $type = scalar $input->param('type') || 'payment'; |
| 41 |
|
| 42 |
my $updatecharges_permissions = ($writeoff_individual || $type eq 'writeoff') ? 'writeoff' : 'remaining_permissions'; |
| 40 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
43 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
| 41 |
{ template_name => 'members/paycollect.tt', |
44 |
{ template_name => 'members/paycollect.tt', |
| 42 |
query => $input, |
45 |
query => $input, |
|
Lines 62-80
my $total_due = $patron->account->outstanding_debits->total_outstanding;
Link Here
|
| 62 |
|
65 |
|
| 63 |
my $total_paid = $input->param('paid'); |
66 |
my $total_paid = $input->param('paid'); |
| 64 |
|
67 |
|
| 65 |
my $individual = $input->param('pay_individual'); |
|
|
| 66 |
my $writeoff = $input->param('writeoff_individual'); |
| 67 |
my $select_lines = $input->param('selected'); |
68 |
my $select_lines = $input->param('selected'); |
|
|
69 |
my $pay_individual = $input->param('pay_individual'); |
| 68 |
my $select = $input->param('selected_accts'); |
70 |
my $select = $input->param('selected_accts'); |
| 69 |
my $payment_note = uri_unescape scalar $input->param('payment_note'); |
71 |
my $payment_note = uri_unescape scalar $input->param('payment_note'); |
| 70 |
my $payment_type = scalar $input->param('payment_type'); |
72 |
my $payment_type = scalar $input->param('payment_type'); |
| 71 |
my $type = scalar $input->param('type') || 'payment', |
|
|
| 72 |
my $accountlines_id; |
73 |
my $accountlines_id; |
| 73 |
|
74 |
|
| 74 |
if ( $individual || $writeoff ) { |
75 |
if ( $pay_individual || $writeoff_individual ) { |
| 75 |
if ($individual) { |
76 |
if ($pay_individual) { |
| 76 |
$template->param( pay_individual => 1 ); |
77 |
$template->param( pay_individual => 1 ); |
| 77 |
} elsif ($writeoff) { |
78 |
} elsif ($writeoff_individual) { |
| 78 |
$template->param( writeoff_individual => 1 ); |
79 |
$template->param( writeoff_individual => 1 ); |
| 79 |
} |
80 |
} |
| 80 |
my $accounttype = $input->param('accounttype'); |
81 |
my $accounttype = $input->param('accounttype'); |
|
Lines 117-123
if ( $total_paid and $total_paid ne '0.00' ) {
Link Here
|
| 117 |
token => scalar $input->param('csrf_token'), |
118 |
token => scalar $input->param('csrf_token'), |
| 118 |
}); |
119 |
}); |
| 119 |
|
120 |
|
| 120 |
if ($individual) { |
121 |
if ($pay_individual) { |
| 121 |
my $line = Koha::Account::Lines->find($accountlines_id); |
122 |
my $line = Koha::Account::Lines->find($accountlines_id); |
| 122 |
Koha::Account->new( { patron_id => $borrowernumber } )->pay( |
123 |
Koha::Account->new( { patron_id => $borrowernumber } )->pay( |
| 123 |
{ |
124 |
{ |
| 124 |
- |
|
|