From c10d634c905580097765571fe7e1f037c2e9d1d9 Mon Sep 17 00:00:00 2001 From: Kenio de Souza Date: Tue, 29 Jul 2025 15:36:09 -0300 Subject: [PATCH] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20ClientBugets.class.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/model/ClientBudgets.class.php | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/vendor/model/ClientBudgets.class.php b/vendor/model/ClientBudgets.class.php index 36af1cc..44e435a 100644 --- a/vendor/model/ClientBudgets.class.php +++ b/vendor/model/ClientBudgets.class.php @@ -59,7 +59,7 @@ class ClientBudgets { /** Consulta SQL */ - $this->sql = "describe client_budgets"; + $this->sql = "describe companies_budgets"; /** Preparo o SQL para execução */ $this->stmt = $this->connection->connect()->prepare($this->sql); @@ -98,7 +98,7 @@ class ClientBudgets $this->clientBudgetsId = $clientBudgetsId; /** Consulta SQL */ - $this->sql = 'select cb.client_budgets_id, + $this->sql = 'select cb.companies_budgets_id, cb.clients_id, cb.users_id, cb.users_id_update, @@ -119,15 +119,15 @@ class ClientBudgets cb.date_start, cb.description, c.fantasy_name - from client_budgets cb + from companies_budgets cb left join clients c on cb.clients_id = c.clients_id - where cb.client_budgets_id = :client_budgets_id'; + where cb.companies_budgets_id = :companies_budgets_id'; /** Preparo o SQL para execução */ $this->stmt = $this->connection->connect()->prepare($this->sql); /** Preencho os parâmetros do SQL */ - $this->stmt->bindParam(':client_budgets_id', $this->clientBudgetsId); + $this->stmt->bindParam(':companies_budgets_id', $this->clientBudgetsId); /** Executo o SQL */ $this->stmt->execute(); @@ -144,7 +144,7 @@ class ClientBudgets $this->clientsId = $clientsId; /** Consulta SQL */ - $this->sql = 'select cb.client_budgets_id, + $this->sql = 'select cb.companies_budgets_id, cb.clients_id, cb.users_id, cb.products_id, @@ -162,7 +162,7 @@ class ClientBudgets cb.date_start, cb.description, u.name_first as responsible - from client_budgets cb + from companies_budgets cb left join users u on cb.users_id = u.users_id where cb.clients_id = :clients_id'; @@ -188,8 +188,8 @@ class ClientBudgets $this->clientsId = $clientsId; /** Consulta SQL */ - $this->sql = 'select count(client_budgets_id) as qtde - from client_budgets + $this->sql = 'select count(companies_budgets_id) as qtde + from companies_budgets where clients_id = :clients_id'; /** Preparo o SQL para execução */ @@ -250,7 +250,7 @@ class ClientBudgets if($this->clientBudgetsId > 0){ /** Consulta SQL */ - $this->sql = 'update client_budgets set budget = :budget, + $this->sql = 'update companies_budgets set budget = :budget, day_due = :day_due, readjustment_index = :readjustment_index, readjustment_value = :readjustment_value, @@ -264,12 +264,12 @@ class ClientBudgets financial_categories_id = :financial_categories_id, financial_accounts_id = :financial_accounts_id, products_id = :products_id - where client_budgets_id = :client_budgets_id'; + where companies_budgets_id = :companies_budgets_id'; }else{//Se o ID não foi informado, grava-se um novo registro /** Consulta SQL */ - $this->sql = 'insert into client_budgets(clients_id, + $this->sql = 'insert into companies_budgets(clients_id, users_id, budget, day_due, @@ -315,7 +315,7 @@ class ClientBudgets if($this->clientBudgetsId > 0){ /** Preencho os parâmetros do SQL */ - $this->stmt->bindParam('client_budgets_id', $this->clientBudgetsId); + $this->stmt->bindParam('companies_budgets_id', $this->clientBudgetsId); }else{ @@ -369,14 +369,14 @@ class ClientBudgets $this->clientBudgetsId = $clientBudgetsId; /** Consulta SQL */ - $this->sql = 'delete from client_budgets - where client_budgets_id = :client_budgets_id'; + $this->sql = 'delete from companies_budgets + where companies_budgets_id = :companies_budgets_id'; /** Preparo o sql para receber os valores */ $this->stmt = $this->connection->connect()->prepare($this->sql); /** Preencho os parâmetros do SQL */ - $this->stmt->bindParam('client_budgets_id', $this->clientBudgetsId); + $this->stmt->bindParam('companies_budgets_id', $this->clientBudgetsId); /** Executo o SQL */ return $this->stmt->execute();