From da3929a3cfa821465ef1450ce7b1106bba17f021 Mon Sep 17 00:00:00 2001 From: Kenio de Souza Date: Tue, 5 Aug 2025 10:45:22 -0300 Subject: [PATCH] Atualizando --- .../financial_movements_save_file.php | 8 ++++- vendor/model/Documents.class.php | 35 +++++++++++-------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/vendor/action/financial_movements/financial_movements_save_file.php b/vendor/action/financial_movements/financial_movements_save_file.php index 4b830f7..8e3a676 100644 --- a/vendor/action/financial_movements/financial_movements_save_file.php +++ b/vendor/action/financial_movements/financial_movements_save_file.php @@ -78,7 +78,13 @@ try{ if($result->financial_movements_id > 0){ /** Salva as informações do arquivo */ - if( $Documents->Save(0, 0, $result->description, $FinancialMovementsValidate->getArchive(), $FinancialMovementsValidate->getExt(), (object)$markings, $result->financial_movements_id) ){ + if( $Documents->Save(0, + 0, + $result->description, + $FinancialMovementsValidate->getArchive(), + $FinancialMovementsValidate->getExt(), + (object)$markings, + $result->financial_movements_id) ){ /** Informa o resultado positivo **/ $result = [ diff --git a/vendor/model/Documents.class.php b/vendor/model/Documents.class.php index 482f961..584732e 100644 --- a/vendor/model/Documents.class.php +++ b/vendor/model/Documents.class.php @@ -35,7 +35,7 @@ class Documents private $and = null; private $financialMovementsId = null; private $markings = null; - private $clientsId = null; + private $companyId = null; private $field = null; /** Construtor da classe */ @@ -107,13 +107,13 @@ class Documents } /** Lista todos os egistros do banco com ou sem paginação*/ - public function All(? int $start, ? int $max, ? int $documentsCategorysId, ? string $tag, ? string $label, ? int $clientsId) + public function All(? int $start, ? int $max, ? int $documentsCategorysId, ? string $tag, ? string $label, ? int $companyId) { /** Parametros de entrada */ $this->start = $start; $this->max = $max; $this->documentsCategorysId = $documentsCategorysId; - $this->clientsId = $clientsId; + $this->companyId = $companyId; $this->tag = $tag; $this->label = $label; $this->and = ""; @@ -131,9 +131,9 @@ class Documents } /** Se houver um cliente informado, crio o filtro de consulta */ - if($this->clientsId > 0){ + if($this->companyId > 0){ - $this->and = " and d.clients_id = {$this->clientsId}"; + $this->and = " and d.clients_id = {$this->companyId}"; } /** Consulta SQL */ @@ -175,13 +175,13 @@ class Documents } /** Conta a quantidades de registros */ - public function Count(? int $documentsCategorysId, ? string $tag, ? string $label, ? int $clientsId) + public function Count(? int $documentsCategorysId, ? string $tag, ? string $label, ? int $companyId) { /** Parametros de entraa */ $this->documentsCategorysId = $documentsCategorysId; $this->tag = $tag; $this->label = $label; - $this->clientsId = $clientsId; + $this->companyId = $companyId; $this->and = ""; /** Se houver categoria informada, crio o filtro de consulta*/ @@ -192,9 +192,9 @@ class Documents } /** Se houver um cliente informado, crio o filtro de consulta */ - if($this->clientsId > 0){ + if($this->companyId > 0){ - $this->and = " and clients_id = {$this->clientsId}"; + $this->and = " and clients_id = {$this->companyId}"; } /** Consulta SQL */ @@ -218,14 +218,21 @@ class Documents } /** Insere um novo registro no banco */ - public function Save(int $documentsId, int $documentsCategorysId, string $description, string $archive, string $extension, object $tag, int $financialMovementsId, int $clientsId) + public function Save(int $documentsId, + int $documentsCategorysId, + string $description, + string $archive, + string $extension, + object $tag, + int $financialMovementsId, + ? int $companyId) { /** Parametros */ $this->documentsId = $documentsId; $this->documentsCategorysId = $documentsCategorysId; - $this->clientsId = $clientsId; + $this->companyId = $companyId; $this->description = $description; $this->archive = $archive; $this->extension = $extension; @@ -247,7 +254,7 @@ class Documents /** Preencho os parâmetros do SQL */ $this->stmt->bindParam('documents_id', $this->documentsId); - $this->stmt->bindParam('clients_id', $this->clientsId); + $this->stmt->bindParam('clients_id', $this->companyId); $this->stmt->bindParam('description', $this->description); $this->stmt->bindParam('tag', $this->tag); @@ -281,7 +288,7 @@ 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->clientsId); + $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 @@ -316,7 +323,7 @@ class Documents $this->stmt->bindParam('documents_categorys_id', $this->documentsCategorysId); $this->stmt->bindParam('users_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->clientsId); + $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);