Increment version for 3.12.0-beta3 release
[koha.git] / members / paycollect.pl
index cbddc05..9828fb3 100755 (executable)
@@ -56,7 +56,7 @@ my $writeoff     = $input->param('writeoff_individual');
 my $select_lines = $input->param('selected');
 my $select       = $input->param('selected_accts');
 my $accountno;
-
+my $accountlines_id;
 if ( $individual || $writeoff ) {
     if ($individual) {
         $template->param( pay_individual => 1 );
@@ -64,9 +64,11 @@ if ( $individual || $writeoff ) {
         $template->param( writeoff_individual => 1 );
     }
     my $accounttype       = $input->param('accounttype');
+    $accountlines_id       = $input->param('accountlines_id');
     my $amount            = $input->param('amount');
     my $amountoutstanding = $input->param('amountoutstanding');
     $accountno = $input->param('accountno');
+    my $itemnumber  = $input->param('itemnumber');
     my $description  = $input->param('description');
     my $title        = $input->param('title');
     my $notify_id    = $input->param('notify_id');
@@ -74,10 +76,12 @@ if ( $individual || $writeoff ) {
     $total_due = $amountoutstanding;
     $template->param(
         accounttype       => $accounttype,
+        accountlines_id    => $accountlines_id,
         accountno         => $accountno,
         amount            => $amount,
         amountoutstanding => $amountoutstanding,
         title             => $title,
+        itemnumber        => $itemnumber,
         description       => $description,
         notify_id         => $notify_id,
         notify_level      => $notify_level,
@@ -93,16 +97,16 @@ if ( $individual || $writeoff ) {
 if ( $total_paid and $total_paid ne '0.00' ) {
     if ( $total_paid < 0 or $total_paid > $total_due ) {
         $template->param(
-            error => sprintf( 'You must pay a value less than or equal to %f.2',
-                $total_due )
+            error_over => 1,
+            total_due => $total_due
         );
     } else {
         if ($individual) {
             if ( $total_paid == $total_due ) {
-                makepayment( $borrowernumber, $accountno, $total_paid, $user,
+                makepayment( $accountlines_id, $borrowernumber, $accountno, $total_paid, $user,
                     $branch );
             } else {
-                makepartialpayment( $borrowernumber, $accountno, $total_paid,
+                makepartialpayment( $accountlines_id, $borrowernumber, $accountno, $total_paid,
                     $user, $branch );
             }
             print $input->redirect(
@@ -133,11 +137,11 @@ if ( $total_paid and $total_paid ne '0.00' ) {
 borrower_add_additional_fields($borrower);
 
 $template->param(
-
- #borrowenumber  => $borrower->{borrowernumber}, # some templates require global
-    borrowenumber => $borrowernumber,    # some templates require global
+    borrowernumber => $borrowernumber,    # some templates require global
     borrower      => $borrower,
-    total         => $total_due
+    total         => $total_due,
+    activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
+    RoutingSerials => C4::Context->preference('RoutingSerials'),
 );
 
 output_html_with_http_headers $input, $cookie, $template->output;