mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
añadida migración para el tamaño de los lomos. Cambiado nombre de variables en el codigo también
This commit is contained in:
@ -130,7 +130,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
$this->viewData['paisList'] = model('App\Models\Configuracion\PaisModel')->getAllForMenu('id, nombre', 'nombre', true);
|
$this->viewData['paisList'] = model('App\Models\Configuracion\PaisModel')->getAllForMenu('id, nombre', 'nombre', true);
|
||||||
$this->viewData['clienteId'] = $clienteId;
|
$this->viewData['clienteId'] = $clienteId;
|
||||||
$this->viewData['POD'] = $POD;
|
$this->viewData['POD'] = $POD;
|
||||||
$this->viewData['lomo_maximo'] = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('lomo_maximo')->value;
|
$this->viewData['lomo_maximo_fresado_cosido'] = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('lomo_maximo_fresado_cosido')->value;
|
||||||
$this->viewData['lomo_minimo_fresado_cosido'] = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('lomo_minimo_fresado_cosido')->value;
|
$this->viewData['lomo_minimo_fresado_cosido'] = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('lomo_minimo_fresado_cosido')->value;
|
||||||
$this->viewData['eb'] = 0;
|
$this->viewData['eb'] = 0;
|
||||||
|
|
||||||
@ -175,7 +175,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
|
|
||||||
$this->viewData['clienteId'] = $clienteId;
|
$this->viewData['clienteId'] = $clienteId;
|
||||||
$this->viewData['POD'] = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('POD')->value;
|
$this->viewData['POD'] = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('POD')->value;
|
||||||
$this->viewData['lomo_maximo'] = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('lomo_maximo')->value;
|
$this->viewData['lomo_maximo_fresado_cosido'] = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('lomo_maximo_fresado_cosido')->value;
|
||||||
$this->viewData['lomo_minimo_fresado_cosido'] = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('lomo_minimo_fresado_cosido')->value;
|
$this->viewData['lomo_minimo_fresado_cosido'] = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('lomo_minimo_fresado_cosido')->value;
|
||||||
$this->viewData['eb'] = $presupuestoEntity->envio_base;
|
$this->viewData['eb'] = $presupuestoEntity->envio_base;
|
||||||
|
|
||||||
@ -418,7 +418,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
'value' => ""
|
'value' => ""
|
||||||
];
|
];
|
||||||
$lomo_minimo_fresado_cosido = intval(model('App\Models\Configuracion\ConfigVariableModel')->getVariable('lomo_minimo_fresado_cosido')->value);
|
$lomo_minimo_fresado_cosido = intval(model('App\Models\Configuracion\ConfigVariableModel')->getVariable('lomo_minimo_fresado_cosido')->value);
|
||||||
$lomo_maximo = intval(model('App\Models\Configuracion\ConfigVariableModel')->getVariable('lomo_maximo')->value);
|
$lomo_maximo_fresado_cosido = intval(model('App\Models\Configuracion\ConfigVariableModel')->getVariable('lomo_maximo_fresado_cosido')->value);
|
||||||
|
|
||||||
if ($tipo == 'cosido' || $tipo == 'fresado') {
|
if ($tipo == 'cosido' || $tipo == 'fresado') {
|
||||||
if ($lomo < $lomo_minimo_fresado_cosido) {
|
if ($lomo < $lomo_minimo_fresado_cosido) {
|
||||||
@ -427,10 +427,10 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
. $lomo_minimo_fresado_cosido . ' mm. El lomo actual es de ' . $lomo . ' mm. ' .
|
. $lomo_minimo_fresado_cosido . ' mm. El lomo actual es de ' . $lomo . ' mm. ' .
|
||||||
"Por favor, aumente el número de páginas o el gramaje del papel para que sea encuadernable.";
|
"Por favor, aumente el número de páginas o el gramaje del papel para que sea encuadernable.";
|
||||||
}
|
}
|
||||||
if ($lomo > $lomo_maximo) {
|
if ($lomo > $lomo_maximo_fresado_cosido) {
|
||||||
$errors['status'] = 1;
|
$errors['status'] = 1;
|
||||||
$errors['value'] = 'No se pueden encuadernar con un lomo superior a '
|
$errors['value'] = 'No se pueden encuadernar con un lomo superior a '
|
||||||
. $lomo_maximo . ' mm. El lomo actual es de ' . $lomo . ' mm. ' .
|
. $lomo_maximo_fresado_cosido . ' mm. El lomo actual es de ' . $lomo . ' mm. ' .
|
||||||
"Por favor, disminuya el número de páginas o el gramaje del papel para que sea encuadernable.";
|
"Por favor, disminuya el número de páginas o el gramaje del papel para que sea encuadernable.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Database\Migrations;
|
||||||
|
|
||||||
|
use CodeIgniter\Database\Migration;
|
||||||
|
|
||||||
|
class LomoMaximoLibros extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
// Renombrar campo
|
||||||
|
$this->db->table('config_variables_app')
|
||||||
|
->where('name', 'lomo_maximo')
|
||||||
|
->set('name', 'lomo_maximo_fresado_cosido')
|
||||||
|
->update();
|
||||||
|
|
||||||
|
// Insertar nuevo campo: lomo_maximo_espiral
|
||||||
|
$this->db->table('config_variables_app')->insert([
|
||||||
|
'name' => 'lomo_maximo_espiral',
|
||||||
|
'value' => '45',
|
||||||
|
'description' => 'Tamaño máximo (mm) para el lomo de los libros espiral',
|
||||||
|
'created_at' => date('Y-m-d H:i:s')
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Insertar nuevo campo: lomo_maximo_wireo
|
||||||
|
$this->db->table('config_variables_app')->insert([
|
||||||
|
'name' => 'lomo_maximo_wireo',
|
||||||
|
'value' => '26',
|
||||||
|
'description' => 'Tamaño máximo (mm) para el lomo de los libros wire-O',
|
||||||
|
'created_at' => date('Y-m-d H:i:s')
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
// Revertir nombre
|
||||||
|
$this->db->table('config_variables_app')
|
||||||
|
->where('name', 'lomo_maximo_fresado_cosido')
|
||||||
|
->set('name', 'lomo_maximo')
|
||||||
|
->update();
|
||||||
|
|
||||||
|
// Borrar los nuevos campos
|
||||||
|
$this->db->table('config_variables_app')->whereIn('name', [
|
||||||
|
'lomo_maximo_espiral',
|
||||||
|
'lomo_maximo_wireo'
|
||||||
|
])->delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -36,7 +36,7 @@
|
|||||||
<input hidden id="lc" value=""></input>
|
<input hidden id="lc" value=""></input>
|
||||||
<input hidden id="lsc" value=""></input>
|
<input hidden id="lsc" value=""></input>
|
||||||
<input readonly hidden id="pod" value="<?= $POD ?>"></input>
|
<input readonly hidden id="pod" value="<?= $POD ?>"></input>
|
||||||
<input readonly hidden id="lomo_maximo" value="<?= $lomo_maximo ?>"></input>
|
<input readonly hidden id="lomo_maximo_fresado_cosido" value="<?= $lomo_maximo_fresado_cosido ?>"></input>
|
||||||
<input readonly hidden id="lomo_minimo_fresado_cosido" value="<?= $lomo_minimo_fresado_cosido ?>"></input>
|
<input readonly hidden id="lomo_minimo_fresado_cosido" value="<?= $lomo_minimo_fresado_cosido ?>"></input>
|
||||||
<input readonly hidden id="pod" value="<?= $POD ?>"></input>
|
<input readonly hidden id="pod" value="<?= $POD ?>"></input>
|
||||||
<input readonly hidden id="c" value="<?= $clienteId ?>"></input>
|
<input readonly hidden id="c" value="<?= $clienteId ?>"></input>
|
||||||
|
|||||||
Reference in New Issue
Block a user