Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop
This commit is contained in:
Laurent Destailleur 2023-11-23 18:56:10 +01:00
commit cb3a86a737
17 changed files with 86 additions and 66 deletions

View File

@ -233,6 +233,9 @@ if (!isModEnabled('cron')) {
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_EMAIL&token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>';
}
} else {
$langs->load("cron");
print '<span class="opacitymedium warning">'.$langs->trans("JobNotFound", $langs->transnoentitiesnoconv("sendEmailsReminder")).'</span>';
}
}
}

View File

@ -1665,17 +1665,23 @@ if ($action == 'create') {
$("#selectremindertype").select2();
$("#select_offsetunittype_duration").select2("destroy");
$("#select_offsetunittype_duration").select2();
selectremindertype();
});
$("#selectremindertype").change(function(){
console.log("Change on selectremindertype");
selectremindertype();
});
function selectremindertype() {
console.log("Call selectremindertype");
var selected_option = $("#selectremindertype option:selected").val();
if(selected_option == "email") {
$("#select_actioncommsendmodel_mail").closest("tr").show();
} else {
$("#select_actioncommsendmodel_mail").closest("tr").hide();
}
});
}
})';
print '</script>'."\n";
}

View File

@ -2505,7 +2505,7 @@ class ActionComm extends CommonObject
$now = dol_now();
$actionCommReminder = new ActionCommReminder($this->db);
dol_syslog(__METHOD__, LOG_DEBUG);
dol_syslog(__METHOD__." start", LOG_INFO);
$this->db->begin();
@ -2635,10 +2635,16 @@ class ActionComm extends CommonObject
if (!$error) {
$this->output = 'Nb of emails sent : '.$nbMailSend;
$this->db->commit();
dol_syslog(__METHOD__." end - ".$this->output, LOG_INFO);
return 0;
} else {
$this->db->commit(); // We commit also on error, to have the error message recorded.
$this->error = 'Nb of emails sent : '.$nbMailSend.', '.(!empty($errorsMsg)) ? join(', ', $errorsMsg) : $error;
dol_syslog(__METHOD__." end - ".$this->error, LOG_INFO);
return $error;
}
}

View File

@ -5652,7 +5652,7 @@ class Facture extends CommonInvoice
$tmpinvoice = new Facture($this->db);
dol_syslog(__METHOD__, LOG_DEBUG);
dol_syslog(__METHOD__." start", LOG_INFO);
// Select all action comm reminder
$sql = "SELECT rowid as id FROM ".MAIN_DB_PREFIX."facture as f";
@ -5892,9 +5892,15 @@ class Facture extends CommonInvoice
if (!$error) {
$this->output .= 'Nb of emails sent : '.$nbMailSend;
dol_syslog(__METHOD__." end - ".$this->output, LOG_INFO);
return 0;
} else {
$this->error = 'Nb of emails sent : '.$nbMailSend.', '.(!empty($errorsMsg)) ? join(', ', $errorsMsg) : $error;
dol_syslog(__METHOD__." end - ".$this->error, LOG_INFO);
return $error;
}
}

View File

@ -36,6 +36,7 @@ $dolibarr_main_url_root='';
// Examples:
// $dolibarr_main_document_root='/var/www/dolibarr/htdocs';
// $dolibarr_main_document_root='C:/My web sites/dolibarr/htdocs';
// $dolibarr_main_document_root=realpath(__DIR__.'/..');
//
$dolibarr_main_document_root='';
@ -44,7 +45,7 @@ $dolibarr_main_document_root='';
// ==========================
// This parameter defines the relative sub URLs to add to $dolibarr_main_url_root to
// forge alternative root directories (used by modules developers).
// You can put several values, separated by a coma, but number of entries must match
// You can put several values, separated by a comma, but number of entries must match
// number of entries into $dolibarr_main_document_root_alt.
//
// Examples:
@ -57,7 +58,7 @@ $dolibarr_main_document_root='';
// dolibarr_main_document_root_alt
// ===============================
// This parameter contains absolute alternative root file system directories (used by modules developers).
// You can put several values, separated by a coma, but number of entries must match
// You can put several values, separated by a comma, but number of entries must match
// number of entries into $dolibarr_main_url_root_alt.
//
// Examples:
@ -75,6 +76,7 @@ $dolibarr_main_document_root='';
// Examples:
// $dolibarr_main_data_root='/var/www/dolibarr/documents';
// $dolibarr_main_data_root='E:/My web sites/dolibarr/documents';
// $dolibarr_main_data_root=realpath(__DIR__.'/../../documents');
//
$dolibarr_main_data_root='';
@ -175,7 +177,7 @@ $dolibarr_main_db_collation='utf8_unicode_ci';
// dolibarr_main_db_readonly
// =========================
// Set this to 1 to have the application working in readonly mode. All SQL commands INSERT/UPDATE/DELETE/CREATE/ALTER/TRUNCATE/DROP will be disabled.
// Set this to 1 to have the application working in readonly mode. All SQL commands INSERT/UPDATE/DELETE/CREATE/ALTER/TRUNCATE/DROP will be disabled.
// Default value: 0
// Examples:
// $dolibarr_main_db_readonly='0';
@ -271,8 +273,8 @@ $dolibarr_main_authentication='dolibarr';
// 'https://my.domain.com' = Force redirect to https using this domain name.
// Warning: If you enable this parameter, your web server must be configured to respond URL with https protocol.
// According to your web server setup, some values may works and other not. Try different values (1,2 or 'https://my.domain.com') if you experience problems.
// Even if a redirect to HTTPS is forced by the webserver, it is recommanded to set this value to another value than 0, so your session cookies will be
// flagged as secured.
// Even if a redirect to HTTPS is forced by the webserver, it is recommended to set this value to another value than 0, so your session cookies will be
// flagged as secured.
// Default value: 0
// Possible values: 0, 1, 2 or 'https://my.domain.com'
// Examples:
@ -376,7 +378,7 @@ $dolibarr_cron_allow_cli='0';
// =========================
// If this value is set to a value, it forces the creation of a file install.lock once an upgrade process into a new version end.
// The value is the octal value of permission to set on created file.
// The file install.lock prevents the use of the migration process another time. You will have to delete it manually for
// The file install.lock prevents the use of the migration process another time. You will have to delete it manually for
// next upgrade.
// Default value: '0'
// Example: '444';
@ -390,7 +392,7 @@ $dolibarr_cron_allow_cli='0';
// dolibarr_main_db_prefix
// =======================
// This parameter contains prefix of Dolibarr database.
// This parameter contains prefix of Dolibarr database.
// Default value: 'llx_' if not defined
// Examples:
// $dolibarr_main_db_prefix='llx_';

View File

@ -6,6 +6,7 @@
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2023 William Mead <william.mead@manchenumerique.fr>
*
* 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
@ -897,9 +898,6 @@ while ($i < $imaxinloop) {
if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = 'cd.qty';
}
if (!$i) {
$totalarray['val']['cd.qty'] = $obj->qty;
}
$totalarray['val']['cd.qty'] += $obj->qty;
}
if (!empty($arrayfields['cd.total_ht']['checked'])) {

View File

@ -36,9 +36,6 @@ if (!defined('NOREQUIREAJAX')) {
if (!defined('NOREQUIRESOC')) {
define('NOREQUIRESOC', '1');
}
if (!defined('NOREQUIRETRAN')) {
define('NOREQUIRETRAN', '1');
}
// Load Dolibarr environment
require '../../main.inc.php';

View File

@ -9967,6 +9967,13 @@ class Form
$disableline = 1;
}
$label = $obj->name;
$labelhtml = $obj->name;
if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
$label .= " (" . $obj->label . ")";
$labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>';
}
$out .= '<option value="' . $obj->rowid . '"';
if ($disableline) {
$out .= ' disabled';
@ -9974,13 +9981,9 @@ class Form
if ((isset($selected[0]) && is_object($selected[0]) && $selected[0]->id == $obj->rowid) || ((!isset($selected[0]) || !is_object($selected[0])) && !empty($selected) && in_array($obj->rowid, $selected))) {
$out .= ' selected';
}
$out .= ' data-html="'.dol_escape_htmltag($labelhtml).'"';
$out .= '>';
$out .= $obj->name;
if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
$out .= " (" . $obj->label . ")";
}
$out .= $label;
$out .= '</option>';
$i++;
}

View File

@ -1412,7 +1412,7 @@ function pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $pos
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('pdf'=>$pdf, 'i'=>$i, 'outputlangs'=>$outputlangs, 'w'=>$w, 'h'=>$h, 'posx'=>$posx, 'posy'=>$posy, 'hideref'=>$hideref, 'hidedesc'=>$hidedesc, 'issupplierline'=>$issupplierline, 'special_code'=>$special_code);
@ -1800,7 +1800,7 @@ function pdf_getlinenum($object, $i, $outputlangs, $hidedetails = 0)
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code);
@ -1833,7 +1833,7 @@ function pdf_getlineref($object, $i, $outputlangs, $hidedetails = 0)
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code);
@ -1865,7 +1865,7 @@ function pdf_getlineref_supplier($object, $i, $outputlangs, $hidedetails = 0)
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code);
@ -1897,7 +1897,7 @@ function pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails = 0)
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code);
@ -1964,7 +1964,7 @@ function pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails = 0)
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code);
@ -2007,7 +2007,7 @@ function pdf_getlineupwithtax($object, $i, $outputlangs, $hidedetails = 0)
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code);
@ -2044,7 +2044,7 @@ function pdf_getlineqty($object, $i, $outputlangs, $hidedetails = 0)
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code);
@ -2084,7 +2084,7 @@ function pdf_getlineqty_asked($object, $i, $outputlangs, $hidedetails = 0)
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code);
@ -2124,7 +2124,7 @@ function pdf_getlineqty_shipped($object, $i, $outputlangs, $hidedetails = 0)
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code);
@ -2164,7 +2164,7 @@ function pdf_getlineqty_keeptoship($object, $i, $outputlangs, $hidedetails = 0)
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code);
@ -2205,7 +2205,7 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanag
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array(
@ -2250,7 +2250,7 @@ function pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails = 0)
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code);
@ -2294,7 +2294,7 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('i' => $i, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails, 'special_code' => $special_code);
@ -2347,7 +2347,7 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0)
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code, 'sign'=>$sign);
@ -2359,7 +2359,7 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0)
}
}
if (empty($reshook)) {
if ($object->lines[$i]->special_code == 3) {
if (!empty($object->lines[$i]) && $object->lines[$i]->special_code == 3) {
$result .= $outputlangs->transnoentities("Option");
} elseif (empty($hidedetails) || $hidedetails > 1) {
$total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht);
@ -2403,7 +2403,7 @@ function pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails = 0)
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) )
if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run
$special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code);

View File

@ -1109,7 +1109,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
$useridtocheck = 0;
if ($feature == 'holiday') {
$useridtocheck = $object->fk_user;
if (!in_array($object->fk_user, $childids) && !in_array($object->fk_validator, $childids)) {
if (!$user->hasRight('holiday', 'readall') && !in_array($useridtocheck, $childids) && !in_array($object->fk_validator, $childids)) {
return false;
}
}

View File

@ -1599,7 +1599,8 @@ class pdf_sponge extends ModelePDFFactures
// Total remise
$total_line_remise = 0;
foreach ($object->lines as $i => $line) {
$total_line_remise += pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); // TODO: add this method to core/lib/pdf.lib
$resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2);
$total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0);
// Gestion remise sous forme de ligne négative
if ($line->total_ht < 0) {
$total_line_remise += -$line->total_ht;

View File

@ -945,7 +945,7 @@ while ($i < $imaxinloop) {
// Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print '<td class="nowrap" align="center">';
print '<td class="nowrap center">';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
@ -967,8 +967,8 @@ while ($i < $imaxinloop) {
// Ref customer
if (!empty($arrayfields['e.ref_customer']['checked'])) {
print "<td>";
print $obj->ref_customer;
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->ref_customer).'">';
print dol_escape_htmltag($obj->ref_customer);
print "</td>\n";
if (!$i) {
$totalarray['nbfield']++;
@ -996,7 +996,7 @@ while ($i < $imaxinloop) {
// Zip
if (!empty($arrayfields['s.zip']['checked'])) {
print '<td class="nocellnopadd center">';
print $obj->zip;
print dol_escape_htmltag($obj->zip);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
@ -1013,7 +1013,7 @@ while ($i < $imaxinloop) {
if (!empty($arrayfields['country.code_iso']['checked'])) {
print '<td class="center">';
$tmparray = getCountry($obj->fk_pays, 'all');
print $tmparray['label'];
print dol_escape_htmltag($tmparray['label']);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
@ -1138,7 +1138,7 @@ while ($i < $imaxinloop) {
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print '<td class="nowrap" align="center">';
print '<td class="nowrap center">';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {

View File

@ -2916,7 +2916,6 @@ class CommandeFournisseur extends CommonOrder
$this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
$this->line->remise_percent = $remise_percent;
$this->line->subprice = $pu_ht;
$this->line->rang = $this->rang;
$this->line->info_bits = $info_bits;
$this->line->total_ht = $total_ht;
$this->line->total_tva = $total_tva;
@ -2924,7 +2923,8 @@ class CommandeFournisseur extends CommonOrder
$this->line->total_localtax2 = $total_localtax2;
$this->line->total_ttc = $total_ttc;
$this->line->product_type = $type;
$this->line->special_code = (!empty($this->special_code) ? $this->special_code : 0);
$this->line->special_code = $oldline->special_code;
$this->line->rang = $oldline->rang;
$this->line->origin = $this->origin;
$this->line->fk_unit = $fk_unit;

View File

@ -787,7 +787,7 @@ if (empty($reshook)) {
}
$ttc = price2num(GETPOST('price_ttc'), '', 2);
$ht = $ttc / (1 + ($vatratecleaned / 100));
$ht = (float) $ttc / (1 + ($vatratecleaned / 100));
$price_base_type = 'HT';
}

View File

@ -91,6 +91,7 @@ WarningCronDelayed=Attention, for performance purpose, whatever is next date of
DATAPOLICYJob=Data cleaner and anonymizer
JobXMustBeEnabled=Job %s must be enabled
EmailIfError=Email for warning on error
JobNotFound=Job %s not found in list of jobs (try to disable/enabled module)
ErrorInBatch=Error when running the job %s
# Cron Boxes

View File

@ -549,7 +549,7 @@ Reportings=Rapports
Draft=Brouillon
Drafts=Brouillons
StatusInterInvoiced=Facturé
Done=Effectuées
Done=Réalisé
Validated=Validé
ValidatedToProduce=Validé (à produire)
Opened=Ouvert

View File

@ -746,10 +746,10 @@ foreach ($searchCategoryProductList as $searchCategoryProduct) {
$param .= "&search_category_product_list[]=".urlencode($searchCategoryProduct);
}
if ($search_ref) {
$param = "&search_ref=".urlencode($search_ref);
$param .= "&search_ref=".urlencode($search_ref);
}
if ($search_ref_supplier) {
$param = "&search_ref_supplier=".urlencode($search_ref_supplier);
$param .= "&search_ref_supplier=".urlencode($search_ref_supplier);
}
if ($search_barcode) {
$param .= ($search_barcode ? "&search_barcode=".urlencode($search_barcode) : "");
@ -767,7 +767,7 @@ if ($search_tobuy != '') {
$param .= "&search_tobuy=".urlencode($search_tobuy);
}
if ($search_tobatch) {
$param = "&search_tobatch=".urlencode($search_tobatch);
$param .= "&search_tobatch=".urlencode($search_tobatch);
}
if ($search_country != '') {
$param .= "&search_country=".urlencode($search_country);
@ -776,7 +776,7 @@ if ($search_state != '') {
$param .= "&search_state=".urlencode($search_state);
}
if ($search_vatrate) {
$param = "&search_vatrate=".urlencode($search_vatrate);
$param .= "&search_vatrate=".urlencode($search_vatrate);
}
if ($fourn_id > 0) {
$param .= "&fourn_id=".urlencode($fourn_id);
@ -791,25 +791,25 @@ if ($search_type != '') {
$param .= '&search_type='.urlencode($search_type);
}
if ($search_accountancy_code_sell) {
$param = "&search_accountancy_code_sell=".urlencode($search_accountancy_code_sell);
$param .= "&search_accountancy_code_sell=".urlencode($search_accountancy_code_sell);
}
if ($search_accountancy_code_sell_intra) {
$param = "&search_accountancy_code_sell_intra=".urlencode($search_accountancy_code_sell_intra);
$param .= "&search_accountancy_code_sell_intra=".urlencode($search_accountancy_code_sell_intra);
}
if ($search_accountancy_code_sell_export) {
$param = "&search_accountancy_code_sell_export=".urlencode($search_accountancy_code_sell_export);
$param .= "&search_accountancy_code_sell_export=".urlencode($search_accountancy_code_sell_export);
}
if ($search_accountancy_code_buy) {
$param = "&search_accountancy_code_buy=".urlencode($search_accountancy_code_buy);
$param .= "&search_accountancy_code_buy=".urlencode($search_accountancy_code_buy);
}
if ($search_accountancy_code_buy_intra) {
$param = "&search_accountancy_code_buy_intra=".urlencode($search_accountancy_code_buy_intra);
$param .= "&search_accountancy_code_buy_intra=".urlencode($search_accountancy_code_buy_intra);
}
if ($search_accountancy_code_buy_export) {
$param = "&search_accountancy_code_buy_export=".urlencode($search_accountancy_code_buy_export);
$param .= "&search_accountancy_code_buy_export=".urlencode($search_accountancy_code_buy_export);
}
if ($search_finished) {
$param = "&search_finished=".urlencode($search_finished);
$param .= "&search_finished=".urlencode($search_finished);
}
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
@ -943,9 +943,6 @@ if (empty($reshook)) {
if (!empty($moreforfilter)) {
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
}