diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 2530454d056..4841b8bf171 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -117,7 +117,7 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end)) $date_end = dol_get_last_day($pastmonthyear, $pastmonth, false); } -$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_account,"; +$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.amount_main_currency, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_account,"; $sql .= " ba.courant, ba.ref as baref, ba.account_number, ba.fk_accountancy_journal,"; $sql .= " soc.rowid as socid, soc.nom as name, soc.email as email, bu1.type as typeop_company,"; if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { @@ -142,7 +142,7 @@ if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on bu2.url_id=u.rowid"; $sql .= " WHERE ba.fk_accountancy_journal=".((int) $id_journal); -$sql .= ' AND b.amount != 0 AND ba.entity IN ('.getEntity('bank_account', 0).')'; // We don't share object for accountancy +$sql .= ' AND b.amount <> 0 AND ba.entity IN ('.getEntity('bank_account', 0).')'; // We don't share object for accountancy if ($date_start && $date_end) { $sql .= " AND b.dateo >= '".$db->idate($date_start)."' AND b.dateo <= '".$db->idate($date_end)."'"; } @@ -282,6 +282,7 @@ if ($result) { $tabpay[$obj->rowid]["fk_bank"] = $obj->rowid; $tabpay[$obj->rowid]["bank_account_ref"] = $obj->baref; $tabpay[$obj->rowid]["fk_bank_account"] = $obj->fk_account; + $reg = array(); if (preg_match('/^\((.*)\)$/i', $obj->label, $reg)) { $tabpay[$obj->rowid]["lib"] = $langs->trans($reg[1]); } else { @@ -296,6 +297,12 @@ if ($result) { $tabtype[$obj->rowid] = 'unknown'; $tabmoreinfo[$obj->rowid] = array(); + $amounttouse = $obj->amount; + if (!empty($obj->amount_main_currency)) { + // If $obj->amount_main_currency is set, it means that $obj->amount is not in same currency, we must use $obj->amount_main_currency + $amounttouse = $obj->amount_main_currency; + } + // get_url may return -1 which is not traversable if (is_array($links) && count($links) > 0) { // Now loop on each link of record in bank (code similar to bankentries_list.php) @@ -334,7 +341,7 @@ if ($result) { $societestatic->email = $tabcompany[$obj->rowid]['email']; $tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30); if ($compta_soc) { - $tabtp[$obj->rowid][$compta_soc] += $obj->amount; + $tabtp[$obj->rowid][$compta_soc] += $amounttouse; } } elseif ($links[$key]['type'] == 'user') { $userstatic->id = $links[$key]['url_id']; @@ -350,7 +357,7 @@ if ($result) { $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment. } if ($compta_user) { - $tabtp[$obj->rowid][$compta_user] += $obj->amount; + $tabtp[$obj->rowid][$compta_user] += $amounttouse; } } elseif ($links[$key]['type'] == 'sc') { $chargestatic->id = $links[$key]['url_id']; @@ -383,7 +390,7 @@ if ($result) { $resultmid = $db->query($sqlmid); if ($resultmid) { $objmid = $db->fetch_object($resultmid); - $tabtp[$obj->rowid][$objmid->accountancy_code] += $obj->amount; + $tabtp[$obj->rowid][$objmid->accountancy_code] += $amounttouse; } } elseif ($links[$key]['type'] == 'payment_donation') { $paymentdonstatic->id = $links[$key]['url_id']; @@ -391,7 +398,7 @@ if ($result) { $paymentdonstatic->fk_donation = $links[$key]['url_id']; $tabpay[$obj->rowid]["lib"] .= ' '.$paymentdonstatic->getNomUrl(2); $tabpay[$obj->rowid]["paymentdonationid"] = $paymentdonstatic->id; - $tabtp[$obj->rowid][$account_pay_donation] += $obj->amount; + $tabtp[$obj->rowid][$account_pay_donation] += $amounttouse; } elseif ($links[$key]['type'] == 'member') { $paymentsubscriptionstatic->id = $links[$key]['url_id']; $paymentsubscriptionstatic->ref = $links[$key]['url_id']; @@ -399,14 +406,14 @@ if ($result) { $tabpay[$obj->rowid]["lib"] .= ' '.$paymentsubscriptionstatic->getNomUrl(2); $tabpay[$obj->rowid]["paymentsubscriptionid"] = $paymentsubscriptionstatic->id; $paymentsubscriptionstatic->fetch($paymentsubscriptionstatic->id); - $tabtp[$obj->rowid][$account_pay_subscription] += $obj->amount; + $tabtp[$obj->rowid][$account_pay_subscription] += $amounttouse; } elseif ($links[$key]['type'] == 'payment_vat') { // Payment VAT $paymentvatstatic->id = $links[$key]['url_id']; $paymentvatstatic->ref = $links[$key]['url_id']; $paymentvatstatic->label = $links[$key]['label']; $tabpay[$obj->rowid]["lib"] .= ' '.$paymentvatstatic->getNomUrl(2); $tabpay[$obj->rowid]["paymentvatid"] = $paymentvatstatic->id; - $tabtp[$obj->rowid][$account_pay_vat] += $obj->amount; + $tabtp[$obj->rowid][$account_pay_vat] += $amounttouse; } elseif ($links[$key]['type'] == 'payment_salary') { $paymentsalstatic->id = $links[$key]['url_id']; $paymentsalstatic->ref = $links[$key]['url_id']; @@ -438,7 +445,7 @@ if ($result) { if (empty($obj->typeop_user)) { // Add test to avoid to add amount twice if a link already exists also on user. $compta_user = $userstatic->accountancy_code; if ($compta_user) { - $tabtp[$obj->rowid][$compta_user] += $obj->amount; + $tabtp[$obj->rowid][$compta_user] += $amounttouse; $tabuser[$obj->rowid] = array( 'id' => $userstatic->id, 'name' => dolGetFirstLastname($userstatic->firstname, $userstatic->lastname), @@ -465,14 +472,14 @@ if ($result) { $account_various = (!empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined'); // NotDefined is a reserved word $account_subledger = (!empty($paymentvariousstatic->subledger_account) ? $paymentvariousstatic->subledger_account : ''); // NotDefined is a reserved word $tabpay[$obj->rowid]["account_various"] = $account_various; - $tabtp[$obj->rowid][$account_subledger] += $obj->amount; + $tabtp[$obj->rowid][$account_subledger] += $amounttouse; } elseif ($links[$key]['type'] == 'payment_loan') { $paymentloanstatic->id = $links[$key]['url_id']; $paymentloanstatic->ref = $links[$key]['url_id']; $paymentloanstatic->fk_loan = $links[$key]['url_id']; $tabpay[$obj->rowid]["lib"] .= ' '.$paymentloanstatic->getNomUrl(2); $tabpay[$obj->rowid]["paymentloanid"] = $paymentloanstatic->id; - //$tabtp[$obj->rowid][$account_pay_loan] += $obj->amount; + //$tabtp[$obj->rowid][$account_pay_loan] += $amounttouse; $sqlmid = 'SELECT pl.amount_capital, pl.amount_insurance, pl.amount_interest, l.accountancy_account_capital, l.accountancy_account_insurance, l.accountancy_account_interest'; $sqlmid .= ' FROM '.MAIN_DB_PREFIX.'payment_loan as pl, '.MAIN_DB_PREFIX.'loan as l'; $sqlmid .= ' WHERE l.rowid = pl.fk_loan AND pl.fk_bank = '.((int) $obj->rowid); @@ -488,14 +495,14 @@ if ($result) { } elseif ($links[$key]['type'] == 'banktransfert') { $accountLinestatic->fetch($links[$key]['url_id']); $tabpay[$obj->rowid]["lib"] .= ' '.$langs->trans("BankTransfer").'- '.$accountLinestatic ->getNomUrl(1); - $tabtp[$obj->rowid][$account_transfer] += $obj->amount; + $tabtp[$obj->rowid][$account_transfer] += $amounttouse; $bankaccountstatic->fetch($tabpay[$obj->rowid]['fk_bank_account']); $tabpay[$obj->rowid]["soclib"] = $bankaccountstatic->getNomUrl(2); } } } - $tabbq[$obj->rowid][$compta_bank] += $obj->amount; + $tabbq[$obj->rowid][$compta_bank] += $amounttouse; // If no links were found to know the amount on thirdparty, we try to guess it. // This may happens on bank entries without the links lines to 'company'. @@ -542,7 +549,7 @@ if ($result) { } }*/ - // if($obj->socid)$tabtp[$obj->rowid][$compta_soc] += $obj->amount; + // if($obj->socid)$tabtp[$obj->rowid][$compta_soc] += $amounttouse; $i++; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 1b4340276f8..9f6ee0c539f 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1033,8 +1033,8 @@ if ($resql) { $event->type = 'holiday'; $event->type_picto = 'holiday'; - $event->datep = $db->jdate($obj->date_start); - $event->datef = $db->jdate($obj->date_end); + $event->datep = $db->jdate($obj->date_start) + (empty($halfday) || $halfday == 1 ? 0 : 12 * 60 * 60 - 1); + $event->datef = $db->jdate($obj->date_end) + (empty($halfday) || $halfday == -1 ? 24 : 12) * 60 * 60 - 1; $event->date_start_in_calendar = $event->datep; $event->date_end_in_calendar = $event->datef; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 3d2dee9a286..603627ee91e 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -45,8 +45,14 @@ if ($mode == 'customer' && !$user->rights->commande->lire) { if ($mode == 'supplier' && empty($user->rights->fournisseur->commande->lire)) { accessforbidden(); } +if ($mode == 'supplier') { + $object_status = GETPOST('object_status', 'array:int'); + $object_status = implode(',', $object_status); +} else { + $object_status = GETPOST('object_status', 'intcomma'); +} + -$object_status = GETPOST('object_status', 'intcomma'); $typent_id = GETPOST('typent_id', 'int'); $categ_id = GETPOST('categ_id', 'categ_id'); diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 3cf7da7820e..4d133c50dda 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -276,6 +276,9 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', ' if ($offset) { $param .= '&offset='.urlencode($offset); } + if ($limit) { + $param .= '&limit='.urlencode($limit); + } if ($search_conciliated != '' && $search_conciliated != '-1') { $param .= '&search_conciliated='.urlencode($search_conciliated); } diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index f01e74a0cf4..429d7c704c8 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -519,9 +519,10 @@ class Account extends CommonObject * @param string $accountancycode When we record a free bank entry, we must provide accounting account if accountancy module is on. * @param int $datev Date value * @param string $num_releve Label of bank receipt for reconciliation + * @param float $amount_main_currency Amount * @return int Rowid of added entry, <0 if KO */ - public function addline($date, $oper, $label, $amount, $num_chq, $categorie, User $user, $emetteur = '', $banque = '', $accountancycode = '', $datev = null, $num_releve = '') + public function addline($date, $oper, $label, $amount, $num_chq, $categorie, User $user, $emetteur = '', $banque = '', $accountancycode = '', $datev = null, $num_releve = '', $amount_main_currency = null) { // Deprecation warning if (is_numeric($oper)) { @@ -579,6 +580,7 @@ class Account extends CommonObject $accline->datev = $datev; $accline->label = $label; $accline->amount = $amount; + $accline->amount_main_currency = $amount_main_currency; $accline->fk_user_author = $user->id; $accline->fk_account = $this->id; $accline->fk_type = $oper; @@ -1801,7 +1803,8 @@ class AccountLine extends CommonObject */ public $datev; - public $amount; + public $amount; /* Amount of payment in the bank account currency */ + public $amount_main_currency; /* Amount in the currency of company if bank account use another currency */ /** * @var int ID @@ -1962,6 +1965,7 @@ class AccountLine extends CommonObject $sql .= ", datev"; $sql .= ", label"; $sql .= ", amount"; + $sql .= ", amount_main_currency"; $sql .= ", fk_user_author"; $sql .= ", num_chq"; $sql .= ", fk_account"; @@ -1976,7 +1980,8 @@ class AccountLine extends CommonObject $sql .= ", '".$this->db->idate($this->datev)."'"; $sql .= ", '".$this->db->escape($this->label)."'"; $sql .= ", ".price2num($this->amount); - $sql .= ", ".($this->fk_user_author > 0 ? $this->fk_user_author : "null"); + $sql .= ", ".(empty($this->amount_main_currency) ? "NULL" : price2num($this->amount_main_currency)); + $sql .= ", ".($this->fk_user_author > 0 ? ((int) $this->fk_user_author) : "null"); $sql .= ", ".($this->num_chq ? "'".$this->db->escape($this->num_chq)."'" : "null"); $sql .= ", '".$this->db->escape($this->fk_account)."'"; $sql .= ", '".$this->db->escape($this->fk_type)."'"; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index f91b776c0aa..87a59c2c960 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -811,6 +811,10 @@ class Facture extends CommonInvoice $fk_parent_line = 0; } + // Complete vat rate with code + $vatrate = $newinvoiceline->tva_tx; + if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$newinvoiceline->vat_src_code.')'; + $newinvoiceline->fk_parent_line = $fk_parent_line; if ($this->type === Facture::TYPE_REPLACEMENT && $newinvoiceline->fk_remise_except) { @@ -821,7 +825,37 @@ class Facture extends CommonInvoice $newinvoiceline->fk_remise_except = $discountId; } - $result = $newinvoiceline->insert(); + $result = $this->addline( + $newinvoiceline->desc, + $newinvoiceline->subprice, + $newinvoiceline->qty, + $vatrate, + $newinvoiceline->localtax1_tx, + $newinvoiceline->localtax2_tx, + $newinvoiceline->fk_product, + $newinvoiceline->remise_percent, + $newinvoiceline->date_start, + $newinvoiceline->date_end, + $newinvoiceline->fk_code_ventilation, + $newinvoiceline->info_bits, + $newinvoiceline->fk_remise_except, + 'HT', + 0, + $newinvoiceline->product_type, + $newinvoiceline->rang, + $newinvoiceline->special_code, + $newinvoiceline->element, + $newinvoiceline->id, + $fk_parent_line, + $newinvoiceline->fk_fournprice, + $newinvoiceline->pa_ht, + $newinvoiceline->label, + $newinvoiceline->array_options, + $newinvoiceline->situation_percent, + $newinvoiceline->fk_prev_id, + $newinvoiceline->fk_unit, + $newinvoiceline->multicurrency_subprice + ); // Defined the new fk_parent_line if ($result > 0) { diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 774495091a5..aea9f917dab 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -266,6 +266,7 @@ if (empty($reshook)) { if (!$error) { // Create payment and update this->multicurrency_amounts if this->amounts filled or // this->amounts if this->multicurrency_amounts filled. + // This also set ->amount and ->multicurrency_amount $paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices') == 'on' ? 1 : 0), $thirdparty); // This include closing invoices and regenerating documents if ($paiement_id < 0) { setEventMessages($paiement->error, $paiement->errors, 'errors'); diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 86dcbdeff39..c5f40896a18 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -636,17 +636,22 @@ class Paiement extends CommonObject $this->db->begin(); $totalamount = $this->amount; + $totalamount_main_currency = null; if (empty($totalamount)) { $totalamount = $this->total; // For backward compatibility } // if dolibarr currency != bank currency then we received an amount in customer currency (currently I don't manage the case : my currency is USD, the customer currency is EUR and he paid me in GBP. Seems no sense for me) if (!empty($conf->multicurrency->enabled) && $conf->currency != $acc->currency_code) { - $totalamount = $this->multicurrency_amount; + $totalamount = $this->multicurrency_amount; // We will insert into llx_bank.amount in foreign currency + $totalamount_main_currency = $this->amount; // We will also save the amount in main currency into column llx_bank.amount_main_currency } if ($mode == 'payment_supplier') { $totalamount = -$totalamount; + if (isset($totalamount_main_currency)) { + $totalamount_main_currency = -$totalamount_main_currency; + } } // Insert payment into llx_bank @@ -660,8 +665,11 @@ class Paiement extends CommonObject $user, $emetteur_nom, $emetteur_banque, - $accountancycode - ); + $accountancycode, + null, + '', + $totalamount_main_currency + ); // Mise a jour fk_bank dans llx_paiement // On connait ainsi le paiement qui a genere l'ecriture bancaire @@ -706,7 +714,7 @@ class Paiement extends CommonObject DOL_URL_ROOT.'/comm/card.php?socid=', $fac->thirdparty->name, 'company' - ); + ); if ($result <= 0) { dol_syslog(get_class($this).'::addPaymentToBank '.$this->db->lasterror()); } @@ -724,7 +732,7 @@ class Paiement extends CommonObject DOL_URL_ROOT.'/fourn/card.php?socid=', $fac->thirdparty->name, 'company' - ); + ); if ($result <= 0) { dol_syslog(get_class($this).'::addPaymentToBank '.$this->db->lasterror()); } @@ -742,7 +750,7 @@ class Paiement extends CommonObject DOL_URL_ROOT.'/compta/prelevement/card.php?id=', $this->num_payment, 'withdraw' - ); + ); } // Add link 'InvoiceRefused' in bank_url @@ -753,7 +761,7 @@ class Paiement extends CommonObject DOL_URL_ROOT.'/compta/prelevement/card.php?id=', $this->num_prelevement, 'withdraw' - ); + ); } if (!$error && !$notrigger) { @@ -1291,40 +1299,40 @@ class Paiement extends CommonObject $langs->load('compta'); /*if ($mode == 0) - { - if ($status == 0) return $langs->trans('ToValidate'); - if ($status == 1) return $langs->trans('Validated'); - } - if ($mode == 1) - { - if ($status == 0) return $langs->trans('ToValidate'); - if ($status == 1) return $langs->trans('Validated'); - } - if ($mode == 2) - { - if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate'); - if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated'); - } - if ($mode == 3) - { - if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1'); - if ($status == 1) return img_picto($langs->trans('Validated'),'statut4'); - } - if ($mode == 4) - { - if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate'); - if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated'); - } - if ($mode == 5) - { - if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1'); - if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4'); - } - if ($mode == 6) - { - if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1'); - if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4'); - }*/ + { + if ($status == 0) return $langs->trans('ToValidate'); + if ($status == 1) return $langs->trans('Validated'); + } + if ($mode == 1) + { + if ($status == 0) return $langs->trans('ToValidate'); + if ($status == 1) return $langs->trans('Validated'); + } + if ($mode == 2) + { + if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate'); + if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated'); + } + if ($mode == 3) + { + if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1'); + if ($status == 1) return img_picto($langs->trans('Validated'),'statut4'); + } + if ($mode == 4) + { + if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate'); + if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated'); + } + if ($mode == 5) + { + if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1'); + if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4'); + } + if ($mode == 6) + { + if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1'); + if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4'); + }*/ return ''; } diff --git a/htdocs/core/boxes/box_birthdays.php b/htdocs/core/boxes/box_birthdays.php index 41e51eee45e..9462c810393 100644 --- a/htdocs/core/boxes/box_birthdays.php +++ b/htdocs/core/boxes/box_birthdays.php @@ -119,7 +119,7 @@ class box_birthdays extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="center nowraponall"', - 'text' => dol_print_date($dateb, "day", 'gmt').' - '.$age.' '.$langs->trans('DurationYears') + 'text' => dol_print_date($dateb, "day", 'tzserver').' - '.$age.' '.$langs->trans('DurationYears') ); /*$this->info_box_contents[$line][] = array( diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f95cb37b9bb..09c0e591ac7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4951,18 +4951,18 @@ abstract class CommonObject global $langs, $hookmanager, $conf, $form, $action; print '
".$langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",
\n"; - $message .= $langs->transnoentities("HolidaysToValidateBody")."\n"; + $message .= "".$langs->transnoentities("HolidaysToValidateBody")."
\n"; // option to warn the validator in case of too short delay @@ -484,8 +483,7 @@ if (empty($reshook)) { $nowplusdelay = dol_time_plus_duree($now, $delayForRequest, 'd'); if ($object->date_debut < $nowplusdelay) { - $message .= "\n"; - $message .= $langs->transnoentities("HolidaysToValidateDelay", $delayForRequest)."\n"; + $message = "".$langs->transnoentities("HolidaysToValidateDelay", $delayForRequest)."
\n"; } } } @@ -495,20 +493,21 @@ if (empty($reshook)) { $nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday); if ($nbopenedday > $object->getCPforUser($object->fk_user, $object->fk_type)) { - $message .= "\n"; - $message .= $langs->transnoentities("HolidaysToValidateAlertSolde")."\n"; + $message .= "".$langs->transnoentities("HolidaysToValidateAlertSolde")."
\n"; } } - $message .= "\n"; - $message .= "- ".$langs->transnoentitiesnoconv("Name")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n"; - $message .= "- ".$langs->transnoentitiesnoconv("Period")." : ".dol_print_date($object->date_debut, 'day')." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($object->date_fin, 'day')."\n"; - $message .= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$object->id."\n\n"; - $message .= "\n"; + $link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id; + + $message .= "".$langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",
\n"; - $message .= $langs->transnoentities("HolidaysValidatedBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."\n"; + $message .= "".$langs->transnoentities("HolidaysValidatedBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."
\n"; - $message .= "- ".$langs->transnoentitiesnoconv("ValidatedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n"; + $link = dol_buildpath('/holiday/card.php', 3).'?id='.$object->id; - $message .= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$object->id."\n\n"; - $message .= "\n"; + $message .= "".$langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",
\n"; - $message .= $langs->transnoentities("HolidaysRefusedBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."\n"; - $message .= GETPOST('detail_refuse', 'alpha')."\n\n"; + $message .= "".$langs->transnoentities("HolidaysRefusedBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."
\n"; + $message .= "
".GETPOST('detail_refuse', 'alpha')."
"; - $message .= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n"; + $link = dol_buildpath('/holiday/card.php', 3).'?id='.$object->id; - $message .= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$object->id."\n\n"; - $message .= "\n"; + $message .= "".$langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",
\n"; - $message .= $langs->transnoentities("HolidaysCanceledBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."\n"; - $message .= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n"; + $message .= "".$langs->transnoentities("HolidaysCanceledBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."
\n"; - $message .= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$object->id."\n\n"; - $message .= "\n"; + $link = dol_buildpath('/holiday/card.php', 3).'?id='.$object->id; + + $message .= "