diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 1d7fb503ea2..6308857f958 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -2774,9 +2774,13 @@ class Adherent extends CommonObject
{
$adherent->fetch_thirdparty();
+ // Language code to use ($languagecodeformember) is default language of thirdparty, if no thirdparty, the language found from country of member then country of thirdparty, and if still not found we use the language of company.
+ $languagefromcountrycode = getLanguageCodeFromCountryCode($adherent->country_code ? $adherent->country_code : $adherent->thirdparty->country_code);
+ $languagecodeformember = (empty($adherent->thirdparty->default_lang) ? ($languagefromcountrycode ? $languagefromcountrycode : $mysoc->default_lang) : $adherent->thirdparty->default_lang);
+
// Send reminder email
$outputlangs = new Translate('', $conf);
- $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang);
+ $outputlangs->setDefaultLang($languagecodeformember);
$outputlangs->loadLangs(array("main", "members"));
dol_syslog("sendReminderForExpiredSubscription Language for member id ".$adherent->id." set to ".$outputlangs->defaultlang." mysoc->default_lang=".$mysoc->default_lang);
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index 9e319d70f91..be36c58573b 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -378,38 +378,43 @@ if ($object->id > 0)
print '';
}
- // Relative discounts (Discounts-Drawbacks-Rebates)
- print '
';
- print '| ';
- print $langs->trans("CustomerRelativeDiscountShort");
- print ' | | ';
- if ($user->rights->societe->creer && !$user->societe_id > 0)
- {
- print ''.img_edit($langs->trans("Modify")).'';
- }
- print ' | ';
- print ' | '.($object->remise_percent?''.$object->remise_percent.'%':'').' | ';
- print '
';
+ $isCustomer = ($object->client == 1 || $object->client == 3);
- // Absolute discounts (Discounts-Drawbacks-Rebates)
- print '';
- print '';
- print '| ';
- print $langs->trans("CustomerAbsoluteDiscountShort");
- print ' | | ';
- if ($user->rights->societe->creer && !$user->societe_id > 0)
+ // Relative discounts (Discounts-Drawbacks-Rebates)
+ if ($isCustomer)
{
- print 'id).'">'.img_edit($langs->trans("Modify")).'';
+ print ' | ';
+ print '| ';
+ print $langs->trans("CustomerRelativeDiscountShort");
+ print ' | | ';
+ if ($user->rights->societe->creer && !$user->societe_id > 0)
+ {
+ print ''.img_edit($langs->trans("Modify")).'';
+ }
+ print ' | ';
+ print ' | '.($object->remise_percent?''.$object->remise_percent.'%':'').' | ';
+ print ' ';
+
+ // Absolute discounts (Discounts-Drawbacks-Rebates)
+ print '| ';
+ print '';
+ print ' | ';
+ print '';
+ $amount_discount=$object->getAvailableDiscounts();
+ if ($amount_discount < 0) dol_print_error($db,$object->error);
+ if ($amount_discount > 0) print 'id).'">'.price($amount_discount,1,$langs,1,-1,-1,$conf->currency).'';
+ //else print $langs->trans("DiscountNone");
+ print ' | ';
+ print ' ';
}
- print ' ';
- print ' | ';
- print '';
- $amount_discount=$object->getAvailableDiscounts();
- if ($amount_discount < 0) dol_print_error($db, $object->error);
- if ($amount_discount > 0) print 'id).'">'.price($amount_discount, 1, $langs, 1, -1, -1, $conf->currency).'';
- //else print $langs->trans("DiscountNone");
- print ' | ';
- print '
';
// Max outstanding bill
if ($object->client)
diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php
index ddb3901051e..a2d373f339a 100644
--- a/htdocs/comm/remise.php
+++ b/htdocs/comm/remise.php
@@ -106,7 +106,7 @@ if ($socid > 0)
$head = societe_prepare_head($object);
- $isCustomer = $object->client == 1 || $object->client == 3;
+ $isCustomer = ($object->client == 1 || $object->client == 3);
$isSupplier = $object->fournisseur == 1;
print '