From b4c1cfa5bd46acddf06ca826ccb7d55feadc17dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Sep 2011 21:50:41 +0000 Subject: [PATCH] New: Add direct link to discount on invoice creation page --- htdocs/comm/remise.php | 26 ++++++++++++++++++++++---- htdocs/comm/remx.php | 2 +- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index 20ae7061a33..e51a1b6833f 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -19,7 +19,7 @@ /** * \file htdocs/comm/remise.php * \ingroup societe - * \brief Onglet remise de la societe + * \brief Page to edit relative discount of a customer */ require("../main.inc.php"); @@ -30,7 +30,7 @@ $langs->load("companies"); $langs->load("orders"); $langs->load("bills"); -$_socid = $_GET["id"]; +$_socid = GETPOST("id"); // Security check if ($user->societe_id > 0) { @@ -38,7 +38,17 @@ if ($user->societe_id > 0) } -if ($_POST["action"] == 'setremise') +/* + * Actions + */ + +if (GETPOST('cancel') && GETPOST('backtopage')) +{ + Header("Location: ".GETPOST("backtopage")); + exit; +} + +if (GETPOST("action") == 'setremise') { $soc = New Societe($db); $soc->fetch($_GET["id"]); @@ -110,6 +120,7 @@ if ($_socid > 0) print '
'; print ''; print ''; + print ''; print ''; @@ -123,7 +134,14 @@ if ($_socid > 0) print "
"; - print '
'; + print '
'; + print ''; + if (GETPOST("backtopage")) + { + print '    '; + print ''; + } + print '
'; print "
"; diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 5893dcd16d3..811bf19b42a 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -33,7 +33,7 @@ $langs->load("bills"); $langs->load("companies"); // Security check -$_socid = $_GET["id"]; +$_socid = GETPOST("id"); if ($user->societe_id > 0) { $_socid = $user->societe_id;