Spaces
This commit is contained in:
parent
e89c4e9f41
commit
db6d7d9e21
@ -1067,7 +1067,7 @@ class BookKeeping extends CommonObject
|
|||||||
$sql.= " WHERE 1 = 1";
|
$sql.= " WHERE 1 = 1";
|
||||||
if (! empty($delyear)) $sql.= " AND YEAR(doc_date) = " . $delyear; // FIXME Must use between
|
if (! empty($delyear)) $sql.= " AND YEAR(doc_date) = " . $delyear; // FIXME Must use between
|
||||||
if (! empty($journal)) $sql.= " AND code_journal = '".$journal."'";
|
if (! empty($journal)) $sql.= " AND code_journal = '".$journal."'";
|
||||||
$sql .= " AND entity IN (" . getEntity("accountancy", 1) . ")";
|
$sql .= " AND entity IN (" . getEntity("accountancy", 1) . ")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
if (! $resql) {
|
if (! $resql) {
|
||||||
@ -1099,7 +1099,7 @@ class BookKeeping extends CommonObject
|
|||||||
$sql = "DELETE";
|
$sql = "DELETE";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
||||||
$sql .= " WHERE piece_num = " . $piecenum;
|
$sql .= " WHERE piece_num = " . $piecenum;
|
||||||
$sql .= " AND entity IN (" . getEntity("accountancy", 1) . ")";
|
$sql .= " AND entity IN (" . getEntity("accountancy", 1) . ")";
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
@ -1202,10 +1202,10 @@ class BookKeeping extends CommonObject
|
|||||||
public function fetchPerMvt($piecenum) {
|
public function fetchPerMvt($piecenum) {
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT piece_num,doc_date,code_journal,doc_ref,doc_type";
|
$sql = "SELECT piece_num,doc_date,code_journal,doc_ref,doc_type";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
||||||
$sql .= " WHERE piece_num = " . $piecenum;
|
$sql .= " WHERE piece_num = " . $piecenum;
|
||||||
$sql .= " AND entity IN (" . getEntity("accountancy", 1) . ")";
|
$sql .= " AND entity IN (" . getEntity("accountancy", 1) . ")";
|
||||||
|
|
||||||
dol_syslog(get_class($this) . "::" . __METHOD__, LOG_DEBUG);
|
dol_syslog(get_class($this) . "::" . __METHOD__, LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -1233,7 +1233,7 @@ class BookKeeping extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function getNextNumMvt()
|
public function getNextNumMvt()
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT MAX(piece_num)+1 as max FROM " . MAIN_DB_PREFIX . $this->table_element;
|
$sql = "SELECT MAX(piece_num)+1 as max FROM " . MAIN_DB_PREFIX . $this->table_element;
|
||||||
$sql .= " WHERE entity IN (" . getEntity("accountancy", 1) . ")";
|
$sql .= " WHERE entity IN (" . getEntity("accountancy", 1) . ")";
|
||||||
@ -1243,9 +1243,9 @@ class BookKeeping extends CommonObject
|
|||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
if ($obj) $result = $obj->max;
|
if ($obj) $result = $obj->max;
|
||||||
if (empty($result)) $result = 1;
|
if (empty($result)) $result = 1;
|
||||||
return $result;
|
return $result;
|
||||||
} else {
|
} else {
|
||||||
$this->error = "Error " . $this->db->lasterror();
|
$this->error = "Error " . $this->db->lasterror();
|
||||||
dol_syslog(get_class($this) . "::getNextNumMvt " . $this->error, LOG_ERR);
|
dol_syslog(get_class($this) . "::getNextNumMvt " . $this->error, LOG_ERR);
|
||||||
@ -1260,7 +1260,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch_all_per_mvt($piecenum) {
|
function fetch_all_per_mvt($piecenum) {
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT rowid, doc_date, doc_type,";
|
$sql = "SELECT rowid, doc_date, doc_type,";
|
||||||
$sql .= " doc_ref, fk_doc, fk_docdet, code_tiers,";
|
$sql .= " doc_ref, fk_doc, fk_docdet, code_tiers,";
|
||||||
@ -1268,7 +1268,7 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num";
|
$sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
||||||
$sql .= " WHERE piece_num = " . $piecenum;
|
$sql .= " WHERE piece_num = " . $piecenum;
|
||||||
$sql .= " AND entity IN (" . getEntity("accountancy", 1) . ")";
|
$sql .= " AND entity IN (" . getEntity("accountancy", 1) . ")";
|
||||||
|
|
||||||
dol_syslog(get_class($this) . "::" . __METHOD__, LOG_DEBUG);
|
dol_syslog(get_class($this) . "::" . __METHOD__, LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -1313,14 +1313,14 @@ class BookKeeping extends CommonObject
|
|||||||
* @return int Result
|
* @return int Result
|
||||||
*/
|
*/
|
||||||
function export_bookkeping($model = 'ebp') {
|
function export_bookkeping($model = 'ebp') {
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT rowid, doc_date, doc_type,";
|
$sql = "SELECT rowid, doc_date, doc_type,";
|
||||||
$sql .= " doc_ref, fk_doc, fk_docdet, code_tiers,";
|
$sql .= " doc_ref, fk_doc, fk_docdet, code_tiers,";
|
||||||
$sql .= " numero_compte, label_compte, debit, credit,";
|
$sql .= " numero_compte, label_compte, debit, credit,";
|
||||||
$sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num";
|
$sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
||||||
$sql .= " WHERE entity IN (" . getEntity("accountancy", 1) . ")";
|
$sql .= " WHERE entity IN (" . getEntity("accountancy", 1) . ")";
|
||||||
|
|
||||||
dol_syslog(get_class($this) . "::export_bookkeping", LOG_DEBUG);
|
dol_syslog(get_class($this) . "::export_bookkeping", LOG_DEBUG);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user