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

Conflicts:
	htdocs/core/modules/modSyslog.class.php
This commit is contained in:
Laurent Destailleur 2018-10-30 15:32:09 +01:00
commit 2c3cd7a668
6 changed files with 35 additions and 22 deletions

View File

@ -644,7 +644,7 @@ if (empty($reshook))
$msg = $arraydefaultmessage->content;
}
if (empty($labeltouse) || (int)$labeltouse === -1) {
if (empty($labeltouse) || (int) $labeltouse === -1) {
//fallback on the old configuration.
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
$error++;
@ -726,7 +726,7 @@ if (empty($reshook))
$msg = $arraydefaultmessage->content;
}
if (empty($labeltouse) || (int)$labeltouse === -1) {
if (empty($labeltouse) || (int) $labeltouse === -1) {
//fallback on the old configuration.
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
$error++;

View File

@ -1824,7 +1824,7 @@ abstract class CommonObject
$this->multicurrency_code = $code;
list($fk_multicurrency, $rate) = MultiCurrency::getIdAndTxFromCode($this->db, $code);
if ($rate) $this->setMulticurrencyRate($rate);
if ($rate) $this->setMulticurrencyRate($rate,2);
return 1;
}

View File

@ -85,20 +85,20 @@ class modSyslog extends DolibarrModules
// Cronjobs
$this->cronjobs = array(
0 => array(
'label' => 'CompressSyslogs',
'jobtype' => 'method',
'class' => 'core/class/utils.class.php',
'objectname' => 'Utils',
'method' => 'compressSyslogs',
'parameters' => '',
'comment' => 'Compress and archive log files. Warning: batch must be run with same account than your web server to avoid to get log files with different owner than required by web server. Another solution is to set web server Operating System group as the group of directory documents and set GROUP permission "rws" on this directory so log files will always have the group and permissions of the web server Operating System group',
'frequency' => 1,
'unitfrequency' => 3600 * 24,
'priority' => 50,
'status' => 0,
'test' => true,
),
0 => array(
'label' => 'CompressSyslogs',
'jobtype' => 'method',
'class' => 'core/class/utils.class.php',
'objectname' => 'Utils',
'method' => 'compressSyslogs',
'parameters' => '',
'comment' => 'Compress and archive log files. Warning: batch must be run with same account than your web server to avoid to get log files with different owner than required by web server. Another solution is to set web server Operating System group as the group of directory documents and set GROUP permission "rws" on this directory so log files will always have the group and permissions of the web server Operating System group',
'frequency' => 1,
'unitfrequency' => 3600 * 24,
'priority' => 50,
'status' => 0,
'test' => true
)
);
}
}

View File

@ -1289,6 +1289,9 @@ class CommandeFournisseur extends CommonOrder
// insert products details into database
for ($i=0;$i<$num;$i++)
{
$this->special_code = $this->lines[$i]->special_code; // TODO : remove this in 9.0 and add special_code param to addline()
$result = $this->addline( // This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set
$this->lines[$i]->desc,
$this->lines[$i]->subprice,

View File

@ -402,8 +402,8 @@ class FactureFournisseur extends CommonInvoice
dol_syslog("There is ".count($this->lines)." lines that are invoice lines objects");
foreach ($this->lines as $i => $val)
{
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)';
$sql .= ' VALUES ('.$this->id.')';
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn, special_code)';
$sql .= ' VALUES ('.$this->id.','.intval($this->lines[$i]->special_code).')';
$resql_insert=$this->db->query($sql);
if ($resql_insert)
@ -421,7 +421,14 @@ class FactureFournisseur extends CommonInvoice
$this->lines[$i]->fk_product,
'HT',
(! empty($this->lines[$i]->info_bits)?$this->lines[$i]->info_bits:''),
$this->lines[$i]->product_type
$this->lines[$i]->product_type,
$this->lines[$i]->remise_percent,
false,
$this->lines[$i]->date_start,
$this->lines[$i]->date_end,
$this->lines[$i]->array_options,
$this->lines[$i]->fk_unit,
$this->lines[$i]->pu_ht_devise
);
}
else
@ -443,8 +450,8 @@ class FactureFournisseur extends CommonInvoice
//if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object.
if (! is_object($line)) $line = (object) $line;
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)';
$sql .= ' VALUES ('.$this->id.')';
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn, special_code)';
$sql .= ' VALUES ('.$this->id.','.intval($this->lines[$i]->special_code).')';
$resql_insert=$this->db->query($sql);
if ($resql_insert)

View File

@ -902,6 +902,9 @@ if (empty($reshook))
if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel;
if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end;
// FIXME Missing special_code into addline and updateline methods
$object->special_code = $lines[$i]->special_code;
// FIXME Missing $lines[$i]->ref_supplier and $lines[$i]->label into addline and updateline methods. They are filled when coming from order for example.
$result = $object->addline(
$desc,