add mostrar_presupuesto_cliente field in tarifas extra y preimpresion

This commit is contained in:
amazuecos
2025-02-20 08:24:01 +01:00
parent 61fdceb8e1
commit 1af261eff9
14 changed files with 86 additions and 7 deletions

View File

@ -65,7 +65,9 @@ class Tarifaextra extends \App\Controllers\GoBaseController
if ($this->request->getPost('mostrar_en_presupuesto') == null) {
$sanitizedData['mostrar_en_presupuesto'] = false;
}
if ($this->request->getPost('mostrar_en_presupuesto_cliente') == null) {
$sanitizedData['mostrar_en_presupuesto_cliente'] = false;
}
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
@ -142,7 +144,9 @@ class Tarifaextra extends \App\Controllers\GoBaseController
if ($this->request->getPost('mostrar_en_presupuesto') == null) {
$sanitizedData['mostrar_en_presupuesto'] = false;
}
if ($this->request->getPost('mostrar_en_presupuesto_cliente') == null) {
$sanitizedData['mostrar_en_presupuesto_cliente'] = false;
}
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :

View File

@ -63,7 +63,9 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController
if ($this->request->getPost('mostrar_en_presupuesto') == null) {
$sanitizedData['mostrar_en_presupuesto'] = false;
}
if ($this->request->getPost('mostrar_en_presupuesto_cliente') == null) {
$sanitizedData['mostrar_en_presupuesto_cliente'] = false;
}
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
@ -144,7 +146,9 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController
if ($this->request->getPost('mostrar_en_presupuesto') == null) {
$sanitizedData['mostrar_en_presupuesto'] = false;
}
if ($this->request->getPost('mostrar_en_presupuesto_cliente') == null) {
$sanitizedData['mostrar_en_presupuesto_cliente'] = false;
}
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :

View File

@ -0,0 +1,30 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AlterTableTarifasExtraPreimpresionCheckPresupuestoClienteMigration extends Migration
{
public function up()
{
$field = [
'mostrar_en_presupuesto_cliente' => [
'type' => 'BOOLEAN',
'default' => false,
]
];
$this->forge->addColumn('tarifa_extra',$field);
$this->forge->addColumn('lg_tarifa_preimpresion',$field);
}
public function down()
{
$this->forge->dropColumn('tarifa_extra','mostrar_en_presupuesto_cliente');
$this->forge->dropColumn('lg_tarifa_preimpresion','mostrar_en_presupuesto_cliente');
}
}

View File

@ -13,6 +13,7 @@ class TarifaextraEntity extends \CodeIgniter\Entity\Entity
"precio" => null,
"margen" => 0,
"mostrar_en_presupuesto" => 1,
"mostrar_en_presupuesto_cliente" => false,
"user_created_id" => 1,
"user_update_id" => 1,
"is_deleted" => 0,
@ -26,6 +27,7 @@ class TarifaextraEntity extends \CodeIgniter\Entity\Entity
"comment" => "string",
"margen" => "float",
"mostrar_en_presupuesto" => "int",
"mostrar_en_presupuesto_cliente" => "bool",
"user_created_id" => "int",
"user_update_id" => "int",
"is_deleted" => "int",

View File

@ -13,6 +13,7 @@ class TarifapreimpresionEntity extends \CodeIgniter\Entity\Entity
"precio" => null,
"margen" => 0,
"mostrar_en_presupuesto" => 1,
"mostrar_en_presupuesto_cliente" => false,
"user_created_id" => 1,
"user_update_id" => 1,
"is_deleted" => 0,
@ -26,6 +27,7 @@ class TarifapreimpresionEntity extends \CodeIgniter\Entity\Entity
"code" => "string",
"comment" => "string",
"mostrar_en_presupuesto" => "int",
"mostrar_en_presupuesto_cliente" => "bool",
"user_created_id" => "int",
"user_update_id" => "int",
"is_deleted" => "int",

View File

@ -14,6 +14,7 @@ return [
'precioMin' => 'Precio Mínimo',
'importeFijo' => 'Importe Fijo',
'mostrar_en_presupuesto' => 'Mostrar en presupuesto',
'mostrar_en_presupuesto_cliente' => 'Mostrar en presupuesto (Cliente)',
'margen' => 'Margen',
'tarifaextra' => 'Tarifa Servicios Extra',
'tarifaextraList' => 'Lista Tarifas Servicios Extra',

View File

@ -14,6 +14,7 @@ return [
'precioMin' => 'Precio Mínimo',
'importeFijo' => 'Importe Fijo',
'mostrar_en_presupuesto' => 'Mostrar en presupuesto',
'mostrar_en_presupuesto_cliente' => 'Mostrar en presupuesto (Cliente)',
'margen' => 'Margen',
'tarifapreimpresion' => 'Tarifa Preimpresión',
'tarifapreimpresionList' => 'Lista Tarifas Preimpresión',

View File

@ -19,6 +19,7 @@ class TarifaextraModel extends \App\Models\BaseModel
"precio",
"margen",
"mostrar_en_presupuesto",
"mostrar_en_presupuesto_cliente",
"deleted_at",
"is_deleted",
"user_created_id",

View File

@ -19,6 +19,7 @@ class TarifapreimpresionModel extends \App\Models\BaseModel
"precio",
"margen",
"mostrar_en_presupuesto",
"mostrar_en_presupuesto_cliente",
"deleted_at",
"is_deleted",
"user_created_id",

View File

@ -81,7 +81,19 @@
</label>
</div>
</div>
<div class="mb-3">
<div class="form-check form-check-inline">
<input type="checkbox"
id="mostrar_en_presupuesto_cliente"
name="mostrar_en_presupuesto_cliente"
value="1"
class="form-check-input"<?= $tarifaextraEntity->mostrar_en_presupuesto_cliente == true ? 'checked' : ''; ?>
>
<label for="mostrar_en_presupuesto_cliente" class="form-check-label">
<?= lang('Tarifaextra.mostrar_en_presupuesto_cliente') ?>
</label>
</div>
</div>
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -20,6 +20,7 @@
<th><?= lang('Tarifaextra.precio') ?></th>
<th><?= lang('Tarifaextra.margen') ?></th>
<th><?= lang('Tarifaextra.mostrar_en_presupuesto') ?></th>
<th><?= lang('Tarifaextra.mostrar_en_presupuesto_cliente') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
@ -46,6 +47,9 @@
<td class="align-middle">
<?= esc($item->mostrar_en_presupuesto)==1?'<i class="ti ti-check"></i>':"" ?>
</td>
<td class="align-middle">
<?= esc($item->mostrar_en_presupuesto_cliente)==1?'<i class="ti ti-check"></i>':"" ?>
</td>
<td class="align-middle text-center text-nowrap">
<?=anchor(route_to('editTarifaextra', $item->id), "<i class='ti ti-pencil ti-sm mx-2'></i>", ['class'=>'text-body', 'data-id'=>$item->id,]); ?>
<?=anchor('#confirm2delete', "<i class='ti ti-trash ti-sm mx-2'></i>", ['class'=>'text-body', 'data-href'=>route_to('deleteTarifaextra', $item->id), 'data-bs-toggle'=>'modal', 'data-bs-target'=>'#confirm2delete']); ?>

View File

@ -92,8 +92,8 @@
{ 'data': 'code' },
{ 'data': 'precio_min' },
{ 'data': 'importe_fijo' },
{ 'data': 'mostrar_en_presupuesto' },
{ 'data': 'mostrar_en_presupuesto_cliente' },
{ 'data': 'mostrar_en_presupuesto',render : (d) => d == true ? '<i class="ti ti-check"></i>' : "" },
{ 'data': 'mostrar_en_presupuesto_cliente',render : (d) => d == true ? '<i class="ti ti-check"></i>' : "" },
{ 'data': actionBtns }
]
});

View File

@ -81,6 +81,19 @@
</label>
</div>
</div>
<div class="mb-3">
<div class="form-check form-check-inline">
<input type="checkbox"
id="mostrar_en_presupuesto_cliente"
name="mostrar_en_presupuesto_cliente"
value="1"
class="form-check-input"<?= $tarifapreimpresionEntity->mostrar_en_presupuesto_cliente == true ? 'checked' : ''; ?>
>
<label for="mostrar_en_presupuesto_cliente" class="form-check-label">
<?= lang('Tarifaextra.mostrar_en_presupuesto_cliente') ?>
</label>
</div>
</div>
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -20,6 +20,7 @@
<th><?= lang('Tarifapreimpresion.precio') ?></th>
<th><?= lang('Tarifapreimpresion.margen') ?></th>
<th><?= lang('Tarifapreimpresion.mostrar_en_presupuesto') ?></th>
<th><?= lang('Tarifapreimpresion.mostrar_en_presupuesto_cliente') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
@ -45,6 +46,9 @@
<td class="align-middle">
<?= esc($item->mostrar_en_presupuesto)==1?'<i class="ti ti-check"></i>':"" ?>
</td>
<td class="align-middle">
<?= esc($item->mostrar_en_presupuesto_cliente)==1?'<i class="ti ti-check"></i>':"" ?>
</td>
<td class="align-middle text-center text-nowrap">
<?=anchor(route_to('editTarifapreimpresion', $item->id), "<i class='ti ti-pencil ti-sm mx-2'></i>", ['class'=>'text-body', 'data-id'=>$item->id,]); ?>
<?=anchor('#confirm2delete', "<i class='ti ti-trash ti-sm mx-2'></i>", ['class'=>'text-body', 'data-href'=>route_to('deleteTarifapreimpresion', $item->id), 'data-bs-toggle'=>'modal', 'data-bs-target'=>'#confirm2delete']); ?>