Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tarea #2964 - Corregido bug al desvincular documento desde el proyecto #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Controller/EditProyecto.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,12 @@ protected function unlinkUpAction(string $modelName): bool
return true;
}

// obtenemos el proyecto
$project = $this->getModel();
if (false === $project->loadFromCode($this->request->get('code', ''))) {
return true;
}

$modelClass = '\\FacturaScripts\\Dinamic\\Model\\' . $modelName;
$model = new $modelClass();
$modelTable = $model->tableName();
Expand All @@ -480,10 +486,8 @@ protected function unlinkUpAction(string $modelName): bool
}
}

$mainViewName = $this->getMainViewName();
$idproyecto = $this->getViewModelValue($mainViewName, 'idproyecto');
ProjectStockManager::rebuild($idproyecto);
ProjectTotalManager::recalculate($idproyecto);
ProjectStockManager::rebuild($project->idproyecto);
ProjectTotalManager::recalculate($project->idproyecto);

Tools::log()->info('record-updated-correctly');
return true;
Expand Down