mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Compare commits
6 Commits
f73472c729
...
7bb6329783
| Author | SHA1 | Date | |
|---|---|---|---|
| 7bb6329783 | |||
| ad8e0ac75b | |||
| df21b5ba05 | |||
| 2639fe705e | |||
| 3f65c9e92a | |||
| e804aa3768 |
@ -37,6 +37,7 @@ $routes->group('configuracion', ['namespace' => 'App\Controllers\Configuracion']
|
|||||||
$routes->post('menuitems', 'Papelesgenericos::menuItems', ['as' => 'menuItemsOfPapelesGenericos']);
|
$routes->post('menuitems', 'Papelesgenericos::menuItems', ['as' => 'menuItemsOfPapelesGenericos']);
|
||||||
$routes->get('getpapelcliente', 'Papelesgenericos::getPapelCliente', ['as' => 'getPapelCliente']);
|
$routes->get('getpapelcliente', 'Papelesgenericos::getPapelCliente', ['as' => 'getPapelCliente']);
|
||||||
$routes->get('selectpapelespecial', 'Papelesgenericos::selectPapelEspecial', ['as' => 'selectPapelEspecial']);
|
$routes->get('selectpapelespecial', 'Papelesgenericos::selectPapelEspecial', ['as' => 'selectPapelEspecial']);
|
||||||
|
$routes->get('gettipopapel', 'Papelesgenericos::getTipoPapelCliente');
|
||||||
});
|
});
|
||||||
|
|
||||||
/* Papeles impresion */
|
/* Papeles impresion */
|
||||||
|
|||||||
@ -301,6 +301,53 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getTipoPapelCliente(){
|
||||||
|
|
||||||
|
if($this->request->isAJAX()) {
|
||||||
|
|
||||||
|
$data_input = $this->request->getGet();
|
||||||
|
$result = $this->papelService->getTiposPalelGenerico((object)$data_input);
|
||||||
|
/*
|
||||||
|
|
||||||
|
$tirada = goSanitize($this->request->getGet('tirada'))[0] ?? null;
|
||||||
|
$POD = null;
|
||||||
|
if ($tirada != null) {
|
||||||
|
$POD_value = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('POD')->value;
|
||||||
|
if (intval($tirada) <= intval($POD_value)) {
|
||||||
|
$POD = true;
|
||||||
|
} else {
|
||||||
|
$POD = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$tipo = goSanitize($this->request->getGet('tipo'))[0];
|
||||||
|
$selected_papel = goSanitize($this->request->getGet('papel'))[0] ?? null;
|
||||||
|
$cubierta = goSanitize($this->request->getGet('cubierta'))[0] ?? 0;
|
||||||
|
$tapa_dura = goSanitize($this->request->getGet('tapa_dura'))[0] ?? null;
|
||||||
|
$sobrecubierta = goSanitize($this->request->getGet('sobrecubierta'))[0] ?? 0;
|
||||||
|
$guardas = goSanitize($this->request->getGet('guardas'))[0] ?? 0;
|
||||||
|
|
||||||
|
$ancho = floatval($this->request->getGet('ancho') ?? 0);
|
||||||
|
$alto = floatval($this->request->getGet('alto') ?? 0);
|
||||||
|
$solapas = floatval($this->request->getGet('solapas') ?? 0);
|
||||||
|
$lomo = floatval($this->request->getGet('lomo') ?? 0);
|
||||||
|
|
||||||
|
$anchoLibro = $ancho;
|
||||||
|
|
||||||
|
if(intval($cubierta) == 1 || intval($sobrecubierta) == 1){
|
||||||
|
$anchoLibro = 2 * $ancho + 2 * $solapas + $lomo;
|
||||||
|
}
|
||||||
|
|
||||||
|
$menu = $this->model->getPapelCliente($tipo, $cubierta, $sobrecubierta, $guardas, $selected_papel, $tapa_dura, false, $POD, $anchoLibro, $alto, $tirada);
|
||||||
|
*/
|
||||||
|
|
||||||
|
return $this->respond($result);
|
||||||
|
} else {
|
||||||
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function getPapelCliente()
|
public function getPapelCliente()
|
||||||
{
|
{
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
|
|||||||
@ -3686,21 +3686,30 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
public function download_zip()
|
public function download_zip()
|
||||||
{
|
{
|
||||||
$presupuesto_id = $this->request->getPost('presupuesto_id');
|
$presupuesto_id = $this->request->getPost('presupuesto_id');
|
||||||
|
$ot_id = $this->request->getPost('ot_id');
|
||||||
|
|
||||||
if (!$presupuesto_id) {
|
if (!$presupuesto_id) {
|
||||||
return $this->response->setStatusCode(400)->setBody('Presupuesto ID requerido');
|
return $this->response->setStatusCode(400)->setBody('Presupuesto ID requerido');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Definir prefijo si se recibió un ot_id válido
|
||||||
|
$prefijo = (!empty($ot_id) && is_numeric($ot_id)) ? "OT_{$ot_id}" : null;
|
||||||
|
|
||||||
$ftpClient = new \App\Libraries\SafekatFtpClient();
|
$ftpClient = new \App\Libraries\SafekatFtpClient();
|
||||||
try {
|
try {
|
||||||
$zipPath = $ftpClient->downloadZipPresupuesto((int) $presupuesto_id);
|
$zipPath = $ftpClient->downloadZipPresupuesto((int) $presupuesto_id, $prefijo);
|
||||||
|
|
||||||
if ($zipPath === null || !file_exists($zipPath)) {
|
if ($zipPath === null || !file_exists($zipPath)) {
|
||||||
return $this->response->setStatusCode(404)->setBody('No se encontraron archivos');
|
return $this->response->setStatusCode(404)->setBody('No se encontraron archivos');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$nombreArchivo = $prefijo
|
||||||
|
? "{$prefijo}_PRESUPUESTO_{$presupuesto_id}.zip"
|
||||||
|
: "archivos_presupuesto_{$presupuesto_id}.zip";
|
||||||
|
|
||||||
return $this->response
|
return $this->response
|
||||||
->download($zipPath, null) // null = usar nombre original del archivo
|
->download($zipPath, null)
|
||||||
->setFileName('archivos_presupuesto_' . $presupuesto_id . '.zip');
|
->setFileName($nombreArchivo);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
log_message('error', $e->getMessage());
|
log_message('error', $e->getMessage());
|
||||||
return $this->response->setStatusCode(500)->setBody('Error interno');
|
return $this->response->setStatusCode(500)->setBody('Error interno');
|
||||||
@ -3708,4 +3717,5 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,35 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\Produccion;
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
|
|
||||||
|
|
||||||
class Ordenmaquina extends BaseController
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
echo 'Orden maquina';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function delete()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function add()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\Produccion;
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
|
|
||||||
|
|
||||||
class Ordentrabajomaquetacion extends BaseController
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
echo 'Orden maquetación';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function delete()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function add()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\Produccion;
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
|
|
||||||
|
|
||||||
class Pedidoproduccion extends BaseController
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
echo 'Pedido produccion';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function delete()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function add()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ class SafekatFtpClient
|
|||||||
return implode('/', [$this->base_dir, 'pedidos_files', $rootIdExtern]);
|
return implode('/', [$this->base_dir, 'pedidos_files', $rootIdExtern]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function downloadZipPresupuesto(int $presupuesto_id): ?string
|
public function downloadZipPresupuesto(int $presupuesto_id, ?string $prefijo = null): ?string
|
||||||
{
|
{
|
||||||
$modelPedidoLinea = model(PedidoLineaModel::class);
|
$modelPedidoLinea = model(PedidoLineaModel::class);
|
||||||
$model = model(PresupuestoFicheroModel::class);
|
$model = model(PresupuestoFicheroModel::class);
|
||||||
@ -143,8 +143,11 @@ class SafekatFtpClient
|
|||||||
|
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
$originalName = $file->nombre ?? basename($file->file_path);
|
$originalName = $file->nombre ?? basename($file->file_path);
|
||||||
$localFile = $localTempDir . '/' . $originalName;
|
$prefixedName = $prefijo ? $prefijo . '_' . $originalName : $originalName;
|
||||||
|
|
||||||
|
$localFile = $localTempDir . '/' . $prefixedName;
|
||||||
$remoteFile = $remotePath . '/' . basename($file->file_path);
|
$remoteFile = $remotePath . '/' . basename($file->file_path);
|
||||||
|
|
||||||
$this->ftp->get($remoteFile, $localFile);
|
$this->ftp->get($remoteFile, $localFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,4 +170,5 @@ class SafekatFtpClient
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,5 +18,57 @@ class TipoPapelGenericoModel extends \App\Models\BaseModel
|
|||||||
];
|
];
|
||||||
protected $returnType = "App\Entities\Configuracion\TipoPapelGenerico";
|
protected $returnType = "App\Entities\Configuracion\TipoPapelGenerico";
|
||||||
|
|
||||||
|
public function getTiposPapel($data)
|
||||||
|
{
|
||||||
|
$builder = $this->db
|
||||||
|
->table($this->table . " t1")
|
||||||
|
->select(
|
||||||
|
"t1.id as id, t1.clave AS nombre",
|
||||||
|
// for debug, t2.nombre AS nombre_papel_impresion, t4.nombre AS maquina_nombre, t5.uso AS tarifa_uso, t5.tipo AS tarifa_tipo"
|
||||||
|
)
|
||||||
|
->join("lg_papel_generico t2", "t2.tipo_papel_generico_id = t1.id", "inner")
|
||||||
|
->join("lg_papel_impresion t3", "t3.papel_generico_id = t2.id", "inner")
|
||||||
|
->join("lg_maquina_papel_impresion t4", "t4.papel_impresion_id = t3.id", "inner")
|
||||||
|
->join("lg_maquinas t5", "t4.maquina_id = t5.id", "inner")
|
||||||
|
->join("lg_maquinas_tarifas_impresion t6", "t6.maquina_id = t5.id", "inner")
|
||||||
|
|
||||||
|
->where("t2.is_deleted", 0)
|
||||||
|
->where("t2.show_in_client", 1)
|
||||||
|
->where("t3.is_deleted", 0)
|
||||||
|
->where("t3.isActivo", 1)
|
||||||
|
->where("t3.use_in_client", 1)
|
||||||
|
->where("t4.active", 1)
|
||||||
|
->where("t5.is_deleted", 0)
|
||||||
|
->where("t5.min <= ", $data['tirada'] ?? 0)
|
||||||
|
->where("t5.max >= ", $data['tirada'] ?? 0)
|
||||||
|
->where("t5.tipo", "impresion")
|
||||||
|
->where("t6.is_deleted", 0)
|
||||||
|
->where("t6.tipo", $data['tipo'] ?? null)
|
||||||
|
->distinct('t1.id');
|
||||||
|
|
||||||
|
// Validación adicional para asegurar que t1.id esté presente en las combinaciones con t3.active = 1
|
||||||
|
$builder->whereIn("t2.id", function ($subQuery) {
|
||||||
|
$subQuery->select("t1_inner.id")
|
||||||
|
->from("lg_papel_generico t1_inner")
|
||||||
|
->join("lg_papel_impresion t2_inner", "t2_inner.papel_generico_id = t1_inner.id", "inner")
|
||||||
|
->join("lg_maquina_papel_impresion t3_inner", "t3_inner.papel_impresion_id = t2_inner.id", "inner")
|
||||||
|
->where("t3_inner.active", 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
$builder->groupStart()
|
||||||
|
->groupStart()
|
||||||
|
->where("t5.ancho_impresion >", $data['ancho'] ?? 0)
|
||||||
|
->where("t5.alto_impresion >", $data['alto'] ?? 0)
|
||||||
|
->groupEnd()
|
||||||
|
->orGroupStart()
|
||||||
|
->where("t5.ancho_impresion >", $data['alto'] ?? 0)
|
||||||
|
->where("t5.alto_impresion >", $data['ancho'] ?? 0)
|
||||||
|
->groupEnd()
|
||||||
|
->orGroupStart()
|
||||||
|
->where("t5.ancho_impresion >", $data['alto'] ?? 0)
|
||||||
|
->where("t5.is_rotativa", 1)
|
||||||
|
->groupEnd()
|
||||||
|
->groupEnd();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,14 +4,17 @@ namespace App\Services;
|
|||||||
|
|
||||||
use CodeIgniter\Config\BaseService;
|
use CodeIgniter\Config\BaseService;
|
||||||
use App\Models\Configuracion\TipoPapelGenericoModel;
|
use App\Models\Configuracion\TipoPapelGenericoModel;
|
||||||
|
use App\Models\Configuracion\PapelGenericoModel;
|
||||||
|
|
||||||
class PapelService extends BaseService
|
class PapelService extends BaseService
|
||||||
{
|
{
|
||||||
protected TipoPapelGenericoModel $tipoPapelGenericoModel;
|
protected TipoPapelGenericoModel $tipoPapelGenericoModel;
|
||||||
|
protected PapelGenericoModel $papelGenericoModel;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->tipoPapelGenericoModel = model(TipoPapelGenericoModel::class);
|
$this->tipoPapelGenericoModel = model(TipoPapelGenericoModel::class);
|
||||||
|
$this->papelGenericoModel = model(PapelGenericoModel::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTipoPapelGenerico()
|
public function getTipoPapelGenerico()
|
||||||
@ -24,4 +27,27 @@ class PapelService extends BaseService
|
|||||||
|
|
||||||
return $tipoPapelGenericoList;
|
return $tipoPapelGenericoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtencion de los tipos de papel genérico dependiendo del uso
|
||||||
|
* @param object $data
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getTiposPalelGenerico($data){
|
||||||
|
|
||||||
|
if(!isset($data) || empty($data)){
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->papelGenericoModel->where('tipo_papel_generico_id !=', null)->findAll();
|
||||||
|
/*
|
||||||
|
$values = $this->papelGenericoModel->where('uso', $uso)->findAll();
|
||||||
|
$tipoPapelGenericoList = [];
|
||||||
|
foreach ($values as $value) {
|
||||||
|
$tipoPapelGenericoList[$value->id] = lang('PapelGenerico.' . $value->clave);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $tipoPapelGenericoList;
|
||||||
|
*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -12,7 +12,7 @@
|
|||||||
data-bs-parent="#accordionPresupuestoFiles">
|
data-bs-parent="#accordionPresupuestoFiles">
|
||||||
<div class="accordion-body">
|
<div class="accordion-body">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="dropzone needsclick" id="<?= $id ?>" data-id="<?= $modelId ?>">
|
<div class="dropzone needsclick" id="<?= $id ?>" data-id="<?= $modelId ?>" data-ot-id="<?= $otId ?? '' ?>">
|
||||||
|
|
||||||
<div class="dz-message needsclick">
|
<div class="dz-message needsclick">
|
||||||
Arrastre aquí los ficheros o haga click
|
Arrastre aquí los ficheros o haga click
|
||||||
|
|||||||
@ -13,92 +13,110 @@
|
|||||||
<div class="col-xl-12">
|
<div class="col-xl-12">
|
||||||
<div class="border rounded p-4 mb-3 pb-3">
|
<div class="border rounded p-4 mb-3 pb-3">
|
||||||
|
|
||||||
<!-- Price Details -->
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
<dl class="row mb-0">
|
<h5 class="mb-0">Costes detallados</h5>
|
||||||
<dt class="col-5 py-1 fw-normal text-end">Coste papel</dt>
|
<button class="btn btn-sm btn-link p-0" type="button" data-bs-toggle="collapse"
|
||||||
<dd class="py-1 col-6 text-end"><span id="totalCostePapel"
|
data-bs-target="#detallesCostes" aria-expanded="true"
|
||||||
class="autonumeric-resumen-currency"></span></dd>
|
aria-controls="detallesCostes" title="Mostrar/ocultar detalle de precios">
|
||||||
<dt class="col-5 py-1 fw-normal text-end">Margen papel</dt>
|
<i class="ti ti-chevron-down"></i>
|
||||||
<dd class="col-3 text-end py-1"><span id="porcentajeMargenPapel"
|
</button>
|
||||||
class="autonumeric-resumen-percent"></span></dd>
|
</div>
|
||||||
<dd class="col-3 text-end py-1"><span id="margenPapel"
|
|
||||||
class="autonumeric-resumen-currency"></span></dd>
|
|
||||||
|
|
||||||
<dt class="col-5 fw-normal text-end">
|
<div id="detallesCostes" class="collapse">
|
||||||
<a href="javascript:void(0);" data-bs-toggle="collapse" data-bs-target=".costes-impresion" aria-expanded="false" aria-controls="costes-impresion">
|
<!-- Price Details -->
|
||||||
<i class="ti ti-list ti-sm mx-2"></i>
|
<dl class="row mb-0">
|
||||||
</a>
|
<dt class="col-5 py-1 fw-normal text-end">Coste papel</dt>
|
||||||
Coste impresión
|
<dd class="py-1 col-6 text-end"><span id="totalCostePapel"
|
||||||
</dt>
|
class="autonumeric-resumen-currency"></span></dd>
|
||||||
<dd class="col-6 text-end py-1"><span id="totalCosteImpresion"
|
<dt class="col-5 py-1 fw-normal text-end">Margen papel</dt>
|
||||||
class="autonumeric-resumen-currency"></span></dd>
|
<dd class="col-3 text-end py-1"><span id="porcentajeMargenPapel"
|
||||||
<!-- Bloque colapsable, sin <div>, solo usando clases -->
|
class="autonumeric-resumen-percent"></span></dd>
|
||||||
<dt class="col-5 fw-normal text-end collapse costes-impresion">Coste clicks</dt>
|
<dd class="col-3 text-end py-1"><span id="margenPapel"
|
||||||
<dd class="col-6 text-end py-1 collapse costes-impresion">
|
class="autonumeric-resumen-currency"></span></dd>
|
||||||
<span id="totalCosteClicks" class="autonumeric-resumen-currency"></span>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt class="col-5 fw-normal text-end collapse costes-impresion">Coste horas</dt>
|
<dt class="col-5 fw-normal text-end">
|
||||||
<dd class="col-6 text-end py-1 collapse costes-impresion">
|
<a href="javascript:void(0);" data-bs-toggle="collapse"
|
||||||
<span id="totalCosteHoras" class="autonumeric-resumen-currency"></span>
|
data-bs-target=".costes-impresion" aria-expanded="false"
|
||||||
</dd>
|
aria-controls="costes-impresion">
|
||||||
|
<i class="ti ti-list ti-sm mx-2"></i>
|
||||||
|
</a>
|
||||||
|
Coste impresión
|
||||||
|
</dt>
|
||||||
|
<dd class="col-6 text-end py-1"><span id="totalCosteImpresion"
|
||||||
|
class="autonumeric-resumen-currency"></span></dd>
|
||||||
|
<!-- Bloque colapsable, sin <div>, solo usando clases -->
|
||||||
|
<dt class="col-5 fw-normal text-end collapse costes-impresion">Coste clicks</dt>
|
||||||
|
<dd class="col-6 text-end py-1 collapse costes-impresion">
|
||||||
|
<span id="totalCosteClicks" class="autonumeric-resumen-currency"></span>
|
||||||
|
</dd>
|
||||||
|
|
||||||
<dt class="col-5 fw-normal text-end collapse costes-impresion">Coste tinta</dt>
|
<dt class="col-5 fw-normal text-end collapse costes-impresion">Coste horas</dt>
|
||||||
<dd class="col-6 text-end py-1 collapse costes-impresion">
|
<dd class="col-6 text-end py-1 collapse costes-impresion">
|
||||||
<span id="totalCosteTinta" class="autonumeric-resumen-currency" ></span>
|
<span id="totalCosteHoras" class="autonumeric-resumen-currency"></span>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt class="col-5 fw-normal text-end collapse costes-impresion">Coste corte</dt>
|
<dt class="col-5 fw-normal text-end collapse costes-impresion">Coste tinta</dt>
|
||||||
<dd class="col-6 text-end py-1 collapse costes-impresion">
|
<dd class="col-6 text-end py-1 collapse costes-impresion">
|
||||||
<span id="totalCosteCorte" class="autonumeric-resumen-currency"></span>
|
<span id="totalCosteTinta" class="autonumeric-resumen-currency"></span>
|
||||||
</dd>
|
</dd>
|
||||||
<dt class="col-5 py-1 fw-normal text-end">
|
|
||||||
<a href="javascript:void(0);" data-bs-toggle="collapse" data-bs-target=".margen-impresion" aria-expanded="false" aria-controls="margen-impresion">
|
|
||||||
<i class="ti ti-list ti-sm mx-2"></i>
|
|
||||||
</a>
|
|
||||||
Margen impresión
|
|
||||||
</dt>
|
|
||||||
<dd class="col-3 text-end py-1"><span id="porcentajeMargenImpresion"
|
|
||||||
class="autonumeric-resumen-percent"></span></dd>
|
|
||||||
<dd class="col-3 text-end py-1"><span id="margenImpresion"
|
|
||||||
class="autonumeric-resumen-currency"></span></dd>
|
|
||||||
<!-- Bloque colapsable, sin <div>, solo usando clases -->
|
|
||||||
<dt class="col-5 fw-normal text-end collapse margen-impresion">Margen clicks</dt>
|
|
||||||
<dd class="col-6 text-end py-1 collapse margen-impresion">
|
|
||||||
<span id="totalMargenClicks" class="autonumeric-resumen-currency"></span>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt class="col-5 fw-normal text-end collapse margen-impresion">Margen horas</dt>
|
<dt class="col-5 fw-normal text-end collapse costes-impresion">Coste corte</dt>
|
||||||
<dd class="col-6 text-end py-1 collapse margen-impresion">
|
<dd class="col-6 text-end py-1 collapse costes-impresion">
|
||||||
<span id="totalMargenHoras" class="autonumeric-resumen-currency"></span>
|
<span id="totalCosteCorte" class="autonumeric-resumen-currency"></span>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt class="col-5 py-1 fw-normal text-end">
|
||||||
|
<a href="javascript:void(0);" data-bs-toggle="collapse"
|
||||||
|
data-bs-target=".margen-impresion" aria-expanded="false"
|
||||||
|
aria-controls="margen-impresion">
|
||||||
|
<i class="ti ti-list ti-sm mx-2"></i>
|
||||||
|
</a>
|
||||||
|
Margen impresión
|
||||||
|
</dt>
|
||||||
|
<dd class="col-3 text-end py-1"><span id="porcentajeMargenImpresion"
|
||||||
|
class="autonumeric-resumen-percent"></span></dd>
|
||||||
|
<dd class="col-3 text-end py-1"><span id="margenImpresion"
|
||||||
|
class="autonumeric-resumen-currency"></span></dd>
|
||||||
|
<!-- Bloque colapsable, sin <div>, solo usando clases -->
|
||||||
|
<dt class="col-5 fw-normal text-end collapse margen-impresion">Margen clicks</dt>
|
||||||
|
<dd class="col-6 text-end py-1 collapse margen-impresion">
|
||||||
|
<span id="totalMargenClicks" class="autonumeric-resumen-currency"></span>
|
||||||
|
</dd>
|
||||||
|
|
||||||
<dt class="col-5 fw-normal text-end collapse margen-impresion">Margen tinta</dt>
|
<dt class="col-5 fw-normal text-end collapse margen-impresion">Margen horas</dt>
|
||||||
<dd class="col-6 text-end py-1 collapse margen-impresion">
|
<dd class="col-6 text-end py-1 collapse margen-impresion">
|
||||||
<span id="totalMargenTinta" class="autonumeric-resumen-currency" ></span>
|
<span id="totalMargenHoras" class="autonumeric-resumen-currency"></span>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt class="col-5 fw-normal text-end collapse margen-impresion">Margen corte</dt>
|
<dt class="col-5 fw-normal text-end collapse margen-impresion">Margen tinta</dt>
|
||||||
<dd class="col-6 text-end py-1 collapse margen-impresion">
|
<dd class="col-6 text-end py-1 collapse margen-impresion">
|
||||||
<span id="totalMargenCorte" class="autonumeric-resumen-currency"></span>
|
<span id="totalMargenTinta" class="autonumeric-resumen-currency"></span>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
|
<dt class="col-5 fw-normal text-end collapse margen-impresion">Margen corte</dt>
|
||||||
|
<dd class="col-6 text-end py-1 collapse margen-impresion">
|
||||||
|
<span id="totalMargenCorte" class="autonumeric-resumen-currency"></span>
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt class="col-5 fw-normal text-end">Coste servicios</dt>
|
||||||
|
<dd class="col-6 text-end py-1 "><span id="totalServicios"
|
||||||
|
class="autonumeric-resumen-currency"></span></dd>
|
||||||
|
<dt class="col-5 fw-normal text-end">Margen servicios</dt>
|
||||||
|
<dd class="col-3 text-end py-1 "><span id="porcentajeMargenServicios"
|
||||||
|
class="autonumeric-resumen-percent"></span></dd>
|
||||||
|
<dd class="col-3 text-end py-1 "><span id="margenServicios"
|
||||||
|
class="autonumeric-resumen-currency"></span></dd>
|
||||||
|
|
||||||
|
<dt class="col-5 fw-normal text-end">Coste de envío</dt>
|
||||||
|
<dd class="col-6 text-end py-1 "><span id="costeEnvios"
|
||||||
|
class="autonumeric-resumen-currency"></span></dd>
|
||||||
|
<dt class="col-5 fw-normal text-end">Margen envío</dt>
|
||||||
|
<dd class="col-6 text-end py-1 "><span id="margenEnvios"
|
||||||
|
class="autonumeric-resumen-currency"></span></dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<dt class="col-5 fw-normal text-end">Coste servicios</dt>
|
|
||||||
<dd class="col-6 text-end py-1 "><span id="totalServicios"
|
|
||||||
class="autonumeric-resumen-currency"></span></dd>
|
|
||||||
<dt class="col-5 fw-normal text-end">Margen servicios</dt>
|
|
||||||
<dd class="col-3 text-end py-1 "><span id="porcentajeMargenServicios"
|
|
||||||
class="autonumeric-resumen-percent"></span></dd>
|
|
||||||
<dd class="col-3 text-end py-1 "><span id="margenServicios"
|
|
||||||
class="autonumeric-resumen-currency"></span></dd>
|
|
||||||
|
|
||||||
<dt class="col-5 fw-normal text-end">Coste de envío</dt>
|
|
||||||
<dd class="col-6 text-end py-1 "><span id="costeEnvios"
|
|
||||||
class="autonumeric-resumen-currency"></span></dd>
|
|
||||||
<dt class="col-5 fw-normal text-end">Margen envío</dt>
|
|
||||||
<dd class="col-6 text-end py-1 "><span id="margenEnvios"
|
|
||||||
class="autonumeric-resumen-currency"></span></dd>
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
<hr class="mx-n4">
|
<hr class="mx-n4">
|
||||||
|
|
||||||
@ -111,7 +129,7 @@
|
|||||||
class="autonumeric-resumen-percent"></span></dd>
|
class="autonumeric-resumen-percent"></span></dd>
|
||||||
<dd class="col-3 text-end py-1"><span id="totalMargenes"
|
<dd class="col-3 text-end py-1"><span id="totalMargenes"
|
||||||
class="autonumeric-resumen-currency"></span></dd>
|
class="autonumeric-resumen-currency"></span></dd>
|
||||||
<dt class="col-5 fw-normal text-end">Total envío base</dt>
|
<dt class="col-5 fw-normal text-end">Total envío base</dt>
|
||||||
<dd class="col-6 text-end py-1 "><span id="precioEnvios"
|
<dd class="col-6 text-end py-1 "><span id="precioEnvios"
|
||||||
class="autonumeric-resumen-currency"></span></dd>
|
class="autonumeric-resumen-currency"></span></dd>
|
||||||
</dl>
|
</dl>
|
||||||
@ -168,7 +186,8 @@
|
|||||||
<div class="col-xl-12 mt-3">
|
<div class="col-xl-12 mt-3">
|
||||||
<div class="card border border-secondary-subtle rounded-3">
|
<div class="card border border-secondary-subtle rounded-3">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div id="div_ajustar_error" class="alert alert-danger d-flex align-items-baseline d-none" role="alert">
|
<div id="div_ajustar_error" class="alert alert-danger d-flex align-items-baseline d-none"
|
||||||
|
role="alert">
|
||||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||||
<i class="ti ti-ban ti-sm"></i>
|
<i class="ti ti-ban ti-sm"></i>
|
||||||
</span>
|
</span>
|
||||||
@ -194,15 +213,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php /*if ($presupuestoEntity->estado_id == 2): ?>
|
<?php /*if ($presupuestoEntity->estado_id == 2): ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6 mb-1">
|
<div class="col-sm-6 mb-1">
|
||||||
<label for="totalAceptado"
|
<label for="totalAceptado"
|
||||||
class="form-label"><?= lang('Presupuestos.totalAceptado') ?></label>
|
class="form-label"><?= lang('Presupuestos.totalAceptado') ?></label>
|
||||||
<input disabled type="text" id="totalAceptado" name="totalAceptado"
|
<input disabled type="text" id="totalAceptado" name="totalAceptado"
|
||||||
class="form-control text-center fs-5 autonumeric-resumen-currency" value="" <?php echo ($tipo_impresion_id == 21) ? ' max=80' : '' ?>>
|
class="form-control text-center fs-5 autonumeric-resumen-currency" value="" <?php echo ($tipo_impresion_id == 21) ? ' max=80' : '' ?>>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; */ ?>
|
<?php endif; */ ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<p>
|
<p>
|
||||||
<span id="aprobado_by_at"></span>
|
<span id="aprobado_by_at"></span>
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<?= view("themes/vuexy/components/dropzone",data: ['id' => 'dropzone-ot-files','modelId' => $presupuesto->id]) ?>
|
<?= view("themes/vuexy/components/dropzone", data: [
|
||||||
|
'id' => 'dropzone-ot-files',
|
||||||
|
'modelId' => $presupuesto->id,
|
||||||
|
'otId' => $ot->id
|
||||||
|
]) ?>
|
||||||
</div><!--//.col -->
|
</div><!--//.col -->
|
||||||
</div><!--//.row -->
|
</div><!--//.row -->
|
||||||
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
import Ajax from '../ajax.js';
|
import Ajax from '../ajax.js';
|
||||||
import { alertSuccessMessage } from '../alerts/sweetAlert.js'
|
import { alertSuccessMessage, alertWarningMessage } from '../alerts/sweetAlert.js'
|
||||||
|
|
||||||
const PREVIEW_TEMPLATE = `
|
const PREVIEW_TEMPLATE = `
|
||||||
<div class="dz-preview dz-file-preview">
|
<div class="dz-preview dz-file-preview">
|
||||||
@ -25,7 +25,7 @@ const PREVIEW_TEMPLATE = `
|
|||||||
class FileUploadDropzone {
|
class FileUploadDropzone {
|
||||||
|
|
||||||
|
|
||||||
constructor({ domElement, nameId = "presupuesto_id", getUri = null, postUri = null, resourcePath = "presupuestos" }) {
|
constructor({ domElement, nameId = "presupuesto_id", getUri = null, postUri = null, resourcePath = "presupuestos", otId = null }) {
|
||||||
Dropzone.autoDiscover = false;
|
Dropzone.autoDiscover = false;
|
||||||
this.domElement = domElement
|
this.domElement = domElement
|
||||||
this.jqElement = $(domElement)
|
this.jqElement = $(domElement)
|
||||||
@ -35,6 +35,7 @@ class FileUploadDropzone {
|
|||||||
this.btnDownloadFiles = $(`#${domElement.replace('#', '')}_btnDownloadFiles`);
|
this.btnDownloadFiles = $(`#${domElement.replace('#', '')}_btnDownloadFiles`);
|
||||||
this.dataPost = {}
|
this.dataPost = {}
|
||||||
this.nameId = nameId;
|
this.nameId = nameId;
|
||||||
|
this.otId = otId;
|
||||||
this.getUri = getUri
|
this.getUri = getUri
|
||||||
this.postUri = postUri
|
this.postUri = postUri
|
||||||
this.dataPost[nameId] = this.modelId;
|
this.dataPost[nameId] = this.modelId;
|
||||||
@ -160,7 +161,8 @@ class FileUploadDropzone {
|
|||||||
url: `/presupuestoadmin/download_zip`,
|
url: `/presupuestoadmin/download_zip`,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: {
|
data: {
|
||||||
[this.nameId]: this.modelId
|
[this.nameId]: this.modelId,
|
||||||
|
'ot_id': this.otId
|
||||||
},
|
},
|
||||||
xhrFields: {
|
xhrFields: {
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
@ -185,7 +187,7 @@ class FileUploadDropzone {
|
|||||||
window.URL.revokeObjectURL(url);
|
window.URL.revokeObjectURL(url);
|
||||||
},
|
},
|
||||||
error: () => {
|
error: () => {
|
||||||
alertWarningMessage("Error al descargar el archivo ZIP.");
|
alertWarningMessage("Error", "Error al descargar el archivo ZIP.");
|
||||||
},
|
},
|
||||||
complete: () => {
|
complete: () => {
|
||||||
$("#loader").modal('hide');
|
$("#loader").modal('hide');
|
||||||
|
|||||||
@ -111,6 +111,29 @@ class DisenioInterior {
|
|||||||
this.disenioInterior.on('click', this.#handleDisenioInterior.bind(this));
|
this.disenioInterior.on('click', this.#handleDisenioInterior.bind(this));
|
||||||
this.disenioInterior_color.on('click', this.#handleDisenioInterior.bind(this));
|
this.disenioInterior_color.on('click', this.#handleDisenioInterior.bind(this));
|
||||||
|
|
||||||
|
// test
|
||||||
|
$(document).on('keydown', function (e) {
|
||||||
|
if (e.ctrlKey && e.key === '.') {
|
||||||
|
e.preventDefault(); // Evita comportamiento por defecto si es necesario
|
||||||
|
console.log('Se pulsó Control + .');
|
||||||
|
new Ajax('/configuracion/papelesgenericos/gettipopapel',
|
||||||
|
{
|
||||||
|
[self.csrf_token]: self.csrf_hash,
|
||||||
|
tirada: $('#tirada').val(),
|
||||||
|
tipo: () => self.getTipoImpresion(),
|
||||||
|
ancho: self.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
|
||||||
|
alto: self.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
|
||||||
|
solapas: 0,
|
||||||
|
lomo: 0,
|
||||||
|
cubierta: 0,
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
(response) => { console.log(response); },
|
||||||
|
(response) => { console.error(response); }
|
||||||
|
).get();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,7 @@ class OrdenTrabajo {
|
|||||||
this.otForm = this.item.find("#ot-edit-form")
|
this.otForm = this.item.find("#ot-edit-form")
|
||||||
this.block = document.querySelector('.section-block');
|
this.block = document.querySelector('.section-block');
|
||||||
this.modelId = this.item.data("id");
|
this.modelId = this.item.data("id");
|
||||||
|
this.otId = parseInt($("#dropzone-ot-files").data("ot-id")) || null;
|
||||||
this.tareasTableItem = this.item.find("#ot-task-table");
|
this.tareasTableItem = this.item.find("#ot-task-table");
|
||||||
this.tareasId = []
|
this.tareasId = []
|
||||||
this.summaryData = {}
|
this.summaryData = {}
|
||||||
@ -70,6 +71,7 @@ class OrdenTrabajo {
|
|||||||
this.configUploadDropzone = {
|
this.configUploadDropzone = {
|
||||||
domElement: '#dropzone-ot-files',
|
domElement: '#dropzone-ot-files',
|
||||||
nameId: "presupuesto_id",
|
nameId: "presupuesto_id",
|
||||||
|
otId: this.otId,
|
||||||
getUri: '/presupuestos/presupuestocliente/get_files',
|
getUri: '/presupuestos/presupuestocliente/get_files',
|
||||||
postUri: '/presupuestos/presupuestocliente/upload_files'
|
postUri: '/presupuestos/presupuestocliente/upload_files'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user