add comment field

This commit is contained in:
amazuecos
2024-10-21 17:46:46 +00:00
parent c7c9b54556
commit 2ff86a7743
9 changed files with 110 additions and 29 deletions

View File

@ -10,6 +10,9 @@ return [
'id' => 'ID',
'moduleTitle' => 'Tarifas Manipulado',
'nombre' => 'Nombre',
'code' => 'Código',
'comment' => 'Comentario',
'comment_placeholder' => 'Inserte un comentario',
'importeMinimo' => 'Importe mínimo',
'precioMax' => 'Precio T. Mín',
'precioMin' => 'Precio T. Máx',

View File

@ -82,7 +82,7 @@ class TarifaManipuladoModel extends \App\Models\BaseModel
*/
public function getResource(string $search = "")
{
$builder = $this->db->table($this->table . " t1")->select("t1.id AS id, t1.nombre AS nombre, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo
$builder = $this->db->table($this->table . " t1")->select("t1.id AS id,t1.code AS code, t1.nombre AS nombre, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo
,t1.mostrar_en_presupuesto AS mostrar_en_presupuesto");
//JJO

View File

@ -1,28 +1,52 @@
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<label for="nombre" class="form-label">
<?= lang('TarifasEnvios.nombre') ?>*
</label>
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?= old('nombre', $tarifaEnvioEntity->nombre) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="code" class="form-label">
<?= lang('TarifasEnvios.code') ?>*
</label>
<input
type="text"
id="code"
name="code"
required
maxLength="5"
class="form-control"
value="<?= old('code', $tarifaEnvioEntity->code) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="paisId" class="form-label">
<?= lang('TarifasEnvios.paisId') ?>*
</label>
<select id="paisId" name="pais_id" class="form-control select2bs" style="width: 100%;">
<option value=""><?= lang('Basic.global.pleaseSelectA', [lang('TarifasEnvios.paisId')]) ?></option>
<?php foreach ($paisList as $item) : ?>
<option value="<?= $item->id ?>" <?= $item->id == $tarifaEnvioEntity->pais_id ? ' selected' : '' ?>>
<?= $item->nombre ?>
</option>
<?php endforeach; ?>
</select>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="nombre" class="form-label">
<?=lang('TarifasEnvios.nombre') ?>*
</label>
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $tarifaEnvioEntity->nombre) ?>">
</div><!--//.mb-3 -->
<label for="comment" class="form-label">
<?= lang('TarifasEnvios.comment') ?>*
</label>
<textarea
id="comment"
name="comment"
rows="5"
cols="10"
placeholder="<?= lang('TarifasEnvios.comment_placeholder') ?>"
class="form-control"><?= old('comment', $tarifaEnvioEntity->comment) ?></textarea>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="paisId" class="form-label">
<?=lang('TarifasEnvios.paisId') ?>*
</label>
<select id="paisId" name="pais_id" class="form-control select2bs" style="width: 100%;" >
<option value=""><?=lang('Basic.global.pleaseSelectA', [lang('TarifasEnvios.paisId')]) ?></option>
<?php foreach ($paisList as $item) : ?>
<option value="<?=$item->id ?>"<?=$item->id==$tarifaEnvioEntity->pais_id ? ' selected':'' ?>>
<?=$item->nombre ?>
</option>
<?php endforeach; ?>
</select>
</div><!--//.mb-3 -->
</div><!--//.col -->
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -176,7 +176,8 @@
idSrc: 'id',
fields: [ {
name: "nombre"
}, {
},
{
name: "cp_inicial"
}, {
name: "cp_final"

View File

@ -18,6 +18,7 @@
<thead>
<tr>
<th><?= lang('TarifasEnvios.nombre') ?></th>
<th><?= lang('TarifasEnvios.code') ?></th>
<th><?= lang('Paises.pais') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>

View File

@ -14,7 +14,19 @@
value="<?= old('nombre', $tarifaextraEntity->nombre) ?>"
>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="code" class="form-label">
<?= lang('Tarifaextra.code') ?>*
</label>
<input
type="text"
id="code"
name="code"
required
maxLength="5"
class="form-control"
value="<?= old('code', $tarifaextraEntity->code) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="precio" class="form-label">
<?= lang('Tarifaextra.precio') ?>*
@ -45,7 +57,18 @@
>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="comment" class="form-label">
<?= lang('Tarifaextra.comment') ?>*
</label>
<textarea
id="comment"
name="comment"
rows="5"
cols="10"
placeholder="<?= lang('Tarifaextra.comment_placeholder') ?>"
class="form-control"><?= old('comment', $tarifaextraEntity->comment) ?></textarea>
</div><!--//.mb-3 -->
<div class="mb-3">
<div class="form-check form-check-inline">
<input type="checkbox"

View File

@ -16,6 +16,7 @@
<thead>
<tr>
<th><?= lang('Tarifaextra.nombre') ?></th>
<th><?= lang('Tarifaextra.code') ?></th>
<th><?= lang('Tarifaextra.precio') ?></th>
<th><?= lang('Tarifaextra.margen') ?></th>
<th><?= lang('Tarifaextra.mostrar_en_presupuesto') ?></th>
@ -28,6 +29,9 @@
<td class="align-middle">
<?= empty($item->nombre) || strlen($item->nombre) < 51 ? esc($item->nombre) : character_limiter(esc($item->nombre), 50) ?>
</td>
<td class="align-middle">
<?= esc($item->code) ?>
</td>
<td class="align-middle">
<?= esc($item->precio) ?>
</td>

View File

@ -6,7 +6,19 @@
</label>
<input type="text" id="nombre" name="nombre" maxLength="255" class="form-control" value="<?=old('nombre', $tarifaManipuladoEntity->nombre) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="code" class="form-label">
<?= lang('Tarifamanipulado.code') ?>*
</label>
<input
type="text"
id="code"
name="code"
required
maxLength="5"
class="form-control"
value="<?= old('code', $tarifaManipuladoEntity->code) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="nombre" class="form-label">
<?=lang('Tarifamanipulado.importeMinimo') ?>*
@ -20,7 +32,18 @@
</label>
<input type="text" id="importe_fijo" name="importe_fijo" class="form-control" value="<?=old('importe_fijo', $tarifaManipuladoEntity->importe_fijo) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="comment" class="form-label">
<?= lang('Tarifamanipulado.comment') ?>*
</label>
<textarea
id="comment"
name="comment"
rows="5"
cols="10"
placeholder="<?= lang('Tarifamanipulado.comment_placeholder') ?>"
class="form-control"><?= old('comment', $tarifaManipuladoEntity->comment) ?></textarea>
</div><!--//.mb-3 -->
<div class="mb-3">
<div class="form-check">

View File

@ -17,6 +17,7 @@
<thead>
<tr>
<th><?= lang('Tarifamanipulado.nombre') ?></th>
<th><?= lang('Tarifamanipulado.code') ?></th>
<th><?= lang('Tarifamanipulado.importeMinimo') ?></th>
<th><?= lang('Tarifamanipulado.importeFijo') ?></th>
<th><?= lang('Tarifamanipulado.mostrar_en_presupuesto') ?></th>
@ -87,6 +88,7 @@
],
columns : [
{ 'data': 'nombre' },
{ 'data': 'code' },
{ 'data': 'precio_min' },
{ 'data': 'importe_fijo' },
{ 'data': 'mostrar_en_presupuesto' },