+
-
-
+
+
-
-
-
- |
- = lang('Presupuestos.tipo') ?>
- |
-
- = lang('Presupuestos.paginas') ?>
- |
-
- = lang('Presupuestos.papel') ?>
- |
-
- = lang('Presupuestos.gramaje') ?>
- |
-
- = lang('Presupuestos.marca') ?>
- |
-
- = lang('Presupuestos.maquina') ?>
- |
-
- = lang('Presupuestos.numeroPliegos') ?>
- |
-
- = lang('Presupuestos.pliegosPedido') ?>
- |
-
- = lang('Presupuestos.precioPliego') ?>
- |
-
- = lang('Presupuestos.libro') ?>
- |
-
- = lang('Presupuestos.totalPapelPedido') ?>
- |
-
- = lang('Presupuestos.lomo') ?>
- |
-
- = lang('Presupuestos.peso') ?>
- |
-
- = lang('Presupuestos.horas') ?>
- |
-
- = lang('Presupuestos.precioImpresion') ?>
- |
-
- = lang('Presupuestos.total') ?>
- |
-
-
-
-
-
-
- |
- = lang('Presupuestos.total') ?>
- = lang("Presupuestos.Guardas") ?>:
- |
-
- 0.00 |
-
-
-
+
+
+
+ |
+ = lang('Presupuestos.tipo') ?>
+ |
+
+ = lang('Presupuestos.paginas') ?>
+ |
+
+ = lang('Presupuestos.papel') ?>
+ |
+
+ = lang('Presupuestos.gramaje') ?>
+ |
+
+ = lang('Presupuestos.marca') ?>
+ |
+
+ = lang('Presupuestos.maquina') ?>
+ |
+
+ = lang('Presupuestos.numeroPliegos') ?>
+ |
+
+ = lang('Presupuestos.pliegosPedido') ?>
+ |
+
+ = lang('Presupuestos.precioPliego') ?>
+ |
+
+ = lang('Presupuestos.libro') ?>
+ |
+
+ = lang('Presupuestos.totalPapelPedido') ?>
+ |
+
+ = lang('Presupuestos.lomo') ?>
+ |
+
+ = lang('Presupuestos.peso') ?>
+ |
+
+ = lang('Presupuestos.horas') ?>
+ |
+
+ = lang('Presupuestos.precioImpresion') ?>
+ |
+
+ = lang('Presupuestos.total') ?>
+ |
+
+
+
+
+
+
+ |
+ = lang('Presupuestos.total') ?>
+ = lang("Presupuestos.Guardas") ?>:
+ |
+
+ 0.00 |
+
+
+
-
-
+
+
+
+
-
-
diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioCubierta.php b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioCubierta.php
index 4f62b196..902209d8 100755
--- a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioCubierta.php
+++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioCubierta.php
@@ -136,10 +136,11 @@
= lang('Presupuestos.cabezada') ?>
diff --git a/httpdocs/assets/js/safekat/components/configVariableDatatable.js b/httpdocs/assets/js/safekat/components/configVariableDatatable.js
index c1534967..0b7b4ccb 100644
--- a/httpdocs/assets/js/safekat/components/configVariableDatatable.js
+++ b/httpdocs/assets/js/safekat/components/configVariableDatatable.js
@@ -1,10 +1,8 @@
import Modal from "./modal.js";
import Ajax from "./ajax.js";
-class ConfigVariableDatatable
-{
- constructor(domItem)
- {
+class ConfigVariableDatatable {
+ constructor(domItem) {
this.domItem = domItem
this.datatableItem = this.domItem
this.modalItem = $("#modalConfigVariableForm")
@@ -14,76 +12,69 @@ class ConfigVariableDatatable
this.formEdit = this.modalItem.find("#formEditConfigVariable")
}
- init(){
+ init() {
this.datatable = this.datatableItem.DataTable({
processing: true,
dom: 'Blrtip',
serverSide: true,
- lengthMenu: [ 25, 50, 100, 200 ],
+ lengthMenu: [25, 50, 100, 200],
pageLength: 50,
language: {
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
},
- columns : [
- {data : 'name',searchable:true,sortable:false},
- {data : 'value',searchable:true,sortable:false},
- {data : 'description',searchable:true,sortable:false},
- {data : 'action',sortable:false,searchable:false,
- render : (d,t) =>{
+ columns: [
+ { data: 'name', searchable: true, sortable: false },
+ { data: 'value', searchable: true, sortable: false },
+ { data: 'description', searchable: true, sortable: false },
+ {
+ data: 'action', sortable: false, searchable: false,
+ render: (d, t) => {
return `
`
- }
+ }
},
],
ajax: '/configuracion/variables/datatable'
});
}
- events()
- {
- this.modalItem.on("click",".btn-update-variable",this.handleUpdateVariable.bind(this))
- this.datatableItem.on("click",".edit-variable",(e)=> {
+ events() {
+ this.modalItem.on("click", ".btn-update-variable", this.handleUpdateVariable.bind(this))
+ this.datatableItem.on("click", ".edit-variable", (e) => {
e.preventDefault()
this.variableId = $(e.currentTarget).data("id")
this.handleGetVariable()
})
}
- handleGetVariable()
- {
+ handleGetVariable() {
const url = `/configuracion/variables/find/${this.variableId}`
let ajax = new Ajax(
- url,null,null,
+ url, null, null,
this.handleGetVariableSuccess.bind(this),
this.handleGetVariableError.bind(this)
)
ajax.get()
}
- handleGetVariableSuccess(data){
+ handleGetVariableSuccess(data) {
this.formEdit[0].reset()
this.modalEdit.toggle()
- this.nameInput = this.formEdit
- .find("#name")
+ this.nameInput = this.formEdit.find("#name")
this.nameInput.val(data.name)
- this.valueInput = this.formEdit
- .find("#value")
- this.valueInput.val(data.value)
- this.descriptionInput = this.formEdit
- .find("#description")
+ this.renderValueField(data.name, data.value)
+ this.descriptionInput = this.formEdit.find("#description")
this.descriptionInput.val(data.description)
-
}
- handleGetVariableError(err){}
- handleUpdateVariable()
- {
+ handleGetVariableError(err) { }
+ handleUpdateVariable() {
const url = `/configuracion/variables/edit/${this.variableId}`
const data = {
- value : this.valueInput.val(),
- description : this.descriptionInput.val(),
+ value: this.valueInput.val(),
+ description: this.descriptionInput.val(),
}
let ajax = new Ajax(
url,
@@ -94,26 +85,49 @@ class ConfigVariableDatatable
)
ajax.post()
}
- handleUpdateVariableSucess(data){
+ handleUpdateVariableSucess(data) {
this.modalEdit.toggle()
this.datatable.ajax.reload()
}
- handleUpdateVariableError(err){}
+ handleUpdateVariableError(err) { }
- handleDeleteVariable()
- {
+ handleDeleteVariable() {
const url = `/configuracion/variables/delete/${this.variableId}`
let ajax = new Ajax(
- url,null,null,
+ url, null, null,
this.handleDeleteVariableSucess.bind(this),
this.handleDeleteVariableError.bind(this)
)
ajax.post()
}
- handleDeleteVariableSucess(data){
+ handleDeleteVariableSucess(data) {
this.datatable.reload()
}
- handleDeleteVariableError(err){}
+ handleDeleteVariableError(err) { }
+
+ renderValueField(name, currentValue) {
+ const wrapper = this.formEdit.find("#value-wrapper");
+ let html = '';
+
+ if (name === 'cabezadas_disponibles') {
+ html = `
`;
+ } else if (name === 'cabezada_default') {
+ const options = window.CABEZADAS_OPCIONES || {};
+ html = `
`;
+ } else {
+ html = `
`;
+ }
+
+ wrapper.html(html);
+ this.valueInput = this.formEdit.find("#value"); // Actualiza referencia
+ }
+
+
}
export default ConfigVariableDatatable;
\ No newline at end of file
diff --git a/httpdocs/assets/js/safekat/pages/configuracion/variables.js b/httpdocs/assets/js/safekat/pages/configuracion/variables.js
index 177828f4..615c59d1 100644
--- a/httpdocs/assets/js/safekat/pages/configuracion/variables.js
+++ b/httpdocs/assets/js/safekat/pages/configuracion/variables.js
@@ -2,4 +2,4 @@ import ConfigVariableDatatable from "../../components/configVariableDatatable.js
const item = new ConfigVariableDatatable($("#tableConfigVariables"))
item.init()
-item.events()
\ No newline at end of file
+item.events()