Bug 14898: Add button at manual invoice to redirect to pay tab
authorJulian Maurice <julian.maurice@biblibre.com>
Wed, 5 Feb 2020 14:07:23 +0000 (15:07 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 20 Feb 2020 09:04:27 +0000 (09:04 +0000)
Test plan:
1. Create manual invoice for any patron and click on "Save", you should
   be redirected to Account tab
2. Create manual invoice for any patron and click on "Save and pay", you
   should be redirected to Account tab

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt
members/maninvoice.pl

index 9713cfc..864429e 100644 (file)
@@ -61,7 +61,9 @@
             </ol>
                     </fieldset>
                     <fieldset class="action">
-                        <input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
+                        <button type="submit" name="add" value="save">Save</button>
+                        <button type="submit" name="add" value="save and pay">Save and pay</button>
+                        <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
                     </fieldset>
                 </form>
 
index f271d1f..c39a323 100755 (executable)
@@ -105,9 +105,16 @@ if ($add) {
             $patron->account->reconcile_balance;
         }
 
-        print $input->redirect(
-            "/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber"
-        );
+        if ($add eq 'save and pay') {
+            print $input->redirect(
+                "/cgi-bin/koha/members/pay.pl?borrowernumber=$borrowernumber"
+            );
+        } else {
+            print $input->redirect(
+                "/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber"
+            );
+        }
+
         exit;
     }
 }