From 44f5223c90325c330182e12800598e553da4a221 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Feb 2019 18:54:38 +0100 Subject: [PATCH 01/10] Remove warning --- htdocs/admin/tools/export.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 6b0ea790ab2..5bfacc6c4f0 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -35,14 +35,15 @@ $what=GETPOST('what','alpha'); $export_type=GETPOST('export_type','alpha'); $file=GETPOST('filename_template','alpha'); +// Load variable for pagination +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST("page",'int'); +if (empty($page) || $page == -1 || GETPOST('button_search','alpha') || GETPOST('button_removefilter','alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +$offset = $limit * $page; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="date"; -if ($page < 0) { $page = 0; } -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$offset = $limit * $page; if (! $user->admin) accessforbidden(); From 66998c4873b165a08edc8bf1f84c9b75c62d82ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Feb 2019 19:37:22 +0100 Subject: [PATCH 02/10] Fix translation --- htdocs/langs/en_US/members.lang | 3 ++- htdocs/langs/fr_FR/members.lang | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 6bee353c7ea..35e5a4b35f6 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -195,4 +195,5 @@ NoEmailSentToMember=No email sent to member EmailSentToMember=Email sent to member at %s SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired subscription SendReminderForExpiredSubscription=Send reminder by email to members when subscription is about to expire (parameter is number of days before end of subscription to send the remind. It can be a list of days separated by a semicolon, for example '10;5;0;-5') -MembershipPaid=Membership paid for current period (until %s) \ No newline at end of file +MembershipPaid=Membership paid for current period (until %s) +YouMayFindYourInvoceInThisEmail=You may find your invoice attached to this email \ No newline at end of file diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index 183b11d7e81..0e6ca75ace0 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -195,3 +195,4 @@ NoEmailSentToMember=Aucun e-mail envoyé à l'adhérent EmailSentToMember=Email envoyé à l'adhérent à %s SendReminderForExpiredSubscriptionTitle=Envoyer une relance par mail pour les cotisations expirées SendReminderForExpiredSubscription=Envoyer un rappel par e-mail aux membres lorsque l'adhésion est sur le point d'expirer (le paramètre est le nombre de jours avant la fin de l'adhésion pour envoyer le rappel. Il peut s'agir d'une liste de jours séparé par un point-virgule, par exemple '10;5;0;-5') +YouMayFindYourInvoceInThisEmail=You pourrez trouver votre facture en pièce jointe à cet email \ No newline at end of file From 7436a3bc73d53e74c5eb509bb2d63c4e9ac32d85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Feb 2019 19:37:58 +0100 Subject: [PATCH 03/10] Typo --- htdocs/langs/en_US/members.lang | 2 +- htdocs/langs/fr_FR/members.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 35e5a4b35f6..6de01d396dc 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -196,4 +196,4 @@ EmailSentToMember=Email sent to member at %s SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired subscription SendReminderForExpiredSubscription=Send reminder by email to members when subscription is about to expire (parameter is number of days before end of subscription to send the remind. It can be a list of days separated by a semicolon, for example '10;5;0;-5') MembershipPaid=Membership paid for current period (until %s) -YouMayFindYourInvoceInThisEmail=You may find your invoice attached to this email \ No newline at end of file +YouMayFindYourInvoiceInThisEmail=You may find your invoice attached to this email \ No newline at end of file diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index 0e6ca75ace0..0bc9b0c80b2 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -195,4 +195,4 @@ NoEmailSentToMember=Aucun e-mail envoyé à l'adhérent EmailSentToMember=Email envoyé à l'adhérent à %s SendReminderForExpiredSubscriptionTitle=Envoyer une relance par mail pour les cotisations expirées SendReminderForExpiredSubscription=Envoyer un rappel par e-mail aux membres lorsque l'adhésion est sur le point d'expirer (le paramètre est le nombre de jours avant la fin de l'adhésion pour envoyer le rappel. Il peut s'agir d'une liste de jours séparé par un point-virgule, par exemple '10;5;0;-5') -YouMayFindYourInvoceInThisEmail=You pourrez trouver votre facture en pièce jointe à cet email \ No newline at end of file +YouMayFindYourInvoiceInThisEmail=You pourrez trouver votre facture en pièce jointe à cet email \ No newline at end of file From 7c24847fa3b3329de4075ae213290a179f5e25ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Feb 2019 19:38:28 +0100 Subject: [PATCH 04/10] Typo --- htdocs/langs/en_US/members.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 6de01d396dc..588941d30f9 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -187,7 +187,7 @@ MembersStatisticsByProperties=Members statistics by nature MembersByNature=This screen show you statistics on members by nature. MembersByRegion=This screen show you statistics on members by region. VATToUseForSubscriptions=VAT rate to use for subscriptions -NoVatOnSubscription=No TVA for subscriptions +NoVatOnSubscription=No VAT for subscriptions ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS=Product used for subscription line into invoice: %s NameOrCompany=Name or company SubscriptionRecorded=Subscription recorded From 5a659bfd9008628c7dc1571166d58844c6e69577 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Feb 2019 19:57:35 +0100 Subject: [PATCH 05/10] Fix Missing currency --- htdocs/adherents/subscription.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index b66e472fabf..ae412d59c66 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -673,7 +673,7 @@ if ($rowid > 0) $sql.= " c.datef,"; $sql.= " c.fk_bank,"; $sql.= " b.rowid as bid,"; - $sql.= " ba.rowid as baid, ba.label, ba.bank, ba.ref, ba.account_number, ba.fk_accountancy_journal, ba.number"; + $sql.= " ba.rowid as baid, ba.label, ba.bank, ba.ref, ba.account_number, ba.fk_accountancy_journal, ba.number, ba.currency_code"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; @@ -726,8 +726,9 @@ if ($rowid > 0) $accountstatic->id=$objp->baid; $accountstatic->number=$objp->number; $accountstatic->account_number=$objp->account_number; + $accountstatic->country_code=$obj->currency_code; - if (! empty($conf->accounting->enabled)) + if (! empty($conf->accounting->enabled) && $objp->fk_accountancy_journal > 0) { $accountingjournal = new AccountingJournal($db); $accountingjournal->fetch($objp->fk_accountancy_journal); From d4e6610722c1fc2c731647bcc6f1430f49fcec34 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Feb 2019 19:58:42 +0100 Subject: [PATCH 06/10] Fix currency --- htdocs/adherents/subscription.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index ae412d59c66..c6215717f9a 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -726,7 +726,7 @@ if ($rowid > 0) $accountstatic->id=$objp->baid; $accountstatic->number=$objp->number; $accountstatic->account_number=$objp->account_number; - $accountstatic->country_code=$obj->currency_code; + $accountstatic->currency_code=$obj->currency_code; if (! empty($conf->accounting->enabled) && $objp->fk_accountancy_journal > 0) { From 27f804a454f3670d8f9093f35fc48c0179b05946 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Feb 2019 19:59:36 +0100 Subject: [PATCH 07/10] Fix currency --- htdocs/adherents/subscription.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index c6215717f9a..2b8684793c2 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -726,7 +726,7 @@ if ($rowid > 0) $accountstatic->id=$objp->baid; $accountstatic->number=$objp->number; $accountstatic->account_number=$objp->account_number; - $accountstatic->currency_code=$obj->currency_code; + $accountstatic->currency_code=$objp->currency_code; if (! empty($conf->accounting->enabled) && $objp->fk_accountancy_journal > 0) { From 82df83cec2a5b13e3ebebe33d7cff334274c8e17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Feb 2019 20:04:25 +0100 Subject: [PATCH 08/10] Add log --- htdocs/adherents/class/adherent.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index ea624209f3e..4cfb47947c2 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2760,7 +2760,7 @@ class Adherent extends CommonObject $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang); $outputlangs->loadLangs(array("main", "members")); - dol_syslog("sendReminderForExpiredSubscription Language set to ".$outputlangs->defaultlang); + dol_syslog("sendReminderForExpiredSubscription Language for member id ".$adherent->id." set to ".$outputlangs->defaultlang); $arraydefaultmessage=null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION; From db50ef39e7762dddcb4f594b7dfecb09d5d49f28 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Feb 2019 20:32:14 +0100 Subject: [PATCH 09/10] FIX Translation not loaded by scheduled jobs --- scripts/cron/cron_run_jobs.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 873fc0ae9fb..a3b7d83684d 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -65,10 +65,13 @@ $version=DOL_VERSION; $error=0; + /* * Main */ +$langs->loadLangs(array('main', 'dict')); + // current date $now=dol_now(); From ce5717a7b748306bf7d76f668cb34a6fe53b0183 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Feb 2019 20:43:26 +0100 Subject: [PATCH 10/10] FIX Default language of company is not set --- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/societe/class/societe.class.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 4cfb47947c2..7872ed1ca68 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2760,7 +2760,7 @@ class Adherent extends CommonObject $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang); $outputlangs->loadLangs(array("main", "members")); - dol_syslog("sendReminderForExpiredSubscription Language for member id ".$adherent->id." set to ".$outputlangs->defaultlang); + dol_syslog("sendReminderForExpiredSubscription Language for member id ".$adherent->id." set to ".$outputlangs->defaultlang." mysoc->default_lang=".$mysoc->default_lang); $arraydefaultmessage=null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index a22293f60e6..ca074c87070 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3439,6 +3439,7 @@ class Societe extends CommonObject $this->capital=empty($conf->global->MAIN_INFO_CAPITAL)?'':$conf->global->MAIN_INFO_CAPITAL; $this->forme_juridique_code=empty($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE)?'':$conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE; $this->email=empty($conf->global->MAIN_INFO_SOCIETE_MAIL)?'':$conf->global->MAIN_INFO_SOCIETE_MAIL; + $this->default_lang = (empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT); $this->logo=empty($conf->global->MAIN_INFO_SOCIETE_LOGO)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO; $this->logo_small=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL; $this->logo_mini=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;