mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-04 16:12:39 +01:00
Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c33b7e0bf1 | ||
|
|
ba2c173936 | ||
|
|
0beee0bec5 | ||
|
|
30ecf80732 | ||
|
|
c2ae7d2da1 | ||
|
|
71ec381d3e | ||
|
|
5de1fcca2f | ||
|
|
50afc9682b | ||
|
|
bcf6d6a7a2 | ||
|
|
e818bf732d | ||
|
|
18725aec6b | ||
|
|
7fa3474ecd | ||
|
|
d81a2d060e | ||
|
|
97aaff7395 | ||
|
|
b67fdb3e51 | ||
|
|
ad60a50d4d | ||
|
|
08a976fd85 | ||
|
|
db47ce3bb1 | ||
|
|
5354b54ec0 | ||
|
|
42d8591758 | ||
|
|
628189f57f | ||
|
|
748dcd0881 | ||
|
|
7a7146c03d | ||
|
|
0912b3b04f | ||
|
|
2dd81deb13 | ||
|
|
273ec857a3 | ||
|
|
2519278269 | ||
|
|
74881ae251 | ||
|
|
115323dec8 | ||
|
|
753e5e535d | ||
|
|
a602309e04 | ||
|
|
f51935a258 | ||
|
|
93f23fe452 | ||
|
|
8a55e2f6a4 | ||
|
|
e0a3756c6e | ||
|
|
910f7e8564 | ||
|
|
7cf1a97673 | ||
|
|
cf57e7e88b | ||
|
|
a186e16568 | ||
|
|
70a453a5c2 | ||
|
|
336d3ad8e5 | ||
|
|
e71631abe0 |
@@ -103,7 +103,9 @@ if ($action == "set") {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
} elseif (!$error) {
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
|
||||
@@ -58,6 +58,18 @@ class DolibarrApi
|
||||
|
||||
$this->db = $db;
|
||||
$production_mode = (empty($conf->global->API_PRODUCTION_MODE) ? false : true);
|
||||
|
||||
if ($production_mode) {
|
||||
// Create the directory Defaults::$cacheDirectory if it does not exist. If dir does not exist, using production_mode generates an error 500.
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
if (!dol_is_dir(Defaults::$cacheDirectory)) {
|
||||
dol_mkdir(Defaults::$cacheDirectory, DOL_DATA_ROOT);
|
||||
}
|
||||
if (getDolGlobalString('MAIN_API_DEBUG')) {
|
||||
dol_syslog("Debug API construct::cacheDirectory=".Defaults::$cacheDirectory, LOG_DEBUG, 0, '_api');
|
||||
}
|
||||
}
|
||||
|
||||
$this->r = new Restler($production_mode, $refreshCache);
|
||||
|
||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
|
||||
@@ -1181,8 +1181,14 @@ if ($action == 'create') {
|
||||
$preselectedids[GETPOST('contactid', 'int')] = GETPOST('contactid', 'int');
|
||||
}
|
||||
if ($origin=='contact') $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int');
|
||||
// select "all" or "none" contact by default
|
||||
if (getDolGlobalInt('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT')) {
|
||||
$select_contact_default = 0; // select "all" contacts by default : avoid to use it if there is a lot of contacts
|
||||
} else {
|
||||
$select_contact_default = -1; // select "none" by default
|
||||
}
|
||||
print img_picto('', 'contact', 'class="paddingrightonly"');
|
||||
print $form->selectcontacts(GETPOST('socid', 'int'), $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid');
|
||||
print $form->selectcontacts(GETPOSTISSET('socid') ? GETPOSTINT('socid') : $select_contact_default, $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@@ -1664,7 +1670,12 @@ if ($id > 0) {
|
||||
// related contact
|
||||
print '<tr><td>'.$langs->trans("ActionOnContact").'</td><td>';
|
||||
print '<div class="maxwidth200onsmartphone">';
|
||||
print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts($object->socid, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid');
|
||||
if (getDolGlobalInt('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT')) {
|
||||
$select_contact_default = 0; // select "all" contacts by default : avoid to use it if there is a lot of contacts
|
||||
} else {
|
||||
$select_contact_default = -1; // select "none" by default
|
||||
}
|
||||
print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts(!empty($object->socid) ? $object->socid : $select_contact_default, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid');
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -1203,11 +1203,14 @@ class ActionComm extends CommonObject
|
||||
|
||||
if (!empty($this->socpeopleassigned)) {
|
||||
$already_inserted = array();
|
||||
foreach (array_keys($this->socpeopleassigned) as $id) {
|
||||
foreach (array_keys($this->socpeopleassigned) as $key => $val) {
|
||||
if (!is_array($val)) { // For backward compatibility when val=id
|
||||
$val = array('id'=>$val);
|
||||
}
|
||||
if (!empty($already_inserted[$val['id']])) continue;
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
|
||||
$sql .= " VALUES(".$this->id.", 'socpeople', ".$id.", 0, 0, 0)";
|
||||
$sql .= " VALUES(".((int) $this->id).", 'socpeople', ".((int) $val['id']).", 0, 0, 0)";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
@@ -2341,6 +2344,7 @@ class ActionComm extends CommonObject
|
||||
|
||||
// Load event
|
||||
$res = $this->fetch($actionCommReminder->fk_actioncomm);
|
||||
if ($res > 0) $res = $this->fetch_thirdparty();
|
||||
if ($res > 0) {
|
||||
// PREPARE EMAIL
|
||||
$errormesg = '';
|
||||
|
||||
@@ -183,7 +183,6 @@ class Propal extends CommonObject
|
||||
public $fin_validite;
|
||||
|
||||
public $user_author_id;
|
||||
public $user_valid_id;
|
||||
public $user_close_id;
|
||||
|
||||
/**
|
||||
@@ -1369,7 +1368,7 @@ class Propal extends CommonObject
|
||||
|
||||
// Clear fields
|
||||
$object->user_author = $user->id;
|
||||
$object->user_valid = '';
|
||||
$object->user_validation_id = 0;
|
||||
$object->date = $now;
|
||||
$object->datep = $now; // deprecated
|
||||
$object->fin_validite = $object->date + ($object->duree_validite * 24 * 3600);
|
||||
@@ -1554,7 +1553,7 @@ class Propal extends CommonObject
|
||||
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
||||
|
||||
$this->user_author_id = $obj->fk_user_author;
|
||||
$this->user_valid_id = $obj->fk_user_valid;
|
||||
$this->user_validation_id = $obj->fk_user_valid;
|
||||
$this->user_close_id = $obj->fk_user_cloture;
|
||||
|
||||
//Incoterms
|
||||
@@ -1656,7 +1655,7 @@ class Propal extends CommonObject
|
||||
$sql .= " total_ttc=".(isset($this->total_ttc) ? $this->total_ttc : "null").",";
|
||||
$sql .= " fk_statut=".(isset($this->statut) ? $this->statut : "null").",";
|
||||
$sql .= " fk_user_author=".(isset($this->user_author_id) ? $this->user_author_id : "null").",";
|
||||
$sql .= " fk_user_valid=".(isset($this->user_valid) ? $this->user_valid : "null").",";
|
||||
$sql .= " fk_user_valid = ".(!empty($this->user_validation_id) ? (int) $this->user_validation_id : "null").",";
|
||||
$sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").",";
|
||||
$sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").",";
|
||||
$sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").",";
|
||||
@@ -1942,7 +1941,7 @@ class Propal extends CommonObject
|
||||
$this->ref = $num;
|
||||
$this->brouillon = 0;
|
||||
$this->statut = self::STATUS_VALIDATED;
|
||||
$this->user_valid_id = $user->id;
|
||||
$this->user_validation_id = $user->id;
|
||||
$this->datev = $now;
|
||||
|
||||
$this->db->commit();
|
||||
@@ -3199,9 +3198,7 @@ class Propal extends CommonObject
|
||||
$this->user_creation = $cuser;
|
||||
|
||||
if ($obj->fk_user_valid) {
|
||||
$vuser = new User($this->db);
|
||||
$vuser->fetch($obj->fk_user_valid);
|
||||
$this->user_validation = $vuser;
|
||||
$this->user_validation_id = $obj->fk_user_valid;
|
||||
}
|
||||
|
||||
if ($obj->fk_user_signature) {
|
||||
|
||||
@@ -1156,7 +1156,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -315,6 +315,7 @@ class Invoices extends DolibarrApi
|
||||
* @return int
|
||||
* @throws RestException 400
|
||||
* @throws RestException 401
|
||||
* @throws RestException 403 Access not allowed for login
|
||||
* @throws RestException 404
|
||||
* @throws RestException 405
|
||||
*/
|
||||
@@ -332,6 +333,9 @@ class Invoices extends DolibarrApi
|
||||
if (empty($orderid)) {
|
||||
throw new RestException(400, 'Order ID is mandatory');
|
||||
}
|
||||
if (!DolibarrApi::_checkAccessToResource('commande', $orderid)) {
|
||||
throw new RestException(403, 'Access not allowed on order for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$order = new Commande($this->db);
|
||||
$result = $order->fetch($orderid);
|
||||
|
||||
@@ -5094,116 +5094,117 @@ class Facture extends CommonInvoice
|
||||
|
||||
if ($resql) {
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
if (!$error) {
|
||||
// Load event
|
||||
$res = $tmpinvoice->fetch($obj->id);
|
||||
// Create a loopError that is reset at each loop, this counter is added to the global counter at the end of loop
|
||||
$loopError = 0;
|
||||
// Load event
|
||||
$res = $tmpinvoice->fetch($obj->id);
|
||||
if ($res > 0) {
|
||||
$tmpinvoice->fetch_thirdparty();
|
||||
|
||||
$outputlangs = new Translate('', $conf);
|
||||
if ($tmpinvoice->thirdparty->default_lang) {
|
||||
$outputlangs->setDefaultLang($tmpinvoice->thirdparty->default_lang);
|
||||
$outputlangs->loadLangs(array("main", "bills"));
|
||||
} else {
|
||||
$outputlangs = $langs;
|
||||
}
|
||||
|
||||
// Select email template
|
||||
$arraymessage = $formmail->getEMailTemplate($this->db, 'facture_send', $user, $outputlangs, (is_numeric($template) ? $template : 0), 1, (is_numeric($template) ? '' : $template));
|
||||
if (is_numeric($arraymessage) && $arraymessage <= 0) {
|
||||
$langs->load("errors");
|
||||
$this->output .= $langs->trans('ErrorFailedToFindEmailTemplate', $template);
|
||||
return 0; // Hint: Strange to return 0 in case of error, because this function is used by cron task and 0 means OK.
|
||||
}
|
||||
|
||||
// PREPARE EMAIL
|
||||
$errormesg = '';
|
||||
|
||||
// Make substitution in email content
|
||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, '', $tmpinvoice);
|
||||
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $tmpinvoice);
|
||||
|
||||
// Topic
|
||||
$sendTopic = make_substitutions(empty($arraymessage->topic) ? $outputlangs->transnoentitiesnoconv('InformationMessage') : $arraymessage->topic, $substitutionarray, $outputlangs, 1);
|
||||
|
||||
// Content
|
||||
$content = $outputlangs->transnoentitiesnoconv($arraymessage->content);
|
||||
|
||||
$sendContent = make_substitutions($content, $substitutionarray, $outputlangs, 1);
|
||||
|
||||
// Recipient
|
||||
$res = $tmpinvoice->fetch_thirdparty();
|
||||
$recipient = $tmpinvoice->thirdparty;
|
||||
if ($res > 0) {
|
||||
$tmpinvoice->fetch_thirdparty();
|
||||
|
||||
$outputlangs = new Translate('', $conf);
|
||||
if ($tmpinvoice->thirdparty->default_lang) {
|
||||
$outputlangs->setDefaultLang($tmpinvoice->thirdparty->default_lang);
|
||||
$outputlangs->loadLangs(array("main", "bills"));
|
||||
if (!empty($recipient->email)) {
|
||||
$to = $recipient->email;
|
||||
} else {
|
||||
$outputlangs = $langs;
|
||||
}
|
||||
|
||||
// Select email template
|
||||
$arraymessage = $formmail->getEMailTemplate($this->db, 'facture_send', $user, $outputlangs, (is_numeric($template) ? $template : 0), 1, (is_numeric($template) ? '' : $template));
|
||||
if (is_numeric($arraymessage) && $arraymessage <= 0) {
|
||||
$langs->load("errors");
|
||||
$this->output .= $langs->trans('ErrorFailedToFindEmailTemplate', $template);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// PREPARE EMAIL
|
||||
$errormesg = '';
|
||||
|
||||
// Make substitution in email content
|
||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, '', $tmpinvoice);
|
||||
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $tmpinvoice);
|
||||
|
||||
// Topic
|
||||
$sendTopic = make_substitutions(empty($arraymessage->topic) ? $outputlangs->transnoentitiesnoconv('InformationMessage') : $arraymessage->topic, $substitutionarray, $outputlangs, 1);
|
||||
|
||||
// Content
|
||||
$content = $outputlangs->transnoentitiesnoconv($arraymessage->content);
|
||||
|
||||
$sendContent = make_substitutions($content, $substitutionarray, $outputlangs, 1);
|
||||
|
||||
// Recipient
|
||||
$res = $tmpinvoice->fetch_thirdparty();
|
||||
$recipient = $tmpinvoice->thirdparty;
|
||||
if ($res > 0) {
|
||||
if (!empty($recipient->email)) {
|
||||
$to = $recipient->email;
|
||||
} else {
|
||||
$errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->fk_soc.". No email defined for user.";
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
$errormesg = "Failed to load recipient with thirdparty id=".$tmpinvoice->fk_soc;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Sender
|
||||
$from = $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
if (empty($from)) {
|
||||
$errormesg = "Failed to get sender into global setup MAIN_MAIL_EMAIL_FROM";
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Errors Recipient
|
||||
$errors_to = $conf->global->MAIN_MAIL_ERRORS_TO;
|
||||
|
||||
$trackid = 'inv'.$tmpinvoice->id;
|
||||
|
||||
//join file is asked
|
||||
$joinFile = [];
|
||||
$joinFileName = [];
|
||||
$joinFileMime = [];
|
||||
if ($arraymessage->joinfiles == 1 && !empty($tmpinvoice->last_main_doc)) {
|
||||
$joinFile[] = DOL_DATA_ROOT.$tmpinvoice->last_main_doc;
|
||||
$joinFileName[] = basename($tmpinvoice->last_main_doc);
|
||||
$joinFileMime[] = dol_mimetype(DOL_DATA_ROOT.$tmpinvoice->last_main_doc);
|
||||
}
|
||||
|
||||
// Mail Creation
|
||||
$cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, $joinFile, $joinFileMime, $joinFileName, '', "", 0, 1, $errors_to, '', $trackid, '', '', '');
|
||||
|
||||
// Sending Mail
|
||||
if ($cMailFile->sendfile()) {
|
||||
$nbMailSend++;
|
||||
} else {
|
||||
$errormesg = $cMailFile->error.' : '.$to;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($errormesg) {
|
||||
$errorsMsg[] = $errormesg;
|
||||
$errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->fk_soc.". No email defined for user.";
|
||||
$loopError++;
|
||||
}
|
||||
} else {
|
||||
$errorsMsg[] = 'Failed to fetch record invoice with ID = '.$obj->id;
|
||||
$error++;
|
||||
$errormesg = "Failed to load recipient with thirdparty id=".$tmpinvoice->fk_soc;
|
||||
$loopError++;
|
||||
}
|
||||
|
||||
// Sender
|
||||
$from = $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
if (empty($from)) {
|
||||
$errormesg = "Failed to get sender into global setup MAIN_MAIL_EMAIL_FROM";
|
||||
$loopError++;
|
||||
}
|
||||
|
||||
if (!$loopError) { // No error until then
|
||||
// Errors Recipient
|
||||
$errors_to = $conf->global->MAIN_MAIL_ERRORS_TO;
|
||||
|
||||
$trackid = 'inv'.$tmpinvoice->id;
|
||||
|
||||
//join file is asked
|
||||
$joinFile = [];
|
||||
$joinFileName = [];
|
||||
$joinFileMime = [];
|
||||
if ($arraymessage->joinfiles == 1 && !empty($tmpinvoice->last_main_doc)) {
|
||||
$joinFile[] = DOL_DATA_ROOT.$tmpinvoice->last_main_doc;
|
||||
$joinFileName[] = basename($tmpinvoice->last_main_doc);
|
||||
$joinFileMime[] = dol_mimetype(DOL_DATA_ROOT.$tmpinvoice->last_main_doc);
|
||||
}
|
||||
|
||||
// Mail Creation
|
||||
$cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, $joinFile, $joinFileMime, $joinFileName, '', "", 0, 1, $errors_to, '', $trackid, '', '', '');
|
||||
|
||||
// Sending Mail
|
||||
if ($cMailFile->sendfile()) {
|
||||
$nbMailSend++;
|
||||
} else {
|
||||
$errormesg = $cMailFile->error.' : '.$to;
|
||||
$loopError++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($errormesg) {
|
||||
$errorsMsg[] = $errormesg;
|
||||
}
|
||||
} else {
|
||||
$errorsMsg[] = 'Failed to fetch record invoice with ID = '.$obj->id;
|
||||
$loopError++;
|
||||
}
|
||||
$error += $loopError;
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$this->output .= 'Nb of emails sent : '.$nbMailSend;
|
||||
$this->db->commit();
|
||||
return 0;
|
||||
} else {
|
||||
if ($error > 0) { // If there is azt least an error, early return with specific message
|
||||
$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;
|
||||
return $error;
|
||||
}
|
||||
|
||||
$this->output .= 'Nb of emails sent : '.$nbMailSend;
|
||||
$this->db->commit();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -481,6 +481,11 @@ abstract class CommonObject
|
||||
*/
|
||||
public $date_modification; // Date last change (tms field)
|
||||
|
||||
/**
|
||||
* @var int|null User id of validation
|
||||
*/
|
||||
public $user_validation_id;
|
||||
|
||||
public $next_prev_filter;
|
||||
|
||||
/**
|
||||
@@ -2046,7 +2051,9 @@ abstract class CommonObject
|
||||
$sql = "SELECT MAX(te.".$fieldid.")";
|
||||
$sql .= " FROM ".(empty($nodbprefix) ?MAIN_DB_PREFIX:'').$this->table_element." as te";
|
||||
if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
$sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
if (empty($user->admin) || !empty($user->entity) || $conf->entity != 1) {
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON ug.fk_user = te.rowid";
|
||||
}
|
||||
}
|
||||
if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) {
|
||||
$tmparray = explode('@', $this->ismultientitymanaged);
|
||||
@@ -2083,7 +2090,6 @@ abstract class CommonObject
|
||||
if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
|
||||
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
||||
} else {
|
||||
$sql .= " AND ug.fk_user = te.rowid";
|
||||
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
|
||||
}
|
||||
} else {
|
||||
@@ -2116,7 +2122,9 @@ abstract class CommonObject
|
||||
$sql = "SELECT MIN(te.".$fieldid.")";
|
||||
$sql .= " FROM ".(empty($nodbprefix) ?MAIN_DB_PREFIX:'').$this->table_element." as te";
|
||||
if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
$sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
if (empty($user->admin) || !empty($user->entity) || $conf->entity != 1) {
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON ug.fk_user=te.rowid";
|
||||
}
|
||||
}
|
||||
if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) {
|
||||
$tmparray = explode('@', $this->ismultientitymanaged);
|
||||
@@ -2153,8 +2161,7 @@ abstract class CommonObject
|
||||
if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
|
||||
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
||||
} else {
|
||||
$sql .= " AND ug.fk_user = te.rowid";
|
||||
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
|
||||
$sql .= " AND ug.entity IN (".getEntity($this->element).")";
|
||||
}
|
||||
} else {
|
||||
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
|
||||
@@ -7691,7 +7698,7 @@ abstract class CommonObject
|
||||
$("#"+child_list).hide();
|
||||
//Show mother lists
|
||||
} else if ($("#"+parent_list).val() != 0){
|
||||
$("#"+parent_list).show();
|
||||
showOptions'.$type.'(child_list, parent_list, orig_select[child_list]);
|
||||
}
|
||||
//Show the child list if the parent list value is selected
|
||||
$("select[name=\""+parent_list+"\"]").click(function() {
|
||||
|
||||
@@ -168,7 +168,7 @@ class Utils
|
||||
}
|
||||
|
||||
// Recreate temp dir that are not automatically recreated by core code for performance purpose, we need them
|
||||
if (!empty($conf->api->enabled)) {
|
||||
if (isModEnabled('api')) {
|
||||
dol_mkdir($conf->api->dir_temp);
|
||||
}
|
||||
dol_mkdir($conf->user->dir_temp);
|
||||
@@ -461,7 +461,7 @@ class Utils
|
||||
if ($compression == 'bz') {
|
||||
bzclose($handle);
|
||||
}
|
||||
if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error
|
||||
if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg) || preg_match('/^\/\*M?!999999/', $errormsg)) { // Start of file is ok, NOT an error
|
||||
$errormsg = '';
|
||||
} else {
|
||||
// Renommer fichier sortie en fichier erreur
|
||||
|
||||
@@ -1173,4 +1173,39 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Code to manage the js for combo list with dependencies (called by extrafields_view.tpl.php)
|
||||
function showOptions(child_list, parent_list) {
|
||||
var parentInput = $("select[name="+parent_list+"]");
|
||||
if (parentInput.length === 0) { // when parent extra-field is in view mode and the child is edited directly on card (on line edit)
|
||||
parentInput = $("input[name="+parent_list+"]");
|
||||
}
|
||||
if (parentInput.length > 0) {
|
||||
var val = parentInput.val();
|
||||
var parentVal = parent_list + ":" + val;
|
||||
if (val > 0) {
|
||||
$("select[name=\""+child_list+"\"] option[parent]").prop("disabled", true).hide(); // hide not work with select2 element so disabled it
|
||||
$("select[name=\""+child_list+"\"] option[parent=\""+parentVal+"\"]").prop('disabled', false).show(); // show not work with select2 element so enabled it
|
||||
} else {
|
||||
$("select[name=\""+child_list+"\"] option").prop("disabled", false).show(); // show not work with select2 element so enabled it
|
||||
}
|
||||
}
|
||||
}
|
||||
function setListDependencies() {
|
||||
console.log("setListDependencies");
|
||||
jQuery("select option[parent]").parent().each(function() {
|
||||
var child_list = $(this).attr("name");
|
||||
var parent = $(this).find("option[parent]:first").attr("parent");
|
||||
var infos = parent.split(":");
|
||||
var parent_list = infos[0];
|
||||
showOptions(child_list, parent_list);
|
||||
|
||||
/* Activate the handler to call showOptions on each future change */
|
||||
$("select[name=\""+parent_list+"\"]").change(function() {
|
||||
showOptions(child_list, parent_list);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// End of lib_head.js.php
|
||||
|
||||
@@ -656,7 +656,6 @@ class modProduct extends DolibarrModules
|
||||
'p.fk_product_type'=>'^[0|1]$',
|
||||
'p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$',
|
||||
'p.recuperableonly' => '^[0|1]$',
|
||||
'p.finished' => '^[0|1]$'
|
||||
);
|
||||
// field order as per structure of table llx_product
|
||||
$import_sample = array(
|
||||
|
||||
@@ -257,6 +257,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
|
||||
} else {
|
||||
//var_dump($tmpkeyextra.'-'.$value.'-'.$object->table_element);
|
||||
print $extrafields->showOutputField($tmpkeyextra, $value, '', $object->table_element);
|
||||
print '<input type="hidden" value="' . $value . '" name="options_' . $tmpkeyextra . '" id="options_' . $tmpkeyextra . '"/>'; // it's needed when to get parent value when extra-field list depend on parent extra-field list
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
@@ -271,31 +272,6 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
|
||||
print '
|
||||
<script>
|
||||
jQuery(document).ready(function() {
|
||||
function showOptions(child_list, parent_list)
|
||||
{
|
||||
var val = $("select[name="+parent_list+"]").val();
|
||||
var parentVal = parent_list + ":" + val;
|
||||
if(val > 0) {
|
||||
$("select[name=\""+child_list+"\"] option[parent]").hide();
|
||||
$("select[name=\""+child_list+"\"] option[parent=\""+parentVal+"\"]").show();
|
||||
} else {
|
||||
$("select[name=\""+child_list+"\"] option").show();
|
||||
}
|
||||
}
|
||||
function setListDependencies() {
|
||||
jQuery("select option[parent]").parent().each(function() {
|
||||
var child_list = $(this).attr("name");
|
||||
var parent = $(this).find("option[parent]:first").attr("parent");
|
||||
var infos = parent.split(":");
|
||||
var parent_list = infos[0];
|
||||
showOptions(child_list, parent_list);
|
||||
|
||||
/* Activate the handler to call showOptions on each future change */
|
||||
$("select[name=\""+parent_list+"\"]").change(function() {
|
||||
showOptions(child_list, parent_list);
|
||||
});
|
||||
});
|
||||
}
|
||||
setListDependencies();
|
||||
});
|
||||
</script>'."\n";
|
||||
|
||||
@@ -1322,6 +1322,8 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
// We set order into draft status
|
||||
$this->brouillon = 1;
|
||||
$this->statut = self::STATUS_DRAFT; // deprecated
|
||||
$this->status = self::STATUS_DRAFT;
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."commande_fournisseur (";
|
||||
$sql .= "ref";
|
||||
@@ -2131,6 +2133,16 @@ class CommandeFournisseur extends CommonOrder
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."commandedet SET fk_commandefourndet = NULL WHERE fk_commandefourndet IN (SELECT rowid FROM ".$main." WHERE fk_commande = ".((int) $this->id).")";
|
||||
dol_syslog(__METHOD__." linked order lines", LOG_DEBUG);
|
||||
if (!$this->db->query($sql1)) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseurdet WHERE fk_commande =".((int) $this->id);
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
if (!$this->db->query($sql)) {
|
||||
@@ -3892,7 +3904,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql1 = 'UPDATE '.MAIN_DB_PREFIX."commandedet SET fk_commandefourndet = NULL WHERE rowid=".((int) $this->id);
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."commandedet SET fk_commandefourndet = NULL WHERE fk_commandefourndet=".((int) $this->id);
|
||||
$resql = $this->db->query($sql1);
|
||||
if (!$resql) {
|
||||
$this->db->rollback();
|
||||
|
||||
@@ -987,6 +987,13 @@ class Holiday extends CommonObject
|
||||
$error++; $this->errors[] = "Error ".$this->db->lasterror();
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $this->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if (!$notrigger) {
|
||||
// Call trigger
|
||||
|
||||
@@ -117,14 +117,14 @@ class Segment implements IteratorAggregate, Countable
|
||||
// Remove the IF tag
|
||||
$this->xml = str_replace('[!-- IF '.$key.' --]', '', $this->xml);
|
||||
// Remove everything between the ELSE tag (if it exists) and the ENDIF tag
|
||||
$reg = '@(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
$reg = '@(\[!--\sELSE\s' . preg_quote($key, '@') . '\s--\](.*))?\[!--\sENDIF\s' . preg_quote($key, '@') . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
$this->xml = preg_replace($reg, '', $this->xml);
|
||||
}
|
||||
// Else the value is false, then two cases: no ELSE and we're done, or there is at least one place where there is an ELSE clause, then we replace it
|
||||
else
|
||||
{
|
||||
// Find all conditional blocks for this variable: from IF to ELSE and to ENDIF
|
||||
$reg = '@\[!--\sIF\s' . $key . '\s--\](.*)(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
$reg = '@\[!--\sIF\s' . preg_quote($key, '@') . '\s--\](.*)(\[!--\sELSE\s' . preg_quote($key, '@') . '\s--\](.*))?\[!--\sENDIF\s' . preg_quote($key, '@') . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER);
|
||||
foreach($matches as $match) { // For each match, if there is an ELSE clause, we replace the whole block by the value in the ELSE clause
|
||||
if (!empty($match[3])) $this->xml = str_replace($match[0], $match[3], $this->xml);
|
||||
|
||||
@@ -539,7 +539,8 @@ IMG;
|
||||
private function _parse($type='content')
|
||||
{
|
||||
// Search all tags fou into condition to complete $this->vars, so we will proceed all tests even if not defined
|
||||
$reg='@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU';
|
||||
$reg='@\[!--\sIF\s([\[\]{}a-zA-Z0-9\.\,_]+)\s--\]@smU';
|
||||
$matches = array();
|
||||
preg_match_all($reg, $this->contentXml, $matches, PREG_SET_ORDER);
|
||||
|
||||
//var_dump($this->vars);exit;
|
||||
@@ -564,7 +565,7 @@ IMG;
|
||||
// Remove the IF tag
|
||||
$this->contentXml = str_replace('[!-- IF '.$key.' --]', '', $this->contentXml);
|
||||
// Remove everything between the ELSE tag (if it exists) and the ENDIF tag
|
||||
$reg = '@(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
$reg = '@(\[!--\sELSE\s' . preg_quote($key, '@') . '\s--\](.*))?\[!--\sENDIF\s' . preg_quote($key, '@') . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
$this->contentXml = preg_replace($reg, '', $this->contentXml);
|
||||
/*if ($sav != $this->contentXml)
|
||||
{
|
||||
@@ -578,7 +579,7 @@ IMG;
|
||||
//dol_syslog("Var ".$key." is not defined, we remove the IF, ELSE and ENDIF ");
|
||||
//$sav=$this->contentXml;
|
||||
// Find all conditional blocks for this variable: from IF to ELSE and to ENDIF
|
||||
$reg = '@\[!--\sIF\s' . $key . '\s--\](.*)(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
$reg = '@\[!--\sIF\s' . preg_quote($key, '@') . '\s--\](.*)(\[!--\sELSE\s' . preg_quote($key, '@') . '\s--\](.*))?\[!--\sENDIF\s' . preg_quote($key, '@') . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
preg_match_all($reg, $this->contentXml, $matches, PREG_SET_ORDER);
|
||||
foreach($matches as $match) { // For each match, if there is an ELSE clause, we replace the whole block by the value in the ELSE clause
|
||||
if (!empty($match[3])) $this->contentXml = str_replace($match[0], $match[3], $this->contentXml);
|
||||
|
||||
@@ -332,6 +332,8 @@ ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN desiredstock float;
|
||||
|
||||
ALTER TABLE llx_product ADD COLUMN fk_state integer DEFAULT NULL AFTER fk_country;
|
||||
|
||||
ALTER TABLE llx_product CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
|
||||
ALTER TABLE llx_projet ADD COLUMN email_msgid varchar(255);
|
||||
ALTER TABLE llx_ticket ADD COLUMN email_msgid varchar(255);
|
||||
ALTER TABLE llx_actioncomm ADD COLUMN reply_to varchar(255);
|
||||
@@ -597,3 +599,172 @@ insert into llx_c_actioncomm (id, code, type, libelle, module, active, position)
|
||||
|
||||
ALTER TABLE llx_export_model MODIFY COLUMN type varchar(64);
|
||||
|
||||
|
||||
-- ALL tms thanks to regis (commit 111f73bd863c7120a9c13a8fc9ae227a02079cb0)
|
||||
|
||||
ALTER TABLE llx_accounting_account CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_accounting_bookkeeping CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_accounting_bookkeeping_tmp CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_accounting_fiscalyear CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_actioncomm_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_actioncomm CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_adherent_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_adherent CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_adherent_type_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_adherent_type CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_advtargetemailing CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_asset_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_asset CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_asset_type_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_asset_type CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_bank_account_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_bank_account CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_bank CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_blockedlog_authority CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_blockedlog CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_bom_bom_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_bom_bomline_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_bom_bom CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_bordereau_cheque CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_boxes_def CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_budget_lines CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_budget CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_categories_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_categorie CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_c_email_senderprofile CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_c_email_templates CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_c_field_list CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_chargesociales CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commandedet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande_fournisseurdet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande_fournisseur_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande_fournisseur_log CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande_fournisseur CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_comment CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_const CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_contratdet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_contratdet_log CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_contratdet CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_contrat_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_contrat CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_cronjob CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_c_shipment_mode CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_deplacement CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_don_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_don CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_element_resources CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_emailcollector_emailcollectoraction CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_emailcollector_emailcollectorfilter CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_emailcollector_emailcollector CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_entrepot_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_entrepot CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_establishment CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_events CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_expeditiondet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_expedition_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_expedition CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_expensereport_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_expensereport_ik CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_expensereport_rules CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_expensereport CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facturedet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facturedet_rec_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facture_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facture_fourn_det_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facture_fourn_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facture_fourn CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facture_rec_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facture_rec CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facture CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_fichinterdet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_fichinter_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_fichinter CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_holiday_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_holiday CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_inventorydet CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_inventorydet CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_inventory CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_inventory CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_loan_schedule CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_loan CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_localtax CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_mailing_cibles CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_mailing CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_mailing_unsubscribe CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_menu CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_mrp_mo_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_mrp_mo CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_mrp_production CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_notify_def CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_notify CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_online_signatures CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_opensurvey_comments CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_opensurvey_user_studs CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_paiementcharge CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_paiementfourn CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_paiement CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_payment_donation CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_payment_expensereport CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_payment_loan CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_payment_salary_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_payment_salary CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_payment_various CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_pos_cash_fence CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_printing CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_batch CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_customer_price CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_fournisseur_price_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_fournisseur_price CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_lot_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_lot CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_price_by_qty CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_price CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_stock_entrepot CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_stock CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_projet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_projet CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_projet_task_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_projet_task CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_propaldet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_propal_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_propal_merge_pdf_product CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_propal CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_reception_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_reception CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_resource_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_resource CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_account CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_address CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_contacts CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_prices CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_remise CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_remise_supplier CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_rib CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_socpeople_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_socpeople CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_stock_mouvement CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_subscription CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_supplier_proposaldet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_supplier_proposal_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_supplier_proposal CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_ticket_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_ticket CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_tva CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_user_employment CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_user_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_usergroup_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_usergroup CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_user_rib CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_user CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_website_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_website_page CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_website CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_zapier_hook CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
|
||||
@@ -194,17 +194,20 @@ if ($action == 'order' && GETPOST('valid')) {
|
||||
// TODO Get desc in language of thirdparty
|
||||
}
|
||||
|
||||
$line->tva_tx = $productsupplier->vatrate_supplier;
|
||||
$tva = $line->tva_tx / 100;
|
||||
|
||||
// If we use multicurrency
|
||||
if (isModEnabled('multicurrency') && !empty($productsupplier->fourn_multicurrency_code) && $productsupplier->fourn_multicurrency_code != $conf->currency) {
|
||||
$line->multicurrency_code = $productsupplier->fourn_multicurrency_code;
|
||||
$line->fk_multicurrency = $productsupplier->fourn_multicurrency_id;
|
||||
$line->multicurrency_subprice = $productsupplier->fourn_multicurrency_unitprice;
|
||||
$line->multicurrency_code = $productsupplier->fourn_multicurrency_code;
|
||||
$line->fk_multicurrency = $productsupplier->fourn_multicurrency_id;
|
||||
$line->multicurrency_subprice = $productsupplier->fourn_multicurrency_unitprice;
|
||||
$line->multicurrency_total_ht = $line->multicurrency_subprice * $qty;
|
||||
$line->multicurrency_total_tva = $line->multicurrency_total_ht * $tva;
|
||||
$line->multicurrency_total_ttc = $line->multicurrency_total_ht + $line->multicurrency_total_tva;
|
||||
}
|
||||
|
||||
$line->tva_tx = $productsupplier->vatrate_supplier;
|
||||
$line->subprice = $productsupplier->fourn_pu;
|
||||
$line->total_ht = $productsupplier->fourn_pu * $qty;
|
||||
$tva = $line->tva_tx / 100;
|
||||
$line->total_tva = $line->total_ht * $tva;
|
||||
$line->total_ttc = $line->total_ht + $line->total_tva;
|
||||
$line->remise_percent = $productsupplier->remise_percent;
|
||||
|
||||
@@ -507,7 +507,7 @@ if ($search_sale == -2) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid";
|
||||
//elseif ($search_sale || (empty($user->rights->societe->client->voir) && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->societe->client->readallthirdparties_advance)) && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
} elseif (!empty($search_sale) && $search_sale != '-1' || (empty($user->rights->societe->client->voir) && !$socid)) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux AS sc ON s.rowid = sc.fk_soc";
|
||||
}
|
||||
// Add table from hooks
|
||||
$parameters = array();
|
||||
@@ -518,9 +518,6 @@ $sql .= " WHERE s.entity IN (".getEntity('societe').")";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($search_sale && $search_sale != '-1' && $search_sale != '-2') {
|
||||
$sql .= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
}
|
||||
if (!$user->rights->fournisseur->lire) {
|
||||
$sql .= " AND (s.fournisseur <> 1 OR s.client <> 0)"; // client=0, fournisseur=0 must be visible
|
||||
}
|
||||
|
||||
@@ -1922,7 +1922,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
||||
$exclude = array();
|
||||
|
||||
$usergroup = new UserGroup($db);
|
||||
$groupslist = $usergroup->listGroupsForUser($object->id);
|
||||
$groupslist = $usergroup->listGroupsForUser($object->id, false);
|
||||
|
||||
if (!empty($groupslist)) {
|
||||
foreach ($groupslist as $groupforuser) {
|
||||
|
||||
@@ -210,7 +210,7 @@ if (is_array($object->lines) && (count($object->lines) > 0)) {
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
$user->getrights();
|
||||
$user->getrights('', 1); // We force rights reload to have the correct permissions for user in the entity we just switched in
|
||||
}
|
||||
|
||||
// Reload langs
|
||||
|
||||
Reference in New Issue
Block a user