forked from Wavyzz/dolibarr
Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/accountancy/class/bookkeeping.class.php
This commit is contained in:
@@ -431,12 +431,12 @@ if ($action == 'create') {
|
|||||||
// Account movement
|
// Account movement
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="titlefield">'.$langs->trans("NumMvts").'</td>';
|
print '<td class="titlefield">'.$langs->trans("NumMvts").'</td>';
|
||||||
print '<td>'.$object->piece_num.'</td>';
|
print '<td>'.($mode == '_tmp' ? '<span class="opacitymedium" title="Id tmp '.$object->piece_num.'">'.$langs->trans("Draft").'</span>' : $object->piece_num).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||||
print $langs->trans('Docdate');
|
print $langs->trans('Docdate');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editdate') {
|
if ($action != 'editdate') {
|
||||||
|
|||||||
@@ -1863,13 +1863,15 @@ class BookKeeping extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete if there is an empty line
|
if (!$error) {
|
||||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity)." AND numero_compte IS NULL AND debit = 0 AND credit = 0";
|
// Delete if there is an empty line
|
||||||
$resql = $this->db->query($sql);
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity)." AND numero_compte IS NULL AND debit = 0 AND credit = 0";
|
||||||
if (!$resql) {
|
$resql = $this->db->query($sql);
|
||||||
$error++;
|
if (!$resql) {
|
||||||
$this->errors[] = 'Error '.$this->db->lasterror();
|
$error++;
|
||||||
dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
|
$this->errors[] = 'Error '.$this->db->lasterror();
|
||||||
|
dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
@@ -1900,34 +1902,42 @@ class BookKeeping extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($direction == 1) {
|
} elseif ($direction == 1) {
|
||||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
|
if (!$error) {
|
||||||
$resql = $this->db->query($sql);
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
|
||||||
if (!$resql) {
|
$resql = $this->db->query($sql);
|
||||||
$error++;
|
if (!$resql) {
|
||||||
$this->errors[] = 'Error '.$this->db->lasterror();
|
$error++;
|
||||||
dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
|
$this->errors[] = 'Error '.$this->db->lasterror();
|
||||||
|
dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element.'_tmp (doc_date, doc_type,';
|
|
||||||
$sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
|
if (!$error) {
|
||||||
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
|
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element.'_tmp (doc_date, doc_type,';
|
||||||
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num)';
|
$sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
|
||||||
$sql .= ' SELECT doc_date, doc_type,';
|
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
|
||||||
$sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
|
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num)';
|
||||||
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
|
$sql .= ' SELECT doc_date, doc_type,';
|
||||||
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num';
|
$sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
|
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
|
||||||
$resql = $this->db->query($sql);
|
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num';
|
||||||
if (!$resql) {
|
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
|
||||||
$error++;
|
$resql = $this->db->query($sql);
|
||||||
$this->errors[] = 'Error '.$this->db->lasterror();
|
if (!$resql) {
|
||||||
dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
|
$error++;
|
||||||
|
$this->errors[] = 'Error '.$this->db->lasterror();
|
||||||
|
dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
|
|
||||||
$resql = $this->db->query($sql);
|
if (!$error) {
|
||||||
if (!$resql) {
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
|
||||||
$error++;
|
$resql = $this->db->query($sql);
|
||||||
$this->errors[] = 'Error '.$this->db->lasterror();
|
if (!$resql) {
|
||||||
dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
|
$error++;
|
||||||
|
$this->errors[] = 'Error '.$this->db->lasterror();
|
||||||
|
dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ if ($mode == 'customer') {
|
|||||||
$stats->where .= ' AND f.fk_statut IN ('.$db->sanitize($object_status).')';
|
$stats->where .= ' AND f.fk_statut IN ('.$db->sanitize($object_status).')';
|
||||||
}
|
}
|
||||||
if (is_array($custcats) && !empty($custcats)) {
|
if (is_array($custcats) && !empty($custcats)) {
|
||||||
$stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cat OmdN (f.fk_soc = cat.fk_soc)';
|
$stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cat ON (f.fk_soc = cat.fk_soc)';
|
||||||
$stats->where .= ' AND cat.fk_categorie IN ('.$db->sanitize(implode(',', $custcats)).')';
|
$stats->where .= ' AND cat.fk_categorie IN ('.$db->sanitize(implode(',', $custcats)).')';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -546,6 +546,9 @@ CREATE TABLE llx_element_tag
|
|||||||
import_key varchar(14)
|
import_key varchar(14)
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
ALTER TABLE llx_element_tag ADD COLUMN fk_categorie integer;
|
||||||
|
ALTER TABLE llx_element_tag ADD COLUMN fk_element integer;
|
||||||
|
|
||||||
ALTER TABLE llx_element_tag ADD UNIQUE INDEX idx_element_tag_uk (fk_categorie, fk_element);
|
ALTER TABLE llx_element_tag ADD UNIQUE INDEX idx_element_tag_uk (fk_categorie, fk_element);
|
||||||
|
|
||||||
ALTER TABLE llx_element_tag ADD CONSTRAINT fk_element_tag_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
|
ALTER TABLE llx_element_tag ADD CONSTRAINT fk_element_tag_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
|
||||||
|
|||||||
Reference in New Issue
Block a user