Update bookkeeping.class.php

This commit is contained in:
Laurent Destailleur 2021-04-06 19:02:17 +02:00 committed by GitHub
parent 241b0d3f63
commit adbe832826
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -295,7 +295,10 @@ class BookKeeping extends CommonObject
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql .= " WHERE doc_type = '".$this->db->escape($this->doc_type)."'";
$sql .= " AND fk_doc = ".$this->fk_doc;
if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) $sql .= " AND fk_docdet = " . $this->fk_docdet; // This field can be 0 if record is for several lines
if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) {
// DO NOT USE THIS IN PRPDUCTION. This will generate a lot of trouble into reports and will corrupt database (by generating duplicate entries.
$sql .= " AND fk_docdet = " . $this->fk_docdet; // This field can be 0 if record is for several lines
}
$sql .= " AND numero_compte = '".$this->db->escape($this->numero_compte)."'";
$sql .= " AND label_operation = '".$this->db->escape($this->label_operation)."'";
$sql .= " AND entity IN (".getEntity('accountancy').")";