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

Conflicts:
	htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
This commit is contained in:
Laurent Destailleur 2019-11-11 19:10:35 +01:00
commit 2ccef4e469
5 changed files with 20 additions and 5 deletions

View File

@ -461,15 +461,18 @@ if ($nboftargetok) {
print "Clean $BUILDROOT\n";
$ret=`rm -f $BUILDROOT/$PROJECT/.buildpath`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.editorconfig`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.codeclimate`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.externalToolBuilders`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.git*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.project`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.pydevproject`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.settings`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.scrutinizer.yml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.stickler.yml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.travis.yml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.tx`;
$ret=`rm -f $BUILDROOT/$PROJECT/build.xml`;
$ret=`rm -f $BUILDROOT/$PROJECT/phpstan.neon`;
$ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;

View File

@ -297,6 +297,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql .= $db->plimit($limit + 1, $offset);
dol_syslog("accountancy/customer/list.php", LOG_DEBUG);
// MAX_JOIN_SIZE can be very low (ex: 300000) on some limited configurations (ex: https://www.online.net/fr/hosting/online-perso)
// This big SELECT command may exceed the MAX_JOIN_SIZE limit => Therefore we use SQL_BIG_SELECTS=1 to disable the MAX_JOIN_SIZE security
if ($db->type == 'mysqli') {
$db->query("SET SQL_BIG_SELECTS=1");
}
$result = $db->query($sql);
if ($result) {
$num_lines = $db->num_rows($result);
@ -404,7 +409,7 @@ if ($result) {
$facture_static = new Facture($db);
$product_static = new Product($db);
$isSellerInEEC = isInEEC($mysoc);
$isSellerInEEC = isInEEC($mysoc);
$accountingaccount_codetotid_cache = array();
@ -590,6 +595,9 @@ if ($result) {
} else {
print $db->error();
}
if ($db->type == 'mysqli') {
$db->query("SET SQL_BIG_SELECTS=0"); // Enable MAX_JOIN_SIZE limitation
}
// Add code to auto check the box when we select an account
print '<script type="text/javascript" language="javascript">

View File

@ -378,7 +378,7 @@ class PaymentVarious extends CommonObject
$sql.= "'".$this->db->idate($this->datep)."'";
$sql.= ", '".$this->db->idate($this->datev)."'";
$sql.= ", '".$this->db->escape($this->sens)."'";
$sql.= ", ".$this->amount;
$sql.= ", ".price2num($this->amount);
$sql.= ", '".$this->db->escape($this->type_payment)."'";
$sql.= ", '".$this->db->escape($this->num_payment)."'";
if ($this->note) $sql.= ", '".$this->db->escape($this->note)."'";

View File

@ -48,12 +48,11 @@ $backtopage = GETPOST('backtopage', 'alpha');
$accountid = GETPOST("accountid") > 0 ? GETPOST("accountid", "int") : 0;
$label = GETPOST("label", "alpha");
$sens = GETPOST("sens", "int");
$amount = GETPOST("amount", "alpha");
$amount = price2num(GETPOST("amount", "alpha"));
$paymenttype = GETPOST("paymenttype", "int");
$accountancy_code = GETPOST("accountancy_code", "alpha");
$subledger_account = GETPOST("subledger_account", "alpha");
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int'));
$category_transaction = GETPOST("category_transaction", 'alpha');
// Security check
$socid = GETPOST("socid", "int");

View File

@ -217,6 +217,11 @@ class mod_codeproduct_elephant extends ModeleProductCode
$now=dol_now();
if (! empty($conf->global->PRODUCT_ELEPHANT_ADD_WHERE))
{
$where = ' AND ('.dol_string_nospecial(dol_string_unaccent($conf->global->PRODUCT_ELEPHANT_ADD_WHERE), '_', array(',', '@', '"', "|", ";", ":")).')';
}
$numFinal=get_next_value($db, $mask, 'product', $field, $where, '', $now);
return $numFinal;