From a9d934b19ec96da699d570ef5a0e8867dacced1b Mon Sep 17 00:00:00 2001 From: Kenio de Souza Date: Sun, 3 Aug 2025 12:07:09 -0300 Subject: [PATCH] Atualizando arquivos --- .../companies_budgets_save.php | 57 ++++++++++--------- .../CompaniesBudgetsValidate.class.php | 2 +- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/vendor/action/companies_budgets/companies_budgets_save.php b/vendor/action/companies_budgets/companies_budgets_save.php index cab1caa..b696780 100644 --- a/vendor/action/companies_budgets/companies_budgets_save.php +++ b/vendor/action/companies_budgets/companies_budgets_save.php @@ -30,21 +30,24 @@ try{ $clientsBudgetsId = isset($_POST['clients_budgets_id']) ? (int)filter_input(INPUT_POST,'clients_budgets_id', FILTER_SANITIZE_NUMBER_INT) : 0; $financialCategoriesId = isset($_POST['financial_categories_id']) ? (int)filter_input(INPUT_POST,'financial_categories_id', FILTER_SANITIZE_NUMBER_INT) : 0; $financialAccountsId = isset($_POST['financial_accounts_id']) ? (int)filter_input(INPUT_POST,'financial_accounts_id', FILTER_SANITIZE_NUMBER_INT) : 0; - $productsId = isset($_POST['products_id']) ? (int)filter_input(INPUT_POST,'products_id', FILTER_SANITIZE_NUMBER_INT) : 0; + $productsId = isset($_POST['products_id']) ? (string)filter_input(INPUT_POST,'products_id', FILTER_SANITIZE_SPECIAL_CHARS) : 0; $description = isset($_POST['description']) ? (string)filter_input(INPUT_POST, 'description', FILTER_SANITIZE_SPECIAL_CHARS) : ''; + echo $productsId; + exit; + /** Validando os campos de entrada */ - $CompaniesBudgetsValidate->setbudget($budget); - $CompaniesBudgetsValidate->setdayDue($dayDue); - $CompaniesBudgetsValidate->setreadjustmentYear($readjustmentYear); - $CompaniesBudgetsValidate->setreadjustmentMonth($readjustmentMonth); - $CompaniesBudgetsValidate->setreadjustmentIndex($readjustmentIndex); - $CompaniesBudgetsValidate->setreadjustmentValue($readjustmentValue); - $CompaniesBudgetsValidate->setreadjustmentBudget($readjustmentBudget); - $CompaniesBudgetsValidate->setreadjustmentType($readjustmentType); - $CompaniesBudgetsValidate->setoften($often); - $CompaniesBudgetsValidate->setdateStart($dateStart); - $CompaniesBudgetsValidate->setcompanyId($companyId); + $CompaniesBudgetsValidate->setBudget($budget); + $CompaniesBudgetsValidate->setDayDue($dayDue); + $CompaniesBudgetsValidate->setReadjustmentYear($readjustmentYear); + $CompaniesBudgetsValidate->setReadjustmentMonth($readjustmentMonth); + $CompaniesBudgetsValidate->setReadjustmentIndex($readjustmentIndex); + $CompaniesBudgetsValidate->setReadjustmentValue($readjustmentValue); + $CompaniesBudgetsValidate->setReadjustmentBudget($readjustmentBudget); + $CompaniesBudgetsValidate->setReadjustmentType($readjustmentType); + $CompaniesBudgetsValidate->setOften($often); + $CompaniesBudgetsValidate->setDateStart($dateStart); + $CompaniesBudgetsValidate->setCompanyId($companyId); $CompaniesBudgetsValidate->setClientsBudgetsId($clientsBudgetsId); $CompaniesBudgetsValidate->setFinancialCategoriesId($financialCategoriesId); $CompaniesBudgetsValidate->setFinancialAccountsId($financialAccountsId); @@ -65,21 +68,21 @@ try{ /** Salva as alterações ou cadastra um novo registro */ $budgetsId = $CompaniesBudgets->Save($CompaniesBudgetsValidate->getClientsBudgetsId(), - $CompaniesBudgetsValidate->getcompanyId(), - $CompaniesBudgetsValidate->getBudget(), - $CompaniesBudgetsValidate->getDayDue(), - $CompaniesBudgetsValidate->getReadjustmentIndex(), - $CompaniesBudgetsValidate->getReadjustmentValue(), - $CompaniesBudgetsValidate->getReadjustmentBudget(), - $CompaniesBudgetsValidate->getReadjustmentType(), - $CompaniesBudgetsValidate->getReadjustmentYear(), - $CompaniesBudgetsValidate->getReadjustmentMonth(), - $CompaniesBudgetsValidate->getOften(), - $CompaniesBudgetsValidate->getDateStart(), - $CompaniesBudgetsValidate->getDescription(), - $CompaniesBudgetsValidate->getFinancialCategoriesId(), - $CompaniesBudgetsValidate->getFinancialAccountsId(), - $CompaniesBudgetsValidate->getProductsId()); + $CompaniesBudgetsValidate->getcompanyId(), + $CompaniesBudgetsValidate->getBudget(), + $CompaniesBudgetsValidate->getDayDue(), + $CompaniesBudgetsValidate->getReadjustmentIndex(), + $CompaniesBudgetsValidate->getReadjustmentValue(), + $CompaniesBudgetsValidate->getReadjustmentBudget(), + $CompaniesBudgetsValidate->getReadjustmentType(), + $CompaniesBudgetsValidate->getReadjustmentYear(), + $CompaniesBudgetsValidate->getReadjustmentMonth(), + $CompaniesBudgetsValidate->getOften(), + $CompaniesBudgetsValidate->getDateStart(), + $CompaniesBudgetsValidate->getDescription(), + $CompaniesBudgetsValidate->getFinancialCategoriesId(), + $CompaniesBudgetsValidate->getFinancialAccountsId(), + $CompaniesBudgetsValidate->getProductsId()); /** Verifica se ocorreu algum erro na hora de gravar */ if(!empty($CompaniesBudgets->getErrors())){ diff --git a/vendor/controller/companies_budgets/CompaniesBudgetsValidate.class.php b/vendor/controller/companies_budgets/CompaniesBudgetsValidate.class.php index 34ea96b..d6b59c2 100644 --- a/vendor/controller/companies_budgets/CompaniesBudgetsValidate.class.php +++ b/vendor/controller/companies_budgets/CompaniesBudgetsValidate.class.php @@ -75,7 +75,7 @@ class CompaniesBudgetsValidate } /** Método trata campo clients_id */ - public function setClientsId(int $clientsId) : void + public function setCompanyId(int $clientsId) : void { /** Trata a entrada da informação */