Bug 18033: Remove duplicate code in paycollect.pl
authorJosef Moravec <josef.moravec@gmail.com>
Wed, 1 Feb 2017 19:48:49 +0000 (20:48 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Tue, 7 Feb 2017 16:15:39 +0000 (16:15 +0000)
Test plan:
0) apply the patch
1) try to pay individual fee, with full amount and partial amount
   it should work the same as before patch

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
members/paycollect.pl

index a76f007..ac1c281 100755 (executable)
@@ -111,29 +111,15 @@ if ( $total_paid and $total_paid ne '0.00' ) {
         );
     } else {
         if ($individual) {
-            if ( $total_paid == $total_due ) {
-                my $line = Koha::Account::Lines->find($accountlines_id);
-                Koha::Account->new( { patron_id => $borrowernumber } )->pay(
-                    {
-                        lines      => [$line],
-                        amount     => $total_paid,
-                        library_id => $branch,
-                        note       => $payment_note
-                    }
-                );
-            }
-            else {
-                my $line = Koha::Account::Lines->find($accountlines_id);
-
-                Koha::Account->new( { patron_id => $borrowernumber, } )->pay(
-                    {
-                        amount     => $total_paid,
-                        lines      => [$line],
-                        note       => $payment_note,
-                        library_id => $branch,
-                    }
-                );
-            }
+            my $line = Koha::Account::Lines->find($accountlines_id);
+            Koha::Account->new( { patron_id => $borrowernumber } )->pay(
+                {
+                    lines      => [$line],
+                    amount     => $total_paid,
+                    library_id => $branch,
+                    note       => $payment_note
+                }
+            );
             print $input->redirect(
                 "/cgi-bin/koha/members/pay.pl?borrowernumber=$borrowernumber");
         } else {