diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index d307169dfcc..92d8f7b1c37 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -33,6 +33,9 @@ $langs->load("bills"); $langs->load("accountancy"); $action = GETPOST('action', 'alpha'); +$cancel = GETPOST('cancel', 'alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); + $codeventil = GETPOST('codeventil'); $id = GETPOST('id'); @@ -40,12 +43,15 @@ $id = GETPOST('id'); if ($user->societe_id > 0) accessforbidden(); + /* * Actions */ -if ($action == 'ventil' && $user->rights->accounting->bind->write) { - if (! GETPOST('cancel', 'alpha')) { +if ($action == 'ventil' && $user->rights->accounting->bind->write) +{ + if (! $cancel) + { if ($codeventil < 0) $codeventil = 0; $sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet"; @@ -59,6 +65,11 @@ if ($action == 'ventil' && $user->rights->accounting->bind->write) { else { setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); + if ($backtopage) + { + header("Location: ".$backtopage); + exit(); + } } } else { header("Location: ./lines.php"); @@ -109,6 +120,7 @@ if (! empty($id)) { print '