FIX Remove warning when using log into syslog

This commit is contained in:
Laurent Destailleur 2017-09-08 15:44:11 +02:00
parent a6a142753a
commit 8b20c5edab
2 changed files with 12 additions and 7 deletions

View File

@ -172,13 +172,16 @@ if ($result) {
{
$obj = $db->fetch_object($result);
$lineisapurchase = ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)');
$lineisasell = ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)');
// Set accountancy code (for bank and thirdparty)
$compta_bank = $obj->account_number;
$compta_soc = 'NotDefined';
if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)')
if ($lineisapurchase)
$compta_soc = (! empty($obj->code_compta_fournisseur) ? $obj->code_compta_fournisseur : $account_supplier);
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)')
if ($lineisasell)
$compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $account_customer);
$tabcompany[$obj->rowid] = array (
@ -604,6 +607,8 @@ if (! $error && $action == 'writebookkeeping') {
}
}
// Export
if ($action == 'exportcsv') { // ISO and not UTF8 !
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
@ -936,7 +941,7 @@ $db->close();
* Return source for doc_ref of a bank transaction
*
* @param string $val Array of val
* @param string $typerecord Type of record
* @param string $typerecord Type of record ('payment', 'payment_supplier', 'payment_expensereport', 'payment_vat', ...)
* @return string|unknown
*/
function getSourceDocRef($val, $typerecord)

View File

@ -49,7 +49,7 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
public function isActive()
{
global $conf;
// This function does not exists on some ISP (Ex: Free in France)
if (!function_exists('openlog')) return 0;
@ -81,15 +81,15 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
*/
public function checkConfiguration()
{
global $langs;
global $conf, $langs;
$errors = array();
$facility = SYSLOG_FACILITY;
$facility = constant($conf->global->SYSLOG_FACILITY);
if ($facility)
{
// Only LOG_USER supported on Windows
if (! empty($_SERVER["WINDIR"])) $facility='LOG_USER';
if (! empty($_SERVER["WINDIR"])) $facility=constant('LOG_USER');
dol_syslog("admin/syslog: facility ".$facility);
}