añadido tick a papeles interior. ese tick se usa en la busqueda

This commit is contained in:
2024-11-25 18:49:46 +01:00
parent 108af267e7
commit fd0989f764
8 changed files with 62 additions and 14 deletions

View File

@ -188,6 +188,9 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController
if ($this->request->getPost('defecto') == null) { if ($this->request->getPost('defecto') == null) {
$sanitizedData['defecto'] = false; $sanitizedData['defecto'] = false;
} }
if ($this->request->getPost('interior') == null) {
$sanitizedData['interior'] = false;
}
if ($this->request->getPost('bn') == null) { if ($this->request->getPost('bn') == null) {
$sanitizedData['bn'] = false; $sanitizedData['bn'] = false;
} }

View File

@ -0,0 +1,26 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AddTickInteriorPapelImpresion extends Migration
{
public function up()
{
$fields = [
'interior' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false,
'default' => 0,
],
];
$this->forge->addColumn('lg_papel_impresion', $fields);
}
public function down()
{
$this->forge->dropColumn('lg_papel_impresion', 'interior');
}
}

View File

@ -15,6 +15,7 @@ class PapelImpresion extends \CodeIgniter\Entity\Entity
"espesor" => 0.0, "espesor" => 0.0,
"gramaje" => null, "gramaje" => null,
"precio_tonelada" => null, "precio_tonelada" => null,
"interior" => true,
"bn" => true, "bn" => true,
"color" => true, "color" => true,
"cubierta" => false, "cubierta" => false,
@ -35,6 +36,7 @@ class PapelImpresion extends \CodeIgniter\Entity\Entity
"espesor" => "float", "espesor" => "float",
"gramaje" => "float", "gramaje" => "float",
"precio_tonelada" => "float", "precio_tonelada" => "float",
"interior" => "boolean",
"bn" => "boolean", "bn" => "boolean",
"color" => "boolean", "color" => "boolean",
"cubierta" => "boolean", "cubierta" => "boolean",

View File

@ -5,6 +5,7 @@
return [ return [
'alto' => 'Alto', 'alto' => 'Alto',
'ancho' => 'Ancho', 'ancho' => 'Ancho',
'interior' => 'Interior',
'bn' => 'B/N', 'bn' => 'B/N',
'color' => 'Color', 'color' => 'Color',
'createdAt' => 'Creado en', 'createdAt' => 'Creado en',

View File

@ -383,6 +383,7 @@ class PapelGenericoModel extends \App\Models\BaseModel
$builder->where("t2.cubierta", 1); $builder->where("t2.cubierta", 1);
$builder->where("t5.uso", 'cubierta'); $builder->where("t5.uso", 'cubierta');
} else { } else {
$builder->where("t2.interior", 1);
$builder->where("t5.uso", 'interior'); $builder->where("t5.uso", 'interior');
if ($tipo == 'negro' || $tipo == 'negrohq') if ($tipo == 'negro' || $tipo == 'negrohq')
$builder->where("t2.bn", 1); $builder->where("t2.bn", 1);

View File

@ -16,15 +16,16 @@ class PapelImpresionModel extends \App\Models\BaseModel
0 => "t1.nombre", 0 => "t1.nombre",
1 => "t2.nombre", 1 => "t2.nombre",
2 => "t1.gramaje", 2 => "t1.gramaje",
3 => "t1.bn", 3 => "t1.interior",
4 => "t1.color", 4 => "t1.bn",
5 => "t1.cubierta", 5 => "t1.color",
6 => "t1.sobrecubierta", 6 => "t1.cubierta",
7 => "t1.guardas", 7 => "t1.sobrecubierta",
8 => "t1.inkjet", 8 => "t1.guardas",
9 => "t1.rotativa", 9 => "t1.inkjet",
10 => "t1.isActivo", 10 => "t1.rotativa",
11 => "t1.use_in_client", 11 => "t1.isActivo",
12 => "t1.use_in_client",
]; ];
@ -37,6 +38,7 @@ class PapelImpresionModel extends \App\Models\BaseModel
"espesor", "espesor",
"gramaje", "gramaje",
"precio_tonelada", "precio_tonelada",
"interior",
"bn", "bn",
"color", "color",
"cubierta", "cubierta",
@ -149,7 +151,7 @@ class PapelImpresionModel extends \App\Models\BaseModel
->table($this->table . " t1") ->table($this->table . " t1")
->select( ->select(
"t1.id AS id, t1.nombre AS nombre, t1.defecto AS defecto, t1.referencia AS referencia, t1.mano AS mano, "t1.id AS id, t1.nombre AS nombre, t1.defecto AS defecto, t1.referencia AS referencia, t1.mano AS mano,
t1.espesor AS espesor, t1.gramaje AS gramaje, t1.precio_tonelada AS precio_tonelada, t1.espesor AS espesor, t1.gramaje AS gramaje, t1.interior AS interior, t1.precio_tonelada AS precio_tonelada,
t1.bn AS bn, t1.color AS color, t1.cubierta AS cubierta, t1.sobrecubierta AS sobrecubierta, t1.guardas AS guardas, t1.bn AS bn, t1.color AS color, t1.cubierta AS cubierta, t1.sobrecubierta AS sobrecubierta, t1.guardas AS guardas,
t1.inkjet AS inkjet, t1.rotativa AS rotativa, t1.inkjet AS inkjet, t1.rotativa AS rotativa,
t1.isActivo AS isActivo, t2.nombre AS papel_generico_id, t1.isActivo AS isActivo, t2.nombre AS papel_generico_id,

View File

@ -91,10 +91,10 @@
<div class="mb-3"> <div class="mb-3">
<div class="form-check"> <div class="form-check">
<label for="cubierta" class="form-check-label"> <label for="interior" class="form-check-label">
<input type="checkbox" id="cubierta" name="cubierta" value="1" class="form-check-input" <input type="checkbox" id="interior" name="interior" value="1" class="form-check-input"
<?= $papelImpresion->cubierta == true ? 'checked' : ''; ?>> <?= $papelImpresion->interior == true ? 'checked' : ''; ?>>
<?= lang('PapelImpresion.cubierta') ?> <?= lang('PapelImpresion.interior') ?>
</label> </label>
</div><!--//.form-check --> </div><!--//.form-check -->
</div><!--//.mb-3 --> </div><!--//.mb-3 -->
@ -155,6 +155,17 @@
</div><!--//.form-check --> </div><!--//.form-check -->
</div><!--//.mb-3 --> </div><!--//.mb-3 -->
<div class="mb-3">
<div class="form-check">
<label for="cubierta" class="form-check-label">
<input type="checkbox" id="cubierta" name="cubierta" value="1" class="form-check-input"
<?= $papelImpresion->cubierta == true ? 'checked' : ''; ?>>
<?= lang('PapelImpresion.cubierta') ?>
</label>
</div><!--//.form-check -->
</div><!--//.mb-3 -->
<div class="mb-3"> <div class="mb-3">
<div class="form-check"> <div class="form-check">

View File

@ -21,6 +21,7 @@
<th><?= lang('PapelImpresion.nombre') ?></th> <th><?= lang('PapelImpresion.nombre') ?></th>
<th><?= lang('PapelGenerico.papelGenerico') ?></th> <th><?= lang('PapelGenerico.papelGenerico') ?></th>
<th><?= lang('PapelImpresion.gramaje') ?></th> <th><?= lang('PapelImpresion.gramaje') ?></th>
<th><?= lang('PapelImpresion.interior') ?></th>
<th><?= lang('PapelImpresion.bn') ?></th> <th><?= lang('PapelImpresion.bn') ?></th>
<th><?= lang('PapelImpresion.color') ?></th> <th><?= lang('PapelImpresion.color') ?></th>
<th><?= lang('PapelImpresion.cubierta') ?></th> <th><?= lang('PapelImpresion.cubierta') ?></th>
@ -99,6 +100,7 @@
{ 'data': 'nombre' }, { 'data': 'nombre' },
{ 'data': 'papel_generico_id' }, { 'data': 'papel_generico_id' },
{ 'data': 'gramaje' }, { 'data': 'gramaje' },
{ 'data': 'interior' },
{ 'data': 'bn' }, { 'data': 'bn' },
{ 'data': 'color' }, { 'data': 'color' },
{ 'data': 'cubierta' }, { 'data': 'cubierta' },