Atualizando

This commit is contained in:
Kenio 2025-08-05 10:58:23 -03:00
parent 31b84e4859
commit 974563db8c

View file

@ -133,7 +133,7 @@ class Documents
/** Se houver um cliente informado, crio o filtro de consulta */
if($this->companyId > 0){
$this->and = " and d.clients_id = {$this->companyId}";
$this->and = " and d.company_id = {$this->companyId}";
}
/** Consulta SQL */
@ -151,7 +151,7 @@ class Documents
dc.description as categorys,
c.fantasy_name
from documents d
left join clients c on d.clients_id = c.clients_id
left join companies c on d.company_id = c.company_id
left join documents_categorys dc on d.documents_categorys_id = dc.documents_categorys_id
where d.company_id = :company_id ';
@ -194,7 +194,7 @@ class Documents
/** Se houver um cliente informado, crio o filtro de consulta */
if($this->companyId > 0){
$this->and = " and clients_id = {$this->companyId}";
$this->and = " and company_id = {$this->companyId}";
}
/** Consulta SQL */
@ -246,7 +246,7 @@ class Documents
/** Consulta SQL */
$this->sql = 'update documents set description = :description,
tag = :tag,
clients_id = :clients_id
company_id = :company_id
where documents_id = :documents_id';
/** Preparo o sql para receber os valores */
@ -254,7 +254,7 @@ class Documents
/** Preencho os parâmetros do SQL */
$this->stmt->bindParam('documents_id', $this->documentsId);
$this->stmt->bindParam('clients_id', $this->companyId);
$this->stmt->bindParam('company_id', $this->companyId);
$this->stmt->bindParam('description', $this->description);
$this->stmt->bindParam('tag', $this->tag);
@ -263,7 +263,6 @@ class Documents
/** Consulta SQL */
$this->sql = 'insert into documents(user_id,
company_id,
clients_id,
description,
archive,
extension,
@ -271,7 +270,6 @@ class Documents
tag
) values (:user_id,
:company_id,
:clients_id,
:description,
:archive,
:extension,
@ -288,7 +286,6 @@ class Documents
$this->stmt->bindParam('archive', $this->archive);
$this->stmt->bindParam('extension', $this->extension);
$this->stmt->bindParam('financial_movements_id', $this->financialMovementsId);
$this->stmt->bindParam('clients_id', $this->companyId);
$this->stmt->bindParam('tag', $this->tag);
}else{//Se o ID não foi informado, grava-se um novo registro
@ -298,7 +295,6 @@ class Documents
documents_categorys_id,
user_id,
company_id,
clients_id,
description,
archive,
extension,
@ -308,7 +304,6 @@ class Documents
:documents_categorys_id,
:user_id,
:company_id,
:clients_id,
:description,
:archive,
:extension,
@ -323,7 +318,6 @@ class Documents
$this->stmt->bindParam('documents_categorys_id', $this->documentsCategorysId);
$this->stmt->bindParam('user_id', $_SESSION['USERSID']);/** Informa o usuário responsável pelo novo arquivo cadastrado */
$this->stmt->bindParam('company_id', $_SESSION['USERSCOMPANYID']);/** Grava o ID da empresa responsável pelo arquivo */
$this->stmt->bindParam('clients_id', $this->companyId);
$this->stmt->bindParam('description', $this->description);
$this->stmt->bindParam('archive', $this->archive);
$this->stmt->bindParam('extension', $this->extension);