fix(): Ajuste na função de atualizar movimentação
This commit is contained in:
parent
5d7993cc27
commit
2c0967119d
3 changed files with 15 additions and 6 deletions
|
|
@ -23,6 +23,7 @@ try{
|
|||
$financialEntriesId = isset($_POST['financial_entries_id']) ? (int)filter_input(INPUT_POST,'financial_entries_id', FILTER_SANITIZE_NUMBER_INT) : 0;
|
||||
$movementUserConfirmed = isset($_POST['movement_user_confirmed']) ? (int)filter_input(INPUT_POST,'movement_user_confirmed', FILTER_SANITIZE_NUMBER_INT) : 0;
|
||||
$updateValue = isset($_POST['updateValue']) ? (string)filter_input(INPUT_POST,'updateValue', FILTER_SANITIZE_SPECIAL_CHARS) : 'N';
|
||||
$description = isset($_POST['description']) ? (string)filter_input(INPUT_POST,'description', FILTER_SANITIZE_SPECIAL_CHARS) : '';
|
||||
|
||||
/** Verifica se é somente atualização de valor */
|
||||
if($updateValue == 'S'){
|
||||
|
|
@ -41,6 +42,7 @@ try{
|
|||
$FinancialMovementsValidate->setMovementValuePaid($movementValuePaid);
|
||||
$FinancialMovementsValidate->setMovementValueFees($movementValueFees);
|
||||
$FinancialMovementsValidate->setMovementMovementUserConfirmed($movementUserConfirmed);
|
||||
$FinancialMovementsValidate->setDescription($description);
|
||||
}
|
||||
|
||||
/** Verifica se não existem erros a serem informados */
|
||||
|
|
@ -101,7 +103,8 @@ try{
|
|||
$FinancialMovementsValidate->getMovementValueFees(),
|
||||
null,
|
||||
null,
|
||||
$FinancialMovementsValidate->getMovementMovementUserConfirmed() )){
|
||||
$FinancialMovementsValidate->getMovementMovementUserConfirmed(),
|
||||
$FinancialMovementsValidate->getDescription() )){
|
||||
|
||||
/** Informa o resultado positivo **/
|
||||
$result = [
|
||||
|
|
|
|||
14
vendor/model/FinancialMovements.class.php
vendored
14
vendor/model/FinancialMovements.class.php
vendored
|
|
@ -1247,7 +1247,8 @@ class FinancialMovements
|
|||
? float $movementValueFees,
|
||||
? float $movementValueRegistrationTariff,
|
||||
? float $movementValueSettlementTariff,
|
||||
int $movementUserConfirmed)
|
||||
int $movementUserConfirmed,
|
||||
string $description)
|
||||
{
|
||||
/** Parametros de entrada */
|
||||
$this->financialMovementsId = $financialMovementsId;
|
||||
|
|
@ -1260,6 +1261,7 @@ class FinancialMovements
|
|||
$this->movementValueRegistrationTariff = $movementValueRegistrationTariff;
|
||||
$this->movementValueSettlementTariff = $movementValueSettlementTariff;
|
||||
$this->movementUserConfirmed = $movementUserConfirmed;
|
||||
$this->description = $description;
|
||||
|
||||
/** se o movement_user_confirmed foi informado */
|
||||
if($this->movementUserConfirmed > 0){
|
||||
|
|
@ -1272,7 +1274,8 @@ class FinancialMovements
|
|||
movement_value_registration_tariff = :movement_value_registration_tariff,
|
||||
movement_value_settlement_tariff = :movement_value_settlement_tariff,
|
||||
movement_date_update = CURRENT_TIMESTAMP,
|
||||
user_id_update = :user_id_update
|
||||
user_id_update = :user_id_update,
|
||||
description = :description
|
||||
where financial_movements_id = :financial_movements_id ";
|
||||
|
||||
|
||||
|
|
@ -1299,6 +1302,7 @@ class FinancialMovements
|
|||
$this->stmt->bindParam('movement_value_settlement_tariff', $this->movementValueSettlementTariff);
|
||||
$this->stmt->bindParam('user_id_update', $_SESSION['USERSID']);
|
||||
$this->stmt->bindParam('financial_movements_id', $this->financialMovementsId);
|
||||
$this->stmt->bindParam('description', $this->description);
|
||||
|
||||
/** Verifica se é uma entrada*/
|
||||
if($this->financialEntriesId > 0){
|
||||
|
|
@ -1326,7 +1330,8 @@ class FinancialMovements
|
|||
movement_value_settlement_tariff = :movement_value_settlement_tariff,
|
||||
status = 2,
|
||||
movement_date_update = CURRENT_TIMESTAMP,
|
||||
user_id_update = :user_id_update
|
||||
user_id_update = :user_id_update,
|
||||
description = :description
|
||||
where financial_movements_id = :financial_movements_id ";
|
||||
|
||||
|
||||
|
|
@ -1353,7 +1358,8 @@ class FinancialMovements
|
|||
$this->stmt->bindParam('movement_value_registration_tariff', $this->movementValueRegistrationTariff);
|
||||
$this->stmt->bindParam('movement_value_settlement_tariff', $this->movementValueSettlementTariff);
|
||||
$this->stmt->bindParam('user_id_update', $_SESSION['USERSID']);
|
||||
$this->stmt->bindParam('financial_movements_id', $this->financialMovementsId);
|
||||
$this->stmt->bindParam('financial_movements_id', $this->financialMovementsId);
|
||||
$this->stmt->bindParam('description', $this->description);
|
||||
|
||||
/** Verifica se é uma entrada*/
|
||||
if($this->financialEntriesId > 0){
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ try{
|
|||
|
||||
<div class="col-sm-12 ">
|
||||
<label for="current_balance">Descrição:</label>
|
||||
<input type="text" class="form-control form-control" id="description" maxlength="160" value="<?php echo $FinancialMovementsResult->description;?> ">
|
||||
<input type="text" class="form-control form-control" id="description" name="description" maxlength="160" value="<?php echo $FinancialMovementsResult->description;?> ">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue