diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/admin/_comentariosItems.php b/ci4/app/Views/themes/vuexy/form/presupuestos/admin/_comentariosItems.php
index f5b3c691..34bd8463 100644
--- a/ci4/app/Views/themes/vuexy/form/presupuestos/admin/_comentariosItems.php
+++ b/ci4/app/Views/themes/vuexy/form/presupuestos/admin/_comentariosItems.php
@@ -25,8 +25,7 @@
= lang("Presupuestos.comentariosCliente") ?>
+ class="badge rounded-pill badge-center h-px-20 w-px-20 bg-warning ms-1 d-none">
!
@@ -43,8 +42,7 @@
= lang("Presupuestos.comentariosSafekat") ?>
+ class="badge rounded-pill badge-center h-px-20 w-px-20 bg-warning ms-1 d-none">
!
@@ -61,8 +59,7 @@
= lang("Presupuestos.comentariosPresupuesto") ?>
+ class="badge rounded-pill badge-center h-px-20 w-px-20 bg-warning ms-1 d-none">
!
@@ -79,8 +76,7 @@
= lang("Presupuestos.comentariosProduccion") ?>
+ class="badge rounded-pill badge-center h-px-20 w-px-20 bg-warning ms-1 d-none">
!
diff --git a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/presupuestoAdminEdit.js b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/presupuestoAdminEdit.js
index bbfedb9f..ac19d7f2 100644
--- a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/presupuestoAdminEdit.js
+++ b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/presupuestoAdminEdit.js
@@ -131,6 +131,16 @@ class PresupuestoAdminEdit {
}
this.downloadPreviewImage();
+ $("textarea[name^='comentarios_']").on("input", function () {
+ let target = $("#mostrar_" + $(this).attr("name"));
+ if ($.trim($(this).val()) === "") {
+ target.addClass('d-none');
+ } else {
+ target.removeClass('d-none');
+ }
+ });
+
+
$(document).on('update-presupuesto', this.updatePresupuesto.bind(this));
this.guardar.on('click', this.guardarPresupuesto.bind(this));
@@ -375,6 +385,7 @@ class PresupuestoAdminEdit {
$('#comentariosSafekat').val(response.data.comentarios_safekat);
$('#comentariosPdf').val(response.data.comentarios_presupuesto);
$('#comentariosProduccion').val(response.data.comentarios_produccion);
+ $("textarea[name^='comentarios_']").trigger("input");
self.tiradasAlternativas.cargar(response.data.tiradasAlternativas);
@@ -622,6 +633,13 @@ document.addEventListener('DOMContentLoaded', function () {
const locale = document.querySelector('meta[name="locale"]').getAttribute('content');
+ $(document).on("keydown", "textarea", function (event) {
+ if (event.key === "Enter" && !event.shiftKey) {
+ event.preventDefault(); // Evita que el formulario se envíe
+ $(this).val($(this).val() + "\n"); // Agrega un salto de línea
+ }
+ });
+
new Ajax('/translate/getTranslation', { locale: locale, translationFile: ['Presupuestos', 'PresupuestosDirecciones'] }, {},
function (translations) {
window.language = JSON.parse(translations);