Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into todo_missing_alreadypaid
This commit is contained in:
commit
bc0b145dc4
@ -441,26 +441,40 @@ class AccountingJournal extends CommonObject
|
|||||||
$langs->loadLangs(array("assets"));
|
$langs->loadLangs(array("assets"));
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if (empty($type)) $type = 'view';
|
if (empty($type)) {
|
||||||
if (empty($in_bookkeeping)) $in_bookkeeping = 'notyet';
|
$type = 'view';
|
||||||
|
}
|
||||||
|
if (empty($in_bookkeeping)) {
|
||||||
|
$in_bookkeeping = 'notyet';
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "";
|
$sql = "";
|
||||||
if ($in_bookkeeping == 'already' || $in_bookkeeping == 'notyet') {
|
|
||||||
|
// FIXME sql error with Mysql 5.7
|
||||||
|
/*if ($in_bookkeeping == 'already' || $in_bookkeeping == 'notyet') {
|
||||||
$sql .= "WITH in_accounting_bookkeeping(fk_docdet) AS (";
|
$sql .= "WITH in_accounting_bookkeeping(fk_docdet) AS (";
|
||||||
$sql .= " SELECT DISTINCT fk_docdet";
|
$sql .= " SELECT DISTINCT fk_docdet";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping";
|
||||||
$sql .= " WHERE doc_type = 'asset'";
|
$sql .= " WHERE doc_type = 'asset'";
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
}
|
}*/
|
||||||
|
|
||||||
$sql .= "SELECT ad.fk_asset AS rowid, a.ref AS asset_ref, a.label AS asset_label, a.acquisition_value_ht AS asset_acquisition_value_ht";
|
$sql .= "SELECT ad.fk_asset AS rowid, a.ref AS asset_ref, a.label AS asset_label, a.acquisition_value_ht AS asset_acquisition_value_ht";
|
||||||
$sql .= ", a.disposal_date AS asset_disposal_date, a.disposal_amount_ht AS asset_disposal_amount_ht, a.disposal_subject_to_vat AS asset_disposal_subject_to_vat";
|
$sql .= ", a.disposal_date AS asset_disposal_date, a.disposal_amount_ht AS asset_disposal_amount_ht, a.disposal_subject_to_vat AS asset_disposal_subject_to_vat";
|
||||||
$sql .= ", ad.rowid AS depreciation_id, ad.depreciation_mode, ad.ref AS depreciation_ref, ad.depreciation_date, ad.depreciation_ht, ad.accountancy_code_debit, ad.accountancy_code_credit";
|
$sql .= ", ad.rowid AS depreciation_id, ad.depreciation_mode, ad.ref AS depreciation_ref, ad.depreciation_date, ad.depreciation_ht, ad.accountancy_code_debit, ad.accountancy_code_credit";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "asset_depreciation as ad";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "asset_depreciation as ad";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "asset as a ON a.rowid = ad.fk_asset";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "asset as a ON a.rowid = ad.fk_asset";
|
||||||
if ($in_bookkeeping == 'already' || $in_bookkeeping == 'notyet') {
|
// FIXME sql error with Mysql 5.7
|
||||||
|
/*if ($in_bookkeeping == 'already' || $in_bookkeeping == 'notyet') {
|
||||||
$sql .= " LEFT JOIN in_accounting_bookkeeping as iab ON iab.fk_docdet = ad.rowid";
|
$sql .= " LEFT JOIN in_accounting_bookkeeping as iab ON iab.fk_docdet = ad.rowid";
|
||||||
}
|
}*/
|
||||||
$sql .= " WHERE a.entity IN (" . getEntity('asset', 0) . ')'; // We don't share object for accountancy, we use source object sharing
|
$sql .= " WHERE a.entity IN (" . getEntity('asset', 0) . ')'; // We don't share object for accountancy, we use source object sharing
|
||||||
|
// Compatibility with Mysql 5.7
|
||||||
|
if ($in_bookkeeping == 'already') {
|
||||||
|
$sql .= " AND EXISTS (SELECT iab.fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')";
|
||||||
|
} elseif ($in_bookkeeping == 'notyet') {
|
||||||
|
$sql .= " AND NOT EXISTS (SELECT iab.fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')";
|
||||||
|
}
|
||||||
$sql .= " AND ad.ref != ''"; // not reversal lines
|
$sql .= " AND ad.ref != ''"; // not reversal lines
|
||||||
if ($date_start && $date_end) {
|
if ($date_start && $date_end) {
|
||||||
$sql .= " AND ad.depreciation_date >= '" . $this->db->idate($date_start) . "' AND ad.depreciation_date <= '" . $this->db->idate($date_end) . "'";
|
$sql .= " AND ad.depreciation_date >= '" . $this->db->idate($date_start) . "' AND ad.depreciation_date <= '" . $this->db->idate($date_end) . "'";
|
||||||
@ -470,9 +484,10 @@ class AccountingJournal extends CommonObject
|
|||||||
$sql .= " AND ad.depreciation_date >= '" . $this->db->idate($conf->global->ACCOUNTING_DATE_START_BINDING) . "'";
|
$sql .= " AND ad.depreciation_date >= '" . $this->db->idate($conf->global->ACCOUNTING_DATE_START_BINDING) . "'";
|
||||||
}
|
}
|
||||||
// Already in bookkeeping or not
|
// Already in bookkeeping or not
|
||||||
if ($in_bookkeeping == 'already' || $in_bookkeeping == 'notyet') {
|
// FIXME sql error with Mysql 5.7
|
||||||
|
/*if ($in_bookkeeping == 'already' || $in_bookkeeping == 'notyet') {
|
||||||
$sql .= " AND iab.fk_docdet IS" . ($in_bookkeeping == 'already' ? " NOT" : "") . " NULL";
|
$sql .= " AND iab.fk_docdet IS" . ($in_bookkeeping == 'already' ? " NOT" : "") . " NULL";
|
||||||
}
|
}*/
|
||||||
$sql .= " ORDER BY ad.depreciation_date";
|
$sql .= " ORDER BY ad.depreciation_date";
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|||||||
@ -289,6 +289,7 @@ print '<td class="right">' . $langs->trans("Debit") . '</td>';
|
|||||||
print '<td class="right">' . $langs->trans("Credit") . '</td>';
|
print '<td class="right">' . $langs->trans("Credit") . '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
if (is_array($journal_data) && !empty($journal_data)) {
|
||||||
foreach ($journal_data as $element_id => $element) {
|
foreach ($journal_data as $element_id => $element) {
|
||||||
foreach ($element['blocks'] as $lines) {
|
foreach ($element['blocks'] as $lines) {
|
||||||
foreach ($lines as $line) {
|
foreach ($lines as $line) {
|
||||||
@ -305,6 +306,7 @@ foreach ($journal_data as $element_id => $element) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -120,7 +120,7 @@ if (empty($conf->global->MAIN_MODULE_API)) {
|
|||||||
// Test if explorer is not disabled
|
// Test if explorer is not disabled
|
||||||
if (preg_match('/api\/index\.php\/explorer/', $url) && !empty($conf->global->API_EXPLORER_DISABLED)) {
|
if (preg_match('/api\/index\.php\/explorer/', $url) && !empty($conf->global->API_EXPLORER_DISABLED)) {
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
dol_syslog("Call Dolibarr API interfaces with module API REST disabled");
|
||||||
print $langs->trans("WarningAPIExplorerDisabled").'.<br><br>';
|
print $langs->trans("WarningAPIExplorerDisabled").'.<br><br>';
|
||||||
//session_destroy();
|
//session_destroy();
|
||||||
exit(0);
|
exit(0);
|
||||||
@ -153,6 +153,10 @@ preg_match('/index\.php\/([^\/]+)(.*)$/', $url, $reg);
|
|||||||
$refreshcache = (empty($conf->global->API_PRODUCTION_DO_NOT_ALWAYS_REFRESH_CACHE) ? true : false);
|
$refreshcache = (empty($conf->global->API_PRODUCTION_DO_NOT_ALWAYS_REFRESH_CACHE) ? true : false);
|
||||||
if (!empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) {
|
if (!empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) {
|
||||||
$refreshcache = true;
|
$refreshcache = true;
|
||||||
|
if (!is_writable($conf->api->dir_temp)) {
|
||||||
|
print 'Erreur temp dir api/temp not writable';
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$api = new DolibarrApi($db, '', $refreshcache);
|
$api = new DolibarrApi($db, '', $refreshcache);
|
||||||
|
|||||||
@ -119,6 +119,15 @@ class AdvanceTargetingMailing extends CommonObject
|
|||||||
'3' => $langs->trans('ThirdParty'),
|
'3' => $langs->trans('ThirdParty'),
|
||||||
'4' => $langs->trans('ContactsWithThirdpartyFilter')
|
'4' => $langs->trans('ContactsWithThirdpartyFilter')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
|
||||||
|
$customerStatic = new Client($this->db);
|
||||||
|
$customerStatic->loadCacheOfProspStatus();
|
||||||
|
if (!empty($customerStatic->cacheprospectstatus)) {
|
||||||
|
foreach ($customerStatic->cacheprospectstatus as $dataProspectSt) {
|
||||||
|
$this->type_statuscommprospect[$dataProspectSt['id']]=$dataProspectSt['label'];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
$this->type_statuscommprospect = array(
|
$this->type_statuscommprospect = array(
|
||||||
-1 => $langs->trans("StatusProspect-1"),
|
-1 => $langs->trans("StatusProspect-1"),
|
||||||
0 => $langs->trans("StatusProspect0"),
|
0 => $langs->trans("StatusProspect0"),
|
||||||
@ -127,6 +136,7 @@ class AdvanceTargetingMailing extends CommonObject
|
|||||||
3 => $langs->trans("StatusProspect3")
|
3 => $langs->trans("StatusProspect3")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create object into database
|
* Create object into database
|
||||||
|
|||||||
@ -355,7 +355,7 @@ class FormAdvTargetEmailing extends Form
|
|||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
$sql = "SELECT c.rowid, c.name, c.fk_element";
|
$sql = "SELECT c.rowid, c.name, c.fk_element";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."advtargetemailing as c";
|
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_advtarget as c";
|
||||||
$sql .= " WHERE type_element = '".$this->db->escape($type_element)."'";
|
$sql .= " WHERE type_element = '".$this->db->escape($type_element)."'";
|
||||||
$sql .= " ORDER BY c.name";
|
$sql .= " ORDER BY c.name";
|
||||||
|
|
||||||
|
|||||||
@ -167,6 +167,12 @@ class Cronjob extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $test;
|
public $test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Autodelete
|
||||||
|
*/
|
||||||
|
public $autodelete;
|
||||||
|
|
||||||
|
|
||||||
const STATUS_DISABLED = 0;
|
const STATUS_DISABLED = 0;
|
||||||
const STATUS_ENABLED = 1;
|
const STATUS_ENABLED = 1;
|
||||||
const STATUS_ARCHIVED = 2;
|
const STATUS_ARCHIVED = 2;
|
||||||
@ -1191,7 +1197,8 @@ class Cronjob extends CommonObject
|
|||||||
dol_syslog(get_class($this)."::run_jobs START ".$this->objectname."->".$this->methodename."(".$this->params.");", LOG_DEBUG);
|
dol_syslog(get_class($this)."::run_jobs START ".$this->objectname."->".$this->methodename."(".$this->params.");", LOG_DEBUG);
|
||||||
|
|
||||||
// Create Object for the called module
|
// Create Object for the called module
|
||||||
$object = new $this->objectname($this->db);
|
$nameofclass = $this->objectname;
|
||||||
|
$object = new $nameofclass($this->db);
|
||||||
if ($this->entity > 0) {
|
if ($this->entity > 0) {
|
||||||
$object->entity = $this->entity; // We work on a dedicated entity
|
$object->entity = $this->entity; // We work on a dedicated entity
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,6 +41,8 @@ class PartnershipUtils
|
|||||||
public $error; //!< To return error code (or message)
|
public $error; //!< To return error code (or message)
|
||||||
public $errors = array(); //!< To return several error codes (or messages)
|
public $errors = array(); //!< To return several error codes (or messages)
|
||||||
|
|
||||||
|
public $output; // To store output of some cron methods
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|||||||
@ -4812,7 +4812,7 @@ class Product extends CommonObject
|
|||||||
$sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens
|
$sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens
|
||||||
$sql.= " ORDER BY pa.rang";
|
$sql.= " ORDER BY pa.rang";
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.implode(',', $parents), LOG_DEBUG);
|
dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents)?implode(',', $parents):$parents), LOG_DEBUG);
|
||||||
|
|
||||||
if ($level == 1) {
|
if ($level == 1) {
|
||||||
$alreadyfound = array($id=>1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediatly
|
$alreadyfound = array($id=>1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediatly
|
||||||
|
|||||||
@ -1207,7 +1207,7 @@ if (!empty($arrayfields['customerorsupplier']['checked'])) {
|
|||||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||||
}
|
}
|
||||||
print $formcompany->selectProspectCustomerType($search_type, 'search_type', 'search_type', 'list');
|
print $formcompany->selectProspectCustomerType($search_type, 'search_type', 'search_type', 'list');
|
||||||
print '</select></td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Prospect level
|
// Prospect level
|
||||||
if (!empty($arrayfields['s.fk_prospectlevel']['checked'])) {
|
if (!empty($arrayfields['s.fk_prospectlevel']['checked'])) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user