mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
modificacion hecha
This commit is contained in:
@ -205,10 +205,13 @@ class Papelesimpresion extends \App\Controllers\GoBaseResourceController
|
||||
if ($this->request->getPost('rotativa') == null) {
|
||||
$sanitizedData['rotativa'] = false;
|
||||
}
|
||||
if ($this->request->getPost('inkjet') == null) {
|
||||
$sanitizedData['inkjet'] = false;
|
||||
}
|
||||
|
||||
// Hay que asegurarse de que se quitan los consumos de tintas de rotativa
|
||||
// en caso de que se haya deseleccionado la opción rotativa
|
||||
if(!$sanitizedData['rotativa']){
|
||||
if(!$sanitizedData['rotativa'] && !$sanitizedData['inkjet']){
|
||||
$this->tpModel->removeForPapelImpresion($id);
|
||||
}
|
||||
|
||||
@ -221,8 +224,7 @@ class Papelesimpresion extends \App\Controllers\GoBaseResourceController
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->canValidate()) :
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||
@ -415,12 +417,12 @@ class Papelesimpresion extends \App\Controllers\GoBaseResourceController
|
||||
$ma_model = new MaquinaModel();
|
||||
$ma_pa_model = new MaquinasPapelesImpresionModel();
|
||||
|
||||
$active_values = $ma_pa_model->getInitSelectedMachines($id, $data['rotativa'])->get()->getResult('array');
|
||||
$active_values = $ma_pa_model->getInitSelectedMachines($id, $data['rotativa'], $data['inkjet'])->get()->getResult('array');
|
||||
|
||||
$ma_pa_model->deleteForPapelImpresion($id);
|
||||
|
||||
// Se obtienen las máquinas que cumplen las condiciones
|
||||
$rows = $ma_model->getIdMaquinasForPapelImpresion($id, $data['rotativa'])->get()->getResult('array');
|
||||
$rows = $ma_model->getIdMaquinasForPapelImpresion($id, $data['rotativa'], $data['inkjet'])->get()->getResult('array');
|
||||
$ma_pa_model->insertRows($rows);
|
||||
|
||||
// Se actualizan los activos que había en caso de que los hubiera
|
||||
|
||||
Reference in New Issue
Block a user