diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index 848e1a01173..6dc609041c8 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -47,6 +47,9 @@ $langs->loadLangs(array('companies', 'bills', 'banks', 'compta'));
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
+$cancel = GETPOST('cancel', 'alpha');
+$backtopage = GETPOST('backtopage', 'alpha');
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
$facid = GETPOST('facid', 'int');
$socid = GETPOST('socid', 'int');
@@ -110,6 +113,18 @@ $arrayfields = array();
* Actions
*/
+if ($cancel) {
+ if (!empty($backtopageforcancel)) {
+ header("Location: ".$backtopageforcancel);
+ exit;
+ } elseif (!empty($backtopage)) {
+ header("Location: ".$backtopage);
+ exit;
+ }
+ header("Location: ".DOL_URL_ROOT.'/fourn/facture/list.php');
+ exit;
+}
+
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
$search_ref = "";
$search_account = "";
@@ -779,7 +794,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '