diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php
index 511b12de3c2..61e131ff47d 100644
--- a/htdocs/accountancy/bookkeeping/card.php
+++ b/htdocs/accountancy/bookkeeping/card.php
@@ -431,12 +431,12 @@ if ($action == 'create') {
// Account movement
print '
';
- print '';
+ print '| ';
print $langs->trans('Docdate');
print ' | ';
if ($action != 'editdate') {
diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php
index ad2720f4675..1a43a999ea1 100644
--- a/htdocs/accountancy/class/bookkeeping.class.php
+++ b/htdocs/accountancy/class/bookkeeping.class.php
@@ -1863,13 +1863,15 @@ class BookKeeping extends CommonObject
$error++;
}
- // Delete if there is an empty line
- $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";
- $resql = $this->db->query($sql);
- if (!$resql) {
- $error++;
- $this->errors[] = 'Error '.$this->db->lasterror();
- dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
+ if (!$error) {
+ // Delete if there is an empty line
+ $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";
+ $resql = $this->db->query($sql);
+ if (!$resql) {
+ $error++;
+ $this->errors[] = 'Error '.$this->db->lasterror();
+ dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
+ }
}
if (!$error) {
@@ -1900,34 +1902,42 @@ class BookKeeping extends CommonObject
}
}
} elseif ($direction == 1) {
- $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 (!$resql) {
- $error++;
- $this->errors[] = 'Error '.$this->db->lasterror();
- dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
+ if (!$error) {
+ $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 (!$resql) {
+ $error++;
+ $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,';
- $sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
- $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num)';
- $sql .= ' SELECT doc_date, doc_type,';
- $sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
- $sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
- $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num';
- $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
- $resql = $this->db->query($sql);
- if (!$resql) {
- $error++;
- $this->errors[] = 'Error '.$this->db->lasterror();
- dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
+
+ if (!$error) {
+ $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,';
+ $sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
+ $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num)';
+ $sql .= ' SELECT doc_date, doc_type,';
+ $sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
+ $sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
+ $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num';
+ $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
+ $resql = $this->db->query($sql);
+ if (!$resql) {
+ $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 (!$resql) {
- $error++;
- $this->errors[] = 'Error '.$this->db->lasterror();
- dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
+
+ if (!$error) {
+ $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 (!$resql) {
+ $error++;
+ $this->errors[] = 'Error '.$this->db->lasterror();
+ dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
+ }
}
}
if (!$error) {
diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php
index 6ee1a057664..cb0e38b7a34 100644
--- a/htdocs/compta/facture/stats/index.php
+++ b/htdocs/compta/facture/stats/index.php
@@ -102,7 +102,7 @@ if ($mode == 'customer') {
$stats->where .= ' AND f.fk_statut IN ('.$db->sanitize($object_status).')';
}
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)).')';
}
}
diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
index e2e3ffd2a21..1327c2e27a2 100644
--- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
+++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
@@ -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/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
/**
diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql
index 7355f1d8987..a945f078bbb 100644
--- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql
+++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql
@@ -546,6 +546,9 @@ CREATE TABLE llx_element_tag
import_key varchar(14)
)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 CONSTRAINT fk_element_tag_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
|
|