modificado el papel impresion tick

This commit is contained in:
2024-11-20 17:29:07 +01:00
parent 80b4d3aaf4
commit 791a17d3da
9 changed files with 62 additions and 51 deletions

View File

@ -212,15 +212,8 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController
if ($this->request->getPost('isActivo') == null) {
$sanitizedData['isActivo'] = false;
}
if ($this->request->getPost('show_in_client') == null) {
$sanitizedData['show_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;
if ($this->request->getPost('use_in_client') == null) {
$sanitizedData['use_in_client'] = false;
}
// 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,
"rotativa" => false,
"isActivo" => true,
"show_in_client" => false,
"show_in_client_special" => false,
"use_in_client" => false,
"is_deleted" => 0,
"created_at" => null,
"updated_at" => null,
@ -43,8 +42,7 @@ class PapelImpresion extends \CodeIgniter\Entity\Entity
"guardas" => "boolean",
"rotativa" => "boolean",
"isActivo" => "boolean",
"show_in_client" => "boolean",
"show_in_client_special" => "boolean",
"use_in_client" => "boolean",
"is_deleted" => "int",
];
}

View File

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

View File

@ -24,8 +24,7 @@ class PapelImpresionModel extends \App\Models\BaseModel
8 => "t1.inkjet",
9 => "t1.rotativa",
10 => "t1.isActivo",
11 => "t1.show_in_client",
12 => "t1.show_in_client_special"
11 => "t1.use_in_client",
];
@ -46,8 +45,7 @@ class PapelImpresionModel extends \App\Models\BaseModel
"inkjet",
"rotativa",
"isActivo",
"show_in_client",
"show_in_client_special",
"use_in_client",
"deleted_at",
"is_deleted",
"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.inkjet AS inkjet, t1.rotativa AS rotativa,
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");

View File

@ -31,7 +31,7 @@
<?= lang('PapelGenerico.showInClient') ?>
</label>
<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' : ''; ?>>
</div><!--//.form-check -->

View File

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

View File

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

View File

@ -29,8 +29,7 @@
<th><?= lang('PapelImpresion.inkjet') ?></th>
<th><?= lang('PapelImpresion.rotativa') ?></th>
<th><?= lang('PapelImpresion.activo') ?></th>
<th><?= lang('PapelImpresion.showInClient') ?></th>
<th><?= lang('PapelImpresion.showInClientSpecial') ?></th>
<th><?= lang('PapelImpresion.useInClient') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
@ -108,8 +107,7 @@
{ 'data': 'inkjet' },
{ 'data': 'rotativa' },
{ 'data': 'isActivo' },
{ 'data': 'show_in_client' },
{ 'data': 'show_in_client_special' },
{ 'data': 'use_in_client' },
{ 'data': actionBtns }
]
});