mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'mod/papelesImpresionTick' into 'main'
Mod/papeles impresion tick See merge request jjimenez/safekat!392
This commit is contained in:
@ -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
|
||||
|
||||
@ -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');
|
||||
|
||||
}
|
||||
}
|
||||
@ -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",
|
||||
];
|
||||
}
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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 -->
|
||||
|
||||
@ -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 -->
|
||||
|
||||
@ -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; ?>
|
||||
|
||||
|
||||
@ -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,15 +107,14 @@
|
||||
{ 'data': 'inkjet' },
|
||||
{ 'data': 'rotativa' },
|
||||
{ 'data': 'isActivo' },
|
||||
{ 'data': 'show_in_client' },
|
||||
{ 'data': 'show_in_client_special' },
|
||||
{ 'data': 'use_in_client' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
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) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||
|
||||
Reference in New Issue
Block a user