Merge branch 'bug_9953' into 3.12-master
[koha.git] / members / pay.pl
index 8f5233c..4b918ae 100755 (executable)
@@ -83,11 +83,11 @@ my $writeoff_all = $input->param('woall');    # writeoff all fines
 if ($writeoff_all) {
     writeoff_all(@names);
 } elsif ($writeoff_item) {
-    my $accountno    = $input->param('accountno');
+    my $accountlines_id = $input->param('accountlines_id');
     my $itemno       = $input->param('itemnumber');
     my $account_type = $input->param('accounttype');
     my $amount       = $input->param('amountoutstanding');
-    WriteOffFee( $borrowernumber, $accountno, $itemno, $account_type, $amount, $branch );
+    WriteOffFee( $borrowernumber, $accountlines_id, $itemno, $account_type, $amount );
 }
 
 for (@names) {
@@ -106,7 +106,6 @@ add_accounts_to_template();
 
 output_html_with_http_headers $input, $cookie, $template->output;
 
-
 sub add_accounts_to_template {
 
     my ( $total, undef, undef ) = GetMemberAccountRecords($borrowernumber);
@@ -167,6 +166,7 @@ sub redirect_to_paycollect {
     $redirect .= get_for_redirect( 'itemnumber',   "itemnumber$line_no",   0 );
     $redirect .= get_for_redirect( 'notify_id',    "notify_id$line_no",    0 );
     $redirect .= get_for_redirect( 'notify_level', "notify_level$line_no", 0 );
+    $redirect .= get_for_redirect( 'accountlines_id', "accountlines_id$line_no", 0 );
     $redirect .= '&remote_user=';
     $redirect .= $user;
     return print $input->redirect($redirect);
@@ -184,7 +184,8 @@ sub writeoff_all {
             my $itemno    = $input->param("itemnumber$value");
             my $amount    = $input->param("amountoutstanding$value");
             my $accountno = $input->param("accountno$value");
-            WriteOffFee( $borrowernumber, $accountno, $itemno, $accounttype, $amount, $branch );
+            my $accountlines_id = $input->param("accountlines_id$value");
+            WriteOffFee( $borrowernumber, $accountlines_id, $itemno, $accounttype, $amount );
         }
     }