mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
5797a0db3f
|
|
@ -405,15 +405,16 @@ WHERE
|
|||
GROUP BY fk_facture
|
||||
";
|
||||
$resql = $db->query($sql);
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj->nb > 0) {
|
||||
$errorforinvoice[$obj->fk_facture_fourn] = 'somelinesarenotbound';
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj->nb > 0) {
|
||||
$errorforinvoice[$obj->fk_facture_fourn] = 'somelinesarenotbound';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
//var_dump($errorforinvoice);exit;
|
||||
|
||||
|
|
|
|||
|
|
@ -125,6 +125,12 @@ print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? im
|
|||
print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : img_picto('', 'tick').' '.yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
|
||||
//print "<strong>PHP safe_mode</strong> = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).' <span class="opacitymedium">'.$langs->trans("Deprecated")." (removed in PHP 5.4)</span><br>\n";
|
||||
|
||||
if (getDolGlobalString('MAIN_SECURITY_SHOW_MORE_INFO')) {
|
||||
print "<strong>PHP auto_prepend_file</strong> = ".(ini_get('auto_prepend_file') ? ini_get('auto_prepend_file') : '')."</span><br>\n";
|
||||
|
||||
print "<strong>PHP sendmail_path</strong> = ".(ini_get('sendmail_path') ? ini_get('sendmail_path') : '')."</span><br>\n";
|
||||
}
|
||||
|
||||
print "<strong>PHP disable_functions</strong> = ";
|
||||
$arrayoffunctionsdisabled = explode(',', ini_get('disable_functions'));
|
||||
$arrayoffunctionstodisable = explode(',', 'dl,apache_note,apache_setenv,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,show_source,virtual');
|
||||
|
|
@ -579,11 +585,12 @@ if (!$test) {
|
|||
}
|
||||
print '<br>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Modules for Payments
|
||||
$test = isModEnabled('stripe');
|
||||
if ($test) {
|
||||
print '<br>';
|
||||
|
||||
print '<strong>'.$langs->trans("Stripe").'</strong>: ';
|
||||
if (!getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) {
|
||||
print img_picto('', 'error').' '.$langs->trans("OptionXShouldBeEnabledInModuleY", $langs->transnoentities("SecurityTokenIsUnique"), $langs->transnoentities("Stripe"));
|
||||
|
|
@ -594,6 +601,8 @@ if ($test) {
|
|||
} else {
|
||||
$test = isModEnabled('paypal');
|
||||
if ($test) {
|
||||
print '<br>';
|
||||
|
||||
print '<strong>'.$langs->trans("Paypal").'</strong>: ';
|
||||
if (!getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) {
|
||||
print img_picto('', 'error').' '.$langs->trans("OptionXShouldBeEnabledInModuleY", $langs->transnoentities("SecurityTokenIsUnique"), $langs->transnoentities("Paypal"));
|
||||
|
|
|
|||
|
|
@ -1338,7 +1338,7 @@ class Setup extends DolibarrApi
|
|||
|
||||
$sql = "SELECT t.rowid as id, t.name, t.entity, t.elementtype, t.label, t.type, t.size, t.fieldcomputed, t.fielddefault,";
|
||||
$sql .= " t.fieldunique, t.fieldrequired, t.perms, t.enabled, t.pos, t.alwayseditable, t.param, t.list, t.printable,";
|
||||
$sql .= " t.totalizable, t.langs, t.help, t.css, t.cssview, t.fk_user_author, t.fk_user_modif, t.datec, t.tms";
|
||||
$sql .= " t.totalizable, t.langs, t.help, t.css, t.cssview, t.csslist, t.fk_user_author, t.fk_user_modif, t.datec, t.tms";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."extrafields as t";
|
||||
$sql .= " WHERE t.entity IN (".getEntity('extrafields').")";
|
||||
$sql .= " AND t.elementtype = '".$this->db->escape($elementtype)."'";
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 Solution Libre SAS <contact@solution-libre.fr>
|
||||
* Copyright (C) 2024 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
|
||||
|
|
@ -396,10 +397,10 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
|
|||
$search_datelimit_start = '';
|
||||
$search_datelimit_end = '';
|
||||
$search_fac_rec_source_title = '';
|
||||
$search_option = '';
|
||||
$search_categ_cus = 0;
|
||||
$toselect = array();
|
||||
$search_array_options = array();
|
||||
$search_categ_cus = 0;
|
||||
$search_option = '';
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
|
|
|
|||
|
|
@ -3977,20 +3977,22 @@ abstract class CommonObject
|
|||
$diff = price2num($total_tva_by_vats[$obj->vatrate] - (float) $tmpvat, 'MT', 1);
|
||||
//print 'Line '.$i.' rowid='.$obj->rowid.' vat_rate='.$obj->vatrate.' total_ht='.$obj->total_ht.' total_tva='.$obj->total_tva.' total_ttc='.$obj->total_ttc.' total_ht_by_vats='.$total_ht_by_vats[$obj->vatrate].' total_tva_by_vats='.$total_tva_by_vats[$obj->vatrate].' (new calculation = '.$tmpvat.') total_ttc_by_vats='.$total_ttc_by_vats[$obj->vatrate].($diff?" => DIFF":"")."<br>\n";
|
||||
if ($diff) {
|
||||
if (abs((float) $diff) > (10 * pow(10, -1 * getDolGlobalInt('MAIN_MAX_DECIMALS_TOT', 0)))) {
|
||||
$maxdiff = (10 * pow(10, -1 * getDolGlobalInt('MAIN_MAX_DECIMALS_TOT', 0)));
|
||||
if (abs((float) $diff) > $maxdiff) {
|
||||
// If error is more than 10 times the accuracy of rounding. This should not happen.
|
||||
$errmsg = 'A rounding difference was detected into TOTAL but is too high to be corrected. Some data in your lines may be corrupted. Try to edit each line manually to fix this before restarting.';
|
||||
$errmsg = 'We found a rounding difference after line '.($obj->rowid).' between HT*VAT='.$tmpvat.' and total in database='.$total_tva_by_vats[$obj->vatrate].' (calculated with UP*qty) but diff='.$diff.' is too high (> '.$maxdiff.') to be corrected. Some data in your lines may be corrupted. Try to edit each line manually to fix this before restarting.';
|
||||
dol_syslog($errmsg, LOG_WARNING);
|
||||
$this->error = $errmsg;
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($base_price_type == 'TTC') {
|
||||
$sqlfix = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldtva." = ".price2num($obj->total_tva - (float) $diff).", total_ht = ".price2num($obj->total_ht + (float) $diff)." WHERE rowid = ".((int) $obj->rowid);
|
||||
dol_syslog('We found a difference of '.$diff.' for line rowid = '.$obj->rowid.". We fix the total_vat and total_ht of line by running sqlfix = ".$sqlfix);
|
||||
dol_syslog('We found a difference of '.$diff.' for line rowid = '.$obj->rowid.' between TotalHT('.$total_ht_by_vats[$obj->vatrate].')*VATrate('.$obj->vatrate.')='.$tmpvat.' and total in database='.$total_tva_by_vats[$obj->vatrate]." (calculated with UP*qty). We fix the total_vat and total_ht of line by running sqlfix = ".$sqlfix);
|
||||
} else {
|
||||
$sqlfix = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldtva." = ".price2num($obj->total_tva - (float) $diff).", total_ttc = ".price2num($obj->total_ttc - (float) $diff)." WHERE rowid = ".((int) $obj->rowid);
|
||||
dol_syslog('We found a difference of '.$diff.' for line rowid = '.$obj->rowid.". We fix the total_vat and total_ttc of line by running sqlfix = ".$sqlfix);
|
||||
dol_syslog('We found a difference of '.$diff.' for line rowid = '.$obj->rowid.' between TotalHT('.$total_ht_by_vats[$obj->vatrate].')*VATrate('.$obj->vatrate.')='.$tmpvat.' and total in database='.$total_tva_by_vats[$obj->vatrate]." (calculated with UP*qty). We fix the total_vat and total_ttc of line by running sqlfix = ".$sqlfix);
|
||||
}
|
||||
|
||||
$resqlfix = $this->db->query($sqlfix);
|
||||
|
|
|
|||
|
|
@ -1626,6 +1626,8 @@ class ExtraFields
|
|||
// print $sql;
|
||||
|
||||
$sql .= $sqlwhere;
|
||||
$sql .= ' ORDER BY '.implode(', ', $fields_label);
|
||||
|
||||
dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ if (isset($_GET["m"]) && isset($_GET["y"])) {
|
|||
|
||||
// If parameters provided, we show calendar
|
||||
if ($qualified) {
|
||||
displayBox(GETPOSTINT("sd"), GETPOSTINT("m"), GETPOSTINT("y"));
|
||||
displayBox(GETPOST("sd", 'alpha'), GETPOSTINT("m"), GETPOSTINT("y"));
|
||||
} else {
|
||||
dol_print_error(null, 'ErrorBadParameters');
|
||||
}
|
||||
|
|
@ -154,7 +154,7 @@ function xyzToUnixTimestamp($mysqldate)
|
|||
/**
|
||||
* Show box
|
||||
*
|
||||
* @param string $selectedDate Date YYYMMDD
|
||||
* @param string $selectedDate Date YYYYMMDD
|
||||
* @param int $month Month
|
||||
* @param int $year Year
|
||||
* @return void
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
|
|||
// If field is a computed field, we make computation to get value
|
||||
if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) {
|
||||
$objectoffield = $object; //For compatibility with the computed formula
|
||||
$value = dol_eval((int) $extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1, 1, '2');
|
||||
$value = dol_eval((string) $extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1, 1, '2');
|
||||
if (is_numeric(price2num($value)) && $extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key]) {
|
||||
$obj->$tmpkey = price2num($value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,6 +164,9 @@ if (empty($reshook)) {
|
|||
$result = $object->setDraft($user, 0);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
} else {
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
// Reopen
|
||||
|
|
@ -172,6 +175,9 @@ if (empty($reshook)) {
|
|||
$result = $object->reOpen();
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
} else {
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -421,8 +421,12 @@ class LoanSchedule extends CommonObject
|
|||
{
|
||||
$result = '';
|
||||
|
||||
if (!empty($capital) && !empty($rate) && !empty($nbterm)) {
|
||||
$result = ($capital * ($rate / 12)) / (1 - pow((1 + ($rate / 12)), ($nbterm * -1)));
|
||||
if (!empty($capital) && !empty($nbterm)) {
|
||||
if (!empty($rate)) {
|
||||
$result = ($capital * ($rate / 12)) / (1 - pow((1 + ($rate / 12)), ($nbterm * -1)));
|
||||
} else {
|
||||
$result = $capital / $nbterm;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
|
|
|||
|
|
@ -359,6 +359,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
|||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/LEFT JOIN [a-z]+_product_stock as ps ON t.rowid = ps.fk_entrepot LEFT JOIN [a-z]+_product as p ON ps.fk_product = p.rowid/', '', $sqlforcount);
|
||||
$sqlforcount = preg_replace('/LEFT JOIN [a-z]+_product_perentity as pa ON pa.fk_product = p.rowid AND pa.fk_product = ps.fk_product AND pa.entity = -?[0-9]+/', '', $sqlforcount);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
||||
$resql = $db->query($sqlforcount);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ header("Content-type: text/html; charset=UTF8");
|
|||
header("X-Content-Type-Options: nosniff"); // With the nosniff option, if the server says the content is text/html, the browser will render it as text/html (note that most browsers now force this option to on)
|
||||
header("X-Frame-Options: SAMEORIGIN"); // Frames allowed only if on same domain (stop some XSS attacks)
|
||||
|
||||
print "*** TEST READ OF /tmp/test.txt FILE<br>\n";
|
||||
print "*** TEST READ OF /tmp/test.txt FILE (Example: if file exists and owned by apache process owner + PrivateTmp is false + apparmor rules allows read of owned files in /tmp/, then you should see the file)<br>\n";
|
||||
|
||||
$out='';
|
||||
$ret=0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user