diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php
index 8fb75c908d4..ba3a6a172fd 100644
--- a/htdocs/comm/remise.php
+++ b/htdocs/comm/remise.php
@@ -32,7 +32,7 @@ $langs->load("bills");
$id=GETPOST("id",'int');
-$socid = GETPOST('id','int');
+$socid = GETPOST('id','int')?GETPOST('id','int'):GETPOST('socid','int');
// Security check
if ($user->societe_id > 0)
{
@@ -122,14 +122,14 @@ if ($socid > 0)
print '
';
print '
';
-
+
if(! $isCustomer && ! $isSupplier) {
print '
'.$langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts').'
';
-
+
dol_fiche_end();
-
+
print '';
-
+
llxFooter();
$db->close();
exit;
@@ -142,7 +142,7 @@ if ($socid > 0)
print '
| ';
print $langs->trans("CustomerRelativeDiscount").' | '.price2num($object->remise_percent)."% |
";
}
-
+
if($isSupplier) {
// Supplier discount
print '
';
@@ -159,11 +159,11 @@ if ($socid > 0)
if($isCustomer && ! $isSupplier) {
print '';
}
-
+
if(! $isCustomer && $isSupplier) {
print '';
}
-
+
print '';
if($isCustomer && $isSupplier) {
@@ -218,7 +218,7 @@ if ($socid > 0)
$sql.= " AND rc.entity = " . $conf->entity;
$sql.= " AND u.rowid = rc.fk_user_author";
$sql.= " ORDER BY rc.datec DESC";
-
+
$resql=$db->query($sql);
if ($resql)
{
@@ -249,7 +249,7 @@ if ($socid > 0)
else
{
print '| '.$langs->trans("None").' | ';
- }
+ }
$db->free($resql);
print " ";
}
@@ -277,7 +277,7 @@ if ($socid > 0)
$sql.= " AND rc.entity = " . $conf->entity;
$sql.= " AND u.rowid = rc.fk_user_author";
$sql.= " ORDER BY rc.datec DESC";
-
+
$resql=$db->query($sql);
if ($resql)
{
diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang
index aec9c1e1a93..3473667fe55 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -267,6 +267,7 @@ Prospect=Prospect
CustomerCard=Customer Card
Customer=Customer
CustomerRelativeDiscount=Relative customer discount
+SupplierRelativeDiscount=Relative supplier discount
CustomerRelativeDiscountShort=Relative discount
CustomerAbsoluteDiscountShort=Absolute discount
CompanyHasRelativeDiscount=This customer has a default discount of %s%%
|