mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'fix/cambio_cubierta_guardar_valores' of https://git.imnavajas.es/jjimenez/safekat into fix/cambio_cubierta_guardar_valores
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Controllers\Tarifas;
|
namespace App\Controllers\Tarifas;
|
||||||
|
|
||||||
|
|
||||||
@ -11,15 +12,15 @@ use App\Entities\Tarifas\TarifaEncuadernacionLinea;
|
|||||||
use App\Models\Tarifas\TarifaEncuadernacionLineaModel;
|
use App\Models\Tarifas\TarifaEncuadernacionLineaModel;
|
||||||
|
|
||||||
use
|
use
|
||||||
DataTables\Editor,
|
DataTables\Editor,
|
||||||
DataTables\Database,
|
DataTables\Database,
|
||||||
DataTables\Editor\Field,
|
DataTables\Editor\Field,
|
||||||
DataTables\Editor\Format,
|
DataTables\Editor\Format,
|
||||||
DataTables\Editor\Mjoin,
|
DataTables\Editor\Mjoin,
|
||||||
DataTables\Editor\Options,
|
DataTables\Editor\Options,
|
||||||
DataTables\Editor\Upload,
|
DataTables\Editor\Upload,
|
||||||
DataTables\Editor\Validate,
|
DataTables\Editor\Validate,
|
||||||
DataTables\Editor\ValidateOptions;
|
DataTables\Editor\ValidateOptions;
|
||||||
|
|
||||||
|
|
||||||
class Tarifaencuadernacionlineas extends \App\Controllers\BaseResourceController
|
class Tarifaencuadernacionlineas extends \App\Controllers\BaseResourceController
|
||||||
@ -357,7 +358,6 @@ class Tarifaencuadernacionlineas extends \App\Controllers\BaseResourceController
|
|||||||
$response[$csrfTokenName] = $newTokenHash;
|
$response[$csrfTokenName] = $newTokenHash;
|
||||||
|
|
||||||
echo json_encode($response);
|
echo json_encode($response);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return $this->failUnauthorized('Invalid request', 403);
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
}
|
}
|
||||||
@ -384,7 +384,6 @@ class Tarifaencuadernacionlineas extends \App\Controllers\BaseResourceController
|
|||||||
$csrfTokenName => $newTokenHash
|
$csrfTokenName => $newTokenHash
|
||||||
];
|
];
|
||||||
return $this->respond($data);
|
return $this->respond($data);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
|
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
|
||||||
@ -412,8 +411,7 @@ class Tarifaencuadernacionlineas extends \App\Controllers\BaseResourceController
|
|||||||
|
|
||||||
$id_TE = $reqData['tirada_id'] ?? -1;
|
$id_TE = $reqData['tirada_id'] ?? -1;
|
||||||
|
|
||||||
$resourceData = $this->model->getResource("", $id_TE)->
|
$resourceData = $this->model->getResource("", $id_TE)->orderBy($order1, $dir1)->orderBy($order2, $dir2)->orderBy($order3, $dir3)->limit($length, $start)->get()->getResultObject();
|
||||||
orderBy($order1, $dir1)->orderBy($order2, $dir2)->orderBy($order3, $dir3)->limit($length, $start)->get()->getResultObject();
|
|
||||||
|
|
||||||
return $this->respond(Collection::datatable(
|
return $this->respond(Collection::datatable(
|
||||||
$resourceData,
|
$resourceData,
|
||||||
@ -475,5 +473,4 @@ class Tarifaencuadernacionlineas extends \App\Controllers\BaseResourceController
|
|||||||
return $this->failUnauthorized('Invalid request', 403);
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -223,7 +223,6 @@ class Tarifaencuadernaciontiradas extends \App\Controllers\BaseResourceControlle
|
|||||||
$resourceData = $model->getResource("", $id_TM)->
|
$resourceData = $model->getResource("", $id_TM)->
|
||||||
orderBy($order0, $dir0)->orderBy($order1, $dir1)->orderBy($order2, $dir2)->
|
orderBy($order0, $dir0)->orderBy($order1, $dir1)->orderBy($order2, $dir2)->
|
||||||
limit($length, $start)->get()->getResultObject();
|
limit($length, $start)->get()->getResultObject();
|
||||||
|
|
||||||
return $this->respond(Collection::datatable(
|
return $this->respond(Collection::datatable(
|
||||||
$resourceData,
|
$resourceData,
|
||||||
$model->getResource()->countAllResults(),
|
$model->getResource()->countAllResults(),
|
||||||
|
|||||||
@ -4,6 +4,10 @@ return [
|
|||||||
"chat" => "Mensajería",
|
"chat" => "Mensajería",
|
||||||
"messages" => "Mensajes",
|
"messages" => "Mensajes",
|
||||||
"message" => "Mensaje",
|
"message" => "Mensaje",
|
||||||
|
"messages_internal" => "Mensajes internos",
|
||||||
|
"message_internal" => "Mensaje interno",
|
||||||
|
"messages_client" => "Mensajes Clientes",
|
||||||
|
"message_client" => "Mensaje cliente",
|
||||||
"modal" => [
|
"modal" => [
|
||||||
"new_hebra" => "Nuevo hilo",
|
"new_hebra" => "Nuevo hilo",
|
||||||
"title" => "Título",
|
"title" => "Título",
|
||||||
|
|||||||
@ -101,7 +101,7 @@
|
|||||||
<div
|
<div
|
||||||
class="form-send-message d-flex justify-content-between align-items-center">
|
class="form-send-message d-flex justify-content-between align-items-center">
|
||||||
<input class="form-control message-input border-0 me-3 shadow-none"
|
<input class="form-control message-input border-0 me-3 shadow-none"
|
||||||
placeholder="Type your message here" />
|
placeholder="<?=lang('Chat.write_message_placeholder')?>" />
|
||||||
<div class="message-actions d-flex align-items-center">
|
<div class="message-actions d-flex align-items-center">
|
||||||
|
|
||||||
<a class="btn btn-primary d-flex send-msg-btn" style="color:white"
|
<a class="btn btn-primary d-flex send-msg-btn" style="color:white"
|
||||||
|
|||||||
@ -106,7 +106,7 @@
|
|||||||
<div
|
<div
|
||||||
class="form-send-message d-flex justify-content-between align-items-center">
|
class="form-send-message d-flex justify-content-between align-items-center">
|
||||||
<input class="form-control message-input border-0 me-3 shadow-none"
|
<input class="form-control message-input border-0 me-3 shadow-none"
|
||||||
placeholder="Type your message here" />
|
placeholder="<?=lang('Chat.write_message_placeholder')?>" />
|
||||||
<div class="message-actions d-flex align-items-center">
|
<div class="message-actions d-flex align-items-center">
|
||||||
|
|
||||||
<div class="message-actions d-flex align-items-center">
|
<div class="message-actions d-flex align-items-center">
|
||||||
|
|||||||
@ -13,11 +13,11 @@
|
|||||||
<div class="nav-align-top">
|
<div class="nav-align-top">
|
||||||
<ul class="nav nav-pills mb-4" role="tablist">
|
<ul class="nav nav-pills mb-4" role="tablist">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button type="button" class="nav-link <?=auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta') ? "" : "active" ?>" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-chat" aria-controls="navs-pills-top-internal-chat" aria-selected="false">Chat</button>
|
<button type="button" class="nav-link <?=auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta') ? "" : "active" ?>" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-chat" aria-controls="navs-pills-top-internal-chat" aria-selected="false"><?=lang('Chat.messages_client')?></button>
|
||||||
</li>
|
</li>
|
||||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button type="button" class="nav-link active" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-internal-messages" aria-controls="navs-pills-top-internal-messages" aria-selected="false">Mensajes internos</button>
|
<button type="button" class="nav-link active" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-internal-messages" aria-controls="navs-pills-top-internal-messages" aria-selected="false"><?=lang('Chat.messages_internal')?></button>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@ -13,11 +13,11 @@
|
|||||||
<div class="nav-align-top">
|
<div class="nav-align-top">
|
||||||
<ul class="nav nav-pills mb-4" role="tablist">
|
<ul class="nav nav-pills mb-4" role="tablist">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button type="button" class="nav-link <?=auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta') ? "" : "active" ?>" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-chat" aria-controls="navs-pills-top-internal-chat" aria-selected="false">Chat</button>
|
<button type="button" class="nav-link <?=auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta') ? "" : "active" ?>" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-chat" aria-controls="navs-pills-top-internal-chat" aria-selected="false"><?=lang('Chat.messages_client')?></button>
|
||||||
</li>
|
</li>
|
||||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button type="button" class="nav-link active" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-internal-messages" aria-controls="navs-pills-top-internal-messages" aria-selected="false">Mensajes internos</button>
|
<button type="button" class="nav-link active" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-internal-messages" aria-controls="navs-pills-top-internal-messages" aria-selected="false"><?=lang('Chat.messages_internal')?></button>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@ -13,11 +13,11 @@
|
|||||||
<div class="nav-align-top">
|
<div class="nav-align-top">
|
||||||
<ul class="nav nav-pills mb-4" role="tablist">
|
<ul class="nav nav-pills mb-4" role="tablist">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button type="button" class="nav-link <?=auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta') ? "" : "active" ?>" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-chat" aria-controls="navs-pills-top-internal-chat" aria-selected="false">Chat</button>
|
<button type="button" class="nav-link <?=auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta') ? "" : "active" ?>" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-chat" aria-controls="navs-pills-top-internal-chat" aria-selected="false"><?=lang('Chat.messages_client')?></button>
|
||||||
</li>
|
</li>
|
||||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button type="button" class="nav-link active" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-internal-messages" aria-controls="navs-pills-top-internal-messages" aria-selected="false">Mensajes internos</button>
|
<button type="button" class="nav-link active" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-internal-messages" aria-controls="navs-pills-top-internal-messages" aria-selected="false"><?=lang('Chat.messages_internal')?></button>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@ -98,7 +98,7 @@
|
|||||||
<div
|
<div
|
||||||
class="form-send-message d-flex justify-content-between align-items-center">
|
class="form-send-message d-flex justify-content-between align-items-center">
|
||||||
<input class="form-control message-input border-0 me-3 shadow-none"
|
<input class="form-control message-input border-0 me-3 shadow-none"
|
||||||
placeholder="Type your message here" />
|
placeholder="<?=lang('Chat.write_message_placeholder')?>" />
|
||||||
<div class="message-actions d-flex align-items-center">
|
<div class="message-actions d-flex align-items-center">
|
||||||
|
|
||||||
<a class="btn btn-primary d-flex send-msg-btn" style="color:white"
|
<a class="btn btn-primary d-flex send-msg-btn" style="color:white"
|
||||||
|
|||||||
@ -97,7 +97,7 @@
|
|||||||
<div
|
<div
|
||||||
class="form-send-message d-flex justify-content-between align-items-center">
|
class="form-send-message d-flex justify-content-between align-items-center">
|
||||||
<input class="form-control message-input border-0 me-3 shadow-none"
|
<input class="form-control message-input border-0 me-3 shadow-none"
|
||||||
placeholder="Type your message here" />
|
placeholder="<?=lang('Chat.write_message_placeholder')?>" />
|
||||||
<div class="message-actions d-flex align-items-center">
|
<div class="message-actions d-flex align-items-center">
|
||||||
|
|
||||||
<a class="btn btn-primary d-flex send-msg-btn" style="color:white"
|
<a class="btn btn-primary d-flex send-msg-btn" style="color:white"
|
||||||
|
|||||||
@ -389,13 +389,17 @@
|
|||||||
}, {
|
}, {
|
||||||
name: "precio",
|
name: "precio",
|
||||||
attr: {
|
attr: {
|
||||||
type: "number"
|
type: "text",
|
||||||
}
|
name : "precio",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "margen",
|
name: "margen",
|
||||||
attr: {
|
attr: {
|
||||||
type: "number"
|
type: "text",
|
||||||
}
|
name : "margen",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"name": "maquina_id",
|
"name": "maquina_id",
|
||||||
"type": "hidden"
|
"type": "hidden"
|
||||||
@ -409,8 +413,37 @@
|
|||||||
]
|
]
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
editor.on('open', (event) => {
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
autoNumericInstance.remove()
|
||||||
|
|
||||||
|
}
|
||||||
|
new AutoNumeric(this, {
|
||||||
|
decimalCharacter: ",",
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
allowDecimalPadding : 'floats',
|
||||||
|
decimalPlaces: 2,
|
||||||
|
unformatOnSubmit: true,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
editor.on( 'preSubmit', function ( e, d, type ) {
|
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||||
|
if (d.data) {
|
||||||
|
Object.keys(d.data).forEach(function (key) {
|
||||||
|
// Find all elements with class .autonumeric
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
// Get raw value and update the corresponding field
|
||||||
|
let rawValue = autoNumericInstance.getNumericString();
|
||||||
|
d.data[key][this.name] = rawValue; // Ensure the correct name attribute is used
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
if ( type === 'create'){
|
if ( type === 'create'){
|
||||||
d.data[0]['maquina_id'] = id;
|
d.data[0]['maquina_id'] = id;
|
||||||
}
|
}
|
||||||
@ -511,9 +544,9 @@
|
|||||||
return '<?= lang('MaquinasTarifasImpresions.colorhq') ?>';
|
return '<?= lang('MaquinasTarifasImpresions.colorhq') ?>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ 'data': 'precio' },
|
{ 'data': 'precio',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'margen' },
|
{ 'data': 'margen',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'is_deleted',},
|
{ 'data': 'is_deleted'},
|
||||||
{
|
{
|
||||||
data: actionBtns,
|
data: actionBtns,
|
||||||
className: 'row-edit dt-center'
|
className: 'row-edit dt-center'
|
||||||
@ -523,7 +556,7 @@
|
|||||||
columnDefs: [
|
columnDefs: [
|
||||||
{
|
{
|
||||||
target: 4,
|
target: 4,
|
||||||
visible: false
|
visible: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
orderable: false,
|
orderable: false,
|
||||||
@ -585,7 +618,7 @@
|
|||||||
},
|
},
|
||||||
{ 'data': 'papel_generico'},
|
{ 'data': 'papel_generico'},
|
||||||
{ 'data': 'papel_impresion'},
|
{ 'data': 'papel_impresion'},
|
||||||
{ 'data': 'gramaje'},
|
{ 'data': 'gramaje',render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{ 'data': 'bn'},
|
{ 'data': 'bn'},
|
||||||
{ 'data': 'color'},
|
{ 'data': 'color'},
|
||||||
{ 'data': 'cubierta'},
|
{ 'data': 'cubierta'},
|
||||||
@ -731,9 +764,19 @@
|
|||||||
fields: [ {
|
fields: [ {
|
||||||
name: "formas"
|
name: "formas"
|
||||||
}, {
|
}, {
|
||||||
name: "internas"
|
name: "internas",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "internas",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "externas"
|
name: "externas",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "externas",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"name": "maquina_id",
|
"name": "maquina_id",
|
||||||
"type": "hidden"
|
"type": "hidden"
|
||||||
@ -746,7 +789,37 @@
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
} );
|
} );
|
||||||
|
editor3.on('open', (event) => {
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
autoNumericInstance.remove()
|
||||||
|
|
||||||
|
}
|
||||||
|
new AutoNumeric(this, {
|
||||||
|
decimalCharacter: ",",
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
allowDecimalPadding : 'floats',
|
||||||
|
decimalPlaces: 2,
|
||||||
|
unformatOnSubmit: true,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
editor3.on('preSubmit', (e, d, type) => {
|
||||||
|
if (d.data) {
|
||||||
|
Object.keys(d.data).forEach(function (key) {
|
||||||
|
// Find all elements with class .autonumeric
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
// Get raw value and update the corresponding field
|
||||||
|
let rawValue = autoNumericInstance.getNumericString();
|
||||||
|
d.data[key][this.name] = rawValue; // Ensure the correct name attribute is used
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
editor3.on( 'preSubmit', function ( e, d, type ) {
|
editor3.on( 'preSubmit', function ( e, d, type ) {
|
||||||
if ( type === 'create'){
|
if ( type === 'create'){
|
||||||
@ -799,8 +872,8 @@
|
|||||||
}),
|
}),
|
||||||
columns : [
|
columns : [
|
||||||
{ 'data': 'formas' },
|
{ 'data': 'formas' },
|
||||||
{ 'data': 'internas' },
|
{ 'data': 'internas',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'externas' },
|
{ 'data': 'externas',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ data: actionBtns,
|
{ data: actionBtns,
|
||||||
className: 'row-edit dt-center'}
|
className: 'row-edit dt-center'}
|
||||||
],
|
],
|
||||||
|
|||||||
@ -107,12 +107,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ 'data': 'maquina' },
|
{ 'data': 'maquina' },
|
||||||
{ 'data': 'ancho_min' },
|
{ 'data': 'ancho_min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'ancho_max' },
|
{ 'data': 'ancho_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'alto_min' },
|
{ 'data': 'alto_min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'alto_max' },
|
{ 'data': 'alto_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'tirada_min' },
|
{ 'data': 'tirada_min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'tirada_max' },
|
{ 'data': 'tirada_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': actionBtns }
|
{ 'data': actionBtns }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
@ -113,7 +113,7 @@
|
|||||||
columns : [
|
columns : [
|
||||||
{ 'data': 'defecto' },
|
{ 'data': 'defecto' },
|
||||||
{ 'data': 'nombre' },
|
{ 'data': 'nombre' },
|
||||||
{ 'data': 'gramaje' },
|
{ 'data': 'gramaje',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': actionBtns }
|
{ 'data': actionBtns }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
@ -276,17 +276,23 @@
|
|||||||
{
|
{
|
||||||
name: "paginas_min",
|
name: "paginas_min",
|
||||||
attr: {
|
attr: {
|
||||||
type: "number"
|
type: "text",
|
||||||
|
name : "paginas_min",
|
||||||
|
class :"autonumeric"
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
name: "paginas_max",
|
name: "paginas_max",
|
||||||
attr: {
|
attr: {
|
||||||
type: "number"
|
type: "text",
|
||||||
|
name : "paginas_max",
|
||||||
|
class :"autonumeric"
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
name: "margen",
|
name: "margen",
|
||||||
attr: {
|
attr: {
|
||||||
type: "number"
|
type: "text",
|
||||||
|
name : "margen",
|
||||||
|
class :"autonumeric"
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"name": "papel_impresion_id",
|
"name": "papel_impresion_id",
|
||||||
@ -302,6 +308,20 @@
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
|
|
||||||
|
editor3.on('open',(event)=>{
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if(autoNumericInstance){
|
||||||
|
autoNumericInstance.remove()
|
||||||
|
|
||||||
|
}
|
||||||
|
new AutoNumeric(this, {
|
||||||
|
decimalCharacter: ",",
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
unformatOnSubmit : true,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
// Definición de la tabla
|
// Definición de la tabla
|
||||||
theTable3 = $('#tableOfPapelimpresionmargenes').DataTable({
|
theTable3 = $('#tableOfPapelimpresionmargenes').DataTable({
|
||||||
@ -332,13 +352,14 @@
|
|||||||
async: true,
|
async: true,
|
||||||
}),
|
}),
|
||||||
columns : [
|
columns : [
|
||||||
{ 'data': 'paginas_min' },
|
{ 'data': 'paginas_min' , render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'paginas_max' },
|
{ 'data': 'paginas_max' , render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{ 'data': 'margen' },
|
{ 'data': 'margen', render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{ data: actionBtns3,
|
{ data: actionBtns3,
|
||||||
className: 'row-edit dt-center'}
|
className: 'row-edit dt-center'}
|
||||||
],
|
],
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
|
|
||||||
{
|
{
|
||||||
orderable: false,
|
orderable: false,
|
||||||
searchable: false,
|
searchable: false,
|
||||||
@ -374,6 +395,19 @@
|
|||||||
|
|
||||||
// Obtención del id para editar
|
// Obtención del id para editar
|
||||||
editor3.on( 'preSubmit', function ( e, d, type ) {
|
editor3.on( 'preSubmit', function ( e, d, type ) {
|
||||||
|
if (d.data) {
|
||||||
|
Object.keys(d.data).forEach(function (key) {
|
||||||
|
// Find all elements with class .autonumeric
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
// Get raw value and update the corresponding field
|
||||||
|
let rawValue = autoNumericInstance.getNumericString();
|
||||||
|
d.data[key][this.name] = rawValue; // Ensure the correct name attribute is used
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
if ( type === 'create'){
|
if ( type === 'create'){
|
||||||
d.data[0]['papel_impresion_id'] = id;
|
d.data[0]['papel_impresion_id'] = id;
|
||||||
}
|
}
|
||||||
@ -701,10 +735,10 @@
|
|||||||
className: 'dt-body-center'
|
className: 'dt-body-center'
|
||||||
},
|
},
|
||||||
{ 'data': 'maquina'},
|
{ 'data': 'maquina'},
|
||||||
{ 'data': 'ancho'},
|
{ 'data': 'ancho',render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{ 'data': 'alto'},
|
{ 'data': 'alto',render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{ 'data': 'anchoimpresion'},
|
{ 'data': 'anchoimpresion',render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{ 'data': 'altoimpresion'},
|
{ 'data': 'altoimpresion',render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{ data: actionBtns2,
|
{ data: actionBtns2,
|
||||||
className: 'row-edit dt-center'}
|
className: 'row-edit dt-center'}
|
||||||
],
|
],
|
||||||
|
|||||||
@ -100,7 +100,7 @@
|
|||||||
columns : [
|
columns : [
|
||||||
{ 'data': 'nombre' },
|
{ 'data': 'nombre' },
|
||||||
{ 'data': 'papel_generico_id' },
|
{ 'data': 'papel_generico_id' },
|
||||||
{ 'data': 'gramaje' },
|
{ 'data': 'gramaje', render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{ 'data': 'interior' },
|
{ 'data': 'interior' },
|
||||||
{ 'data': 'bn' },
|
{ 'data': 'bn' },
|
||||||
{ 'data': 'color' },
|
{ 'data': 'color' },
|
||||||
|
|||||||
@ -141,7 +141,11 @@ var editor_lineas = new $.fn.dataTable.Editor( {
|
|||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name: "cantidad",
|
name: "cantidad",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "cantidad",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "descripcion",
|
name: "descripcion",
|
||||||
type: "textarea",
|
type: "textarea",
|
||||||
@ -152,10 +156,18 @@ var editor_lineas = new $.fn.dataTable.Editor( {
|
|||||||
}, {
|
}, {
|
||||||
name: "precio_unidad",
|
name: "precio_unidad",
|
||||||
attr: {
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "precio_unidad",
|
||||||
|
class :"autonumeric",
|
||||||
style: "min-width: 65px;"
|
style: "min-width: 65px;"
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "iva",
|
name: "iva",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "iva",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "pedido_linea_impresion_id",
|
name: "pedido_linea_impresion_id",
|
||||||
type: "hidden"
|
type: "hidden"
|
||||||
@ -174,7 +186,37 @@ var editor_lineas = new $.fn.dataTable.Editor( {
|
|||||||
|
|
||||||
|
|
||||||
var old_cantidad = 0;
|
var old_cantidad = 0;
|
||||||
|
editor_lineas.on('open', (event) => {
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
autoNumericInstance.remove()
|
||||||
|
|
||||||
|
}
|
||||||
|
new AutoNumeric(this, {
|
||||||
|
decimalCharacter: ",",
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
allowDecimalPadding : 'floats',
|
||||||
|
decimalPlaces: 2,
|
||||||
|
unformatOnSubmit: true,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
editor_lineas.on('preSubmit', (e, d, type) => {
|
||||||
|
if (d.data) {
|
||||||
|
Object.keys(d.data).forEach(function (key) {
|
||||||
|
// Find all elements with class .autonumeric
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
// Get raw value and update the corresponding field
|
||||||
|
let rawValue = autoNumericInstance.getNumericString();
|
||||||
|
d.data[key][this.name] = rawValue; // Ensure the correct name attribute is used
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
editor_lineas.on( 'preEdit', function ( e, json, data, id ) {
|
editor_lineas.on( 'preEdit', function ( e, json, data, id ) {
|
||||||
|
|
||||||
old_cantidad = data.cantidad;
|
old_cantidad = data.cantidad;
|
||||||
@ -239,7 +281,7 @@ var tableLineas = $('#tableOfLineasFactura').DataTable({
|
|||||||
{data: "pedido_linea_impresion_id"},
|
{data: "pedido_linea_impresion_id"},
|
||||||
{data: "pedido_maquetacion_id"},
|
{data: "pedido_maquetacion_id"},
|
||||||
{data: "pedido_id"},
|
{data: "pedido_id"},
|
||||||
{data: "cantidad"},
|
{data: "cantidad",render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{
|
{
|
||||||
data: "descripcion",
|
data: "descripcion",
|
||||||
render: function (data, type, row, meta) {
|
render: function (data, type, row, meta) {
|
||||||
@ -324,11 +366,11 @@ var tableLineas = $('#tableOfLineasFactura').DataTable({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{data: "precio_unidad"},
|
{data: "precio_unidad",render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{data: "iva"},
|
{data: "iva",render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{data: "base"},
|
{data: "base",render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{data: "total_iva"},
|
{data: "total_iva",render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{data: "total"},
|
{data: "total",render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
],
|
],
|
||||||
order: [[1, "asc"]],
|
order: [[1, "asc"]],
|
||||||
dom: 't',
|
dom: 't',
|
||||||
|
|||||||
@ -160,9 +160,9 @@
|
|||||||
{ 'data': 'numero' },
|
{ 'data': 'numero' },
|
||||||
{ 'data': 'fecha_factura_at' },
|
{ 'data': 'fecha_factura_at' },
|
||||||
{ 'data': 'cliente' },
|
{ 'data': 'cliente' },
|
||||||
{ 'data': 'base' },
|
{ 'data': 'base' ,render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{ 'data': 'total' },
|
{ 'data': 'total',render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{ 'data': 'pendiente' },
|
{ 'data': 'pendiente',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'creditoAsegurado' ,
|
{ 'data': 'creditoAsegurado' ,
|
||||||
render: function(data, type, row, meta) {
|
render: function(data, type, row, meta) {
|
||||||
switch(data){
|
switch(data){
|
||||||
|
|||||||
@ -72,10 +72,10 @@ $('#tableOfPedidos thead tr:eq(1) th').each(function (i) {
|
|||||||
var title = $(this).text();
|
var title = $(this).text();
|
||||||
if($(this).hasClass("totalizador")){
|
if($(this).hasClass("totalizador")){
|
||||||
if(i==9){
|
if(i==9){
|
||||||
$(this).html('<label id="total_tirada" />');
|
$(this).html('<span id="total_tirada" class="autonumeric"></span>');
|
||||||
}
|
}
|
||||||
else if(i==10){
|
else if(i==10){
|
||||||
$(this).html('<label id="total_aceptado" />');
|
$(this).html('<span id="total_aceptado" class="autonumeric"></span>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -220,9 +220,9 @@ $('#tableOfPedidos thead tr:eq(1) th').each(function (i) {
|
|||||||
{ 'data': 'titulo' },
|
{ 'data': 'titulo' },
|
||||||
{ 'data': 'ubicacion' },
|
{ 'data': 'ubicacion' },
|
||||||
{ 'data': 'inc_rei' },
|
{ 'data': 'inc_rei' },
|
||||||
{ 'data': 'paginas' },
|
{ 'data': 'paginas',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'tirada' },
|
{ 'data': 'tirada',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'total_presupuesto' },
|
{ 'data': 'total_presupuesto',render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{ 'data': 'estado',
|
{ 'data': 'estado',
|
||||||
render: function(data, type, row, meta) {
|
render: function(data, type, row, meta) {
|
||||||
switch(data){
|
switch(data){
|
||||||
@ -278,12 +278,6 @@ $('#tableOfPedidos thead tr:eq(1) th').each(function (i) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let coln of priceCols) {
|
|
||||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
|
||||||
cell.innerHTML = parseFloat(cell.innerHTML).toFixed(2);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if(<?= $cliente_id ?> != -1){
|
if(<?= $cliente_id ?> != -1){
|
||||||
// Se oculta la columna de cliente (3)
|
// Se oculta la columna de cliente (3)
|
||||||
|
|||||||
@ -116,7 +116,7 @@
|
|||||||
<div class="form-send-message d-flex justify-content-between align-items-center">
|
<div class="form-send-message d-flex justify-content-between align-items-center">
|
||||||
<input
|
<input
|
||||||
class="form-control message-input border-0 me-3 shadow-none"
|
class="form-control message-input border-0 me-3 shadow-none"
|
||||||
placeholder="Type your message here"
|
placeholder="<?=lang('Chat.write_message_placeholder')?>"
|
||||||
/>
|
/>
|
||||||
<div class="message-actions d-flex align-items-center">
|
<div class="message-actions d-flex align-items-center">
|
||||||
|
|
||||||
|
|||||||
@ -187,9 +187,9 @@ theTable = $('#tableOfPresupuestos').DataTable({
|
|||||||
{ 'data': 'titulo' },
|
{ 'data': 'titulo' },
|
||||||
{ 'data': 'pais' },
|
{ 'data': 'pais' },
|
||||||
{ 'data': 'inc_rei' },
|
{ 'data': 'inc_rei' },
|
||||||
{ 'data': 'paginas' },
|
{ 'data': 'paginas',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'tirada' },
|
{ 'data': 'tirada',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'total_presupuesto' },
|
{ 'data': 'total_presupuesto',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'estado' ,
|
{ 'data': 'estado' ,
|
||||||
'render': function ( data, type, row, meta ) {
|
'render': function ( data, type, row, meta ) {
|
||||||
if(data=='borrador')
|
if(data=='borrador')
|
||||||
@ -221,12 +221,7 @@ theTable.on( 'draw.dt', function () {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let coln of priceCols) {
|
|
||||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
|
||||||
cell.innerHTML = parseFloat(cell.innerHTML).toFixed(2);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -245,9 +245,9 @@ theTable = $('#tableOfPresupuestos').DataTable({
|
|||||||
{ 'data': 'titulo' },
|
{ 'data': 'titulo' },
|
||||||
{ 'data': 'pais' },
|
{ 'data': 'pais' },
|
||||||
{ 'data': 'inc_rei' },
|
{ 'data': 'inc_rei' },
|
||||||
{ 'data': 'paginas' },
|
{ 'data': 'paginas',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'tirada' },
|
{ 'data': 'tirada' ,render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'total_presupuesto' },
|
{ 'data': 'total_presupuesto',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'estado' ,
|
{ 'data': 'estado' ,
|
||||||
'render': function ( data, type, row, meta ) {
|
'render': function ( data, type, row, meta ) {
|
||||||
if(data=='borrador')
|
if(data=='borrador')
|
||||||
@ -279,12 +279,7 @@ theTable.on( 'draw.dt', function () {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let coln of priceCols) {
|
|
||||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
|
||||||
cell.innerHTML = parseFloat(cell.innerHTML).toFixed(2);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -277,9 +277,9 @@ theTable = $('#tableOfPresupuestos').DataTable({
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
{ 'data': 'titulo' },
|
{ 'data': 'titulo' },
|
||||||
{ 'data': 'paginas' },
|
{ 'data': 'paginas',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'tirada' },
|
{ 'data': 'tirada',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'total_presupuesto' },
|
{ 'data': 'total_presupuesto',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'estado' ,
|
{ 'data': 'estado' ,
|
||||||
'render': function ( data, type, row, meta ) {
|
'render': function ( data, type, row, meta ) {
|
||||||
if(data=='borrador')
|
if(data=='borrador')
|
||||||
@ -320,12 +320,7 @@ theTable.on( 'draw.dt', function () {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let coln of priceCols) {
|
|
||||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
|
||||||
cell.innerHTML = parseFloat(cell.innerHTML).toFixed(2);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -116,15 +116,41 @@
|
|||||||
name: "proveedor_id",
|
name: "proveedor_id",
|
||||||
type: "select",
|
type: "select",
|
||||||
}, {
|
}, {
|
||||||
name: "tirada_min"
|
name: "tirada_min",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "tirada_min",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
name: "precio_max"
|
name: "precio_max",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "precio_max",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "tirada_max"
|
name: "tirada_max",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "tirada_max",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "precio_min"
|
name: "precio_min",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "precio_min",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
},{
|
},{
|
||||||
name: "margen"
|
name: "margen",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "margen",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"name": "tarifa_acabado_id",
|
"name": "tarifa_acabado_id",
|
||||||
"type": "hidden"
|
"type": "hidden"
|
||||||
@ -144,8 +170,37 @@
|
|||||||
// Generación de la lista de proveedores (id, nombre) para encuadernación
|
// Generación de la lista de proveedores (id, nombre) para encuadernación
|
||||||
const suppliersList = <?php echo json_encode($proveedores); ?>;
|
const suppliersList = <?php echo json_encode($proveedores); ?>;
|
||||||
editor.field( 'proveedor_id' ).update( suppliersList );
|
editor.field( 'proveedor_id' ).update( suppliersList );
|
||||||
|
editor.on('open',(event)=>{
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if(autoNumericInstance){
|
||||||
|
autoNumericInstance.remove()
|
||||||
|
|
||||||
|
}
|
||||||
|
new AutoNumeric(this, {
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
decimalCharacter: ",",
|
||||||
|
allowDecimalPadding : 'floats',
|
||||||
|
decimalPlaces: 2,
|
||||||
|
unformatOnSubmit: true,
|
||||||
|
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
editor.on( 'preSubmit', function ( e, d, type ) {
|
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||||
|
if (d.data) {
|
||||||
|
Object.keys(d.data).forEach(function (key) {
|
||||||
|
// Find all elements with class .autonumeric
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
// Get raw value and update the corresponding field
|
||||||
|
let rawValue = autoNumericInstance.getNumericString();
|
||||||
|
d.data[key][this.name] = rawValue; // Ensure the correct name attribute is used
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
if ( type === 'create'){
|
if ( type === 'create'){
|
||||||
d.data[0]['tarifa_acabado_id'] = id;
|
d.data[0]['tarifa_acabado_id'] = id;
|
||||||
}
|
}
|
||||||
@ -274,11 +329,11 @@
|
|||||||
return value['label'];
|
return value['label'];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ 'data': 'tirada_min' },
|
{ 'data': 'tirada_min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'precio_max' },
|
{ 'data': 'precio_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'tirada_max' },
|
{ 'data': 'tirada_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'precio_min' },
|
{ 'data': 'precio_min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'margen' },
|
{ 'data': 'margen',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{
|
{
|
||||||
data: actionBtns,
|
data: actionBtns,
|
||||||
className: 'row-edit dt-center'
|
className: 'row-edit dt-center'
|
||||||
|
|||||||
@ -312,15 +312,40 @@ id = -1;
|
|||||||
{name: "id",
|
{name: "id",
|
||||||
"type": "readonly"},
|
"type": "readonly"},
|
||||||
{
|
{
|
||||||
name: "tiempo_min"
|
name: "tiempo_min",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "tiempo_min",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "tiempo_max"
|
name: "tiempo_max",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "tiempo_max",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "precio_hora"
|
name: "precio_hora",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "precio_hora",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "total_min"
|
name: "total_min",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "total_min",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "margen"
|
name: "margen",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "margen",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"name": "tirada_encuadernacion_id",
|
"name": "tirada_encuadernacion_id",
|
||||||
"type": "hidden"
|
"type": "hidden"
|
||||||
@ -333,7 +358,37 @@ id = -1;
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
} );
|
} );
|
||||||
|
editor3.on('open', (event) => {
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
autoNumericInstance.remove()
|
||||||
|
|
||||||
|
}
|
||||||
|
new AutoNumeric(this, {
|
||||||
|
decimalCharacter: ",",
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
allowDecimalPadding : 'floats',
|
||||||
|
decimalPlaces: 2,
|
||||||
|
unformatOnSubmit: true,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
editor3.on('preSubmit', (e, d, type) => {
|
||||||
|
if (d.data) {
|
||||||
|
Object.keys(d.data).forEach(function (key) {
|
||||||
|
// Find all elements with class .autonumeric
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
// Get raw value and update the corresponding field
|
||||||
|
let rawValue = autoNumericInstance.getNumericString();
|
||||||
|
d.data[key][this.name] = rawValue; // Ensure the correct name attribute is used
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
editor3.on( 'preSubmit', function ( e, d, type ) {
|
editor3.on( 'preSubmit', function ( e, d, type ) {
|
||||||
if ( type === 'create'){
|
if ( type === 'create'){
|
||||||
d.data[0]['tirada_encuadernacion_id'] = selected_tirada_id;
|
d.data[0]['tirada_encuadernacion_id'] = selected_tirada_id;
|
||||||
@ -384,11 +439,11 @@ id = -1;
|
|||||||
}),
|
}),
|
||||||
columns: [
|
columns: [
|
||||||
{ 'data': 'id' },
|
{ 'data': 'id' },
|
||||||
{ 'data': 'tiempo_min' },
|
{ 'data': 'tiempo_min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'tiempo_max' },
|
{ 'data': 'tiempo_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'precio_hora' },
|
{ 'data': 'precio_hora',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'total_min' },
|
{ 'data': 'total_min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'margen' },
|
{ 'data': 'margen',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{
|
{
|
||||||
data: actionBtns,
|
data: actionBtns,
|
||||||
className: 'row-edit dt-center'
|
className: 'row-edit dt-center'
|
||||||
@ -505,17 +560,47 @@ id = -1;
|
|||||||
"type": "select"
|
"type": "select"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "paginas_libro_min"
|
name: "paginas_libro_min",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "paginas_libro_min",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "precio_min"
|
name: "precio_min",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "precio_min",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "paginas_libro_max"
|
name: "paginas_libro_max",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "paginas_libro_max",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "precio_max"
|
name: "precio_max",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "precio_min",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "total_min"
|
name: "total_min",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "total_min",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "margen"
|
name: "margen",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "margen",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"name": "tirada_encuadernacion_id",
|
"name": "tirada_encuadernacion_id",
|
||||||
"type": "hidden"
|
"type": "hidden"
|
||||||
@ -532,8 +617,37 @@ id = -1;
|
|||||||
// Generación de la lista de proveedores (id, nombre) para encuadernación
|
// Generación de la lista de proveedores (id, nombre) para encuadernación
|
||||||
const dimensionesList = <?php echo json_encode($dimensiones); ?>;
|
const dimensionesList = <?php echo json_encode($dimensiones); ?>;
|
||||||
editor.field( 'dimensiones_id' ).update( dimensionesList );
|
editor.field( 'dimensiones_id' ).update( dimensionesList );
|
||||||
|
editor.on('open',(event)=>{
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if(autoNumericInstance){
|
||||||
|
autoNumericInstance.remove()
|
||||||
|
|
||||||
|
}
|
||||||
|
new AutoNumeric(this, {
|
||||||
|
alwaysAllowDecimalCharacter: true,
|
||||||
|
decimalCharacter: ",",
|
||||||
|
decimalPlaces : 2,
|
||||||
|
allowDecimalPadding : 'floats',
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
unformatOnSubmit : true,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
editor.on( 'preSubmit', function ( e, d, type ) {
|
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||||
|
if (d.data) {
|
||||||
|
Object.keys(d.data).forEach(function (key) {
|
||||||
|
// Find all elements with class .autonumeric
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
// Get raw value and update the corresponding field
|
||||||
|
let rawValue = autoNumericInstance.getNumericString();
|
||||||
|
d.data[key][this.name] = rawValue; // Ensure the correct name attribute is used
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
if ( type === 'create'){
|
if ( type === 'create'){
|
||||||
d.data[0]['tirada_encuadernacion_id'] = selected_tirada_id;
|
d.data[0]['tirada_encuadernacion_id'] = selected_tirada_id;
|
||||||
}
|
}
|
||||||
@ -589,12 +703,12 @@ id = -1;
|
|||||||
return value['label'];
|
return value['label'];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ 'data': 'paginas_libro_min' },
|
{ 'data': 'paginas_libro_min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'precio_max' },
|
{ 'data': 'precio_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'paginas_libro_max' },
|
{ 'data': 'paginas_libro_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'precio_min' },
|
{ 'data': 'precio_min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'total_min' },
|
{ 'data': 'total_min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'margen' },
|
{ 'data': 'margen' ,render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{
|
{
|
||||||
data: actionBtns,
|
data: actionBtns,
|
||||||
className: 'row-edit dt-center'
|
className: 'row-edit dt-center'
|
||||||
@ -709,11 +823,26 @@ id = -1;
|
|||||||
name: "proveedor_id",
|
name: "proveedor_id",
|
||||||
"type": "select"
|
"type": "select"
|
||||||
}, {
|
}, {
|
||||||
name: "tirada_min"
|
name: "tirada_min",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "tirada_min",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "tirada_max"
|
name: "tirada_max",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "tirada_max",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "importe_fijo"
|
name: "importe_fijo",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "importe_fijo",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"name": "tarifa_encuadernacion_id",
|
"name": "tarifa_encuadernacion_id",
|
||||||
"type": "hidden"
|
"type": "hidden"
|
||||||
@ -735,7 +864,37 @@ id = -1;
|
|||||||
const suppliersList = <?php echo json_encode($proveedores); ?>;
|
const suppliersList = <?php echo json_encode($proveedores); ?>;
|
||||||
editor2.field( 'proveedor_id' ).update( suppliersList );
|
editor2.field( 'proveedor_id' ).update( suppliersList );
|
||||||
|
|
||||||
|
editor2.on('open', (event) => {
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
autoNumericInstance.remove()
|
||||||
|
|
||||||
|
}
|
||||||
|
new AutoNumeric(this, {
|
||||||
|
decimalCharacter: ",",
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
allowDecimalPadding : 'floats',
|
||||||
|
decimalPlaces: 2,
|
||||||
|
unformatOnSubmit: true,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
editor2.on('preSubmit', (e, d, type) => {
|
||||||
|
if (d.data) {
|
||||||
|
Object.keys(d.data).forEach(function (key) {
|
||||||
|
// Find all elements with class .autonumeric
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
// Get raw value and update the corresponding field
|
||||||
|
let rawValue = autoNumericInstance.getNumericString();
|
||||||
|
d.data[key][this.name] = rawValue; // Ensure the correct name attribute is used
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
editor2.on( 'preSubmit', function ( e, d, type ) {
|
editor2.on( 'preSubmit', function ( e, d, type ) {
|
||||||
if ( type === 'create'){
|
if ( type === 'create'){
|
||||||
d.data[0]['tarifa_encuadernacion_id'] = id;
|
d.data[0]['tarifa_encuadernacion_id'] = id;
|
||||||
@ -793,9 +952,9 @@ id = -1;
|
|||||||
return value['label'];
|
return value['label'];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ 'data': 'tirada_min' },
|
{ 'data': 'tirada_min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'tirada_max' },
|
{ 'data': 'tirada_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'importe_fijo' },
|
{ 'data': 'importe_fijo',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{
|
{
|
||||||
data: actionBtns,
|
data: actionBtns,
|
||||||
className: 'row-edit dt-center'
|
className: 'row-edit dt-center'
|
||||||
|
|||||||
@ -182,7 +182,12 @@
|
|||||||
}, {
|
}, {
|
||||||
name: "cp_final"
|
name: "cp_final"
|
||||||
}, {
|
}, {
|
||||||
name: "importe_fijo"
|
name: "importe_fijo",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "importe_fijo",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"name": "tarifa_envio_id",
|
"name": "tarifa_envio_id",
|
||||||
"type": "hidden"
|
"type": "hidden"
|
||||||
@ -195,7 +200,37 @@
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
} );
|
} );
|
||||||
|
editor.on('open', (event) => {
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
autoNumericInstance.remove()
|
||||||
|
|
||||||
|
}
|
||||||
|
new AutoNumeric(this, {
|
||||||
|
decimalCharacter: ",",
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
allowDecimalPadding : 'floats',
|
||||||
|
decimalPlaces: 2,
|
||||||
|
unformatOnSubmit: true,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
editor.on('preSubmit', (e, d, type) => {
|
||||||
|
if (d.data) {
|
||||||
|
Object.keys(d.data).forEach(function (key) {
|
||||||
|
// Find all elements with class .autonumeric
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
// Get raw value and update the corresponding field
|
||||||
|
let rawValue = autoNumericInstance.getNumericString();
|
||||||
|
d.data[key][this.name] = rawValue; // Ensure the correct name attribute is used
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
editor.on( 'preSubmit', function ( e, d, type ) {
|
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||||
if ( type === 'create'){
|
if ( type === 'create'){
|
||||||
@ -255,7 +290,7 @@
|
|||||||
{ 'data': 'nombre' },
|
{ 'data': 'nombre' },
|
||||||
{ 'data': 'cp_inicial' },
|
{ 'data': 'cp_inicial' },
|
||||||
{ 'data': 'cp_final' },
|
{ 'data': 'cp_final' },
|
||||||
{ 'data': 'importe_fijo' },
|
{ 'data': 'importe_fijo',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{
|
{
|
||||||
data: actionBtns,
|
data: actionBtns,
|
||||||
className: 'row-edit dt-center'
|
className: 'row-edit dt-center'
|
||||||
@ -346,18 +381,48 @@ const lastColNr2 = $('#tableOfPrecios').find("tr:first th").length - 1;
|
|||||||
name: "tipo_envio",
|
name: "tipo_envio",
|
||||||
"type": "select"
|
"type": "select"
|
||||||
}, {
|
}, {
|
||||||
name: "peso_min"
|
name: "peso_min",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "peso_min",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "peso_max"
|
name: "peso_max",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "peso_max",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "precio_min"
|
name: "precio_min",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "precio_min",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "precio_max"
|
name: "precio_max",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "precio_max",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "precio_adicional",
|
name: "precio_adicional",
|
||||||
def: 0
|
def: 0,
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "precio_adicional",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "margen"
|
name: "margen",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "margen",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"name": "tarifa_envio_id",
|
"name": "tarifa_envio_id",
|
||||||
"type": "hidden"
|
"type": "hidden"
|
||||||
@ -370,7 +435,37 @@ const lastColNr2 = $('#tableOfPrecios').find("tr:first th").length - 1;
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
} );
|
} );
|
||||||
|
editor2.on('open', (event) => {
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
autoNumericInstance.remove()
|
||||||
|
|
||||||
|
}
|
||||||
|
new AutoNumeric(this, {
|
||||||
|
decimalCharacter: ",",
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
allowDecimalPadding : 'floats',
|
||||||
|
decimalPlaces: 2,
|
||||||
|
unformatOnSubmit: true,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
editor2.on('preSubmit', (e, d, type) => {
|
||||||
|
if (d.data) {
|
||||||
|
Object.keys(d.data).forEach(function (key) {
|
||||||
|
// Find all elements with class .autonumeric
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
// Get raw value and update the corresponding field
|
||||||
|
let rawValue = autoNumericInstance.getNumericString();
|
||||||
|
d.data[key][this.name] = rawValue; // Ensure the correct name attribute is used
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
// Generación de la lista de proveedores (id, nombre)
|
// Generación de la lista de proveedores (id, nombre)
|
||||||
const suppliersList = <?php echo json_encode($proveedores); ?>;
|
const suppliersList = <?php echo json_encode($proveedores); ?>;
|
||||||
editor2.field( 'proveedor_id' ).update( suppliersList );
|
editor2.field( 'proveedor_id' ).update( suppliersList );
|
||||||
@ -455,12 +550,12 @@ const lastColNr2 = $('#tableOfPrecios').find("tr:first th").length - 1;
|
|||||||
return '<?= lang('TarifasEnviosPrecios.palets') ?>';
|
return '<?= lang('TarifasEnviosPrecios.palets') ?>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ 'data': 'peso_min' },
|
{ 'data': 'peso_min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'peso_max' },
|
{ 'data': 'peso_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'precio_min' },
|
{ 'data': 'precio_min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'precio_max' },
|
{ 'data': 'precio_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'precio_adicional' },
|
{ 'data': 'precio_adicional',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'margen' },
|
{ 'data': 'margen',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{
|
{
|
||||||
data: actionBtns,
|
data: actionBtns,
|
||||||
className: 'row-edit dt-center'
|
className: 'row-edit dt-center'
|
||||||
|
|||||||
@ -33,10 +33,15 @@
|
|||||||
<?= esc($item->code) ?>
|
<?= esc($item->code) ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
<?= esc($item->precio) ?>
|
<span class="autonumeric">
|
||||||
|
<?= esc($item->precio) ?>
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
<?= esc($item->margen) ?>
|
<span class="autonumeric">
|
||||||
|
<?= esc($item->margen) ?>
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
<?= esc($item->mostrar_en_presupuesto)==1?'<i class="ti ti-check"></i>':"" ?>
|
<?= esc($item->mostrar_en_presupuesto)==1?'<i class="ti ti-check"></i>':"" ?>
|
||||||
|
|||||||
@ -115,15 +115,40 @@
|
|||||||
table : "#tableOfTarifamanipuladolineas",
|
table : "#tableOfTarifamanipuladolineas",
|
||||||
idSrc: 'id',
|
idSrc: 'id',
|
||||||
fields: [ {
|
fields: [ {
|
||||||
name: "tirada_min"
|
name: "tirada_min",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "tirada_min",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "precio_max"
|
name: "precio_max",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "tirada_min",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "tirada_max"
|
name: "tirada_max",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "tirada_max",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "precio_min"
|
name: "precio_min",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "tirada_min",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "margen"
|
name: "margen",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "tirada_min",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"name": "tarifa_manipulado_id",
|
"name": "tarifa_manipulado_id",
|
||||||
"type": "hidden"
|
"type": "hidden"
|
||||||
@ -137,7 +162,39 @@
|
|||||||
]
|
]
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
editor.on('open', (event) => {
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
autoNumericInstance.remove()
|
||||||
|
|
||||||
|
}
|
||||||
|
new AutoNumeric(this, {
|
||||||
|
decimalCharacter: ",",
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
allowDecimalPadding : 'floats',
|
||||||
|
decimalPlaces: 2,
|
||||||
|
unformatOnSubmit: true,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
editor.on('preSubmit', (e, d, type) => {
|
||||||
|
if (d.data) {
|
||||||
|
Object.keys(d.data).forEach(function (key) {
|
||||||
|
// Find all elements with class .autonumeric
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (autoNumericInstance) {
|
||||||
|
// Get raw value and update the corresponding field
|
||||||
|
let rawValue = autoNumericInstance.getNumericString();
|
||||||
|
d.data[key][this.name] = rawValue; // Ensure the correct name attribute is used
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
editor.on( 'preSubmit', function ( e, d, type ) {
|
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||||
|
|
||||||
if ( type === 'create'){
|
if ( type === 'create'){
|
||||||
d.data[0]['tarifa_manipulado_id'] = id;
|
d.data[0]['tarifa_manipulado_id'] = id;
|
||||||
}
|
}
|
||||||
@ -184,11 +241,11 @@
|
|||||||
async: true,
|
async: true,
|
||||||
}),
|
}),
|
||||||
columns: [
|
columns: [
|
||||||
{ 'data': 'tirada_min' },
|
{ 'data': 'tirada_min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'precio_max' },
|
{ 'data': 'precio_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'tirada_max' },
|
{ 'data': 'tirada_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'precio_min' },
|
{ 'data': 'precio_min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'margen' },
|
{ 'data': 'margen',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{
|
{
|
||||||
data: actionBtns,
|
data: actionBtns,
|
||||||
className: 'row-edit dt-center'
|
className: 'row-edit dt-center'
|
||||||
|
|||||||
@ -33,10 +33,14 @@
|
|||||||
<?= esc($item->code) ?>
|
<?= esc($item->code) ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
<?= esc($item->precio) ?>
|
<span class="autonumeric">
|
||||||
|
<?= esc($item->precio) ?>
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
<?= esc($item->margen) ?>
|
<span class="autonumeric">
|
||||||
|
<?= esc($item->margen) ?>
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
<?= esc($item->mostrar_en_presupuesto)==1?'<i class="ti ti-check"></i>':"" ?>
|
<?= esc($item->mostrar_en_presupuesto)==1?'<i class="ti ti-check"></i>':"" ?>
|
||||||
|
|||||||
@ -69,7 +69,7 @@ $picture = "/assets/img/default-user.png";
|
|||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>" />
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>" />
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>" />
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>" />
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.css') ?>"/>
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.css') ?>" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -85,6 +85,8 @@ $picture = "/assets/img/default-user.png";
|
|||||||
<!-- Helpers -->
|
<!-- Helpers -->
|
||||||
<script src="<?= site_url('themes/vuexy/vendor/js/helpers.js') ?>"></script>
|
<script src="<?= site_url('themes/vuexy/vendor/js/helpers.js') ?>"></script>
|
||||||
<script src="<?= site_url('themes/vuexy/js/config.js') ?>"></script>
|
<script src="<?= site_url('themes/vuexy/js/config.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/autoNumeric/autoNumeric.min.js') ?>"></script>
|
||||||
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@ -351,6 +353,8 @@ $picture = "/assets/img/default-user.png";
|
|||||||
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
|
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
|
||||||
|
|
||||||
<script type="module" src="<?= site_url('assets/js/safekat/pages/chatNotification.js') ?>"></script>
|
<script type="module" src="<?= site_url('assets/js/safekat/pages/chatNotification.js') ?>"></script>
|
||||||
|
<script type="module" src="<?= site_url('assets/js/safekat/pages/layout.js') ?>"></script>
|
||||||
|
|
||||||
|
|
||||||
<!-- endbuild -->
|
<!-- endbuild -->
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
export function getToken()
|
export function getToken() {
|
||||||
{
|
|
||||||
const scriptUrl = new URL(import.meta.url);
|
const scriptUrl = new URL(import.meta.url);
|
||||||
const params = new URLSearchParams(scriptUrl.search);
|
const params = new URLSearchParams(scriptUrl.search);
|
||||||
|
|
||||||
@ -10,3 +9,67 @@ export function getToken()
|
|||||||
export function capitalizeFirstLetter(string) {
|
export function capitalizeFirstLetter(string) {
|
||||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const initAutonumeric = () => {
|
||||||
|
$(document).on('draw.dt', (event) => {
|
||||||
|
$("span.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (!autoNumericInstance) {
|
||||||
|
new AutoNumeric(this, {
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
decimalCharacter: ",",
|
||||||
|
allowDecimalPadding : 'floats',
|
||||||
|
decimalPlaces: 2,
|
||||||
|
unformatOnSubmit: true,
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// $(':input[type="number"]').each(function(){
|
||||||
|
// $(this).attr('type','text')
|
||||||
|
// let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
// if (!autoNumericInstance) {
|
||||||
|
// new AutoNumeric(this, {
|
||||||
|
// digitGroupSeparator: ".",
|
||||||
|
// decimalCharacter: ",",
|
||||||
|
// allowDecimalPadding : 'floats',
|
||||||
|
// decimalPlaces: 2,
|
||||||
|
// unformatOnSubmit: true,
|
||||||
|
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
})
|
||||||
|
// editor.on('open', (event) => {
|
||||||
|
// $("input.autonumeric").each(function () {
|
||||||
|
// let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
// if (autoNumericInstance) {
|
||||||
|
// autoNumericInstance.remove()
|
||||||
|
|
||||||
|
// }
|
||||||
|
// new AutoNumeric(this, {
|
||||||
|
// decimalCharacter: ",",
|
||||||
|
// digitGroupSeparator: ".",
|
||||||
|
// allowDecimalPadding : 'floats',
|
||||||
|
// decimalPlaces: 2,
|
||||||
|
// unformatOnSubmit: true,
|
||||||
|
// });
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// editor.on('preSubmit', (e, d, type) => {
|
||||||
|
// if (d.data) {
|
||||||
|
// Object.keys(d.data).forEach(function (key) {
|
||||||
|
// // Find all elements with class .autonumeric
|
||||||
|
// $("input.autonumeric").each(function () {
|
||||||
|
// let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
// if (autoNumericInstance) {
|
||||||
|
// // Get raw value and update the corresponding field
|
||||||
|
// let rawValue = autoNumericInstance.getNumericString();
|
||||||
|
// d.data[key][this.name] = rawValue; // Ensure the correct name attribute is used
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
}
|
||||||
@ -14,7 +14,7 @@ class OrdenTrabajoDatatable {
|
|||||||
{ data: 'cliente_nombre', searchable: false, sortable: false },
|
{ data: 'cliente_nombre', searchable: false, sortable: false },
|
||||||
{ data: 'presupuesto_titulo', searchable: false, sortable: false },
|
{ data: 'presupuesto_titulo', searchable: false, sortable: false },
|
||||||
{ data: 'ubicacion_nombre', searchable: false, sortable: false },
|
{ data: 'ubicacion_nombre', searchable: false, sortable: false },
|
||||||
{ data: 'total_tirada', searchable: false, sortable: false },
|
{ data: 'total_tirada', searchable: false, sortable: false ,render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{ data: 'tipo_presupuesto_impresion', searchable: false, sortable: false },
|
{ data: 'tipo_presupuesto_impresion', searchable: false, sortable: false },
|
||||||
{
|
{
|
||||||
data: 'logo', searchable: false, sortable: false, render: (d, t) => {
|
data: 'logo', searchable: false, sortable: false, render: (d, t) => {
|
||||||
|
|||||||
4
httpdocs/assets/js/safekat/pages/layout.js
Normal file
4
httpdocs/assets/js/safekat/pages/layout.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import { initAutonumeric } from "../common/common.js";
|
||||||
|
|
||||||
|
|
||||||
|
initAutonumeric()
|
||||||
@ -91,10 +91,10 @@ class MaquinasList {
|
|||||||
{ 'data': 'id' },
|
{ 'data': 'id' },
|
||||||
{ 'data': 'nombre' },
|
{ 'data': 'nombre' },
|
||||||
{ 'data': 'tipo' },
|
{ 'data': 'tipo' },
|
||||||
{ 'data': 'ancho_impresion' },
|
{ 'data': 'ancho_impresion',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'alto_impresion' },
|
{ 'data': 'alto_impresion',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'min' },
|
{ 'data': 'min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'max' }
|
{ 'data': 'max',render : (d) => `<span class="autonumeric">${d}</span>` }
|
||||||
];
|
];
|
||||||
|
|
||||||
const actions = ['edit', 'delete'];
|
const actions = ['edit', 'delete'];
|
||||||
|
|||||||
9
httpdocs/themes/vuexy/vendor/libs/autoNumeric/autoNumeric.min.js
vendored
Normal file
9
httpdocs/themes/vuexy/vendor/libs/autoNumeric/autoNumeric.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user