From b869d8d7c7ab7adfb1969096e67599b854996c5c Mon Sep 17 00:00:00 2001 From: Kenio de Souza Date: Sat, 9 Aug 2025 12:06:18 -0300 Subject: [PATCH] =?UTF-8?q?Atualizando=20sa=C3=ADdas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../financial_outputs_save.php | 6 +++--- .../FinancialOutputsValidate.class.php | 19 ------------------- vendor/model/FinancialOutputs.class.php | 4 ++-- 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/vendor/action/financial_outputs/financial_outputs_save.php b/vendor/action/financial_outputs/financial_outputs_save.php index 994ad1a..eabd6bc 100644 --- a/vendor/action/financial_outputs/financial_outputs_save.php +++ b/vendor/action/financial_outputs/financial_outputs_save.php @@ -15,7 +15,7 @@ try{ /** Parametros de saida */ $description = isset($_POST['description']) ? (string)filter_input(INPUT_POST,'description', FILTER_SANITIZE_SPECIAL_CHARS) : ''; - $clientsId = isset($_POST['clients_id']) ? (int)filter_input(INPUT_POST,'clients_id', FILTER_SANITIZE_SPECIAL_CHARS) : 0; + $companyId = isset($_POST['company_id']) ? (int)filter_input(INPUT_POST,'company_id', FILTER_SANITIZE_SPECIAL_CHARS) : 0; $financialAccountsId = isset($_POST['financial_accounts_id']) ? (int)filter_input(INPUT_POST,'financial_accounts_id', FILTER_SANITIZE_SPECIAL_CHARS) : 0; $financialCategoriesId = isset($_POST['financial_categories_id']) ? (int)filter_input(INPUT_POST,'financial_categories_id', FILTER_SANITIZE_SPECIAL_CHARS) : 0; $fixed = isset($_POST['fixed']) ? (int)filter_input(INPUT_POST,'fixed', FILTER_SANITIZE_SPECIAL_CHARS) : 0; @@ -27,7 +27,7 @@ try{ /** Validando os campos de entrada */ $FinancialOutputsValidate->setDescription($description); - $FinancialOutputsValidate->setClientsId($clientsId); + $FinancialOutputsValidate->setCompanyId($companyId); $FinancialOutputsValidate->setFinancialAccountsId($financialAccountsId); $FinancialOutputsValidate->setFinancialCategoriesId($financialCategoriesId); $FinancialOutputsValidate->setFinancialOutputsId($financialOutputsId); @@ -48,7 +48,7 @@ try{ /** Salva o registro junto ao banco de dados */ if($FinancialOutputs->Save($FinancialOutputsValidate->getFinancialOutputsId(), - $FinancialOutputsValidate->getClientsId(), + $FinancialOutputsValidate->getCompanyId(), $FinancialOutputsValidate->getDescription(), $FinancialOutputsValidate->getFixed(), $FinancialOutputsValidate->getDuration(), diff --git a/vendor/controller/financial_outputs/FinancialOutputsValidate.class.php b/vendor/controller/financial_outputs/FinancialOutputsValidate.class.php index a2a9b0b..115ee23 100644 --- a/vendor/controller/financial_outputs/FinancialOutputsValidate.class.php +++ b/vendor/controller/financial_outputs/FinancialOutputsValidate.class.php @@ -25,7 +25,6 @@ class FinancialOutputsValidate private $info = null; private $financialOutputsId = null; private $companyId = null; - private $clientsId = null; private $usersId = null; private $financialAccountsId = null; private $description = null; @@ -81,24 +80,6 @@ class FinancialOutputsValidate } - /** Método trata campo clients_id */ - public function setClientsId(int $clientsId) : void - { - - /** Trata a entrada da informação */ - $this->clientsId = isset($clientsId) ? (int)$this->Main->antiInjection($clientsId) : 0; - - /** Verifica se a informação foi informada */ - /*if( $this->clientsId == 0) - { - - /** Adição de elemento */ - /*array_push($this->errors, 'O campo "Cliente", deve ser selecionado'); - - }*/ - - } - /** Método trata campo users_id */ public function setUsersId(int $usersId) : void { diff --git a/vendor/model/FinancialOutputs.class.php b/vendor/model/FinancialOutputs.class.php index 33a24b0..9d1e542 100644 --- a/vendor/model/FinancialOutputs.class.php +++ b/vendor/model/FinancialOutputs.class.php @@ -108,7 +108,7 @@ class FinancialOutputs $this->stmt = $this->connection->connect()->prepare($this->sql); /** Preencho os parâmetros do SQL */ - //$this->stmt->bindParam(':financial_outputs_id', $this->financialoutputsId); + $this->stmt->bindParam(':financial_outputs_id', $this->financialOutputsId); /** Executo o SQL */ $this->stmt->execute(); @@ -192,7 +192,7 @@ class FinancialOutputs /** Parametros */ $this->financialOutputsId = $financialOutputsId; - $this->companyId = $companyId > 0 ? $companyId : null; + $this->companyId = $companyId; $this->description = $description; $this->fixed = $fixed; $this->duration = $duration;