Merge branch 'mod/papelesImpresionTick' into 'main'

Mod/papeles impresion tick

See merge request jjimenez/safekat!392
This commit is contained in:
2024-11-21 19:19:56 +00:00
9 changed files with 63 additions and 52 deletions

View File

@ -212,15 +212,8 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController
if ($this->request->getPost('isActivo') == null) { if ($this->request->getPost('isActivo') == null) {
$sanitizedData['isActivo'] = false; $sanitizedData['isActivo'] = false;
} }
if ($this->request->getPost('show_in_client') == null) { if ($this->request->getPost('use_in_client') == null) {
$sanitizedData['show_in_client'] = false; $sanitizedData['use_in_client'] = false;
}
if ($this->request->getPost('show_in_client_special') == null) {
$sanitizedData['show_in_client_special'] = false;
}
if($sanitizedData['show_in_client_special']){
$sanitizedData['show_in_client'] = true;
} }
// Hay que asegurarse de que se quitan los consumos de tintas de rotativa // Hay que asegurarse de que se quitan los consumos de tintas de rotativa

View File

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

View File

@ -23,8 +23,7 @@ class PapelImpresion extends \CodeIgniter\Entity\Entity
"inkjet" => false, "inkjet" => false,
"rotativa" => false, "rotativa" => false,
"isActivo" => true, "isActivo" => true,
"show_in_client" => false, "use_in_client" => false,
"show_in_client_special" => false,
"is_deleted" => 0, "is_deleted" => 0,
"created_at" => null, "created_at" => null,
"updated_at" => null, "updated_at" => null,
@ -43,8 +42,7 @@ class PapelImpresion extends \CodeIgniter\Entity\Entity
"guardas" => "boolean", "guardas" => "boolean",
"rotativa" => "boolean", "rotativa" => "boolean",
"isActivo" => "boolean", "isActivo" => "boolean",
"show_in_client" => "boolean", "use_in_client" => "boolean",
"show_in_client_special" => "boolean",
"is_deleted" => "int", "is_deleted" => "int",
]; ];
} }

View File

@ -35,8 +35,7 @@ return [
'rotativa' => 'Rotativa', 'rotativa' => 'Rotativa',
'updatedAt' => 'Actualizado en', 'updatedAt' => 'Actualizado en',
'activo' => 'Activo?', 'activo' => 'Activo?',
'showInClient' => 'Mostrar en cliente', 'useInClient' => 'Usar en presup. cliente',
'showInClientSpecial' => 'Papel especial cliente',
'userUpdateId' => 'ID usuario actualización', 'userUpdateId' => 'ID usuario actualización',
'consumo_tintas_rotativas' => 'Consumo tintas', 'consumo_tintas_rotativas' => 'Consumo tintas',

View File

@ -24,8 +24,7 @@ class PapelImpresionModel extends \App\Models\BaseModel
8 => "t1.inkjet", 8 => "t1.inkjet",
9 => "t1.rotativa", 9 => "t1.rotativa",
10 => "t1.isActivo", 10 => "t1.isActivo",
11 => "t1.show_in_client", 11 => "t1.use_in_client",
12 => "t1.show_in_client_special"
]; ];
@ -46,8 +45,7 @@ class PapelImpresionModel extends \App\Models\BaseModel
"inkjet", "inkjet",
"rotativa", "rotativa",
"isActivo", "isActivo",
"show_in_client", "use_in_client",
"show_in_client_special",
"deleted_at", "deleted_at",
"is_deleted", "is_deleted",
"user_updated_id", "user_updated_id",
@ -155,7 +153,7 @@ class PapelImpresionModel extends \App\Models\BaseModel
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,
t1.show_in_client AS show_in_client, t1.show_in_client_special AS show_in_client_special" t1.use_in_client AS use_in_client"
); );
$builder->join("lg_papel_generico t2", "t1.papel_generico_id = t2.id", "left"); $builder->join("lg_papel_generico t2", "t1.papel_generico_id = t2.id", "left");

View File

@ -31,7 +31,7 @@
<?= lang('PapelGenerico.showInClient') ?> <?= lang('PapelGenerico.showInClient') ?>
</label> </label>
<input type="checkbox" id="showInClient" name="show_in_client" value="1" class="form-check-input" <input type="checkbox" id="showInClient" name="show_in_client" value="1" class="form-check-input"
<?= $papelImpresion->show_in_client_special == true ? 'disabled' : ''; ?> <?= $papelGenerico->show_in_client_special == true ? 'disabled' : ''; ?>
<?= $papelGenerico->show_in_client == true ? 'checked' : ''; ?>> <?= $papelGenerico->show_in_client == true ? 'checked' : ''; ?>>
</div><!--//.form-check --> </div><!--//.form-check -->

View File

@ -134,22 +134,11 @@
<div class="mb-3"> <div class="mb-3">
<div class="form-check"> <div class="form-check">
<label for="showInClient" class="form-check-label"> <label for="useInClient" class="form-check-label">
<?= lang('PapelImpresion.showInClient') ?> <?= lang('PapelImpresion.useInClient') ?>
</label> </label>
<input type="checkbox" id="showInClient" name="show_in_client" value="1" class="form-check-input" <input type="checkbox" id="useInClient" name="use_in_client" value="1" class="form-check-input"
<?= $papelImpresion->show_in_client_special == true ? 'disabled' : ''; ?> <?= $papelImpresion->use_in_client == true ? 'checked' : ''; ?>>
<?= $papelImpresion->show_in_client == true ? 'checked' : ''; ?>>
</div><!--//.form-check -->
</div><!--//.mb-3 -->
<div class="mb-3">
<div class="form-check">
<label for="showInClientSpecial" class="form-check-label">
<?= lang('PapelImpresion.showInClientSpecial') ?>
</label>
<input type="checkbox" id="showInClientSpecial" name="show_in_client_special" value="1" class="form-check-input"
<?= $papelImpresion->show_in_client_special == true ? 'checked' : ''; ?>>
</div><!--//.form-check --> </div><!--//.form-check -->
</div><!--//.mb-3 --> </div><!--//.mb-3 -->
</div><!--//.col --> </div><!--//.col -->

View File

@ -757,17 +757,7 @@
} }
}) })
$('#showInClientSpecial').on('change', function() { <?= $this->endSection() ?>
if($(this).is(':checked')) {
$('#showInClient').prop('disabled', true);
$('#showInClient').prop('checked', true);
}
else{
$('#showInClient').prop('disabled', false);
}
});
<?= $this->endSection() ?>
<?php endif; ?> <?php endif; ?>

View File

@ -29,8 +29,7 @@
<th><?= lang('PapelImpresion.inkjet') ?></th> <th><?= lang('PapelImpresion.inkjet') ?></th>
<th><?= lang('PapelImpresion.rotativa') ?></th> <th><?= lang('PapelImpresion.rotativa') ?></th>
<th><?= lang('PapelImpresion.activo') ?></th> <th><?= lang('PapelImpresion.activo') ?></th>
<th><?= lang('PapelImpresion.showInClient') ?></th> <th><?= lang('PapelImpresion.useInClient') ?></th>
<th><?= lang('PapelImpresion.showInClientSpecial') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th> <th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr> </tr>
</thead> </thead>
@ -108,15 +107,14 @@
{ 'data': 'inkjet' }, { 'data': 'inkjet' },
{ 'data': 'rotativa' }, { 'data': 'rotativa' },
{ 'data': 'isActivo' }, { 'data': 'isActivo' },
{ 'data': 'show_in_client' }, { 'data': 'use_in_client' },
{ 'data': 'show_in_client_special' },
{ 'data': actionBtns } { 'data': actionBtns }
] ]
}); });
theTable.on( 'draw.dt', function () { theTable.on( 'draw.dt', function () {
const boolCols = [3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; const boolCols = [3, 4, 5, 6, 7, 8, 9, 10, 11];
for (let coln of boolCols) { for (let coln of boolCols) {
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) { theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : ''; cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';