mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
autonumeric
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(),
|
||||||
|
|||||||
@ -276,12 +276,16 @@
|
|||||||
{
|
{
|
||||||
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",
|
||||||
@ -302,6 +306,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 +350,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' },
|
||||||
{ data: actionBtns3,
|
{ data: actionBtns3,
|
||||||
className: 'row-edit dt-center'}
|
className: 'row-edit dt-center'}
|
||||||
],
|
],
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
|
|
||||||
{
|
{
|
||||||
orderable: false,
|
orderable: false,
|
||||||
searchable: false,
|
searchable: false,
|
||||||
@ -356,7 +375,13 @@
|
|||||||
} ]
|
} ]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
theTable3.on('draw',() => {
|
||||||
|
AutoNumeric.multiple("span.autonumeric", {
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
decimalCharacter: ",",
|
||||||
|
unformatOnSubmit: true
|
||||||
|
});
|
||||||
|
})
|
||||||
// Activate an inline edit on click of a table cell
|
// Activate an inline edit on click of a table cell
|
||||||
$(document).on('click', '.btn-edit3', function(e) {
|
$(document).on('click', '.btn-edit3', function(e) {
|
||||||
editor3.inline(
|
editor3.inline(
|
||||||
@ -374,6 +399,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;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -117,11 +117,22 @@
|
|||||||
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"
|
||||||
}, {
|
}, {
|
||||||
name: "tirada_max"
|
name: "tirada_max",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "tirada_max",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "precio_min"
|
name: "precio_min"
|
||||||
},{
|
},{
|
||||||
@ -145,8 +156,35 @@
|
|||||||
// 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, {
|
||||||
|
decimalCharacter: ",",
|
||||||
|
decimalPlaces : 0,
|
||||||
|
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]['tarifa_acabado_id'] = id;
|
d.data[0]['tarifa_acabado_id'] = id;
|
||||||
}
|
}
|
||||||
@ -275,9 +313,9 @@
|
|||||||
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' },
|
||||||
{ 'data': 'tirada_max' },
|
{ 'data': 'tirada_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'precio_min' },
|
{ 'data': 'precio_min' },
|
||||||
{ 'data': 'margen' },
|
{ 'data': 'margen' },
|
||||||
{
|
{
|
||||||
@ -323,7 +361,14 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
} );
|
} );
|
||||||
|
theTable.on('draw',() => {
|
||||||
|
AutoNumeric.multiple("span.autonumeric", {
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
decimalCharacter: ",",
|
||||||
|
decimalPlaces : 0,
|
||||||
|
unformatOnSubmit: true
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
// Delete row
|
// Delete row
|
||||||
$(document).on('click', '.btn-delete', function(e) {
|
$(document).on('click', '.btn-delete', function(e) {
|
||||||
|
|||||||
@ -370,8 +370,7 @@ id = -1;
|
|||||||
searching: false,
|
searching: false,
|
||||||
paging: true,
|
paging: true,
|
||||||
info: false,
|
info: false,
|
||||||
dom: '<"mt-4"><"float-end"B><"float-start"l>
|
dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||||
<t><"mt-4 mb-3"p>',
|
|
||||||
ajax : $.fn.dataTable.pipeline( {
|
ajax : $.fn.dataTable.pipeline( {
|
||||||
url: '<?= route_to('dataTableOfTarifaEncuadernacionLineasHoras') ?>',
|
url: '<?= route_to('dataTableOfTarifaEncuadernacionLineasHoras') ?>',
|
||||||
data: function ( d ) {
|
data: function ( d ) {
|
||||||
@ -504,11 +503,21 @@ 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"
|
||||||
}, {
|
}, {
|
||||||
name: "paginas_libro_max"
|
name: "paginas_libro_max",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "paginas_libro_max",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "precio_max"
|
name: "precio_max"
|
||||||
}, {
|
}, {
|
||||||
@ -531,8 +540,36 @@ 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 : 0,
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
@ -570,8 +607,7 @@ id = -1;
|
|||||||
searching: false,
|
searching: false,
|
||||||
paging: true,
|
paging: true,
|
||||||
info: false,
|
info: false,
|
||||||
dom: '<"mt-4"><"float-end"B><"float-start"l>
|
dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||||
<t><"mt-4 mb-3"p>',
|
|
||||||
ajax : $.fn.dataTable.pipeline( {
|
ajax : $.fn.dataTable.pipeline( {
|
||||||
url: '<?= route_to('dataTableOfTarifaEncuadernacionLineas') ?>',
|
url: '<?= route_to('dataTableOfTarifaEncuadernacionLineas') ?>',
|
||||||
data: function ( d ) {
|
data: function ( d ) {
|
||||||
@ -589,9 +625,9 @@ 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' },
|
||||||
{ 'data': 'paginas_libro_max' },
|
{ 'data': 'paginas_libro_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'precio_min' },
|
{ 'data': 'precio_min' },
|
||||||
{ 'data': 'total_min' },
|
{ 'data': 'total_min' },
|
||||||
{ 'data': 'margen' },
|
{ 'data': 'margen' },
|
||||||
@ -664,7 +700,14 @@ id = -1;
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
} );
|
} );
|
||||||
|
theTable.on('draw',() => {
|
||||||
|
AutoNumeric.multiple("span.autonumeric", {
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
decimalCharacter: ",",
|
||||||
|
decimalPlaces : 0,
|
||||||
|
unformatOnSubmit: true
|
||||||
|
});
|
||||||
|
})
|
||||||
// Delete row
|
// Delete row
|
||||||
function remove_lineas(dataId, row){
|
function remove_lineas(dataId, row){
|
||||||
|
|
||||||
@ -776,8 +819,7 @@ id = -1;
|
|||||||
paging: true,
|
paging: true,
|
||||||
select: true,
|
select: true,
|
||||||
info: false,
|
info: false,
|
||||||
dom: '<"mt-4"><"float-end"B><"float-start"l>
|
dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||||
<t><"mt-4 mb-3"p>',
|
|
||||||
ajax : $.fn.dataTable.pipeline( {
|
ajax : $.fn.dataTable.pipeline( {
|
||||||
url: '<?= route_to('dataTableOfTarifaEncuadernacionTiradas') ?>',
|
url: '<?= route_to('dataTableOfTarifaEncuadernacionTiradas') ?>',
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
@ -115,11 +115,21 @@
|
|||||||
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"
|
||||||
}, {
|
}, {
|
||||||
name: "tirada_max"
|
name: "tirada_max",
|
||||||
|
attr: {
|
||||||
|
type: "text",
|
||||||
|
name : "tirada_max",
|
||||||
|
class :"autonumeric"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
name: "precio_min"
|
name: "precio_min"
|
||||||
}, {
|
}, {
|
||||||
@ -137,7 +147,36 @@
|
|||||||
]
|
]
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
editor.on('open',(event)=>{
|
||||||
|
$("input.autonumeric").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if(autoNumericInstance){
|
||||||
|
autoNumericInstance.remove()
|
||||||
|
|
||||||
|
}
|
||||||
|
new AutoNumeric(this, {
|
||||||
|
decimalCharacter: ",",
|
||||||
|
decimalPlaces : 0,
|
||||||
|
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]['tarifa_manipulado_id'] = id;
|
d.data[0]['tarifa_manipulado_id'] = id;
|
||||||
}
|
}
|
||||||
@ -184,9 +223,9 @@
|
|||||||
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', },
|
||||||
{ 'data': 'tirada_max' },
|
{ 'data': 'tirada_max',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'precio_min' },
|
{ 'data': 'precio_min' },
|
||||||
{ 'data': 'margen' },
|
{ 'data': 'margen' },
|
||||||
{
|
{
|
||||||
@ -245,7 +284,14 @@
|
|||||||
);
|
);
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
theTable.on('draw',() => {
|
||||||
|
AutoNumeric.multiple("span.autonumeric", {
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
decimalCharacter: ",",
|
||||||
|
decimalPlaces : 0,
|
||||||
|
unformatOnSubmit: true
|
||||||
|
});
|
||||||
|
})
|
||||||
// Delete row
|
// Delete row
|
||||||
$('#tableOfTarifamanipuladolineas').on( 'click', 'tbody span.remove', function (e) {
|
$('#tableOfTarifamanipuladolineas').on( 'click', 'tbody span.remove', function (e) {
|
||||||
|
|
||||||
|
|||||||
@ -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>
|
||||||
|
|
||||||
|
|||||||
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