diff --git a/ci4/app/Views/themes/vuexy/form/tarifas/acabado/viewTarifaAcabadoForm.php b/ci4/app/Views/themes/vuexy/form/tarifas/acabado/viewTarifaAcabadoForm.php
index cb6651ef..ced61c74 100644
--- a/ci4/app/Views/themes/vuexy/form/tarifas/acabado/viewTarifaAcabadoForm.php
+++ b/ci4/app/Views/themes/vuexy/form/tarifas/acabado/viewTarifaAcabadoForm.php
@@ -2,37 +2,36 @@
= $this->include("themes/_commonPartialsBs/select2bs5") ?>
= $this->include("themes/_commonPartialsBs/sweetalert") ?>
= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
-=$this->extend('themes/vuexy/main/defaultlayout') ?>
+= $this->extend('themes/vuexy/main/defaultlayout') ?>
= $this->section("content") ?>
-
-
-
-
-
-
-
-
-
-
- = view("themes/vuexy/components/forms/tarifa_maquinas",["id" => "tarifa_maquina_component","tarifaId" => $tarifaacabadoEntity->id ]) ?>
+
+
+
+
+
+
+
+
+ = view("themes/vuexy/components/forms/tarifa_maquinas", ["id" => "tarifa_maquina_component", "tarifaId" => $tarifaacabadoEntity->id]) ?>
+
-
-
-
+
+
+
-= $this->endSection() ?>
+ = $this->endSection() ?>
-= $this->section("additionalExternalJs") ?>
-
-= $this->endSection() ?>
+ = $this->section("additionalExternalJs") ?>
+
+ = $this->endSection() ?>
-= $this->section("additionalInlineJs") ?>
- const lastColNr = $('#tableOfTarifasacabado').find("tr:first th").length - 1;
- const url = window.location.href;
- const url_parts = url.split('/');
- let id = -1;
- if(url_parts[url_parts.length-2] == 'edit'){
+ = $this->section("additionalInlineJs") ?>
+ const lastColNr = $('#tableOfTarifasacabado').find("tr:first th").length - 1;
+ const url = window.location.href;
+ const url_parts = url.split('/');
+ let id = -1;
+ if(url_parts[url_parts.length-2] == 'edit'){
id = url_parts[url_parts.length-1];
- }
+ }
- const actionBtns = function(data) {
+ const actionBtns = function(data) {
return `
-
-
-
- `;
- };
+
+
+
+ `;
+ };
- var editor = new $.fn.dataTable.Editor( {
+ var editor = new $.fn.dataTable.Editor( {
ajax: {
- url: "= route_to('tarifaAcabadoLineasDTE') ?>",
- headers: {
- = csrf_token() ?? "token" ?> : = csrf_token() ?>v,
- },
+ url: "= route_to('tarifaAcabadoLineasDTE') ?>",
+ headers: {
+ = csrf_token() ?? "token" ?> : = csrf_token() ?>v,
+ },
+ },
+ table : "#tableOfTarifaacabadolineas",
+ idSrc: 'id',
+ fields: [
+ {
+ name: "proveedor_id",
+ type: "select",
+ }, {
+ name: "tirada_min"
+ }, {
+ name: "precio_max"
+ }, {
+ name: "tirada_max"
+ }, {
+ name: "precio_min"
+ },{
+ name: "margen"
+ }, {
+ "name": "tarifa_acabado_id",
+ "type": "hidden"
+ },{
+ name: "proveedor_nombre",
+ "type": "hidden"
+ },{
+ "name": "deleted_at",
+ "type": "hidden"
+ },{
+ "name": "is_deleted",
+ "type": "hidden"
},
- table : "#tableOfTarifaacabadolineas",
- idSrc: 'id',
- fields: [
- {
- name: "proveedor_id",
- type: "select",
- }, {
- name: "tirada_min"
- }, {
- name: "precio_max"
- }, {
- name: "tirada_max"
- }, {
- name: "precio_min"
- },{
- name: "margen"
- }, {
- "name": "tarifa_acabado_id",
- "type": "hidden"
- },{
- name: "proveedor_nombre",
- "type": "hidden"
- },{
- "name": "deleted_at",
- "type": "hidden"
- },{
- "name": "is_deleted",
- "type": "hidden"
- },
]
- } );
+ } );
- // Generación de la lista de proveedores (id, nombre) para encuadernación
- const suppliersList = ;
- editor.field( 'proveedor_id' ).update( suppliersList );
+ // Generación de la lista de proveedores (id, nombre) para encuadernación
+ const suppliersList = ;
+ editor.field( 'proveedor_id' ).update( suppliersList );
- editor.on( 'preSubmit', function ( e, d, type ) {
+ editor.on( 'preSubmit', function ( e, d, type ) {
if ( type === 'create'){
- d.data[0]['tarifa_acabado_id'] = id;
+ d.data[0]['tarifa_acabado_id'] = id;
}
else if(type === 'edit' ) {
- for (v in d.data){
- d.data[v]['tarifa_acabado_id'] = id;
- }
+ for (v in d.data){
+ d.data[v]['tarifa_acabado_id'] = id;
}
- });
-
-
- editor.on( 'postSubmit', function ( e, json, data, action ) {
-
- yeniden(json.= csrf_token() ?>);
- });
+ }
+ });
+
+
+ editor.on( 'postSubmit', function ( e, json, data, action ) {
+
+ yeniden(json.= csrf_token() ?>);
+ });
+
+ editor.on( 'submitSuccess', function ( e, json, data, action ) {
- editor.on( 'submitSuccess', function ( e, json, data, action ) {
-
theTable.clearPipeline();
theTable.draw();
- });
+ });
- function searchProviders(){
+ function searchProviders(){
var values = [];
$('#select_Proveedor').find(':selected').each(function () {
- values.push($(this).val());
+ values.push($(this).val());
});
theTable.column(0).search(values).draw();
- }
-
+ }
- // Setup - add a text input to each footer cell
- $('#tableOfTarifaacabadolineas thead tr').clone(true).appendTo('#tableOfTarifaacabadolineas thead');
- $('#tableOfTarifaacabadolineas thead tr:eq(1) th').each(function (i) {
+
+ // Setup - add a text input to each footer cell
+ $('#tableOfTarifaacabadolineas thead tr').clone(true).appendTo('#tableOfTarifaacabadolineas thead');
+ $('#tableOfTarifaacabadolineas thead tr:eq(1) th').each(function (i) {
if (!$(this).hasClass("noFilter")) {
- var title = $(this).text();
- title = title.replace(/ /g, "_").replace(/\./g, "_");
+ var title = $(this).text();
+ title = title.replace(/ /g, "_").replace(/\./g, "_");
- if(i==0){
+ if(i==0){
- // Agregar un selector en la primera columna
- $(this).html(`
`);
+ // Agregar un selector en la primera columna
+ $(this).html(`
`);
- // Agregar opciones al selector
- var selector = $('select', this);
- const suppliersList = ;
- //selector.append('
'); // Opción vacía
- for (j = 0; j < suppliersList.length; j++) {
- selector.append('
');
- };
-
- $('#select_' + title).select2({
- multiple: true,
- placeholder: ""
- });
+ // Agregar opciones al selector
+ var selector = $('select', this);
+ const suppliersList = ;
+ //selector.append('
'); // Opción vacía
+ for (j = 0; j < suppliersList.length; j++) {
+ selector.append('
');
+ };
+
+ $('#select_' + title).select2({
+ multiple: true,
+ placeholder: ""
+ });
- selector.bind('select2:select', searchProviders);
- selector.bind('select2:unselect', searchProviders);
+ selector.bind('select2:select', searchProviders);
+ selector.bind('select2:unselect', searchProviders);
+
+ $('#select_' + title).val("").trigger('change');
- $('#select_' + title).val("").trigger('change');
-
}
else{
-
-
- $(this).html(`
-
-
-
-
- `);
-
- $('input', this).on('change clear', function () {
- var minInputValue = parseFloat($(`#min_${title}`).val().replace(',','.')) || "";
- var maxInputValue = parseFloat($(`#max_${title}`).val().replace(',','.')) || "";
+ $(this).html(`
+
+
+
+
+ `);
-
- if (theTable.column(i).search() !== [minInputValue,maxInputValue]) {
- theTable
- .column(i)
- .search([minInputValue,maxInputValue])
- .draw();
- }
- });
+
+
+ $('input', this).on('change clear', function () {
+ var minInputValue = parseFloat($(`#min_${title}`).val().replace(',','.')) || "";
+ var maxInputValue = parseFloat($(`#max_${title}`).val().replace(',','.')) || "";
+
+
+ if (theTable.column(i).search() !== [minInputValue,maxInputValue]) {
+ theTable
+ .column(i)
+ .search([minInputValue,maxInputValue])
+ .draw();
}
- }
- else {
+ });
+ }
+ }
+ else {
$(this).html('
');
- }
- });
-
-
- var theTable = $('#tableOfTarifaacabadolineas').DataTable( {
- orderCellsTop: true,
- serverSide: true,
- processing: true,
- autoWidth: true,
- responsive: true,
- fixedHeader: true,
- lengthMenu: [ 5, 10, 25],
- order: [[ 0, "asc" ], [ 1, "asc" ]],
- pageLength: 10,
- lengthChange: true,
- paging: true,
- info: false,
- stateSave: false,
- dom: '<"mt-4"><"float-end"B><"float-start"l>
<"mt-4 mb-3"p>',
- ajax : $.fn.dataTable.pipeline( {
- url: '= route_to('tarifaAcabadoLineasDT') ?>',
- data: {
- id_tarifaacabado: id,
- },
- method: 'POST',
- headers: {'X-Requested-With': 'XMLHttpRequest'},
- async: true,
- }),
- columns: [
- { 'data': 'proveedor_id',
- render: function(data, type, row, meta) {
- var value = suppliersList.find(element => element.value === data);
- return value['label'];
- },
- },
- { 'data': 'tirada_min' },
- { 'data': 'precio_max' },
- { 'data': 'tirada_max' },
- { 'data': 'precio_min' },
- { 'data': 'margen' },
- {
- data: actionBtns,
- className: 'row-edit dt-center'
}
- ],
- columnDefs: [
- {
- orderable: false,
- searchable: false,
- targets: [lastColNr]
- },
-
- ],
- language: {
- url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
-
- },
- buttons: [ {
- className: 'btn btn-primary me-sm-3 me-1',
- extend: "createInline",
- editor: editor,
- formOptions: {
- submitTrigger: -1,
- submitHtml: ''
- }
- } ]
- } );
-
-
-
- // Activate an inline edit on click of a table cell
- $('#tableOfTarifaacabadolineas').on( 'click', 'tbody span.edit', function (e) {
- editor.inline(
- theTable.cells(this.parentNode.parentNode, '*').nodes(),
- {
- cancelHtml: '',
- cancelTrigger: 'span.cancel',
- submitHtml: '',
- submitTrigger: 'span.edit',
- submit: 'allIfChanged'
- }
- );
- } );
-
-
- // Delete row
- $(document).on('click', '.btn-delete', function(e) {
- $(".btn-remove").attr('data-id', $(this).attr('data-id'));
- });
-
- $(document).on('click', '.btn-remove', function(e) {
- const dataId = $(this).attr('data-id');
- const row = $(this).closest('tr');
- if ($.isNumeric(dataId)) {
- $.ajax({
- url: `/tarifas/acabados/lineas/delete/${dataId}`,
- method: 'GET',
- }).done((data, textStatus, jqXHR) => {
- $('#confirm2delete').modal('toggle');
- theTable.clearPipeline();
- theTable.row($(row)).invalidate().draw();
- popSuccessAlert(data.msg ?? jqXHR.statusText);
- }).fail((jqXHR, textStatus, errorThrown) => {
- popErrorAlert(jqXHR.responseJSON.messages.error)
- })
- }
- });
-
-
-= $this->endSection() ?>
-
-=$this->section('css') ?>
-
- ">
- ">
-=$this->endSection() ?>
+ });
-= $this->section('additionalExternalJs') ?>
-
-
-
-
-
-
-
-
-=$this->endSection() ?>
+ var theTable = $('#tableOfTarifaacabadolineas').DataTable( {
+ orderCellsTop: true,
+ serverSide: true,
+ processing: true,
+ autoWidth: true,
+ responsive: true,
+ fixedHeader: true,
+ lengthMenu: [ 5, 10, 25],
+ order: [[ 0, "asc" ], [ 1, "asc" ]],
+ pageLength: 10,
+ lengthChange: true,
+ paging: true,
+ info: false,
+ stateSave: false,
+ dom: '<"mt-4"><"float-end"B><"float-start"l>
+ <"mt-4 mb-3"p>',
+ ajax : $.fn.dataTable.pipeline( {
+ url: '= route_to('tarifaAcabadoLineasDT') ?>',
+ data: {
+ id_tarifaacabado: id,
+ },
+ method: 'POST',
+ headers: {'X-Requested-With': 'XMLHttpRequest'},
+ async: true,
+ }),
+ columns: [
+ { 'data': 'proveedor_id',
+ render: function(data, type, row, meta) {
+ var value = suppliersList.find(element => element.value === data);
+ return value['label'];
+ },
+ },
+ { 'data': 'tirada_min' },
+ { 'data': 'precio_max' },
+ { 'data': 'tirada_max' },
+ { 'data': 'precio_min' },
+ { 'data': 'margen' },
+ {
+ data: actionBtns,
+ className: 'row-edit dt-center'
+ }
+ ],
+ columnDefs: [
+ {
+ orderable: false,
+ searchable: false,
+ targets: [lastColNr]
+ },
+ ],
+ language: {
+ url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
+
+ },
+ buttons: [ {
+ className: 'btn btn-primary me-sm-3 me-1',
+ extend: "createInline",
+ editor: editor,
+ formOptions: {
+ submitTrigger: -1,
+ submitHtml: ''
+ }
+ } ]
+ } );
+
+
+
+ // Activate an inline edit on click of a table cell
+ $('#tableOfTarifaacabadolineas').on( 'click', 'tbody span.edit', function (e) {
+ editor.inline(
+ theTable.cells(this.parentNode.parentNode, '*').nodes(),
+ {
+ cancelHtml: '',
+ cancelTrigger: 'span.cancel',
+ submitHtml: '',
+ submitTrigger: 'span.edit',
+ submit: 'allIfChanged'
+ }
+ );
+ } );
+
+
+ // Delete row
+ $(document).on('click', '.btn-delete', function(e) {
+ $(".btn-remove").attr('data-id', $(this).attr('data-id'));
+ });
+
+ $(document).on('click', '.btn-remove', function(e) {
+ const dataId = $(this).attr('data-id');
+ const row = $(this).closest('tr');
+ if ($.isNumeric(dataId)) {
+ $.ajax({
+ url: `/tarifas/acabados/lineas/delete/${dataId}`,
+ method: 'GET',
+ }).done((data, textStatus, jqXHR) => {
+ $('#confirm2delete').modal('toggle');
+ theTable.clearPipeline();
+ theTable.row($(row)).invalidate().draw();
+ popSuccessAlert(data.msg ?? jqXHR.statusText);
+ }).fail((jqXHR, textStatus, errorThrown) => {
+ popErrorAlert(jqXHR.responseJSON.messages.error)
+ })
+ }
+ });
+
+
+ = $this->endSection() ?>
+
+ = $this->section('css') ?>
+
+ ">
+ ">
+ = $this->endSection() ?>
+
+
+ = $this->section('additionalExternalJs') ?>
+
+
+
+
+
+
+
+
+ = $this->endSection() ?>
\ No newline at end of file
diff --git a/ci4/app/Views/themes/vuexy/form/tarifas/encuadernacion/viewTarifaEncuadernacionForm.php b/ci4/app/Views/themes/vuexy/form/tarifas/encuadernacion/viewTarifaEncuadernacionForm.php
index 2d3eb35b..134679e5 100644
--- a/ci4/app/Views/themes/vuexy/form/tarifas/encuadernacion/viewTarifaEncuadernacionForm.php
+++ b/ci4/app/Views/themes/vuexy/form/tarifas/encuadernacion/viewTarifaEncuadernacionForm.php
@@ -7,42 +7,41 @@
= $this->section("content") ?>
-
-
-
+
-
-
+
+
-
+
@@ -52,27 +51,27 @@
| = lang('Tarifaencuadernacion.importeFijo') ?> |
|
-
+
-
+
-
+
-
+
= lang("TarifaEncuadernacionLineas.moduleExplanation") ?>
-
+
+
-
-
-
+
+
+
+
+
+
+ = view("themes/vuexy/components/forms/tarifa_maquinas", ["id" => "tarifa_maquina_component", "tarifaId" => $tarifaEncuadernacionEntity->id]) ?>
+
+
+
+
+
@@ -119,25 +131,14 @@
-
+
-
-
-
-
-
-
- = view("themes/vuexy/components/forms/tarifa_maquinas",["id" => "tarifa_maquina_component","tarifaId" => $tarifaEncuadernacionEntity->id ]) ?>
-
-
-
-
+
+
+
+
= view("themes/_commonPartialsBs/_modalConfirmDialog") ?>
@@ -151,772 +152,774 @@
= $this->section("additionalInlineJs") ?>
- const url = window.location.href;
- const url_parts = url.split('/');
- var id = -1;
- if(url_parts[url_parts.length-2] == 'edit'){
- id = url_parts[url_parts.length-1];
- }
- else{
- id = -1;
- }
+const url = window.location.href;
+const url_parts = url.split('/');
+var id = -1;
+if(url_parts[url_parts.length-2] == 'edit'){
+id = url_parts[url_parts.length-1];
+}
+else{
+id = -1;
+}
-
+
const actionBtns = function(data) {
- return `
-
-
-
- `;
+ return `
+
+
+
+ `;
};
// Delete row
$(document).on('click', '.btn-delete', function(e) {
- $(".btn-remove").attr('data-id', $(this).attr('data-id'));
- if($(this).closest('table').attr('id').includes('tiradas')){
- $(".btn-remove").attr('table', "tiradas");
- }
- else if($(this).closest('table').attr('id').includes('lineas')){
- $(".btn-remove").attr('table', "lineas");
- }
- else{
- $(".btn-remove").attr('table', );
- }
+ $(".btn-remove").attr('data-id', $(this).attr('data-id'));
+ if($(this).closest('table').attr('id').includes('tiradas')){
+ $(".btn-remove").attr('table', "tiradas");
+ }
+ else if($(this).closest('table').attr('id').includes('lineas')){
+ $(".btn-remove").attr('table', "lineas");
+ }
+ else{
+ $(".btn-remove").attr('table', );
+ }
});
var selected_tirada_id = -1;
-
- $(document).on('click', '.btn-remove', function(e) {
- const dataId = $(this).attr('data-id');
- const row = $(this).closest('tr');
- if ($.isNumeric(dataId)) {
- if($(this).attr('table').includes('tiradas')){
- remove_tiradas(dataId, row);
- }
- else if ($(this).attr('table').includes('lineasHoras')){
- remove_lineas_horas(dataId, row);
- }
- else{
- remove_lineas(dataId, row);
- }
- }
+ $(document).on('click', '.btn-remove', function(e) {
+ const dataId = $(this).attr('data-id');
+ const row = $(this).closest('tr');
+ if ($.isNumeric(dataId)) {
+
+ if($(this).attr('table').includes('tiradas')){
+ remove_tiradas(dataId, row);
+ }
+ else if ($(this).attr('table').includes('lineasHoras')){
+ remove_lineas_horas(dataId, row);
+ }
+ else{
+ remove_lineas(dataId, row);
+ }
+ }
});
function check_por_horas(){
- if($('#por_horas').is(':checked')){
- $('#accordionEncuadernacionLineasHoras').css("visibility", "visible");
- $('#accordionEncuadernacionLineas').css("visibility", "collapse");
- }
- else{
- $('#accordionEncuadernacionLineasHoras').css("visibility", "collapse");
- $('#accordionEncuadernacionLineas').css("visibility", "visible");
- }
+ if($('#por_horas').is(':checked')){
+ $('#accordionEncuadernacionLineasHoras').css("visibility", "visible");
+ $('#accordionEncuadernacionLineas').css("visibility", "collapse");
+ }
+ else{
+ $('#accordionEncuadernacionLineasHoras').css("visibility", "collapse");
+ $('#accordionEncuadernacionLineas').css("visibility", "visible");
+ }
}
check_por_horas()
$("#por_horas").change(function() {
- asyncConfirmDialog('= lang('Tarifaencuadernacion.sureToChange') ?>',
- '= lang('Tarifaencuadernacion.sureToChangePorHorasText') ?>', yesCallback, noCallback);
+ asyncConfirmDialog('= lang('Tarifaencuadernacion.sureToChange') ?>',
+ '= lang('Tarifaencuadernacion.sureToChangePorHorasText') ?>', yesCallback, noCallback);
});
function yesCallback() {
- check_por_horas()
- if($('#por_horas').is(':checked')){
-
- theTable.clearPipeline();
- theTable.draw();
+ check_por_horas()
+ if($('#por_horas').is(':checked')){
- $.ajax({
- url: '= route_to('dataTableOfTarifaEncuadernacionLineas') ?>',
- data: {
- cleandatatable: 1,
- tarifa_encuadernacion_id: id,
- = csrf_token() ?? "token" ?>: = csrf_token() ?>v,
- },
- method: 'POST',
- headers: {'X-Requested-With': 'XMLHttpRequest'},
- success:function(response){
- token = response.= csrf_token() ?>;
- yeniden(token);
+ theTable.clearPipeline();
+ theTable.draw();
- theTable3.clearPipeline();
- theTable3.draw();
-
- theTable.clearPipeline();
- theTable.draw();
- }
- });
-
- }else{
+ $.ajax({
+ url: '= route_to('dataTableOfTarifaEncuadernacionLineas') ?>',
+ data: {
+ cleandatatable: 1,
+ tarifa_encuadernacion_id: id,
+ = csrf_token() ?? "token" ?>: = csrf_token() ?>v,
+ },
+ method: 'POST',
+ headers: {'X-Requested-With': 'XMLHttpRequest'},
+ success:function(response){
+ token = response.= csrf_token() ?>;
+ yeniden(token);
- theTable3.clearPipeline();
- theTable3.draw();
+ theTable3.clearPipeline();
+ theTable3.draw();
- $.ajax({
- url: '= route_to('dataTableOfTarifaEncuadernacionLineasHoras') ?>',
- data: {
- cleandatatable: 1,
- tarifa_encuadernacion_id: id,
- = csrf_token() ?? "token" ?>: = csrf_token() ?>v,
- },
- method: 'POST',
- headers: {'X-Requested-With': 'XMLHttpRequest'},
- success:function(response){
-
- token=response.= csrf_token() ?>;
- yeniden(token);
+ theTable.clearPipeline();
+ theTable.draw();
+ }
+ });
- theTable3.clearPipeline();
- theTable3.draw();
-
- theTable.clearPipeline();
- theTable.draw();
- }
- });
- }
+ }else{
+
+ theTable3.clearPipeline();
+ theTable3.draw();
+
+ $.ajax({
+ url: '= route_to('dataTableOfTarifaEncuadernacionLineasHoras') ?>',
+ data: {
+ cleandatatable: 1,
+ tarifa_encuadernacion_id: id,
+ = csrf_token() ?? "token" ?>: = csrf_token() ?>v,
+ },
+ method: 'POST',
+ headers: {'X-Requested-With': 'XMLHttpRequest'},
+ success:function(response){
+
+ token=response.= csrf_token() ?>;
+ yeniden(token);
+
+ theTable3.clearPipeline();
+ theTable3.draw();
+
+ theTable.clearPipeline();
+ theTable.draw();
+ }
+ });
+ }
}
function noCallback() {
- // Toggle behaviour
- $('#por_horas').prop("checked", !$('#por_horas').prop("checked"));
+ // Toggle behaviour
+ $('#por_horas').prop("checked", !$('#por_horas').prop("checked"));
}
-
+
= $this->endSection() ?>
-
+
-
-
-
-= $this->section("additionalInlineJs") ?>
+
+
+
+ = $this->section("additionalInlineJs") ?>
const lastColNr3 = $('#tableOfTarifaencuadernacionlineasHoras').find("tr:first th").length - 1;
var editor3 = new $.fn.dataTable.Editor( {
- ajax: {
- url: "= route_to('editorOfTarifaEncuadernacionLineasHoras') ?>",
- headers: {
- = csrf_token() ?? "token" ?> : = csrf_token() ?>v,
- },
- },
- table : "#tableOfTarifaencuadernacionlineasHoras",
- idSrc: 'id',
- fields: [
- {name: "id",
- "type": "readonly"},
- {
- name: "tiempo_min"
- }, {
- name: "tiempo_max"
- }, {
- name: "precio_hora"
- }, {
- name: "total_min"
- }, {
- name: "margen"
- }, {
- "name": "tirada_encuadernacion_id",
- "type": "hidden"
- },{
- "name": "deleted_at",
- "type": "hidden"
- },{
- "name": "is_deleted",
- "type": "hidden"
- },
- ]
+ ajax: {
+ url: "= route_to('editorOfTarifaEncuadernacionLineasHoras') ?>",
+ headers: {
+ = csrf_token() ?? "token" ?> : = csrf_token() ?>v,
+ },
+ },
+ table : "#tableOfTarifaencuadernacionlineasHoras",
+ idSrc: 'id',
+ fields: [
+ {name: "id",
+ "type": "readonly"},
+ {
+ name: "tiempo_min"
+ }, {
+ name: "tiempo_max"
+ }, {
+ name: "precio_hora"
+ }, {
+ name: "total_min"
+ }, {
+ name: "margen"
+ }, {
+ "name": "tirada_encuadernacion_id",
+ "type": "hidden"
+ },{
+ "name": "deleted_at",
+ "type": "hidden"
+ },{
+ "name": "is_deleted",
+ "type": "hidden"
+ },
+ ]
} );
editor3.on( 'preSubmit', function ( e, d, type ) {
- if ( type === 'create'){
- d.data[0]['tirada_encuadernacion_id'] = selected_tirada_id;
- }
- else if(type === 'edit' ) {
- for (v in d.data){
- d.data[v]['tirada_encuadernacion_id'] = selected_tirada_id;
- }
- }
+ if ( type === 'create'){
+ d.data[0]['tirada_encuadernacion_id'] = selected_tirada_id;
+ }
+ else if(type === 'edit' ) {
+ for (v in d.data){
+ d.data[v]['tirada_encuadernacion_id'] = selected_tirada_id;
+ }
+ }
});
-
-
+
+
editor3.on( 'postSubmit', function ( e, json, data, action ) {
-
- yeniden(json.= csrf_token() ?>);
+
+ yeniden(json.= csrf_token() ?>);
});
editor3.on( 'submitSuccess', function ( e, json, data, action ) {
-
- theTable3.clearPipeline();
- theTable3.draw();
+
+ theTable3.clearPipeline();
+ theTable3.draw();
});
var theTable3 = $('#tableOfTarifaencuadernacionlineasHoras').DataTable( {
- draw:3,
- serverSide: true,
- processing: true,
- autoWidth: true,
- responsive: true,
- lengthMenu: [ 5, 10, 25],
- order: [[ 0, "asc" ], [ 1, "asc" ]],
- pageLength: 10,
- lengthChange: true,
- searching: false,
- paging: true,
- info: false,
- dom: '<"mt-4"><"float-end"B><"float-start"l>
<"mt-4 mb-3"p>',
- ajax : $.fn.dataTable.pipeline( {
- url: '= route_to('dataTableOfTarifaEncuadernacionLineasHoras') ?>',
- data: function ( d ) {
- d.tirada_id = selected_tirada_id;
- },
- method: 'POST',
- headers: {'X-Requested-With': 'XMLHttpRequest'},
- async: true,
- }),
- columns: [
- { 'data': 'id' },
- { 'data': 'tiempo_min' },
- { 'data': 'tiempo_max' },
- { 'data': 'precio_hora' },
- { 'data': 'total_min' },
- { 'data': 'margen' },
- {
- data: actionBtns,
- className: 'row-edit dt-center'
- }
- ],
- columnDefs: [
- {
- orderable: false,
- searchable: false,
- targets: [lastColNr3]
- },
- {"orderData": [ 0, 1 ], "targets": 0 },
+ draw:3,
+ serverSide: true,
+ processing: true,
+ autoWidth: true,
+ responsive: true,
+ lengthMenu: [ 5, 10, 25],
+ order: [[ 0, "asc" ], [ 1, "asc" ]],
+ pageLength: 10,
+ lengthChange: true,
+ searching: false,
+ paging: true,
+ info: false,
+ dom: '<"mt-4"><"float-end"B><"float-start"l>
+ <"mt-4 mb-3"p>',
+ ajax : $.fn.dataTable.pipeline( {
+ url: '= route_to('dataTableOfTarifaEncuadernacionLineasHoras') ?>',
+ data: function ( d ) {
+ d.tirada_id = selected_tirada_id;
+ },
+ method: 'POST',
+ headers: {'X-Requested-With': 'XMLHttpRequest'},
+ async: true,
+ }),
+ columns: [
+ { 'data': 'id' },
+ { 'data': 'tiempo_min' },
+ { 'data': 'tiempo_max' },
+ { 'data': 'precio_hora' },
+ { 'data': 'total_min' },
+ { 'data': 'margen' },
+ {
+ data: actionBtns,
+ className: 'row-edit dt-center'
+ }
+ ],
+ columnDefs: [
+ {
+ orderable: false,
+ searchable: false,
+ targets: [lastColNr3]
+ },
+ {"orderData": [ 0, 1 ], "targets": 0 },
- ],
- language: {
- url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
- },
- buttons: [
- {
- extend: 'collection',
- text: 'Exportar',
- buttons:[
- 'copy', 'csv', 'excel', 'print', {
+ ],
+ language: {
+ url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
+ },
+ buttons: [
+ {
+ extend: 'collection',
+ text: 'Exportar',
+ buttons:[
+ 'copy', 'csv', 'excel', 'print', {
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'A4'
- }
- ]
- },
- {
- className: 'btn btn-primary float-end me-sm-3 me-1',
- extend: "createInline",
- editor: editor3,
- formOptions: {
- submitTrigger: -1,
- submitHtml: ''
-
- },
- action: function ( e, dt, node, config ) {
- if(selected_tirada_id == -1){
+ }
+ ]
+ },
+ {
+ className: 'btn btn-primary float-end me-sm-3 me-1',
+ extend: "createInline",
+ editor: editor3,
+ formOptions: {
+ submitTrigger: -1,
+ submitHtml: ''
+
+ },
+ action: function ( e, dt, node, config ) {
+ if(selected_tirada_id == -1){
popErrorAlert("= lang('TarifaEncuadernacionLineas.validation.error_seleccion_tiradas') ?>");
- }
- else{
+ }
+ else{
formOptions= {
- submitTrigger: -1,
- submitHtml: ''
-
+ submitTrigger: -1,
+ submitHtml: ''
+
};
- editor3.inlineCreate(config.position, formOptions);
- }
- },
- }
- ]
- } );
-
-
- // Activate an inline edit on click of a table cell
- $('#tableOfTarifaencuadernacionlineasHoras').on( 'click', 'tbody span.edit', function (e) {
- editor3.inline(
- theTable3.cells(this.parentNode.parentNode, '*').nodes(),
- {
- cancelHtml: '',
- cancelTrigger: 'span.cancel',
- submitHtml: '',
- submitTrigger: 'span.edit',
- submit: 'allIfChanged'
- }
- );
- } );
-
- // Delete row
- function remove_lineas_horas(dataId, row){
-
- $.ajax({
- url: `/tarifas/tarifaencuadernacionlineashoras/delete/${dataId}`,
- method: 'GET',
- }).done((data, textStatus, jqXHR) => {
- $('#confirm2delete').modal('toggle');
- theTable3.clearPipeline();
- theTable3.row($(row)).invalidate().draw();
- popSuccessAlert(data.msg ?? jqXHR.statusText);
- }).fail((jqXHR, textStatus, errorThrown) => {
- popErrorAlert(jqXHR.responseJSON.messages.error)
- });
-
- }
-
-
-
-= $this->endSection() ?>
+ editor3.inlineCreate(config.position, formOptions);
+ }
+ },
+ }
+ ]
+ } );
-
-
-
-= $this->section("additionalInlineJs") ?>
+ // Activate an inline edit on click of a table cell
+ $('#tableOfTarifaencuadernacionlineasHoras').on( 'click', 'tbody span.edit', function (e) {
+ editor3.inline(
+ theTable3.cells(this.parentNode.parentNode, '*').nodes(),
+ {
+ cancelHtml: '',
+ cancelTrigger: 'span.cancel',
+ submitHtml: '',
+ submitTrigger: 'span.edit',
+ submit: 'allIfChanged'
+ }
+ );
+ } );
- const lastColNr = $('#tableOfTarifaencuadernacionlineas').find("tr:first th").length - 1;
+ // Delete row
+ function remove_lineas_horas(dataId, row){
- var editor = new $.fn.dataTable.Editor( {
- ajax: {
- url: "= route_to('editorOfTarifaEncuadernacionLineas') ?>",
- headers: {
- = csrf_token() ?? "token" ?> : = csrf_token() ?>v,
- },
- },
- table : "#tableOfTarifaencuadernacionlineas",
- idSrc: 'id',
- fields: [
- {name: "id",
- "type": "readonly"},
- {
- name: "dimensiones_id",
- "type": "select"
- },
- {
- name: "paginas_libro_min"
- }, {
- name: "precio_min"
- }, {
- name: "paginas_libro_max"
- }, {
- name: "precio_max"
- }, {
- name: "total_min"
- }, {
- name: "margen"
- }, {
- "name": "tirada_encuadernacion_id",
- "type": "hidden"
- },{
- "name": "deleted_at",
- "type": "hidden"
- },{
- "name": "is_deleted",
- "type": "hidden"
- },
- ]
- } );
+ $.ajax({
+ url: `/tarifas/tarifaencuadernacionlineashoras/delete/${dataId}`,
+ method: 'GET',
+ }).done((data, textStatus, jqXHR) => {
+ $('#confirm2delete').modal('toggle');
+ theTable3.clearPipeline();
+ theTable3.row($(row)).invalidate().draw();
+ popSuccessAlert(data.msg ?? jqXHR.statusText);
+ }).fail((jqXHR, textStatus, errorThrown) => {
+ popErrorAlert(jqXHR.responseJSON.messages.error)
+ });
- // Generación de la lista de proveedores (id, nombre) para encuadernación
- const dimensionesList = ;
- editor.field( 'dimensiones_id' ).update( dimensionesList );
-
- editor.on( 'preSubmit', function ( e, d, type ) {
- if ( type === 'create'){
- d.data[0]['tirada_encuadernacion_id'] = selected_tirada_id;
- }
- else if(type === 'edit' ) {
- for (v in d.data){
- d.data[v]['tirada_encuadernacion_id'] = selected_tirada_id;
- }
- }
- });
-
-
- editor.on( 'postSubmit', function ( e, json, data, action ) {
-
- yeniden(json.= csrf_token() ?>);
- });
+ }
- editor.on( 'submitSuccess', function ( e, json, data, action ) {
-
- theTable.clearPipeline();
- theTable.draw();
- });
+
+ = $this->endSection() ?>
- var theTable = $('#tableOfTarifaencuadernacionlineas').DataTable( {
- draw:2,
- serverSide: true,
- processing: true,
- autoWidth: true,
- responsive: true,
- lengthMenu: [ 5, 10, 25],
- order: [[ 0, "asc" ], [ 1, "asc" ]],
- pageLength: 10,
- lengthChange: true,
- searching: false,
- paging: true,
- info: false,
- dom: '<"mt-4"><"float-end"B><"float-start"l><"mt-4 mb-3"p>',
- ajax : $.fn.dataTable.pipeline( {
- url: '= route_to('dataTableOfTarifaEncuadernacionLineas') ?>',
- data: function ( d ) {
- d.tirada_id = selected_tirada_id;
- },
- method: 'POST',
- headers: {'X-Requested-With': 'XMLHttpRequest'},
- async: true,
- }),
- columns: [
- { 'data': 'id' },
- { 'data': 'dimensiones_id',
- render: function(data, type, row, meta) {
- var value = dimensionesList.find(element => element.value === data);
- return value['label'];
- },
- },
- { 'data': 'paginas_libro_min' },
- { 'data': 'precio_max' },
- { 'data': 'paginas_libro_max' },
- { 'data': 'precio_min' },
- { 'data': 'total_min' },
- { 'data': 'margen' },
- {
- data: actionBtns,
- className: 'row-edit dt-center'
- }
- ],
- columnDefs: [
- {
- orderable: false,
- searchable: false,
- targets: [lastColNr]
- },
- {"orderData": [ 0, 1 ], "targets": 0 },
+
+
+
+ = $this->section("additionalInlineJs") ?>
- ],
- language: {
- url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
- },
- buttons: [
- {
- extend: 'collection',
- text: 'Exportar',
- buttons:[
- 'copy', 'csv', 'excel', 'print', {
- extend: 'pdfHtml5',
- orientation: 'landscape',
- pageSize: 'A4'
- }
- ]
- },
- {
- className: 'btn btn-primary float-end me-sm-3 me-1',
- extend: "createInline",
- editor: editor,
- formOptions: {
- submitTrigger: -1,
- submitHtml: ''
-
- },
- action: function ( e, dt, node, config ) {
- if(selected_tirada_id == -1){
- popErrorAlert("= lang('TarifaEncuadernacionLineas.validation.error_seleccion_tiradas') ?>");
- }
- else{
- formOptions= {
- submitTrigger: -1,
- submitHtml: ''
-
- };
- editor.inlineCreate(config.position, formOptions);
- }
- },
- }
- ]
- } );
+ const lastColNr = $('#tableOfTarifaencuadernacionlineas').find("tr:first th").length - 1;
-
- // Activate an inline edit on click of a table cell
- $('#tableOfTarifaencuadernacionlineas').on( 'click', 'tbody span.edit', function (e) {
- editor.inline(
- theTable.cells(this.parentNode.parentNode, '*').nodes(),
- {
- cancelHtml: '',
- cancelTrigger: 'span.cancel',
- submitHtml: '',
- submitTrigger: 'span.edit',
- submit: 'allIfChanged'
- }
- );
- } );
+ var editor = new $.fn.dataTable.Editor( {
+ ajax: {
+ url: "= route_to('editorOfTarifaEncuadernacionLineas') ?>",
+ headers: {
+ = csrf_token() ?? "token" ?> : = csrf_token() ?>v,
+ },
+ },
+ table : "#tableOfTarifaencuadernacionlineas",
+ idSrc: 'id',
+ fields: [
+ {name: "id",
+ "type": "readonly"},
+ {
+ name: "dimensiones_id",
+ "type": "select"
+ },
+ {
+ name: "paginas_libro_min"
+ }, {
+ name: "precio_min"
+ }, {
+ name: "paginas_libro_max"
+ }, {
+ name: "precio_max"
+ }, {
+ name: "total_min"
+ }, {
+ name: "margen"
+ }, {
+ "name": "tirada_encuadernacion_id",
+ "type": "hidden"
+ },{
+ "name": "deleted_at",
+ "type": "hidden"
+ },{
+ "name": "is_deleted",
+ "type": "hidden"
+ },
+ ]
+ } );
- // Delete row
- function remove_lineas(dataId, row){
+ // Generación de la lista de proveedores (id, nombre) para encuadernación
+ const dimensionesList = ;
+ editor.field( 'dimensiones_id' ).update( dimensionesList );
- $.ajax({
- url: `/tarifas/tarifaencuadernacionlineas/delete/${dataId}`,
- method: 'GET',
- }).done((data, textStatus, jqXHR) => {
- $('#confirm2delete').modal('toggle');
- theTable.clearPipeline();
- theTable.row($(row)).invalidate().draw();
- popSuccessAlert(data.msg ?? jqXHR.statusText);
- }).fail((jqXHR, textStatus, errorThrown) => {
- popErrorAlert(jqXHR.responseJSON.messages.error)
- });
-
- }
-
-
-
-= $this->endSection() ?>
-
-
-
-
-= $this->section("additionalInlineJs") ?>
-
- // Definicion de la ultima columna de la tabla
- const lastColNr2 = $('#tableOfTarifaencuadernaciontiradas').find("tr:first th").length - 1;
-
-
- // Datatables Editor
- var editor2 = new $.fn.dataTable.Editor( {
- ajax: {
- url: "= route_to('editorOfTarifaEncuadernacionTiradas') ?>",
- headers: {
- = csrf_token() ?? "token" ?> : = csrf_token() ?>v,
- },
- },
- table : "#tableOfTarifaencuadernaciontiradas",
- idSrc: 'id',
- fields: [ {
- name: "proveedor_id",
- "type": "select"
- }, {
- name: "tirada_min"
- }, {
- name: "tirada_max"
- }, {
- name: "importe_fijo"
- }, {
- "name": "tarifa_encuadernacion_id",
- "type": "hidden"
- },{
- name: "proveedor",
- "type": "hidden"
- }, {
- "name": "deleted_at",
- "type": "hidden"
- },{
- "name": "is_deleted",
- "type": "hidden"
- },
- ]
- } );
+ editor.on( 'preSubmit', function ( e, d, type ) {
+ if ( type === 'create'){
+ d.data[0]['tirada_encuadernacion_id'] = selected_tirada_id;
+ }
+ else if(type === 'edit' ) {
+ for (v in d.data){
+ d.data[v]['tirada_encuadernacion_id'] = selected_tirada_id;
+ }
+ }
+ });
- // Generación de la lista de proveedores (id, nombre) para encuadernación
- const suppliersList = ;
- editor2.field( 'proveedor_id' ).update( suppliersList );
+ editor.on( 'postSubmit', function ( e, json, data, action ) {
+
+ yeniden(json.= csrf_token() ?>);
+ });
- editor2.on( 'preSubmit', function ( e, d, type ) {
- if ( type === 'create'){
- d.data[0]['tarifa_encuadernacion_id'] = id;
- }
- else if(type === 'edit' ) {
- for (v in d.data){
- d.data[v]['tarifa_encuadernacion_id'] = id;
- }
- }
- });
-
-
- editor2.on( 'postSubmit', function ( e, json, data, action ) {
-
- yeniden(json.= csrf_token() ?>);
- });
+ editor.on( 'submitSuccess', function ( e, json, data, action ) {
+
+ theTable.clearPipeline();
+ theTable.draw();
+ });
- editor2.on( 'submitSuccess', function ( e, json, data, action ) {
-
- theTable2.clearPipeline();
- theTable2.draw();
- });
+ var theTable = $('#tableOfTarifaencuadernacionlineas').DataTable( {
+ draw:2,
+ serverSide: true,
+ processing: true,
+ autoWidth: true,
+ responsive: true,
+ lengthMenu: [ 5, 10, 25],
+ order: [[ 0, "asc" ], [ 1, "asc" ]],
+ pageLength: 10,
+ lengthChange: true,
+ searching: false,
+ paging: true,
+ info: false,
+ dom: '<"mt-4"><"float-end"B><"float-start"l>
+ <"mt-4 mb-3"p>',
+ ajax : $.fn.dataTable.pipeline( {
+ url: '= route_to('dataTableOfTarifaEncuadernacionLineas') ?>',
+ data: function ( d ) {
+ d.tirada_id = selected_tirada_id;
+ },
+ method: 'POST',
+ headers: {'X-Requested-With': 'XMLHttpRequest'},
+ async: true,
+ }),
+ columns: [
+ { 'data': 'id' },
+ { 'data': 'dimensiones_id',
+ render: function(data, type, row, meta) {
+ var value = dimensionesList.find(element => element.value === data);
+ return value['label'];
+ },
+ },
+ { 'data': 'paginas_libro_min' },
+ { 'data': 'precio_max' },
+ { 'data': 'paginas_libro_max' },
+ { 'data': 'precio_min' },
+ { 'data': 'total_min' },
+ { 'data': 'margen' },
+ {
+ data: actionBtns,
+ className: 'row-edit dt-center'
+ }
+ ],
+ columnDefs: [
+ {
+ orderable: false,
+ searchable: false,
+ targets: [lastColNr]
+ },
+ {"orderData": [ 0, 1 ], "targets": 0 },
+
+ ],
+ language: {
+ url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
+ },
+ buttons: [
+ {
+ extend: 'collection',
+ text: 'Exportar',
+ buttons:[
+ 'copy', 'csv', 'excel', 'print', {
+ extend: 'pdfHtml5',
+ orientation: 'landscape',
+ pageSize: 'A4'
+ }
+ ]
+ },
+ {
+ className: 'btn btn-primary float-end me-sm-3 me-1',
+ extend: "createInline",
+ editor: editor,
+ formOptions: {
+ submitTrigger: -1,
+ submitHtml: ''
+
+ },
+ action: function ( e, dt, node, config ) {
+ if(selected_tirada_id == -1){
+ popErrorAlert("= lang('TarifaEncuadernacionLineas.validation.error_seleccion_tiradas') ?>");
+ }
+ else{
+ formOptions= {
+ submitTrigger: -1,
+ submitHtml: ''
+
+ };
+ editor.inlineCreate(config.position, formOptions);
+ }
+ },
+ }
+ ]
+ } );
- // Tabla de tiradas
- var theTable2 = $('#tableOfTarifaencuadernaciontiradas').DataTable( {
- draw:1,
- serverSide: true,
- processing: true,
- autoWidth: true,
- responsive: true,
- lengthMenu: [ 5, 10, 25],
- order: [ 0, "asc" ],
- pageLength: 10,
- lengthChange: true,
- searching: false,
- paging: true,
- select: true,
- info: false,
- dom: '<"mt-4"><"float-end"B><"float-start"l><"mt-4 mb-3"p>',
- ajax : $.fn.dataTable.pipeline( {
- url: '= route_to('dataTableOfTarifaEncuadernacionTiradas') ?>',
- data: {
- id_tarifaencuadernacion: id,
- },
- method: 'POST',
- headers: {'X-Requested-With': 'XMLHttpRequest'},
- async: true,
- }),
- columns: [
- { 'data': 'proveedor_id',
- render: function(data, type, row, meta) {
- var value = suppliersList.find(element => element.value === data);
- return value['label'];
- },
- },
- { 'data': 'tirada_min' },
- { 'data': 'tirada_max' },
- { 'data': 'importe_fijo' },
- {
- data: actionBtns,
- className: 'row-edit dt-center'
- }
- ],
- columnDefs: [
- {
- orderable: false,
- searchable: false,
- targets: [lastColNr2]
- },
+ // Activate an inline edit on click of a table cell
+ $('#tableOfTarifaencuadernacionlineas').on( 'click', 'tbody span.edit', function (e) {
+ editor.inline(
+ theTable.cells(this.parentNode.parentNode, '*').nodes(),
+ {
+ cancelHtml: '',
+ cancelTrigger: 'span.cancel',
+ submitHtml: '',
+ submitTrigger: 'span.edit',
+ submit: 'allIfChanged'
+ }
+ );
+ } );
- ],
- language: {
- url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
- },
- buttons: [
- {
- extend: 'collection',
- text: 'Exportar',
- buttons:[
- 'copy', 'csv', 'excel', 'print', {
- extend: 'pdfHtml5',
- orientation: 'landscape',
- pageSize: 'A4'
- }
- ]
- },
- {
- className: 'btn btn-primary float-end me-sm-3 me-1',
- extend: "createInline",
- editor: editor2,
- formOptions: {
- submitTrigger: -1,
- submitHtml: ''
- }
- } ]
- } );
+ // Delete row
+ function remove_lineas(dataId, row){
+
+ $.ajax({
+ url: `/tarifas/tarifaencuadernacionlineas/delete/${dataId}`,
+ method: 'GET',
+ }).done((data, textStatus, jqXHR) => {
+ $('#confirm2delete').modal('toggle');
+ theTable.clearPipeline();
+ theTable.row($(row)).invalidate().draw();
+ popSuccessAlert(data.msg ?? jqXHR.statusText);
+ }).fail((jqXHR, textStatus, errorThrown) => {
+ popErrorAlert(jqXHR.responseJSON.messages.error)
+ });
+
+ }
- // Obtener la id de la fila seleccionada o ponerla a -1 cuando no haya ninguna seleccionada
- var selected_tirada_id = -1;
- theTable2.on( 'select', function ( e, dt, type, indexes ) {
- if ( type === 'row' ) {
-
- selected_tirada_id = parseInt(theTable2.rows( indexes ).data().pluck( 'id' )[0]);
- if($('#por_horas').is(':checked')){
- theTable3.clearPipeline();
- theTable3.draw();
- }
- else{
- theTable.clearPipeline();
- theTable.draw();
- }
- }
- } );
- theTable2.on( 'deselect', function ( e, dt, type, indexes ) {
- if ( theTable2.rows( '.selected' ).count() == 0 ) {
- selected_tirada_id = -1;
- if($('#por_horas').is(':checked')){
- theTable3.clearPipeline();
- theTable3.draw();
- }
- else{
- theTable.clearPipeline();
- theTable.draw();
- }
- }
- } );
+ = $this->endSection() ?>
-
- // Activate an inline edit on click of a table cell
- $('#tableOfTarifaencuadernaciontiradas').on( 'click', 'tbody span.edit', function (e) {
- editor2.inline(
- theTable2.cells(this.parentNode.parentNode, '*').nodes(),
- {
- cancelHtml: '',
- cancelTrigger: 'span.cancel',
- submitHtml: '',
- submitTrigger: 'span.edit',
- submit: 'allIfChanged'
- }
- );
- } );
+
+
+
+ = $this->section("additionalInlineJs") ?>
-
- // Delete row
- function remove_tiradas(dataId, row){
-
- $.ajax({
- url: `/tarifas/tarifaencuadernaciontiradas/delete/${dataId}`,
- method: 'GET',
- }).done((data, textStatus, jqXHR) => {
- $('#confirm2delete').modal('toggle');
- theTable2.clearPipeline();
- theTable2.row($(row)).invalidate().draw();
- theTable.clearPipeline();
- theTable.draw();
- popSuccessAlert(data.msg ?? jqXHR.statusText);
- }).fail((jqXHR, textStatus, errorThrown) => {
- popErrorAlert(jqXHR.statusText)
- });
- }
-
-= $this->endSection() ?>
-
-
-
-=$this->section('css') ?>
-
- ">
-=$this->endSection() ?>
+ // Definicion de la ultima columna de la tabla
+ const lastColNr2 = $('#tableOfTarifaencuadernaciontiradas').find("tr:first th").length - 1;
-= $this->section('additionalExternalJs') ?>
-
-
-
-
-
-
-
-
-
-=$this->endSection() ?>
+ // Datatables Editor
+ var editor2 = new $.fn.dataTable.Editor( {
+ ajax: {
+ url: "= route_to('editorOfTarifaEncuadernacionTiradas') ?>",
+ headers: {
+ = csrf_token() ?? "token" ?> : = csrf_token() ?>v,
+ },
+ },
+ table : "#tableOfTarifaencuadernaciontiradas",
+ idSrc: 'id',
+ fields: [ {
+ name: "proveedor_id",
+ "type": "select"
+ }, {
+ name: "tirada_min"
+ }, {
+ name: "tirada_max"
+ }, {
+ name: "importe_fijo"
+ }, {
+ "name": "tarifa_encuadernacion_id",
+ "type": "hidden"
+ },{
+ name: "proveedor",
+ "type": "hidden"
+ }, {
+ "name": "deleted_at",
+ "type": "hidden"
+ },{
+ "name": "is_deleted",
+ "type": "hidden"
+ },
+ ]
+ } );
+
+ // Generación de la lista de proveedores (id, nombre) para encuadernación
+ const suppliersList = ;
+ editor2.field( 'proveedor_id' ).update( suppliersList );
+
+
+ editor2.on( 'preSubmit', function ( e, d, type ) {
+ if ( type === 'create'){
+ d.data[0]['tarifa_encuadernacion_id'] = id;
+ }
+ else if(type === 'edit' ) {
+ for (v in d.data){
+ d.data[v]['tarifa_encuadernacion_id'] = id;
+ }
+ }
+ });
+
+
+ editor2.on( 'postSubmit', function ( e, json, data, action ) {
+
+ yeniden(json.= csrf_token() ?>);
+ });
+
+
+ editor2.on( 'submitSuccess', function ( e, json, data, action ) {
+
+ theTable2.clearPipeline();
+ theTable2.draw();
+ });
+
+
+ // Tabla de tiradas
+ var theTable2 = $('#tableOfTarifaencuadernaciontiradas').DataTable( {
+ draw:1,
+ serverSide: true,
+ processing: true,
+ autoWidth: true,
+ responsive: true,
+ lengthMenu: [ 5, 10, 25],
+ order: [ 0, "asc" ],
+ pageLength: 10,
+ lengthChange: true,
+ searching: false,
+ paging: true,
+ select: true,
+ info: false,
+ dom: '<"mt-4"><"float-end"B><"float-start"l>
+ <"mt-4 mb-3"p>',
+ ajax : $.fn.dataTable.pipeline( {
+ url: '= route_to('dataTableOfTarifaEncuadernacionTiradas') ?>',
+ data: {
+ id_tarifaencuadernacion: id,
+ },
+ method: 'POST',
+ headers: {'X-Requested-With': 'XMLHttpRequest'},
+ async: true,
+ }),
+ columns: [
+ { 'data': 'proveedor_id',
+ render: function(data, type, row, meta) {
+ var value = suppliersList.find(element => element.value === data);
+ return value['label'];
+ },
+ },
+ { 'data': 'tirada_min' },
+ { 'data': 'tirada_max' },
+ { 'data': 'importe_fijo' },
+ {
+ data: actionBtns,
+ className: 'row-edit dt-center'
+ }
+ ],
+ columnDefs: [
+ {
+ orderable: false,
+ searchable: false,
+ targets: [lastColNr2]
+ },
+
+ ],
+ language: {
+ url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
+ },
+ buttons: [
+ {
+ extend: 'collection',
+ text: 'Exportar',
+ buttons:[
+ 'copy', 'csv', 'excel', 'print', {
+ extend: 'pdfHtml5',
+ orientation: 'landscape',
+ pageSize: 'A4'
+ }
+ ]
+ },
+ {
+ className: 'btn btn-primary float-end me-sm-3 me-1',
+ extend: "createInline",
+ editor: editor2,
+ formOptions: {
+ submitTrigger: -1,
+ submitHtml: ''
+ }
+ } ]
+ } );
+
+
+ // Obtener la id de la fila seleccionada o ponerla a -1 cuando no haya ninguna seleccionada
+ var selected_tirada_id = -1;
+ theTable2.on( 'select', function ( e, dt, type, indexes ) {
+ if ( type === 'row' ) {
+
+ selected_tirada_id = parseInt(theTable2.rows( indexes ).data().pluck( 'id' )[0]);
+ if($('#por_horas').is(':checked')){
+ theTable3.clearPipeline();
+ theTable3.draw();
+ }
+ else{
+ theTable.clearPipeline();
+ theTable.draw();
+ }
+ }
+ } );
+
+ theTable2.on( 'deselect', function ( e, dt, type, indexes ) {
+ if ( theTable2.rows( '.selected' ).count() == 0 ) {
+ selected_tirada_id = -1;
+ if($('#por_horas').is(':checked')){
+ theTable3.clearPipeline();
+ theTable3.draw();
+ }
+ else{
+ theTable.clearPipeline();
+ theTable.draw();
+ }
+ }
+ } );
+
+
+ // Activate an inline edit on click of a table cell
+ $('#tableOfTarifaencuadernaciontiradas').on( 'click', 'tbody span.edit', function (e) {
+ editor2.inline(
+ theTable2.cells(this.parentNode.parentNode, '*').nodes(),
+ {
+ cancelHtml: '',
+ cancelTrigger: 'span.cancel',
+ submitHtml: '',
+ submitTrigger: 'span.edit',
+ submit: 'allIfChanged'
+ }
+ );
+ } );
+
+
+ // Delete row
+ function remove_tiradas(dataId, row){
+
+ $.ajax({
+ url: `/tarifas/tarifaencuadernaciontiradas/delete/${dataId}`,
+ method: 'GET',
+ }).done((data, textStatus, jqXHR) => {
+ $('#confirm2delete').modal('toggle');
+ theTable2.clearPipeline();
+ theTable2.row($(row)).invalidate().draw();
+ theTable.clearPipeline();
+ theTable.draw();
+ popSuccessAlert(data.msg ?? jqXHR.statusText);
+ }).fail((jqXHR, textStatus, errorThrown) => {
+ popErrorAlert(jqXHR.statusText)
+ });
+ }
+
+ = $this->endSection() ?>
+
+
+
+ = $this->section('css') ?>
+
+ ">
+ = $this->endSection() ?>
+
+
+ = $this->section('additionalExternalJs') ?>
+
+
+
+
+
+
+
+
+
+ = $this->endSection() ?>
\ No newline at end of file
diff --git a/ci4/app/Views/themes/vuexy/form/tarifas/manipulado/viewTarifaManipuladoForm.php b/ci4/app/Views/themes/vuexy/form/tarifas/manipulado/viewTarifaManipuladoForm.php
index 87eef817..47bbb8ce 100644
--- a/ci4/app/Views/themes/vuexy/form/tarifas/manipulado/viewTarifaManipuladoForm.php
+++ b/ci4/app/Views/themes/vuexy/form/tarifas/manipulado/viewTarifaManipuladoForm.php
@@ -6,160 +6,163 @@
= $this->section("content") ?>
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
- = view("themes/vuexy/components/forms/tarifa_maquinas",["id" => "tarifa_maquina_component","tarifaId" => $tarifaManipuladoEntity?->id ]) ?>
-
+
+
+
+
+
+
+
+
+ | = lang('TarifaManipuladoLineas.tiradaMin') ?> |
+ = lang('TarifaManipuladoLineas.precioMax') ?> |
+ = lang('TarifaManipuladoLineas.tiradaMax') ?> |
+ = lang('TarifaManipuladoLineas.precioMin') ?> |
+ = lang('TarifaManipuladoLineas.margen') ?> |
+ |
+
+
+
+
+
+
-
-= $this->endSection() ?>
-= $this->section("additionalExternalJs") ?>
-
-= $this->endSection() ?>
+
+
+
+
+
+
+
+ = view("themes/vuexy/components/forms/tarifa_maquinas", ["id" => "tarifa_maquina_component", "tarifaId" => $tarifaManipuladoEntity?->id]) ?>
+
+
+
+
+
+
+
+ = $this->endSection() ?>
+ = $this->section("additionalExternalJs") ?>
+
+ = $this->endSection() ?>
-= $this->section("additionalInlineJs") ?>
+ = $this->section("additionalInlineJs") ?>
- const lastColNr = $('#tableOfTarifamanipuladolineas').find("tr:first th").length - 1;
- const url = window.location.href;
- const url_parts = url.split('/');
- let id = -1;
- if(url_parts[url_parts.length-2] == 'edit'){
+ const lastColNr = $('#tableOfTarifamanipuladolineas').find("tr:first th").length - 1;
+ const url = window.location.href;
+ const url_parts = url.split('/');
+ let id = -1;
+ if(url_parts[url_parts.length-2] == 'edit'){
id = url_parts[url_parts.length-1];
- }
+ }
- const actionBtns = function(data) {
+ const actionBtns = function(data) {
return `
-
-
-
- `;
- };
+
+
+
+ `;
+ };
- editor = new $.fn.dataTable.Editor( {
+ editor = new $.fn.dataTable.Editor( {
ajax: {
- url: "= route_to('editorOfTarifaManipuladoLineas') ?>",
- headers: {
- = csrf_token() ?? "token" ?> : = csrf_token() ?>v,
- },
+ url: "= route_to('editorOfTarifaManipuladoLineas') ?>",
+ headers: {
+ = csrf_token() ?? "token" ?> : = csrf_token() ?>v,
},
- table : "#tableOfTarifamanipuladolineas",
- idSrc: 'id',
+ },
+ table : "#tableOfTarifamanipuladolineas",
+ idSrc: 'id',
fields: [ {
- name: "tirada_min"
- }, {
- name: "precio_max"
- }, {
- name: "tirada_max"
- }, {
- name: "precio_min"
- }, {
- name: "margen"
- }, {
- "name": "tarifa_manipulado_id",
- "type": "hidden"
- },{
- "name": "deleted_at",
- "type": "hidden"
- },{
- "name": "is_deleted",
- "type": "hidden"
- },
+ name: "tirada_min"
+ }, {
+ name: "precio_max"
+ }, {
+ name: "tirada_max"
+ }, {
+ name: "precio_min"
+ }, {
+ name: "margen"
+ }, {
+ "name": "tarifa_manipulado_id",
+ "type": "hidden"
+ },{
+ "name": "deleted_at",
+ "type": "hidden"
+ },{
+ "name": "is_deleted",
+ "type": "hidden"
+ },
]
- } );
+ } );
- editor.on( 'preSubmit', function ( e, d, type ) {
+ editor.on( 'preSubmit', function ( e, d, type ) {
if ( type === 'create'){
- d.data[0]['tarifa_manipulado_id'] = id;
+ d.data[0]['tarifa_manipulado_id'] = id;
}
else if(type === 'edit' ) {
- for (v in d.data){
- d.data[v]['tarifa_manipulado_id'] = id;
- }
+ for (v in d.data){
+ d.data[v]['tarifa_manipulado_id'] = id;
}
- });
-
-
- editor.on( 'postSubmit', function ( e, json, data, action ) {
-
- yeniden(json.= csrf_token() ?>);
- });
+ }
+ });
+
+
+ editor.on( 'postSubmit', function ( e, json, data, action ) {
+
+ yeniden(json.= csrf_token() ?>);
+ });
+
+ editor.on( 'submitSuccess', function ( e, json, data, action ) {
- editor.on( 'submitSuccess', function ( e, json, data, action ) {
-
theTable.clearPipeline();
theTable.draw();
- });
+ });
- var theTable = $('#tableOfTarifamanipuladolineas').DataTable( {
- serverSide: true,
+ var theTable = $('#tableOfTarifamanipuladolineas').DataTable( {
+ serverSide: true,
processing: true,
autoWidth: true,
responsive: true,
@@ -167,149 +170,149 @@
order: [[ 0, "asc" ], [ 1, "asc" ]],
pageLength: 10,
lengthChange: true,
- searching: false,
- paging: true,
+ searching: false,
+ paging: true,
info: false,
- dom: '<"mt-4"><"float-end"B><"float-start"l>
<"mt-4 mb-3"p>',
- ajax : $.fn.dataTable.pipeline( {
- url: '= route_to('dataTableOfTarifaManipuladoLineas') ?>',
- data: {
- id_tarifamanipulado: id,
- },
- method: 'POST',
- headers: {'X-Requested-With': 'XMLHttpRequest'},
- async: true,
- }),
- columns: [
- { 'data': 'tirada_min' },
- { 'data': 'precio_max' },
- { 'data': 'tirada_max' },
- { 'data': 'precio_min' },
- { 'data': 'margen' },
- {
- data: actionBtns,
- className: 'row-edit dt-center'
- }
- ],
- columnDefs: [
- {
- orderable: false,
- searchable: false,
- targets: [lastColNr]
- },
- {"orderData": [ 0, 1 ], "targets": 0 },
+ dom: '<"mt-4"><"float-end"B><"float-start"l>
+ <"mt-4 mb-3"p>',
+ ajax : $.fn.dataTable.pipeline( {
+ url: '= route_to('dataTableOfTarifaManipuladoLineas') ?>',
+ data: {
+ id_tarifamanipulado: id,
+ },
+ method: 'POST',
+ headers: {'X-Requested-With': 'XMLHttpRequest'},
+ async: true,
+ }),
+ columns: [
+ { 'data': 'tirada_min' },
+ { 'data': 'precio_max' },
+ { 'data': 'tirada_max' },
+ { 'data': 'precio_min' },
+ { 'data': 'margen' },
+ {
+ data: actionBtns,
+ className: 'row-edit dt-center'
+ }
+ ],
+ columnDefs: [
+ {
+ orderable: false,
+ searchable: false,
+ targets: [lastColNr]
+ },
+ {"orderData": [ 0, 1 ], "targets": 0 },
- ],
- language: {
- url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
- },
- buttons: [
- {
- extend: 'collection',
- text: 'Exportar',
- buttons:[
- 'copy', 'csv', 'excel', 'print', {
- extend: 'pdfHtml5',
- orientation: 'landscape',
- pageSize: 'A4'
- }
- ]
- },
- {
- className: 'btn btn-primary float-end me-sm-3 me-1',
- extend: "createInline",
- editor: editor,
- formOptions: {
- submitTrigger: -1,
- submitHtml: ''
- }
- } ]
- } );
-
-
-
- // Activate an inline edit on click of a table cell
- $('#tableOfTarifamanipuladolineas').on( 'click', 'tbody span.edit', function (e) {
- editor.inline(
- theTable.cells(this.parentNode.parentNode, '*').nodes(),
- {
- cancelHtml: '',
- cancelTrigger: 'span.cancel',
- submitHtml: '',
- submitTrigger: 'span.edit',
- submit: 'allIfChanged'
- }
- );
- } );
-
-
- // Delete row
- $('#tableOfTarifamanipuladolineas').on( 'click', 'tbody span.remove', function (e) {
-
- Swal.fire({
- title: '= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Basic.global.sweet.line'))]) ?>',
- text: '= lang('Basic.global.sweet.sureToDeleteText') ?>',
- icon: 'warning',
- showCancelButton: true,
- confirmButtonColor: '#3085d6',
- confirmButtonText: '= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
- cancelButtonText: '= lang('Basic.global.Cancel') ?>',
- cancelButtonColor: '#d33'
- })
- .then((result) => {
- const dataId = $(this).data('id');
- const row = $(this).closest('tr');
- if (result.value) {
- editor
- .create( false )
- .edit( this.parentNode, false)
- .set( 'deleted_at', new Date().toISOString().slice(0, 19).replace('T', ' ') )
- .set( 'is_deleted', 1 )
- .submit();
-
- }
- });
- });
+ ],
+ language: {
+ url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
+ },
+ buttons: [
+ {
+ extend: 'collection',
+ text: 'Exportar',
+ buttons:[
+ 'copy', 'csv', 'excel', 'print', {
+ extend: 'pdfHtml5',
+ orientation: 'landscape',
+ pageSize: 'A4'
+ }
+ ]
+ },
+ {
+ className: 'btn btn-primary float-end me-sm-3 me-1',
+ extend: "createInline",
+ editor: editor,
+ formOptions: {
+ submitTrigger: -1,
+ submitHtml: ''
+ }
+ } ]
+ } );
- // Delete row
- $(document).on('click', '.btn-delete', function(e) {
- $(".btn-remove").attr('data-id', $(this).attr('data-id'));
- });
- $(document).on('click', '.btn-remove', function(e) {
- const dataId = $(this).attr('data-id');
- const row = $(this).closest('tr');
- if ($.isNumeric(dataId)) {
- $.ajax({
- url: `/tarifas/tarifamanipuladolineas/delete/${dataId}`,
- method: 'GET',
- }).done((data, textStatus, jqXHR) => {
- $('#confirm2delete').modal('toggle');
- theTable.clearPipeline();
- theTable.row($(row)).invalidate().draw();
- popSuccessAlert(data.msg ?? jqXHR.statusText);
- }).fail((jqXHR, textStatus, errorThrown) => {
- popErrorAlert(jqXHR.responseJSON.messages.error)
- })
- }
- });
-= $this->endSection() ?>
-
-=$this->section('css') ?>
-
- ">
-=$this->endSection() ?>
+ // Activate an inline edit on click of a table cell
+ $('#tableOfTarifamanipuladolineas').on( 'click', 'tbody span.edit', function (e) {
+ editor.inline(
+ theTable.cells(this.parentNode.parentNode, '*').nodes(),
+ {
+ cancelHtml: '',
+ cancelTrigger: 'span.cancel',
+ submitHtml: '',
+ submitTrigger: 'span.edit',
+ submit: 'allIfChanged'
+ }
+ );
+ } );
-= $this->section('additionalExternalJs') ?>
-
-
-
-
-
-
-
-
-=$this->endSection() ?>
+ // Delete row
+ $('#tableOfTarifamanipuladolineas').on( 'click', 'tbody span.remove', function (e) {
+ Swal.fire({
+ title: '= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Basic.global.sweet.line'))]) ?>',
+ text: '= lang('Basic.global.sweet.sureToDeleteText') ?>',
+ icon: 'warning',
+ showCancelButton: true,
+ confirmButtonColor: '#3085d6',
+ confirmButtonText: '= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
+ cancelButtonText: '= lang('Basic.global.Cancel') ?>',
+ cancelButtonColor: '#d33'
+ })
+ .then((result) => {
+ const dataId = $(this).data('id');
+ const row = $(this).closest('tr');
+ if (result.value) {
+ editor
+ .create( false )
+ .edit( this.parentNode, false)
+ .set( 'deleted_at', new Date().toISOString().slice(0, 19).replace('T', ' ') )
+ .set( 'is_deleted', 1 )
+ .submit();
+
+ }
+ });
+ });
+
+
+ // Delete row
+ $(document).on('click', '.btn-delete', function(e) {
+ $(".btn-remove").attr('data-id', $(this).attr('data-id'));
+ });
+
+ $(document).on('click', '.btn-remove', function(e) {
+ const dataId = $(this).attr('data-id');
+ const row = $(this).closest('tr');
+ if ($.isNumeric(dataId)) {
+ $.ajax({
+ url: `/tarifas/tarifamanipuladolineas/delete/${dataId}`,
+ method: 'GET',
+ }).done((data, textStatus, jqXHR) => {
+ $('#confirm2delete').modal('toggle');
+ theTable.clearPipeline();
+ theTable.row($(row)).invalidate().draw();
+ popSuccessAlert(data.msg ?? jqXHR.statusText);
+ }).fail((jqXHR, textStatus, errorThrown) => {
+ popErrorAlert(jqXHR.responseJSON.messages.error)
+ })
+ }
+ });
+ = $this->endSection() ?>
+
+ = $this->section('css') ?>
+
+ ">
+ = $this->endSection() ?>
+
+
+ = $this->section('additionalExternalJs') ?>
+
+
+
+
+
+
+
+
+ = $this->endSection() ?>
\ No newline at end of file
diff --git a/ci4/app/Views/themes/vuexy/form/tarifas/preimpresion/viewTarifapreimpresionForm.php b/ci4/app/Views/themes/vuexy/form/tarifas/preimpresion/viewTarifapreimpresionForm.php
index ff1ac32a..8eb895fa 100644
--- a/ci4/app/Views/themes/vuexy/form/tarifas/preimpresion/viewTarifapreimpresionForm.php
+++ b/ci4/app/Views/themes/vuexy/form/tarifas/preimpresion/viewTarifapreimpresionForm.php
@@ -26,6 +26,8 @@
+
+
- = view("themes/vuexy/components/forms/tarifa_maquinas", ["id" => "tarifa_maquina_component", "tarifaId" => $tarifapreimpresionEntity->id]) ?>
+ = view("themes/vuexy/components/forms/tarifa_maquinas", ["id" => "tarifa_maquina_component", "tarifaId" => $tarifapreimpresionEntity?->id]) ?>
+
+
= $this->endSection() ?>
= $this->section("additionalExternalJs") ?>
diff --git a/httpdocs/assets/js/safekat/pages/tarifas/tarifaMaquina.js b/httpdocs/assets/js/safekat/pages/tarifas/tarifaMaquina.js
index 6ebee9e7..0fafa984 100644
--- a/httpdocs/assets/js/safekat/pages/tarifas/tarifaMaquina.js
+++ b/httpdocs/assets/js/safekat/pages/tarifas/tarifaMaquina.js
@@ -73,7 +73,6 @@ class TarifaMaquina {
this.datatable.ajax.reload()
this.selectMaquinaTarea.reset()
this.selectTarifaMaquina.reset()
- console.log(response)
}
handleNewTarifaMaquinaError(error) { }