mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
presupuestos direcciones!
This commit is contained in:
@ -479,6 +479,7 @@ $routes->resource('ClienteContactos', ['namespace' => 'App\Controllers\Clientes'
|
|||||||
|
|
||||||
|
|
||||||
$routes->group('clientedirecciones', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
$routes->group('clientedirecciones', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
||||||
|
$routes->get('delete/(:num)', 'Clientedirecciones::delete/$1', ['as' => 'deleteClientedirecciones']);
|
||||||
$routes->post('datatable', 'Clientedirecciones::datatable', ['as' => 'dataTableOfClienteDirecciones']);
|
$routes->post('datatable', 'Clientedirecciones::datatable', ['as' => 'dataTableOfClienteDirecciones']);
|
||||||
$routes->post('datatable_editor', 'Clientedirecciones::datatable_editor', ['as' => 'editorOfClienteDirecciones']);
|
$routes->post('datatable_editor', 'Clientedirecciones::datatable_editor', ['as' => 'editorOfClienteDirecciones']);
|
||||||
});
|
});
|
||||||
@ -523,6 +524,10 @@ $routes->group('serviciospreimpresiones', ['namespace' => 'App\Controllers\Presu
|
|||||||
$routes->post('edit/(:num)', 'Presupuestopreimpresiones::edit/$1', ['as' => 'updatePresupuestopreimpresiones']);
|
$routes->post('edit/(:num)', 'Presupuestopreimpresiones::edit/$1', ['as' => 'updatePresupuestopreimpresiones']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$routes->group('presupuestodirecciones', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
|
||||||
|
$routes->post('datatable', 'Presupuestodirecciones::datatable', ['as' => 'dataTableOfPresupuestoDirecciones']);
|
||||||
|
});
|
||||||
|
|
||||||
$routes->group('printpresupuestos', ['namespace' => 'App\Controllers\Pdf'], function ($routes) {
|
$routes->group('printpresupuestos', ['namespace' => 'App\Controllers\Pdf'], function ($routes) {
|
||||||
$routes->get('', 'PrintPresupuestos::index', ['as' => 'viewPresupuesto']);
|
$routes->get('', 'PrintPresupuestos::index', ['as' => 'viewPresupuesto']);
|
||||||
$routes->get('generar', 'PrintPresupuestos::generar', ['as' => 'presupuestoToPdf']);
|
$routes->get('generar', 'PrintPresupuestos::generar', ['as' => 'presupuestoToPdf']);
|
||||||
|
|||||||
@ -22,11 +22,7 @@ class Clientedirecciones extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
protected static $controllerSlug = 'clientedirecciones';
|
protected static $controllerSlug = 'clientedirecciones';
|
||||||
|
|
||||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
|
|
||||||
$this->soft_delete = false;
|
|
||||||
|
|
||||||
$this->viewData = ['usingServerSideDataTable' => true]; // JJO
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function datatable()
|
public function datatable()
|
||||||
|
|||||||
@ -7,6 +7,7 @@ use App\Entities\Configuracion\Maquina;
|
|||||||
use App\Models\Collection;
|
use App\Models\Collection;
|
||||||
|
|
||||||
use App\Entities\Presupuestos\PresupuestoEntity;
|
use App\Entities\Presupuestos\PresupuestoEntity;
|
||||||
|
use App\Models\Presupuestos\PresupuestoDireccionesModel;
|
||||||
use App\Models\Configuracion\PapelGenericoModel;
|
use App\Models\Configuracion\PapelGenericoModel;
|
||||||
use App\Models\Presupuestos\PresupuestoModel;
|
use App\Models\Presupuestos\PresupuestoModel;
|
||||||
|
|
||||||
@ -288,6 +289,9 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
$this->viewData['serviciosManipuladoList'] = (new PresupuestoManipuladosModel())->getResource($id)->get()->getResultObject();
|
$this->viewData['serviciosManipuladoList'] = (new PresupuestoManipuladosModel())->getResource($id)->get()->getResultObject();
|
||||||
$this->viewData['serviciosPreimpresionList'] = (new PresupuestoPreimpresionesModel())->getResource($id)->get()->getResultObject();
|
$this->viewData['serviciosPreimpresionList'] = (new PresupuestoPreimpresionesModel())->getResource($id)->get()->getResultObject();
|
||||||
|
|
||||||
|
// Direciones presupuesto
|
||||||
|
$this->viewData['presupuestoDirecciones'] = (new PresupuestoDireccionesModel())->getResource("",$id)->get()->getResultObject();
|
||||||
|
|
||||||
$this->viewData['POD'] = $this->getPOD();
|
$this->viewData['POD'] = $this->getPOD();
|
||||||
|
|
||||||
$this->viewData['tipo_impresion_id'] = 4; // Cosido tapa blanda JJO
|
$this->viewData['tipo_impresion_id'] = 4; // Cosido tapa blanda JJO
|
||||||
|
|||||||
70
ci4/app/Controllers/Presupuestos/Presupuestodirecciones.php
Normal file
70
ci4/app/Controllers/Presupuestos/Presupuestodirecciones.php
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
<?php namespace App\Controllers\Presupuestos;
|
||||||
|
|
||||||
|
|
||||||
|
use App\Controllers\GoBaseResourceController;
|
||||||
|
|
||||||
|
use App\Models\Collection;
|
||||||
|
|
||||||
|
|
||||||
|
use App\Models\Presupuestos\PresupuestoDireccionesModel;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class Presupuestodirecciones extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
|
protected $modelName = PresupuestoDireccionesModel::class;
|
||||||
|
protected $format = 'json';
|
||||||
|
|
||||||
|
protected static $singularObjectName = 'Presupuesto direcciones';
|
||||||
|
protected static $singularObjectNameCc = 'presupuestoDirecciones';
|
||||||
|
protected static $pluralObjectName = 'Presupuestos direcciones';
|
||||||
|
protected static $pluralObjectNameCc = 'presupuestosDirecciones';
|
||||||
|
|
||||||
|
protected static $controllerSlug = 'presupuesto-direcciones';
|
||||||
|
|
||||||
|
protected static $viewPath = 'themes/backend/vuexy/form/presupuestos/';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
|
||||||
|
{
|
||||||
|
parent::initController($request, $response, $logger);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function datatable()
|
||||||
|
{
|
||||||
|
if ($this->request->isAJAX()) {
|
||||||
|
$reqData = $this->request->getPost();
|
||||||
|
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
|
||||||
|
$errstr = 'No data available in response to this specific request.';
|
||||||
|
$response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
$start = $reqData['start'] ?? 0;
|
||||||
|
$length = 30;
|
||||||
|
$search = $reqData['search']['value'];
|
||||||
|
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
|
||||||
|
$order = PresupuestoDireccionesModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 1];
|
||||||
|
$dir = $reqData['order']['0']['dir'] ?? 'asc';
|
||||||
|
|
||||||
|
$id_P = $reqData['presupuesto_id'] ?? -1;
|
||||||
|
|
||||||
|
|
||||||
|
$resourceData = $this->model->getResource($search, $id_P)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
||||||
|
|
||||||
|
|
||||||
|
return $this->respond(Collection::datatable(
|
||||||
|
$resourceData,
|
||||||
|
$this->model->getResource()->countAllResults(),
|
||||||
|
$this->model->getResource("", $id_P)->countAllResults()
|
||||||
|
));
|
||||||
|
} else {
|
||||||
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -17,9 +17,9 @@ class Test extends BaseController
|
|||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$model = model('App\Models\Clientes\ClienteDireccionesModel');
|
$model = model('App\Models\Presupuestos\PresupuestoDireccionesModel');
|
||||||
echo '<pre>';
|
echo '<pre>';
|
||||||
var_dump($model->getResource("", 1420)->get()->getResultArray());
|
var_dump($model->getResource("", 8)->get()->getResultObject());
|
||||||
echo '</pre>';
|
echo '</pre>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,11 +15,12 @@ class PresupuestoDireccionesEntity extends \CodeIgniter\Entity\Entity
|
|||||||
"direccion" => null,
|
"direccion" => null,
|
||||||
"pais_id" => null,
|
"pais_id" => null,
|
||||||
"ccaa_id" => null,
|
"ccaa_id" => null,
|
||||||
"provincia_id" => null,
|
"provincia" => null,
|
||||||
"municipio_id" => null,
|
"municipio" => null,
|
||||||
"cp" => null,
|
"cp" => null,
|
||||||
"telefono" => null,
|
"telefono" => null,
|
||||||
"precio" => null,
|
"precio" => null,
|
||||||
|
"margen" => null,
|
||||||
];
|
];
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
"presupuesto_id" => "int",
|
"presupuesto_id" => "int",
|
||||||
@ -27,9 +28,9 @@ class PresupuestoDireccionesEntity extends \CodeIgniter\Entity\Entity
|
|||||||
"peso" => "float",
|
"peso" => "float",
|
||||||
"pais_id" => "int",
|
"pais_id" => "int",
|
||||||
"ccaa_id" => "int",
|
"ccaa_id" => "int",
|
||||||
"provincia_id" => "int",
|
|
||||||
"municipio_id" => "int",
|
|
||||||
"cp" => "int",
|
"cp" => "int",
|
||||||
"precio" => "float",
|
"precio" => "float",
|
||||||
|
"margen" => "float",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
27
ci4/app/Language/en/PresupuestosDirecciones.php
Normal file
27
ci4/app/Language/en/PresupuestosDirecciones.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'nuevaTitle' => 'New address',
|
||||||
|
'alias' => 'Alias',
|
||||||
|
'att' => 'Attn.',
|
||||||
|
'email' => 'Email',
|
||||||
|
'direccion' => 'Address',
|
||||||
|
'cp' => 'Zip Code',
|
||||||
|
'municipio' => 'Town',
|
||||||
|
'provincia' => 'City',
|
||||||
|
'ccaa' => 'Region',
|
||||||
|
'pais' => 'Country',
|
||||||
|
'telefono' => 'Phone',
|
||||||
|
'peso' => 'Weight',
|
||||||
|
'cantidad' => 'Quantity',
|
||||||
|
'precio' => 'Price',
|
||||||
|
'validation' => [
|
||||||
|
'max_length' => 'Max. length ',
|
||||||
|
'required' => 'Field required'
|
||||||
|
'valid_email' => 'The email is not valid',
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
'selectPais' => 'Select a country',
|
||||||
|
|
||||||
|
];
|
||||||
@ -180,6 +180,8 @@ return [
|
|||||||
|
|
||||||
// Envios
|
// Envios
|
||||||
'envios' => 'Envios',
|
'envios' => 'Envios',
|
||||||
|
'recogerEnTaller' => 'Recoger en taller',
|
||||||
|
|
||||||
|
|
||||||
'cantidad' => 'Cantidad',
|
'cantidad' => 'Cantidad',
|
||||||
|
|
||||||
@ -335,7 +337,7 @@ return [
|
|||||||
'presupuesto' => 'Presupuesto',
|
'presupuesto' => 'Presupuesto',
|
||||||
'presupuestoList' => 'Presupuesto List',
|
'presupuestoList' => 'Presupuesto List',
|
||||||
'presupuestos' => 'Presupuestos',
|
'presupuestos' => 'Presupuestos',
|
||||||
'recogerEnTaller' => 'Recoger EN Taller',
|
|
||||||
'referenciaCliente' => 'Referencia Cliente',
|
'referenciaCliente' => 'Referencia Cliente',
|
||||||
'responsable' => 'Responsable',
|
'responsable' => 'Responsable',
|
||||||
'serieId' => 'Serie ID',
|
'serieId' => 'Serie ID',
|
||||||
|
|||||||
30
ci4/app/Language/es/PresupuestosDirecciones.php
Normal file
30
ci4/app/Language/es/PresupuestosDirecciones.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
return [
|
||||||
|
'nuevaTitle' => 'Añadir nueva dirección',
|
||||||
|
'alias' => 'Alias',
|
||||||
|
'att' => 'Att.',
|
||||||
|
'email' => 'Email',
|
||||||
|
'direccion' => 'Direccion',
|
||||||
|
'cp' => 'CP',
|
||||||
|
'municipio' => 'Ciudad',
|
||||||
|
'provincia' => 'Provincia',
|
||||||
|
'ccaa' => 'CCAA',
|
||||||
|
'pais' => 'País',
|
||||||
|
'telefono' => 'Teléfono',
|
||||||
|
'peso' => 'Peso',
|
||||||
|
'cantidad' => 'Cantidad',
|
||||||
|
'precio' => 'Precio',
|
||||||
|
'validation' => [
|
||||||
|
'max_length' => 'Max. valor caracteres alcanzado',
|
||||||
|
'required' => 'Campo obligatorio',
|
||||||
|
'valid_email' => 'El email introducido no es válido',
|
||||||
|
],
|
||||||
|
|
||||||
|
|
||||||
|
'selectPais' => 'Seleccione País',
|
||||||
|
'selectCcaa' => 'Seleccione CCAA',
|
||||||
|
'selectProvincia' => 'Seleccione Provincia',
|
||||||
|
'selectMunicipio' => 'Seleccione Municipio',
|
||||||
|
];
|
||||||
@ -19,10 +19,11 @@ class ClienteDireccionesModel extends \App\Models\GoBaseModel
|
|||||||
2 => "t1.email",
|
2 => "t1.email",
|
||||||
3 => "t1.direccion",
|
3 => "t1.direccion",
|
||||||
4 => "t1.cp",
|
4 => "t1.cp",
|
||||||
5 => "t5.municipio_nombre",
|
5 => "t1.municipio",
|
||||||
6 => "t4.nombre",
|
6 => "t1.provincia",
|
||||||
7 => "t3.nombre",
|
7 => "t4.nombre",
|
||||||
8 => "t1.telefono",
|
8 => "t3.nombre",
|
||||||
|
9 => "t1.telefono",
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $allowedFields = [
|
protected $allowedFields = [
|
||||||
|
|||||||
89
ci4/app/Models/Presupuestos/PresupuestoDireccionesModel.php
Normal file
89
ci4/app/Models/Presupuestos/PresupuestoDireccionesModel.php
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models\Presupuestos;
|
||||||
|
|
||||||
|
class PresupuestoDireccionesModel extends \App\Models\GoBaseModel
|
||||||
|
{
|
||||||
|
protected $table = "presupuesto_direcciones";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether primary key uses auto increment.
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $useAutoIncrement = true;
|
||||||
|
|
||||||
|
const SORTABLE = [
|
||||||
|
0 => "t1.cantidad",
|
||||||
|
1 => "t1.att",
|
||||||
|
2 => "t1.email",
|
||||||
|
3 => "t1.direccion",
|
||||||
|
4 => "t1.cp",
|
||||||
|
5 => "t1.municipio",
|
||||||
|
6 => "t1.provincia",
|
||||||
|
7 => "t2.nombre",
|
||||||
|
8 => "t1.telefono",
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $allowedFields = [
|
||||||
|
"presupuesto_id",
|
||||||
|
"cantidad",
|
||||||
|
"peso",
|
||||||
|
"att",
|
||||||
|
"email",
|
||||||
|
"direccion",
|
||||||
|
"pais_id",
|
||||||
|
"ccaa_id",
|
||||||
|
"provincia",
|
||||||
|
"municipio",
|
||||||
|
"cp",
|
||||||
|
"telefono",
|
||||||
|
'precio',
|
||||||
|
'margen',
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $returnType = "App\Entities\Clientes\ClienteDireccionesEntity";
|
||||||
|
|
||||||
|
public static $labelField = "id";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get resource data.
|
||||||
|
*
|
||||||
|
* @param string $search
|
||||||
|
*
|
||||||
|
* @return \CodeIgniter\Database\BaseBuilder
|
||||||
|
*/
|
||||||
|
public function getResource(string $search = "", $presupuesto_id = -1)
|
||||||
|
{
|
||||||
|
$builder = $this->db
|
||||||
|
->table($this->table . " t1")
|
||||||
|
->select(
|
||||||
|
"t1.id AS id, t1.presupuesto_id AS presupuesto_id, t1.att AS att,
|
||||||
|
t1.email AS email, t1.direccion AS direccion, t1.pais_id AS pais_id, t2.nombre AS pais,
|
||||||
|
t1.ccaa_id AS ccaa_id, t3.nombre AS ccaa_nombre,
|
||||||
|
t1.municipio AS municipio, t1.provincia AS provincia, t1.cp AS cp, t1.telefono AS telefono,
|
||||||
|
t1.cantidad AS cantidad, t1.precio AS precio, t1.margen AS margen"
|
||||||
|
);
|
||||||
|
|
||||||
|
$builder->where('t1.presupuesto_id', $presupuesto_id);
|
||||||
|
$builder->join("lg_paises t2", "t1.pais_id = t2.id", "left");
|
||||||
|
$builder->join("lg_comunidades_autonomas t3", "t1.ccaa_id = t3.id", "left");
|
||||||
|
|
||||||
|
return empty($search)
|
||||||
|
? $builder
|
||||||
|
: $builder
|
||||||
|
->groupStart()
|
||||||
|
->like("t1.att", $search)
|
||||||
|
->orLike("t1.email", $search)
|
||||||
|
->orLike("t1.direccion", $search)
|
||||||
|
->orLike("t2.nombre", $search)
|
||||||
|
->orLike("t3.nombre", $search)
|
||||||
|
->orLike("t1.municipio", $search)
|
||||||
|
->orLike("t1.provincia", $search)
|
||||||
|
->orLike("t1.cp", $search)
|
||||||
|
->orLike("t1.telefono", $search)
|
||||||
|
->groupEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -967,7 +967,7 @@ var tableDirecciones = $('#tableOfDireccionesEnvio').DataTable( {
|
|||||||
processing: true,
|
processing: true,
|
||||||
autoWidth: true,
|
autoWidth: true,
|
||||||
responsive: true,
|
responsive: true,
|
||||||
order: [[ 0, "asc" ], [ 1, "asc" ]],
|
order: [0, "asc" ],
|
||||||
pageLength: 10,
|
pageLength: 10,
|
||||||
lengthChange: false,
|
lengthChange: false,
|
||||||
searching: false,
|
searching: false,
|
||||||
@ -1060,7 +1060,7 @@ $(document).on('click', '.btn-delete-add', function(e) {
|
|||||||
|
|
||||||
function delete_direccion_envio(dataId){
|
function delete_direccion_envio(dataId){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: `/clientedirecciones/delete/${dataId}`,
|
url: `/clientes/clientedirecciones/delete/${dataId}`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
}).done((data, textStatus, jqXHR) => {
|
}).done((data, textStatus, jqXHR) => {
|
||||||
$('#confirm2delete').modal('toggle');
|
$('#confirm2delete').modal('toggle');
|
||||||
|
|||||||
@ -1,39 +1,50 @@
|
|||||||
<div class="accordion mt-3" id="accordionDatosLibro">
|
<div class="accordion mt-3" id="accordionEnvios">
|
||||||
<div class="card accordion-item active">
|
<div class="card accordion-item active">
|
||||||
<h2 class="accordion-header" id="headingOne">
|
<h2 class="accordion-header" id="headingOne">
|
||||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionDatosLibroTip" aria-expanded="false" aria-controls="accordionDatosLibroTip">
|
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionEnviosTip" aria-expanded="false" aria-controls="accordionEnviosTip">
|
||||||
<h4><?= lang("Presupuestos.envios") ?></h4>
|
<h4><?= lang("Presupuestos.envios") ?></h4>
|
||||||
</button>
|
</button>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
<div id="accordionEnviosTip" class="accordion-collapse collapse show" data-bs-parent="#accordionEnvios">
|
||||||
<table id="tableOfDireccionesEnvio" class="table dt-responsive dataTable" style="width: 100%;">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th><?= lang('Presupuestos.cantidad') ?></th>
|
|
||||||
<th><?= lang('Presupuestos.peso') ?></th>
|
|
||||||
<th><?= lang('Presupuestos.att') ?></th>
|
|
||||||
<th><?= lang('Presupuestos.email') ?></th>
|
|
||||||
<th><?= lang('Presupuestos.direccion') ?></th>
|
|
||||||
<th><?= lang('Presupuestos.paisiD') ?></th>
|
|
||||||
<th><?= lang('Presupuestos.ccaa') ?></th>
|
|
||||||
<th><?= lang('Presupuestos.provincia') ?></th>
|
|
||||||
<th><?= lang('Presupuestos.municipio') ?></th>
|
|
||||||
<th><?= lang('Presupuestos.cp') ?></th>
|
|
||||||
<th><?= lang('Presupuestos.telefono') ?></th>
|
|
||||||
<th><?= lang('Presupuestos.precio') ?></th>
|
|
||||||
<th></th>
|
|
||||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<div id="accordionDatosLibroTip" class="accordion-collapse collapse show" data-bs-parent="#accordionDatosLibro">
|
|
||||||
<div class="accordion-body">
|
<div class="accordion-body">
|
||||||
|
|
||||||
|
<table id="tableOfDireccionesEnvio" class="table dt-responsive dataTable px-4" style="width: 100%;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><?= lang('PresupuestosDirecciones.cantidad') ?></th>
|
||||||
|
<th><?= lang('PresupuestosDirecciones.peso') ?></th>
|
||||||
|
<th><?= lang('PresupuestosDirecciones.att') ?></th>
|
||||||
|
<th><?= lang('PresupuestosDirecciones.email') ?></th>
|
||||||
|
<th><?= lang('PresupuestosDirecciones.direccion') ?></th>
|
||||||
|
<th><?= lang('PresupuestosDirecciones.cp') ?></th>
|
||||||
|
<th><?= lang('PresupuestosDirecciones.municipio') ?></th>
|
||||||
|
<th><?= lang('PresupuestosDirecciones.provincia') ?></th>
|
||||||
|
<th><?= lang('PresupuestosDirecciones.ccaa') ?></th>
|
||||||
|
<th><?= lang('PresupuestosDirecciones.pais') ?></th>
|
||||||
|
<th><?= lang('PresupuestosDirecciones.telefono') ?></th>
|
||||||
|
<th><?= lang('PresupuestosDirecciones.precio') ?></th>
|
||||||
|
<th></th>
|
||||||
|
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 col-lg-4 px-4 py-2">
|
||||||
|
<input class="form-check-input" type="checkbox" id="recoger_en_taller" name="recoger_en_taller" value="1" <?= $presupuestoEntity->recoger_en_taller == true ? 'checked' : ''; ?> >
|
||||||
|
<label class="form-check-label" for="recoger_en_taller"><?= lang('Presupuestos.recogerEnTaller') ?></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 col-lg-4 px-4 py-2">
|
||||||
|
<button id="insertar_direccion" type="button" class="btn btn-secondary waves-effect waves-light float-start"><?= lang("Presupuestos.insertar")?></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div> <!-- //.accordion-body -->
|
</div> <!-- //.accordion-body -->
|
||||||
</div> <!-- //.accordion-collapse -->
|
</div> <!-- //.accordion-collapse -->
|
||||||
</div> <!-- //.accordion-item -->
|
</div> <!-- //.accordion-item -->
|
||||||
@ -43,9 +54,10 @@
|
|||||||
<!-- Código JS comportamiento general pag. -->
|
<!-- Código JS comportamiento general pag. -->
|
||||||
<!------------------------------------------->
|
<!------------------------------------------->
|
||||||
<?= $this->section("additionalInlineJs") ?>
|
<?= $this->section("additionalInlineJs") ?>
|
||||||
|
|
||||||
const lastColNr = $('#tableOfDireccionesEnvio').find("tr:first th").length - 1;
|
const lastColNr = $('#tableOfDireccionesEnvio').find("tr:first th").length - 1;
|
||||||
|
|
||||||
const actionBtns = function(data) {
|
const actionBtns_direcciones = function(data) {
|
||||||
return `
|
return `
|
||||||
<span class="edit"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a></span>
|
<span class="edit"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a></span>
|
||||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
||||||
@ -54,20 +66,20 @@ const actionBtns = function(data) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var tableEnvios = $('#tableOfDireccionesEnvio').DataTable( {
|
var tableEnvios = $('#tableOfDireccionesEnvio').DataTable( {
|
||||||
draw:4,
|
draw:5,
|
||||||
serverSide: true,
|
serverSide: true,
|
||||||
processing: true,
|
processing: true,
|
||||||
autoWidth: true,
|
autoWidth: true,
|
||||||
responsive: true,
|
responsive: true,
|
||||||
order: [[ 0, "asc" ], [ 1, "asc" ]],
|
order: [[ 0, "asc" ]],
|
||||||
pageLength: 10,
|
pageLength: 20,
|
||||||
lengthChange: false,
|
lengthChange: false,
|
||||||
searching: false,
|
searching: false,
|
||||||
paging: true,
|
paging: false,
|
||||||
info: false,
|
info: false,
|
||||||
dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
|
||||||
ajax : $.fn.dataTable.pipeline( {
|
ajax : $.fn.dataTable.pipeline( {
|
||||||
url: '<?= route_to('dataTableOfPresupuestosenvios') ?>',
|
url: '<?= route_to('dataTableOfPresupuestoDirecciones') ?>',
|
||||||
data: function ( d ) {
|
data: function ( d ) {
|
||||||
d.presupuesto_id = id;
|
d.presupuesto_id = id;
|
||||||
},
|
},
|
||||||
@ -81,16 +93,16 @@ var tableEnvios = $('#tableOfDireccionesEnvio').DataTable( {
|
|||||||
{ 'data': 'att' },
|
{ 'data': 'att' },
|
||||||
{ 'data': 'email' },
|
{ 'data': 'email' },
|
||||||
{ 'data': 'direccion' },
|
{ 'data': 'direccion' },
|
||||||
{ 'data': 'paisId' },
|
|
||||||
{ 'data': 'ccaaId' },
|
|
||||||
{ 'data': 'provinciaId' },
|
|
||||||
{ 'data': 'municipioId' },
|
|
||||||
{ 'data': 'cp' },
|
{ 'data': 'cp' },
|
||||||
|
{ 'data': 'municipio' },
|
||||||
|
{ 'data': 'provincia' },
|
||||||
|
{ 'data': 'ccaaId' },
|
||||||
|
{ 'data': 'paisId' },
|
||||||
{ 'data': 'telefono' },
|
{ 'data': 'telefono' },
|
||||||
{ 'data': 'precio' },
|
{ 'data': 'precio' },
|
||||||
{ 'data': 'margen' },
|
{ 'data': 'margen' },
|
||||||
{
|
{
|
||||||
data: actionBtns,
|
data: actionBtns_direcciones,
|
||||||
className: 'row-edit dt-center'
|
className: 'row-edit dt-center'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -100,34 +112,12 @@ var tableEnvios = $('#tableOfDireccionesEnvio').DataTable( {
|
|||||||
searchable: false,
|
searchable: false,
|
||||||
targets: [lastColNr]
|
targets: [lastColNr]
|
||||||
},
|
},
|
||||||
{"orderData": [ 0, 1 ], "targets": 0 },
|
{"orderData": [ 0], "targets": 0 },
|
||||||
|
|
||||||
],
|
],
|
||||||
language: {
|
language: {
|
||||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||||
},
|
},
|
||||||
/*buttons: [ {
|
|
||||||
className: 'btn btn-primary float-end me-sm-3 me-1',
|
|
||||||
extend: "createInline",
|
|
||||||
editor: editor3,
|
|
||||||
formOptions: {
|
|
||||||
submitTrigger: -1,
|
|
||||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
|
|
||||||
|
|
||||||
},
|
|
||||||
action: function ( e, dt, node, config ) {
|
|
||||||
if(selected_tirada_id == -1){
|
|
||||||
popErrorAlert("<?= lang('TarifaEncuadernacionLineas.validation.error_seleccion_tiradas') ?>");
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
formOptions= {
|
|
||||||
submitTrigger: -1,
|
|
||||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
|
|
||||||
|
|
||||||
};
|
|
||||||
editor3.inlineCreate(config.position, formOptions);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
} ]*/
|
|
||||||
} );
|
} );
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
Reference in New Issue
Block a user