Atualizando saídas

This commit is contained in:
Kenio 2025-08-09 11:47:50 -03:00
parent 4908e9064a
commit 26a4bd136b

View file

@ -26,7 +26,7 @@ class FinancialOutputs
private $financialOutputsId = null;
private $financialCategoriesId = null;
private $companyId = null;
private $usersId = null;
private $userId = null;
private $description = null;
private $fixed = null;
private $duration = null;
@ -176,13 +176,23 @@ class FinancialOutputs
}
/** Insere um novo registro no banco */
public function Save(int $financialOutputsId, int $clientsId, string $description, int $fixed, int $duration, string $startDate, float $outputValue, string $endDate, int $financialAccountsId, string $active, int $financialCategoriesId)
public function Save(int $financialOutputsId,
int $companyId,
string $description,
int $fixed,
int $duration,
string $startDate,
float $outputValue,
string $endDate,
int $financialAccountsId,
string $active,
int $financialCategoriesId)
{
/** Parametros */
$this->financialOutputsId = $financialOutputsId;
$this->clientsId = $clientsId > 0 ? $clientsId : null;
$this->companyId = $companyId > 0 ? $companyId : null;
$this->description = $description;
$this->fixed = $fixed;
$this->duration = $duration;
@ -215,7 +225,7 @@ class FinancialOutputs
/** Preencho os parâmetros do SQL */
$this->stmt->bindParam('financial_outputs_id', $this->financialOutputsId);
$this->stmt->bindParam('company_id', $this->clientsId);
$this->stmt->bindParam('company_id', $this->companyId);
$this->stmt->bindParam('financial_accounts_id', $this->financialAccountsId);
$this->stmt->bindParam('financial_categories_id', $this->financialCategoriesId);
$this->stmt->bindParam('description', $this->description);
@ -262,7 +272,7 @@ class FinancialOutputs
$this->stmt = $this->connection->connect()->prepare($this->sql);
/** Preencho os parâmetros do SQL */
$this->stmt->bindParam('user_id', $_SESSION['USERSID']);/** Informa o usuário responsável pelo novo cliente cadastrado */
$this->stmt->bindParam('user_id', $_SESSION['userId']);/** Informa o usuário responsável pelo novo cliente cadastrado */
$this->stmt->bindParam('company_id', $this->companyId);/** Informa a qual empresa pertence o cliente */
$this->stmt->bindParam('financial_accounts_id', $this->financialAccountsId);
$this->stmt->bindParam('financial_outputs_id', $this->financialOutputsId);
@ -328,7 +338,7 @@ class FinancialOutputs
$this->stmt = $this->connection->connect()->prepare($this->sql);
/** Preencho os parâmetros do SQL */
$this->stmt->bindParam('user_id', $_SESSION['USERSID']);/** Informa o usuário responsável pelo novo cliente cadastrado */
$this->stmt->bindParam('user_id', $_SESSION['userId']);/** Informa o usuário responsável pelo novo cliente cadastrado */
$this->stmt->bindParam('company_id', $this->companyId);/** Informa a qual empresa pertence o cliente */
$this->stmt->bindParam('financial_accounts_id', $this->financialAccountsId);
$this->stmt->bindParam('financial_categories_id', $this->financialCategoriesId);
@ -382,7 +392,7 @@ class FinancialOutputs
$this->stmt = $this->connection->connect()->prepare($this->sql);
/** Preencho os parâmetros do SQL */
$this->stmt->bindParam('user_id', $_SESSION['USERSID']);/** Informa o usuário responsável pelo novo cliente cadastrado */
$this->stmt->bindParam('user_id', $_SESSION['userId']);/** Informa o usuário responsável pelo novo cliente cadastrado */
$this->stmt->bindParam('company_id', $this->companyId);/** Informa a qual empresa pertence o cliente */
$this->stmt->bindParam('financial_accounts_id', $this->financialAccountsId);
$this->stmt->bindParam('financial_outputs_id', $this->lastid);