diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index aaab987fd9c..2fe683f4f8e 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -465,7 +465,7 @@ if ($object->id > 0) { print $langs->trans("CustomerRelativeDiscountShort"); print ''; if ($user->rights->societe->creer && !$user->socid > 0) { - print ''.img_edit($langs->trans("Modify")).''; + print ''.img_edit($langs->trans("Modify")).''; } print ''; print ''.($object->remise_percent ? ''.$object->remise_percent.'%' : '').''; @@ -478,7 +478,7 @@ if ($object->id > 0) { print $langs->trans("CustomerAbsoluteDiscountShort"); print ''; if ($user->rights->societe->creer && !$user->socid > 0) { - print ''.img_edit($langs->trans("Modify")).''; + print ''.img_edit($langs->trans("Modify")).''; } print ''; print ''; @@ -488,7 +488,7 @@ if ($object->id > 0) { dol_print_error($db, $object->error); } if ($amount_discount > 0) { - print ''.price($amount_discount, 1, $langs, 1, -1, -1, $conf->currency).''; + print ''.price($amount_discount, 1, $langs, 1, -1, -1, $conf->currency).''; } //else print $langs->trans("DiscountNone"); print ''; diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index b2900e65575..cdd8fefc4b0 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2021 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,18 +38,30 @@ if ($user->socid > 0) { } $backtopage = GETPOST('backtopage', 'alpha'); +$cancel = GETPOST('cancel', 'aplha'); +$action = GETPOST('action', 'aZ09'); + +// Security check +if ($user->socid > 0) { + $id = $user->socid; +} +$result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0); /* * Actions */ -if (GETPOST('cancel', 'alpha') && !empty($backtopage)) { - header("Location: ".$backtopage); - exit; +if ($cancel) { + if (!empty($backtopage)) { + header("Location: ".$backtopage); + exit; + } else { + $action = ''; + } } -if (GETPOST('action', 'aZ09') == 'setremise') { +if ($action == 'setremise') { $object = new Societe($db); $object->fetch($id); @@ -74,11 +86,6 @@ if (GETPOST('action', 'aZ09') == 'setremise') { } } -// Security check -if ($user->socid > 0) { - $id = $user->socid; -} -$result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0); /* diff --git a/htdocs/core/tpl/object_discounts.tpl.php b/htdocs/core/tpl/object_discounts.tpl.php index 38e1967c11b..4373f09fdb7 100644 --- a/htdocs/core/tpl/object_discounts.tpl.php +++ b/htdocs/core/tpl/object_discounts.tpl.php @@ -40,8 +40,8 @@ if (!isset($absolute_creditnote)) { } // Relative and absolute discounts -$addrelativediscount = ''.$langs->trans("EditRelativeDiscount").''; -$addabsolutediscount = ''.$langs->trans("EditGlobalDiscounts").''; +$addrelativediscount = ''.$langs->trans("EditRelativeDiscount").''; +$addabsolutediscount = ''.$langs->trans("EditGlobalDiscounts").''; $viewabsolutediscount = ''.$langs->trans("ViewAvailableGlobalDiscounts").''; $fixedDiscount = $thirdparty->remise_percent; diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 16e89850ae4..fd3ec1fa34f 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -297,7 +297,7 @@ if ($object->id > 0) { print $langs->trans("CustomerRelativeDiscountShort"); print ''; if ($user->rights->societe->creer && !$user->socid > 0) { - print ''.img_edit($langs->trans("Modify")).''; + print ''.img_edit($langs->trans("Modify")).''; } print ''; print ''.($object->remise_supplier_percent ? ''.$object->remise_supplier_percent.'%' : '').''; @@ -310,7 +310,7 @@ if ($object->id > 0) { print $langs->trans("CustomerAbsoluteDiscountShort"); print ''; if ($user->rights->societe->creer && !$user->socid > 0) { - print ''.img_edit($langs->trans("Modify")).''; + print ''.img_edit($langs->trans("Modify")).''; } print ''; print ''; @@ -320,7 +320,7 @@ if ($object->id > 0) { dol_print_error($db, $object->error); } if ($amount_discount > 0) { - print ''.price($amount_discount, 1, $langs, 1, -1, -1, $conf->currency).''; + print ''.price($amount_discount, 1, $langs, 1, -1, -1, $conf->currency).''; } //else print $langs->trans("DiscountNone"); print '';