Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git in…
Browse files Browse the repository at this point in the history
…to develop_project
  • Loading branch information
hregis committed Oct 30, 2018
2 parents 26b00dc + f845a52 commit e4d77bd
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 59 deletions.
76 changes: 37 additions & 39 deletions htdocs/adherents/card.php
Expand Up @@ -644,27 +644,26 @@
$msg = $arraydefaultmessage->content;
}

if (empty($labeltouse) || (int)$labeltouse === -1) {
//fallback on the old configuration.
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
$error++;
}else{
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);

$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";

$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
if ($result < 0)
{
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
}
if (empty($labeltouse) || (int) $labeltouse === -1) {
//fallback on the old configuration.
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
$error++;
}
else {
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);

$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";

$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
if ($result < 0)
{
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
}
else
Expand Down Expand Up @@ -726,28 +725,27 @@
$msg = $arraydefaultmessage->content;
}

if (empty($labeltouse) || (int)$labeltouse === -1) {
//fallback on the old configuration.
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
$error++;
}else{
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs);

$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";

$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
if ($result < 0)
{
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
if (empty($labeltouse) || (int) $labeltouse === -1) {
//fallback on the old configuration.
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
$error++;
}
else {
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs);

$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";

$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
if ($result < 0)
{
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/commonobject.class.php
Expand Up @@ -1824,7 +1824,7 @@ function setMulticurrencyCode($code)
$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;
}
Expand Down
28 changes: 14 additions & 14 deletions htdocs/core/modules/modSyslog.class.php
Expand Up @@ -85,20 +85,20 @@ function __construct($db)

// 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
)
);
}
}
3 changes: 3 additions & 0 deletions htdocs/fourn/class/fournisseur.commande.class.php
Expand Up @@ -1289,6 +1289,9 @@ public function create($user, $notrigger=0)
// 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,
Expand Down
17 changes: 12 additions & 5 deletions htdocs/fourn/class/fournisseur.facture.class.php
Expand Up @@ -402,8 +402,8 @@ public function create($user)
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)
Expand All @@ -421,7 +421,14 @@ public function create($user)
$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
Expand All @@ -443,8 +450,8 @@ public function create($user)
//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)
Expand Down
3 changes: 3 additions & 0 deletions htdocs/fourn/facture/card.php
Expand Up @@ -902,6 +902,9 @@
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,
Expand Down

0 comments on commit e4d77bd

Please sign in to comment.