mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into 'dev/new_lp'
# Conflicts: # ci4/app/Controllers/Test.php
This commit is contained in:
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/safekat.iml" filepath="$PROJECT_DIR$/.idea/safekat.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
2
.idea/php.xml
generated
2
.idea/php.xml
generated
@ -10,7 +10,7 @@
|
||||
<option name="highlightLevel" value="WARNING" />
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="8.0">
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.3">
|
||||
<option name="suggestChangeDefaultLanguageLevel" value="false" />
|
||||
</component>
|
||||
<component name="PhpStanOptionsConfiguration">
|
||||
|
||||
10
.idea/phpunit.xml
generated
Normal file
10
.idea/phpunit.xml
generated
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PHPUnit">
|
||||
<option name="directories">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/ci4/tests" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
14
.idea/safekat.iml
generated
Normal file
14
.idea/safekat.iml
generated
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/ci4/app" isTestSource="false" packagePrefix="App\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/ci4/app/Config" isTestSource="false" packagePrefix="Config\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/ci4/app/ThirdParty/DatatablesEditor/" isTestSource="false" packagePrefix="DataTables\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/ci4/tests" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/ci4/tests/_support" isTestSource="true" packagePrefix="Tests\Support\" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@ -31,7 +31,6 @@ class Clientedirecciones extends \App\Controllers\GoBaseResourceController
|
||||
$email = $reqData['email'] ?? "";
|
||||
$direccion = $reqData['direccion'] ?? "";
|
||||
$pais_id = $reqData['paisId'] ?? -1;
|
||||
$ccaa_id = $reqData['ccaaId'] ?? -1;
|
||||
$provincia = $reqData['provincia'] ?? "";
|
||||
$municipio = $reqData['municipio'] ?? "";
|
||||
$cp = $reqData['cp'] ?? "";
|
||||
@ -44,7 +43,6 @@ class Clientedirecciones extends \App\Controllers\GoBaseResourceController
|
||||
"email" => $email,
|
||||
"direccion" => $direccion,
|
||||
"pais_id" => $pais_id,
|
||||
"ccaa_id" => $ccaa_id,
|
||||
"provincia" => $provincia,
|
||||
"municipio" => $municipio,
|
||||
"cp" => $cp,
|
||||
@ -208,17 +206,6 @@ class Clientedirecciones extends \App\Controllers\GoBaseResourceController
|
||||
return true;
|
||||
}
|
||||
),
|
||||
Field::inst('ccaa_id')
|
||||
->validator( function ( $val, $data, $field, $host ) {
|
||||
if ($data['pais_id'] == 1) { // Si es españa provincia y CCAA es obligatorio
|
||||
if (strlen( $val ) > 100)
|
||||
lang('ClienteDirecciones.validation.required');
|
||||
else
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
),
|
||||
Field::inst('pais_id')->validator('Validate::notEmpty', array(
|
||||
'message' => lang('ClienteDirecciones.validation.required'))),
|
||||
Field::inst('cliente_id'),
|
||||
|
||||
@ -18,19 +18,58 @@ class Test extends BaseController
|
||||
public function index()
|
||||
{
|
||||
|
||||
echo '<pre>';
|
||||
$this->getPapelesCubierta();
|
||||
echo '</pre>';
|
||||
/*
|
||||
echo '<pre>';
|
||||
$model = model('App\Models\Clientes\ClientePreciosModel');
|
||||
$configuracion = (object)[
|
||||
'tipo' => 'interior',
|
||||
'tipo_maquina' => 'inkjet',
|
||||
'tipo_impresion' => 'color'
|
||||
];
|
||||
var_dump($model->get_precio_hora(999,$configuracion, 1.5));
|
||||
echo '</pre>';*/
|
||||
$this->asignar_tarifa_defecto_todos_usuarios();
|
||||
|
||||
}
|
||||
|
||||
private function asignar_tarifa_defecto_todos_usuarios()
|
||||
{
|
||||
|
||||
// Previo a ejecutar, vaciar la tabla clientes_precios (ojo si hay customizaciones)
|
||||
|
||||
$db = \Config\Database::connect();
|
||||
$builder = $db->table('cliente_precios');
|
||||
|
||||
$plantillaDefectoId = 5;
|
||||
$clienteModel = model('App\Models\Clientes\ClienteModel');
|
||||
$platillaModel = model('App\Models\Clientes\ClientePlantillaPreciosLineasModel');
|
||||
|
||||
$plantillaDefecto = $platillaModel->getResource($plantillaDefectoId)->get()->getResultObject();
|
||||
|
||||
$clientes = $clienteModel->getResource()->get()->getResultObject();
|
||||
|
||||
foreach ($clientes as $cliente){
|
||||
|
||||
foreach ($plantillaDefecto as $plantillaDefectoLinea){
|
||||
|
||||
$data = [
|
||||
'plantilla_id' => $plantillaDefectoId,
|
||||
'cliente_id' => $cliente->id,
|
||||
'tipo' => $plantillaDefectoLinea->tipo,
|
||||
'tipo_maquina' => $plantillaDefectoLinea->tipo_maquina,
|
||||
'tipo_impresion' => $plantillaDefectoLinea->tipo_impresion,
|
||||
'tiempo_min' => $plantillaDefectoLinea->tiempo_min,
|
||||
'tiempo_max' => $plantillaDefectoLinea->tiempo_max,
|
||||
'precio_hora' => $plantillaDefectoLinea->precio_hora,
|
||||
'margen' => $plantillaDefectoLinea->margen,
|
||||
'user_created_id' => 2,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
];
|
||||
|
||||
/*echo '<pre>';
|
||||
var_dump($data);
|
||||
echo '</pre>';*/
|
||||
|
||||
$builder->insert($data);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -7,11 +7,10 @@ return [
|
||||
'alias' => 'Alias',
|
||||
'att' => 'Att.',
|
||||
'email' => 'Email',
|
||||
'direccion' => 'Direccion',
|
||||
'direccion' => 'Dirección',
|
||||
'cp' => 'CP',
|
||||
'municipio' => 'Ciudad',
|
||||
'provincia' => 'Provincia',
|
||||
'ccaa' => 'CCAA',
|
||||
'pais' => 'País',
|
||||
'telefono' => 'Teléfono',
|
||||
'validation' => [
|
||||
@ -21,7 +20,6 @@ return [
|
||||
],
|
||||
|
||||
'selectPais' => 'Seleccione País',
|
||||
'selectCcaa' => 'Seleccione CCAA',
|
||||
'selectProvincia' => 'Seleccione Provincia',
|
||||
'selectMunicipio' => 'Seleccione Municipio',
|
||||
];
|
||||
@ -33,8 +33,7 @@ class ClienteDireccionesModel extends \App\Models\GoBaseModel
|
||||
"email",
|
||||
"direccion",
|
||||
"pais_id",
|
||||
"ccaa_id",
|
||||
"provincia",
|
||||
"provincia",
|
||||
"municipio",
|
||||
"cp",
|
||||
"telefono",
|
||||
@ -101,14 +100,12 @@ class ClienteDireccionesModel extends \App\Models\GoBaseModel
|
||||
->select(
|
||||
"t1.id AS id, t1.cliente_id AS cliente_id, t2.nombre as cliente_nombre, t1.att AS att, t1.alias AS alias,
|
||||
t1.email AS email, t1.direccion AS direccion, t1.pais_id AS pais_id, t3.nombre AS pais,
|
||||
t1.ccaa_id AS ccaa_id, t4.nombre AS ccaa_nombre,
|
||||
t1.municipio AS municipio, t1.provincia AS provincia, t1.cp AS cp, t1.telefono AS telefono"
|
||||
);
|
||||
|
||||
$builder->where('t1.cliente_id', $cliente_id);
|
||||
$builder->join("clientes t2", "t1.cliente_id = t2.id", "left");
|
||||
$builder->join("lg_paises t3", "t1.pais_id = t3.id", "left");
|
||||
$builder->join("lg_comunidades_autonomas t4", "t1.ccaa_id = t4.id", "left");
|
||||
|
||||
|
||||
return empty($search)
|
||||
@ -134,14 +131,12 @@ class ClienteDireccionesModel extends \App\Models\GoBaseModel
|
||||
->select(
|
||||
"t1.id AS id, t1.cliente_id AS cliente_id, t2.nombre as cliente_nombre, t1.att AS att, t1.alias AS alias,
|
||||
t1.email AS email, t1.direccion AS direccion, t1.pais_id AS pais_id, t3.nombre AS pais,
|
||||
t1.ccaa_id AS ccaa_id, t4.nombre AS ccaa_nombre,
|
||||
t1.municipio AS municipio, t1.provincia AS provincia, t1.cp AS cp, t1.telefono AS telefono"
|
||||
);
|
||||
|
||||
$builder->where('t1.id', $id);
|
||||
$builder->join("clientes t2", "t1.cliente_id = t2.id", "left");
|
||||
$builder->join("lg_paises t3", "t1.pais_id = t3.id", "left");
|
||||
$builder->join("lg_comunidades_autonomas t4", "t1.ccaa_id = t4.id", "left");
|
||||
|
||||
|
||||
return $builder->get()->getResultObject();
|
||||
|
||||
@ -118,10 +118,7 @@
|
||||
$('.dataTables_processing').hide();
|
||||
const theData = jqXHR.responseJSON;
|
||||
drawCallback(theData);
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: errorThrown,
|
||||
});
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
@ -48,21 +48,6 @@
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-6 pl-4 spain-data" style="display: none;">
|
||||
<div class="mb-3">
|
||||
<label for="add_ccaa" class="form-label">
|
||||
<?=lang('ClienteDirecciones.ccaa') ?>*
|
||||
</label>
|
||||
<select id="add_ccaa" tabindex="5" class="form-control select2bs" style="width: 100%;" >
|
||||
<option value="" disabled selected><?=lang('ClienteDirecciones.selectCcaa') ?></option>
|
||||
<?php foreach ($ccaaList as $item) : ?>
|
||||
<option value="<?=$item->id ?>">
|
||||
<?=$item->nombre ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
</div> <!-- //.row -->
|
||||
|
||||
@ -139,7 +124,6 @@ $('#saveAdd').on('click', function(){
|
||||
|
||||
|
||||
|
||||
|
||||
$('#add_pais_id').on('change', function(){
|
||||
var nombre_pais = $("#add_pais_id option:selected" ).text().trim();
|
||||
if(nombre_pais.localeCompare('España')==0){
|
||||
@ -162,7 +146,6 @@ $('#addressForm').on('hidden.bs.modal', function () {
|
||||
$('#add_email').val("")
|
||||
$('#add_direccion').val("")
|
||||
$("#add_pais_id").val("").change()
|
||||
$("#add_ccaa").val("").change()
|
||||
$('#add_municipio').val("")
|
||||
$('#add_provincia').val("")
|
||||
$('#add_cp').val("")
|
||||
|
||||
@ -642,7 +642,6 @@
|
||||
<th><?= lang('ClienteDirecciones.cp') ?></th>
|
||||
<th><?= lang('ClienteDirecciones.municipio') ?></th>
|
||||
<th><?= lang('ClienteDirecciones.provincia') ?></th>
|
||||
<th><?= lang('ClienteDirecciones.ccaa') ?></th>
|
||||
<th><?= lang('ClienteDirecciones.pais') ?></th>
|
||||
<th><?= lang('ClienteDirecciones.telefono') ?></th>
|
||||
<th class="text-nowrap" style="min-width:100px;"><?= lang('Basic.global.Action') ?></th>
|
||||
@ -1264,7 +1263,6 @@ function saveAdd_callback(){
|
||||
.set( 'email', $('#add_email').val() )
|
||||
.set( 'direccion', $('#add_direccion').val() )
|
||||
.set( 'pais_id', $("#add_pais_id option:selected").val())
|
||||
.set( 'ccaa_id', $("#add_ccaa option:selected").val())
|
||||
.set( 'municipio', $('#add_municipio').val() )
|
||||
.set( 'provincia', $('#add_provincia').val() )
|
||||
.set( 'cp', $('#add_cp').val() )
|
||||
@ -1280,7 +1278,6 @@ function saveAdd_callback(){
|
||||
.set( 'email', $('#add_email').val() )
|
||||
.set( 'direccion', $('#add_direccion').val() )
|
||||
.set( 'pais_id', $("#add_pais_id option:selected").val())
|
||||
.set( 'ccaa_id', $("#add_ccaa option:selected").val())
|
||||
.set( 'municipio', $('#add_municipio').val() )
|
||||
.set( 'provincia', $('#add_provincia').val() )
|
||||
.set( 'cp', $('#add_cp').val() )
|
||||
@ -1312,8 +1309,6 @@ const editorAddress = new DataTable.Editor({
|
||||
name: "municipio"
|
||||
}, {
|
||||
name: "provincia"
|
||||
}, {
|
||||
name: "ccaa_id"
|
||||
}, {
|
||||
name: "pais_id"
|
||||
}, {
|
||||
@ -1392,11 +1387,6 @@ var tableDirecciones = $('#tableOfDireccionesEnvio').DataTable( {
|
||||
{ 'data': 'cp' },
|
||||
{ 'data': 'municipio' },
|
||||
{ 'data': 'provincia' },
|
||||
{ 'data': 'ccaa_id' ,
|
||||
"render": function (data, type, row, meta) {
|
||||
return row.ccaa_nombre;
|
||||
}
|
||||
},
|
||||
{ 'data': 'pais_id' ,
|
||||
"render": function (data, type, row, meta) {
|
||||
return row.pais;
|
||||
@ -1444,7 +1434,6 @@ $('#tableOfDireccionesEnvio').on( 'click', 'tbody span.edit-add', function (e) {
|
||||
$('#add_email').val(data.email)
|
||||
$('#add_direccion').val(data.direccion)
|
||||
$("#add_pais_id").val(data.pais_id).change()
|
||||
$("#add_ccaa").val(data.ccaa_id).change()
|
||||
$('#add_municipio').val(data.municipio)
|
||||
$('#add_provincia').val(data.provincia)
|
||||
$('#add_cp').val(data.cp)
|
||||
|
||||
@ -237,3 +237,4 @@
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>">
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
@ -31,8 +31,8 @@
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#pv_bn_hq"
|
||||
aria-controls="pv_bn_hq"
|
||||
data-bs-target="#pv_bnhq"
|
||||
aria-controls="pv_bnhq"
|
||||
aria-selected="true">
|
||||
<?= lang("Presupuestos.preview-conf-bn-hq") ?>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user