Merge branch 'feat/tarifa-code' into 'dev/presu_cliente_v2'

Feat/tarifa code

See merge request jjimenez/safekat!351
This commit is contained in:
Alvaro
2024-10-22 12:29:26 +00:00
33 changed files with 360 additions and 120 deletions

View File

@ -30,15 +30,24 @@ class ConfigErrores extends BaseResourceController
public function index()
{
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_error_presupuesto"), 'route' => site_url('configuracion/errores-presupuesto'), 'active' => true]
];
return view(static::$viewPath . $this->indexRoute, $this->viewData);
}
public function viewForm(int $error_presupuesto_id)
{
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_error_presupuesto"), 'route' => site_url('configuracion/errores-presupuesto'), 'active' => true]
];
$this->viewData["error_presupuesto_id"] = $error_presupuesto_id;
$this->errorPresupuestoModel->update($error_presupuesto_id, [
"last_user_id" => auth()->user()->id,
"visto" => true,
]);
return view(static::$viewPath . 'viewErrorPresupuestoForm', ["error_presupuesto_id" => $error_presupuesto_id]);
return view(static::$viewPath . 'viewErrorPresupuestoForm', $this->viewData);
}
public function store()
{

View File

@ -9,6 +9,7 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
"id" => null,
"nombre" => null,
"code" => null,
"comment" => null,
"precio_min" => 0,
"importe_fijo" => 0,
"mostrar_en_presupuesto" => 1,
@ -23,6 +24,8 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
];
protected $casts = [
"precio_min" => "float",
"comment" => "string",
"code" => "string",
"importe_fijo" => "float",
"user_created_id" => "int",
"user_updated_id" => "int",

View File

@ -9,6 +9,7 @@ class TarifaEncuadernacionEntity extends \CodeIgniter\Entity\Entity
protected $attributes = [
"id" => null,
"nombre" => null,
"code" => null,
"mostrar_en_presupuesto" => 1,
"tipo_encuadernacion" => 0,
"servicio_encuadernacion" => 0,
@ -22,6 +23,7 @@ class TarifaEncuadernacionEntity extends \CodeIgniter\Entity\Entity
];
protected $casts = [
"mostrar_en_presupuesto" => "int",
"code" => "string",
"tipo_encuadernacion" => "int",
"servicio_encuadernacion" => "int",
"por_horas" => "int",

View File

@ -9,6 +9,8 @@ class TarifaEnvioEntity extends \CodeIgniter\Entity\Entity
"id" => null,
"pais_id" => null,
"nombre" => null,
"code" => null,
"comment" => null,
"user_created_id" => 0,
"user_updated_id" => 0,
"is_deleted" => 0,
@ -17,6 +19,8 @@ class TarifaEnvioEntity extends \CodeIgniter\Entity\Entity
];
protected $casts = [
"pais_id" => "?int",
"code" => "string",
"comment" => "string",
"user_created_id" => "int",
"user_updated_id" => "int",
"is_deleted" => "int",

View File

@ -9,6 +9,8 @@ class TarifaManipuladoEntity extends \CodeIgniter\Entity\Entity
protected $attributes = [
"id" => null,
"nombre" => null,
"code" => null,
"comment" => null,
"precio_min" => 0,
"importe_fijo" => 0,
"mostrar_en_presupuesto" => 1,
@ -22,6 +24,8 @@ class TarifaManipuladoEntity extends \CodeIgniter\Entity\Entity
protected $casts = [
"precio_min" => "float",
"importe_fijo" => "float",
"code" => "string",
"comment" => "string",
"mostrar_en_presupuesto" => "int",
"user_created_id" => "int",
"user_updated_id" => "int",

View File

@ -8,6 +8,8 @@ class TarifaextraEntity extends \CodeIgniter\Entity\Entity
protected $attributes = [
"id" => null,
"nombre" => null,
"code" => null,
"comment" => null,
"precio" => null,
"margen" => 0,
"mostrar_en_presupuesto" => 1,
@ -20,6 +22,8 @@ class TarifaextraEntity extends \CodeIgniter\Entity\Entity
];
protected $casts = [
"precio" => "float",
"code" => "string",
"comment" => "string",
"margen" => "float",
"mostrar_en_presupuesto" => "int",
"user_created_id" => "int",

View File

@ -8,6 +8,8 @@ class TarifapreimpresionEntity extends \CodeIgniter\Entity\Entity
protected $attributes = [
"id" => null,
"nombre" => null,
"code" => null,
"comment" => null,
"precio" => null,
"margen" => 0,
"mostrar_en_presupuesto" => 1,
@ -21,6 +23,8 @@ class TarifapreimpresionEntity extends \CodeIgniter\Entity\Entity
protected $casts = [
"precio" => "float",
"margen" => "float",
"code" => "string",
"comment" => "string",
"mostrar_en_presupuesto" => "int",
"user_created_id" => "int",
"user_update_id" => "int",

View File

@ -10,6 +10,9 @@ return [
'id' => 'ID',
'moduleTitle' => 'Finishing Rates',
'nombre' => 'Name',
'code' => 'Código',
'comment' => 'Comentario',
'comment_placeholder' => 'Inserte un comentario',
'precioMax' => 'Price Max',
'precioMin' => 'Price Min',
'precioMin' => 'Min Price',

View File

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

View File

@ -7,6 +7,9 @@ return [
'id' => 'ID',
'moduleTitle' => 'Tarifas Servicios Extra',
'nombre' => 'Nombre',
'code' => 'Código',
'comment' => 'Comentario',
'comment_placeholder' => 'Inserte un comentario',
'precio' => 'Precio',
'precioMin' => 'Precio Mínimo',
'importeFijo' => 'Importe Fijo',

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

@ -7,6 +7,9 @@ return [
'id' => 'ID',
'moduleTitle' => 'Tarifas Preimpresión',
'nombre' => 'Nombre',
'code' => 'Código',
'comment' => 'Comentario',
'comment_placeholder' => 'Inserte un comentario',
'precio' => 'Precio',
'precioMin' => 'Precio Mínimo',
'importeFijo' => 'Importe Fijo',
@ -25,7 +28,16 @@ return [
'required' => 'El campo {field} es obligatorio.',
],
'code' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'El campo {field} es obligatorio.',
],
'comment' => [
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
'required' => 'El campo {field} es obligatorio.',
],
'precio' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'El campo {field} es obligatorio.',

View File

@ -9,6 +9,9 @@ return [
'isDeleted' => 'Is Deleted',
'moduleTitle' => 'Tarifas Envíos',
'nombre' => 'Nombre',
'code' => 'Código',
'comment' => 'Comentario',
'comment_placeholder' => 'Inserte un comentario',
'paisId' => 'Pais',
'tarifaEnvio' => 'Tarifa Envío',
'tarifaEnvioList' => 'Lista Tarifas Envío',

View File

@ -22,6 +22,7 @@ class TarifaAcabadoModel extends \App\Models\BaseModel
protected $allowedFields = [
"nombre",
"code",
"comment",
"precio_min",
"importe_fijo",
"mostrar_en_presupuesto",
@ -84,7 +85,7 @@ class TarifaAcabadoModel 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,
"t1.id AS id, t1.nombre AS nombre,t1.code AS code, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo,
t1.mostrar_en_presupuesto AS mostrar_en_presupuesto, t1.acabado_cubierta AS acabado_cubierta, t1.acabado_sobrecubierta AS acabado_sobrecubierta"
);

View File

@ -22,6 +22,8 @@ class TarifaEncuadernacionModel extends \App\Models\BaseModel
protected $allowedFields = [
"nombre",
"code",
"comment",
"mostrar_en_presupuesto",
"tipo_encuadernacion",
"servicio_encuadernacion",
@ -65,7 +67,7 @@ class TarifaEncuadernacionModel 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,
$builder = $this->db->table($this->table . " t1")->select("t1.id AS id, t1.nombre AS nombre, t1.code AS code,
t1.mostrar_en_presupuesto AS mostrar_en_presupuesto,
t1.tipo_encuadernacion AS tipo_encuadernacion, t1.servicio_encuadernacion AS servicio_encuadernacion,
t1.por_horas AS por_horas");

View File

@ -1,4 +1,5 @@
<?php
namespace App\Models\Tarifas;
class TarifaEnvioModel extends \App\Models\BaseModel
@ -17,7 +18,7 @@ class TarifaEnvioModel extends \App\Models\BaseModel
1 => "t2.nombre",
];
protected $allowedFields = ["pais_id", "nombre","deleted_at","is_deleted"];
protected $allowedFields = ["pais_id", "nombre", "code", "comment", "deleted_at", "is_deleted"];
protected $returnType = "App\Entities\Tarifas\TarifaEnvioEntity";
protected $useTimestamps = true;
@ -73,7 +74,7 @@ class TarifaEnvioModel 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, t2.nombre AS pais_id");
$builder = $this->db->table($this->table . " t1")->select("t1.id as id, t1.nombre AS nombre,t1.code AS code, t2.nombre AS pais_id");
$builder->join("lg_paises t2", "t1.pais_id = t2.id", "left");
//JJO
@ -82,43 +83,44 @@ class TarifaEnvioModel extends \App\Models\BaseModel
return empty($search)
? $builder
: $builder
->groupStart()
->like("t1.nombre", $search)
->orLike("t2.id", $search)
->orLike("t1.pais_id", $search)
->orLike("t1.nombre", $search)
->orLike("t2.nombre", $search)
->groupEnd();
->groupStart()
->like("t1.nombre", $search)
->orLike("t2.code", $search)
->orLike("t2.id", $search)
->orLike("t1.pais_id", $search)
->orLike("t1.nombre", $search)
->orLike("t2.nombre", $search)
->groupEnd();
}
public function getTarifaEnvio($paisId, string $cp, $peso, $tipo_envio){
public function getTarifaEnvio($paisId, string $cp, $peso, $tipo_envio)
{
// Si el pais es españa se tienen que tener en cuenta los postales
// Se busca primero la tarifa a la que corresponde
$builder = $this->db->table($this->table . " t1")
->select("t1.id AS tarifa_envio_id, t2.importe_fijo as importe_fijo")
->join("tarifas_envios_zonas t2", "t1.id = t2.tarifa_envio_id")
->where("t1.pais_id", $paisId)
->where("t1.is_deleted", 0)
->where("t2.is_deleted", 0);
if($paisId == 1) {// España
->select("t1.id AS tarifa_envio_id, t2.importe_fijo as importe_fijo")
->join("tarifas_envios_zonas t2", "t1.id = t2.tarifa_envio_id")
->where("t1.pais_id", $paisId)
->where("t1.is_deleted", 0)
->where("t2.is_deleted", 0);
if ($paisId == 1) { // España
$builder->where("CAST(t2.cp_inicial AS UNSIGNED)<=", intval($cp))
->where("CAST(t2.cp_final AS UNSIGNED) >=", intval($cp));
->where("CAST(t2.cp_final AS UNSIGNED) >=", intval($cp));
}
$tarifas = $builder->get()->getResultObject();
$resultado = [];
$model = model('App\Models\Tarifas\TarifaEnvioPrecioModel');
foreach($tarifas as $tarifa){
foreach ($tarifas as $tarifa) {
$precio_tarifas = $model->getEnvioPrecio($tarifa->tarifa_envio_id, $peso, $tipo_envio);
foreach($precio_tarifas as $precio_tarifa){
foreach ($precio_tarifas as $precio_tarifa) {
$precio_tarifa->importe_fijo = $tarifa->importe_fijo;
array_push($resultado, $precio_tarifa);
}
}
return $resultado;
}
}

View File

@ -22,6 +22,8 @@ class TarifaManipuladoModel extends \App\Models\BaseModel
protected $allowedFields = [
"nombre",
"precio_min",
"code",
"comment",
"importe_fijo",
"mostrar_en_presupuesto",
"deleted_at",
@ -80,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

@ -13,7 +13,9 @@ class TarifaextraModel extends \App\Models\BaseModel
protected $useAutoIncrement = true;
protected $allowedFields = [
"nombre",
"nombre",
"code",
"comment",
"precio",
"margen",
"mostrar_en_presupuesto",

View File

@ -13,7 +13,9 @@ class TarifapreimpresionModel extends \App\Models\BaseModel
protected $useAutoIncrement = true;
protected $allowedFields = [
"nombre",
"nombre",
"code",
"comment",
"precio",
"margen",
"mostrar_en_presupuesto",
@ -37,6 +39,14 @@ class TarifapreimpresionModel extends \App\Models\BaseModel
"label" => "Tarifapreimpresion.nombre",
"rules" => "trim|required|max_length[255]",
],
"code" => [
"label" => "Tarifapreimpresion.code",
"rules" => "trim|required|max_length[5]",
],
"comment" => [
"label" => "Tarifapreimpresion.comment",
"rules" => "trim|max_length[255]",
],
"precio" => [
"label" => "Tarifapreimpresion.precio",
"rules" => "required|decimal",
@ -52,6 +62,14 @@ class TarifapreimpresionModel extends \App\Models\BaseModel
"max_length" => "Tarifapreimpresion.validation.nombre.max_length",
"required" => "Tarifapreimpresion.validation.nombre.required",
],
"code" => [
"max_length" => "Tarifapreimpresion.validation.code.max_length",
"required" => "Tarifapreimpresion.validation.code.required",
],
"comment" => [
"max_length" => "Tarifapreimpresion.validation.comment.max_length",
"required" => "Tarifapreimpresion.validation.comment.required",
],
"precio" => [
"decimal" => "Tarifapreimpresion.validation.precio.decimal",
"required" => "Tarifapreimpresion.validation.precio.required",

View File

@ -25,7 +25,8 @@
</div>
<div class="col-md-2 overflow-hidden w-20">
<label class="switch switch-square switch-lg">
<input type="checkbox" class="switch-input" id="error-presupuesto-visto" name="visto" disabled>
<input type="checkbox" class="switch-input" id="error-presupuesto-visto" name="visto"
disabled>
<span class="switch-toggle-slider">
<span class="switch-on">
<i class="ti ti-eye"></i>
@ -46,8 +47,8 @@
</div>
<div class="col-md-6 mb-3 overflow-hidden">
<label for="error-presupuesto">Error</label>
<textarea rows="10" class="form-control" id="error-presupuesto-text"
placeholder="Error" disabled></textarea>
<textarea rows="10" class="form-control" id="error-presupuesto-text" placeholder="Error"
disabled></textarea>
</div>
<div class="col-md-12 mb-3 overflow-hidden">
<label for="comments-presupuesto">Comentarios</label>
@ -56,23 +57,28 @@
</div>
<div class="col-md-12">
<button class="btn btn-primary button-update-comment w-100" type="button">
<button class="btn btn-primary button-update-comment" type="button">
<span class="ti ti-sm ti-send me-1" id="update-button-icon"></span>
<span class="spinner-border me-1" role="status" aria-hidden="true" id="update-button-loader" hidden></span>
<span class="spinner-border me-1" role="status" aria-hidden="true"
id="update-button-loader" hidden></span>
<?= lang("App.global_save") ?></button>
<a class="btn btn-secondary" href="<?= route_to("erroresPresupuestoIndex") ?>"
class="btn btn-secondary"><?= lang("App.global_come_back") ?>
</a>
</div>
</div>
</form>
</div>
</form>
</div>
<!--//.card-body -->
<div class="card-footer">
</div>
<!--//.card-footer -->
</div>
<!--//.card -->
<!--//.card-body -->
<div class="card-footer">
</div>
<!--//.card-footer -->
</div>
<!--//.card -->
</div>
<!--//.col -->
<!--//.row -->

View File

@ -5,15 +5,26 @@
<?= lang('Tarifaacabado.nombre') ?>*
</label>
<input type="text" id="nombre" name="nombre" maxLength="255" class="form-control"
value="<?= old('nombre', $tarifaacabadoEntity->nombre) ?>">
value="<?= old('nombre', $tarifaacabadoEntity->nombre) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="code" class="form-label">
<?= lang('Tarifaacabado.code') ?>
</label>
<input
type="text"
id="code"
name="code"
maxLength="5"
class="form-control"
value="<?= old('code', $tarifaacabadoEntity->code) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="nombre" class="form-label">
<?= lang('Tarifaacabado.precioMin') ?>*
</label>
<input type="text" id="precio_min" name="precio_min" class="form-control"
value="<?= old('precio_min', $tarifaacabadoEntity->precio_min) ?>">
value="<?= old('precio_min', $tarifaacabadoEntity->precio_min) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
@ -21,9 +32,21 @@
<?= lang('Tarifaacabado.importeFijo') ?>*
</label>
<input type="text" id="importe_fijo" name="importe_fijo" class="form-control"
value="<?= old('importe_fijo', $tarifaacabadoEntity->importe_fijo) ?>">
value="<?= old('importe_fijo', $tarifaacabadoEntity->importe_fijo) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="comment" class="form-label">
<?= lang('Tarifaacabado.comment') ?>
</label>
<textarea
id="comment"
name="comment"
rows="5"
cols="10"
placeholder="<?= lang('Tarifaacabado.comment_placeholder') ?>"
class="form-control"><?= old('comment', $tarifaacabadoEntity->comment) ?></textarea>
</div><!--//.mb-3 -->
<div class="mb-3">
<div class="form-check">
<label for="mostrar_en_presupuesto" class="form-check-label">
@ -32,7 +55,6 @@
</label>
</div><!--//.form-check -->
</div><!--//.mb-3 -->
<div class="mb-3">
<div class="form-check">
<label for="acabado_cubierta" class="form-check-label">

View File

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

View File

@ -7,13 +7,37 @@
</label>
<input type="text" id="nombre" name="nombre" maxLength="255" class="form-control" value="<?=old('nombre', $tarifaEncuadernacionEntity->nombre) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="code" class="form-label">
<?= lang('Tarifaencuadernacion.code') ?>
</label>
<input
type="text"
id="code"
name="code"
maxLength="5"
class="form-control"
value="<?= old('code', $tarifaEncuadernacionEntity->code) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="comment" class="form-label">
<?= lang('Tarifaencuadernacion.comment') ?>
</label>
<textarea
id="comment"
name="comment"
rows="5"
cols="10"
placeholder="<?= lang('Tarifaencuadernacion.comment_placeholder') ?>"
class="form-control"><?= old('comment', $tarifaEncuadernacionEntity->comment) ?></textarea>
</div><!--//.mb-3 -->
</div><!--//.col -->
</div><!-- //.row -->
<div class="row">
<div class="col-md-12 col-lg-4 px-4">
<div class="mb-3">
<div class="form-check">
<label for="mostrar_en_presupuesto" class="form-check-label">

View File

@ -17,6 +17,7 @@
<thead>
<tr>
<th><?= lang('Tarifaencuadernacion.nombre') ?></th>
<th><?= lang('Tarifaencuadernacion.code') ?></th>
<th><?= lang('Tarifaencuadernacion.mostrar_en_presupuesto') ?></th>
<th><?= lang('Tarifaencuadernacion.tipo_encuadernacion') ?></th>
<th><?= lang('Tarifaencuadernacion.servicio_encuadernacion') ?></th>
@ -88,6 +89,7 @@
],
columns : [
{ 'data': 'nombre' },
{ 'data': 'code' },
{ 'data': 'mostrar_en_presupuesto' },
{ 'data': 'tipo_encuadernacion' },
{ 'data': 'servicio_encuadernacion' },

View File

@ -1,28 +1,51 @@
<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"
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>
@ -87,6 +88,7 @@
],
columns : [
{ 'data': 'nombre' },
{ 'data': 'code' },
{ 'data': 'pais_id' },
{ 'data': actionBtns }
]

View File

@ -14,7 +14,18 @@
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"
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 +56,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

@ -1,35 +1,57 @@
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<label for="nombre" class="form-label">
<?=lang('Tarifamanipulado.nombre') ?>*
</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="nombre" class="form-label">
<?=lang('Tarifamanipulado.importeMinimo') ?>*
<?= lang('Tarifamanipulado.nombre') ?>*
</label>
<input type="text" id="precio_min" name="precio_min" class="form-control" value="<?=old('precio_min', $tarifaManipuladoEntity->precio_min) ?>">
<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"
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') ?>*
</label>
<input type="text" id="precio_min" name="precio_min" class="form-control" value="<?= old('precio_min', $tarifaManipuladoEntity->precio_min) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="nombre" class="form-label">
<?=lang('Tarifamanipulado.importeFijo') ?>*
<?= lang('Tarifamanipulado.importeFijo') ?>*
</label>
<input type="text" id="importe_fijo" name="importe_fijo" class="form-control" value="<?=old('importe_fijo', $tarifaManipuladoEntity->importe_fijo) ?>">
<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">
<div class="form-check">
<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">
<label for="mostrar_en_presupuesto" class="form-check-label">
<input type="checkbox" id="mostrar_en_presupuesto" name="mostrar_en_presupuesto" value="1" class="form-check-input" <?= $tarifaManipuladoEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>>
<?= lang('Tarifamanipulado.mostrar_en_presupuesto') ?>
</label>
</div><!--//.form-check -->
</div><!--//.mb-3 -->
<label for="mostrar_en_presupuesto" class="form-check-label">
<input type="checkbox" id="mostrar_en_presupuesto" name="mostrar_en_presupuesto" value="1" class="form-check-input" <?= $tarifaManipuladoEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>>
<?= lang('Tarifamanipulado.mostrar_en_presupuesto') ?>
</label>
</div><!--//.form-check -->
</div><!--//.mb-3 -->
</div><!--//.col -->

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' },

View File

@ -5,62 +5,82 @@
<?= lang('Tarifapreimpresion.nombre') ?>*
</label>
<input
type="text"
id="nombre"
name="nombre"
required
maxLength="255"
class="form-control"
value="<?= old('nombre', $tarifapreimpresionEntity->nombre) ?>"
>
type="text"
id="nombre"
name="nombre"
required
maxLength="255"
class="form-control"
value="<?= old('nombre', $tarifapreimpresionEntity->nombre) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="code" class="form-label">
<?= lang('Tarifapreimpresion.code') ?>
</label>
<input
type="text"
id="code"
name="code"
maxLength="5"
class="form-control"
value="<?= old('code', $tarifapreimpresionEntity->code) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="precio" class="form-label">
<?= lang('Tarifapreimpresion.precio') ?>*
</label>
<input
type="number"
id="precio"
name="precio"
required
maxLength="31"
step="0.01"
class="form-control"
value="<?= old('precio', $tarifapreimpresionEntity->precio) ?>"
>
type="number"
id="precio"
name="precio"
required
maxLength="31"
step="0.01"
class="form-control"
value="<?= old('precio', $tarifapreimpresionEntity->precio) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="margen" class="form-label">
<?= lang('Tarifapreimpresion.margen') ?>*
</label>
<input
type="text"
id="margen"
name="margen"
required
class="form-control"
value="<?= old('margen', $tarifapreimpresionEntity->margen) ?>"
>
type="text"
id="margen"
name="margen"
required
class="form-control"
value="<?= old('margen', $tarifapreimpresionEntity->margen) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="comment" class="form-label">
<?= lang('Tarifapreimpresion.comment') ?>
</label>
<textarea
id="comment"
name="comment"
rows="5"
cols="10"
placeholder="<?= lang('Tarifapreimpresion.comment_placeholder') ?>"
class="form-control"><?= old('comment', $tarifapreimpresionEntity->comment) ?></textarea>
</div><!--//.mb-3 -->
<div class="mb-3">
<div class="form-check form-check-inline">
<input type="checkbox"
id="mostrar_en_presupuesto"
name="mostrar_en_presupuesto"
value="1"
class="form-check-input"<?= $tarifapreimpresionEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>
>
class="form-check-input" <?= $tarifapreimpresionEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>>
<label for="mostrar_en_presupuesto" class="form-check-label">
<?= lang('Tarifapreimpresion.mostrar_en_presupuesto') ?>
</label>
</div>
</div>
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -16,6 +16,7 @@
<thead>
<tr>
<th><?= lang('Tarifapreimpresion.nombre') ?></th>
<th><?= lang('Tarifapreimpresion.code') ?></th>
<th><?= lang('Tarifapreimpresion.precio') ?></th>
<th><?= lang('Tarifapreimpresion.margen') ?></th>
<th><?= lang('Tarifapreimpresion.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>