==== NUEVO DIA: 2026-11-11 ==== [2026-11-11 07:30:40] begin; [2026-11-11 07:30:40] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 07:30:40] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10661 FUE FACTURADO','PEDRO QUIROA MOTA � FACTURA FCAM-21084 � Q717.00','/pedido/10661',10661,'tbl_ven_pedido',1,9) returning notificacion_id [2026-11-11 07:30:40] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1737,16) on conflict do nothing [2026-11-11 07:30:41] commit; [2026-11-11 07:30:41] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 07:30:41] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 07:30:41] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 07:30:41] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 07:30:41] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (16) and usuario_uid_push_endpoint<>'' [2026-11-11 07:45:02] begin; [2026-11-11 07:45:02] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 07:45:02] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10657 FUE FACTURADO','CLINICATS, S.A. � FACTURA FCAM-21086 � Q480.00','/pedido/10657',10657,'tbl_ven_pedido',1,9) returning notificacion_id [2026-11-11 07:45:02] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1738,15) on conflict do nothing [2026-11-11 07:45:02] commit; [2026-11-11 07:45:02] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 07:45:02] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 07:45:02] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 07:45:02] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 07:45:02] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (15) and usuario_uid_push_endpoint<>'' [2026-11-11 07:45:02] update sh_principal.tbl_gen_notificacion_usuario set notificacion_usuario_push_enviado=true, notificacion_usuario_push_registro=now() where notificacion_usuario_notificacion_id=1738 and notificacion_usuario_usuario_id in (15) [2026-11-11 07:48:09] begin; [2026-11-11 07:48:09] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 07:48:09] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10656 FUE FACTURADO','CACHORROLANDIA � FACTURA FCAM-21087 � Q1,016.00','/pedido/10656',10656,'tbl_ven_pedido',1,9) returning notificacion_id [2026-11-11 07:48:09] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1739,15) on conflict do nothing [2026-11-11 07:48:09] commit; [2026-11-11 07:48:09] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 07:48:09] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 07:48:09] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 07:48:09] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 07:48:09] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (15) and usuario_uid_push_endpoint<>'' [2026-11-11 07:48:09] update sh_principal.tbl_gen_notificacion_usuario set notificacion_usuario_push_enviado=true, notificacion_usuario_push_registro=now() where notificacion_usuario_notificacion_id=1739 and notificacion_usuario_usuario_id in (15) [2026-11-11 07:53:36] begin; [2026-11-11 07:53:36] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 07:53:36] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10662 FUE FACTURADO','PET IT EMPRESARIAL S.A � FACTURA FCAM-2251 � Q230.00','/pedido/10662',10662,'tbl_ven_pedido',5,9) returning notificacion_id [2026-11-11 07:53:36] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1740,16) on conflict do nothing [2026-11-11 07:53:36] commit; [2026-11-11 07:53:36] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 07:53:36] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 07:53:36] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 07:53:36] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 07:53:36] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (16) and usuario_uid_push_endpoint<>'' [2026-11-11 07:54:19] begin; [2026-11-11 07:54:19] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 07:54:19] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10660 FUE FACTURADO','PEDRO QUIROA MOTA � FACTURA FCAM-2252 � Q2,208.00','/pedido/10660',10660,'tbl_ven_pedido',5,9) returning notificacion_id [2026-11-11 07:54:19] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1741,16) on conflict do nothing [2026-11-11 07:54:19] commit; [2026-11-11 07:54:19] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 07:54:19] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 07:54:19] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 07:54:19] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 07:54:19] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (16) and usuario_uid_push_endpoint<>'' [2026-11-11 07:54:46] begin; [2026-11-11 07:54:46] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 07:54:46] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10659 FUE FACTURADO','THE FLORIDA STATE PET SHOP, S.A. � FACTURA FCAM-2253 � Q660.00','/pedido/10659',10659,'tbl_ven_pedido',5,9) returning notificacion_id [2026-11-11 07:54:46] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1742,15) on conflict do nothing [2026-11-11 07:54:46] commit; [2026-11-11 07:54:46] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 07:54:46] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 07:54:46] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 07:54:46] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 07:54:46] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (15) and usuario_uid_push_endpoint<>'' [2026-11-11 07:54:46] update sh_principal.tbl_gen_notificacion_usuario set notificacion_usuario_push_enviado=true, notificacion_usuario_push_registro=now() where notificacion_usuario_notificacion_id=1742 and notificacion_usuario_usuario_id in (15) [2026-11-11 08:00:50] begin; [2026-11-11 08:00:50] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 08:00:50] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10658 FUE FACTURADO','ANDREA CARDONA PALMA � FACTURA FCAM-21088 � Q1,874.50','/pedido/10658',10658,'tbl_ven_pedido',1,9) returning notificacion_id [2026-11-11 08:00:50] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1743,15) on conflict do nothing [2026-11-11 08:00:50] commit; [2026-11-11 08:00:50] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 08:00:50] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 08:00:50] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 08:00:50] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 08:00:50] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (15) and usuario_uid_push_endpoint<>'' [2026-11-11 08:00:51] update sh_principal.tbl_gen_notificacion_usuario set notificacion_usuario_push_enviado=true, notificacion_usuario_push_registro=now() where notificacion_usuario_notificacion_id=1743 and notificacion_usuario_usuario_id in (15) [2026-11-11 08:52:55] begin; [2026-11-11 08:52:55] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 08:52:55] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =1318 order by venta_fecha desc [2026-11-11 08:52:55] commit; [2026-11-11 08:52:55] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 08:52:55] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 08:52:57] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 08:52:57] begin; [2026-11-11 08:52:57] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 08:52:57] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 08:52:57] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 08:52:57] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 08:52:57] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 08:52:57] commit; [2026-11-11 08:53:04] begin; [2026-11-11 08:53:04] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 08:53:04] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=5 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 08:53:05] commit; [2026-11-11 08:53:33] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 08:53:33] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 08:53:33] begin; [2026-11-11 08:53:33] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 08:53:33] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 08:53:33] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 08:53:33] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 08:53:33] commit; [2026-11-11 08:53:46] begin; [2026-11-11 08:53:46] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 08:53:46] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 08:53:46] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 08:53:46] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 08:53:46] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 08:53:46] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 08:53:46] commit; [2026-11-11 09:01:31] begin; [2026-11-11 09:01:31] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 09:01:31] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 09:01:31] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 09:01:31] commit; [2026-11-11 09:01:40] begin; [2026-11-11 09:01:40] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 09:01:40] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=5 and rsaldo<>0 and venta_anulada=false and cliente_id =529 order by venta_fecha desc [2026-11-11 09:01:41] commit; [2026-11-11 09:02:29] begin; [2026-11-11 09:02:29] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 09:02:29] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 09:02:29] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 09:02:29] commit; [2026-11-11 09:02:48] begin; [2026-11-11 09:02:48] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 09:02:48] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=5 and rsaldo<>0 and venta_anulada=false and cliente_id =529 order by venta_fecha desc [2026-11-11 09:02:48] commit; [2026-11-11 09:02:58] begin; [2026-11-11 09:02:58] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 09:02:58] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 09:02:58] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 09:02:58] commit; [2026-11-11 09:21:22] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=20 and notificacion_usuario_leida=false [2026-11-11 09:21:22] begin; [2026-11-11 09:21:22] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 09:21:22] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 09:21:22] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 09:21:23] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=20 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 09:21:23] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =20 order by pedido_registro desc limit 200 [2026-11-11 09:21:23] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=20 and notificacion_usuario_leida=false [2026-11-11 09:21:23] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10370,10372,10373,10504,10248,10505,10636,10128,10002,10003,10519,10648,10520,10266,9882,10140,10141,10526,10405,10535,10413,10542,10033,10546,10034,10035,9779,10548,10292,10549,10293,10294,10045,9917,10046,10047,9791,9792,9923,10437,9925,10439,9927,10441,10442,10192,10193,10322,10325,10198,10327,10199,10200,10329,10201,9818,10075,10462,10463,9952,10465,10081,10340,9956,10342,9960,9961,9962,9834,9963,9964,10606,10222,9967,10480,10099,9971,10100,9972,9974,10104,10617,10489,10105,10493,10495) order by pedidod_pedido_id, pedidod_id [2026-11-11 09:21:23] commit; [2026-11-11 09:24:36] begin; [2026-11-11 09:24:36] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 09:24:36] commit; [2026-11-11 09:24:56] begin; [2026-11-11 09:24:56] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 09:24:56] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 09:24:57] commit; [2026-11-11 09:26:22] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1607 and cliente_descuento_producto_id=837 [2026-11-11 09:26:22] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1607 and producto_id=837 [2026-11-11 09:27:05] begin; [2026-11-11 09:27:05] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 09:27:05] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=5 and rsaldo<>0 and venta_anulada=false and cliente_id =529 order by venta_fecha desc [2026-11-11 09:27:06] commit; [2026-11-11 09:27:25] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1607 and cliente_descuento_producto_id=694 [2026-11-11 09:27:25] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1607 and producto_id=694 [2026-11-11 09:28:11] begin; [2026-11-11 09:28:11] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 09:28:11] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =20 order by pedido_registro desc limit 200 [2026-11-11 09:28:11] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10370,10372,10373,10504,10248,10505,10636,10128,10002,10003,10519,10648,10520,10266,9882,10140,10141,10526,10405,10535,10413,10542,10033,10546,10034,10035,9779,10548,10292,10549,10293,10294,10045,9917,10046,10047,9791,9792,9923,10437,9925,10439,9927,10441,10442,10192,10193,10322,10325,10198,10327,10199,10200,10329,10201,9818,10075,10462,10463,9952,10465,10081,10340,9956,10342,9960,9961,9962,9834,9963,9964,10606,10222,9967,10480,10099,9971,10100,9972,9974,10104,10617,10489,10105,10493,10495) order by pedidod_pedido_id, pedidod_id [2026-11-11 09:28:11] commit; [2026-11-11 09:29:55] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 09:29:55] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=20 and notificacion_usuario_leida=false [2026-11-11 09:29:56] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 09:29:56] begin; [2026-11-11 09:29:56] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 09:29:56] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=20 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 09:29:56] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =20 order by pedido_registro desc limit 200 [2026-11-11 09:29:56] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=20 and notificacion_usuario_leida=false [2026-11-11 09:29:56] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (9793,10435,10564,10436,9798,10251,10573,10579,10133,10521,10652,10077,10338,9957,9893,10214,10602,9835,10028,9836,9838,10223,9975,9913,10236,10494) order by pedidod_pedido_id, pedidod_id [2026-11-11 09:29:56] commit; [2026-11-11 09:30:10] begin; [2026-11-11 09:30:10] select transporte_id,transporte_descripcion,transporte_bloqueado from sh_principal.tbl_ven_transporte where 1=1 and transporte_bloqueado=false order by transporte_descripcion [2026-11-11 09:30:10] commit; [2026-11-11 09:30:23] begin; [2026-11-11 09:30:23] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 09:30:23] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=5 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 09:30:24] commit; [2026-11-11 09:30:33] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1607 and cliente_descuento_producto_id=3841 [2026-11-11 09:30:33] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1607 and producto_id=3841 [2026-11-11 09:30:51] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 09:30:51] begin; [2026-11-11 09:30:51] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 09:30:51] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10663','CL�NICA VETERINARIA LA MEDALLA � Q1,320.00','/pedido/10663',10663,'tbl_ven_pedido',5,20) returning notificacion_id [2026-11-11 09:30:51] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 09:30:51] commit; [2026-11-11 09:30:51] begin; [2026-11-11 09:30:51] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 09:30:51] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and pedido_id =10663 order by pedido_registro desc limit 1 [2026-11-11 09:30:51] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10663) order by pedidod_pedido_id, pedidod_id [2026-11-11 09:30:51] commit; [2026-11-11 09:36:45] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 09:36:45] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=20 and notificacion_usuario_leida=false [2026-11-11 09:37:29] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1607 and cliente_descuento_producto_id=826 [2026-11-11 09:37:29] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1607 and producto_id=826 [2026-11-11 09:37:42] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1607 and cliente_descuento_producto_id=837 [2026-11-11 09:37:42] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1607 and producto_id=837 [2026-11-11 09:37:48] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 09:37:48] begin; [2026-11-11 09:37:48] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 09:37:48] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10664','CL�NICA VETERINARIA LA MEDALLA � Q98.00','/pedido/10664',10664,'tbl_ven_pedido',1,20) returning notificacion_id [2026-11-11 09:37:48] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 09:37:48] commit; [2026-11-11 09:37:48] begin; [2026-11-11 09:37:48] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 09:37:48] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and pedido_id =10664 order by pedido_registro desc limit 1 [2026-11-11 09:37:48] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10664) order by pedidod_pedido_id, pedidod_id [2026-11-11 09:37:48] commit; [2026-11-11 09:38:00] begin; [2026-11-11 09:38:00] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 09:38:00] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and pedido_id =10664 order by pedido_registro desc limit 1 [2026-11-11 09:38:00] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10664) order by pedidod_pedido_id, pedidod_id [2026-11-11 09:38:00] commit; [2026-11-11 09:38:23] begin; [2026-11-11 09:38:23] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 09:38:23] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10664 FUE FACTURADO','CL�NICA VETERINARIA LA MEDALLA � FACTURA FCAM-21089 � Q98.00','/pedido/10664',10664,'tbl_ven_pedido',1,9) returning notificacion_id [2026-11-11 09:38:23] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1746,20) on conflict do nothing [2026-11-11 09:38:23] commit; [2026-11-11 09:38:23] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 09:38:23] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 09:38:23] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 09:38:23] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 09:38:23] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (20) and usuario_uid_push_endpoint<>'' [2026-11-11 09:39:04] begin; [2026-11-11 09:39:04] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 09:39:04] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10663 FUE FACTURADO','CL�NICA VETERINARIA LA MEDALLA � FACTURA FCAM-2254 � Q1,320.00','/pedido/10663',10663,'tbl_ven_pedido',5,9) returning notificacion_id [2026-11-11 09:39:04] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1747,20) on conflict do nothing [2026-11-11 09:39:04] commit; [2026-11-11 09:39:04] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 09:39:04] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 09:39:04] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 09:39:04] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 09:39:04] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (20) and usuario_uid_push_endpoint<>'' [2026-11-11 09:39:48] begin; [2026-11-11 09:39:48] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 09:39:48] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =20 order by pedido_registro desc limit 200 [2026-11-11 09:39:48] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10370,10372,10373,10504,10248,10505,10636,10128,10002,10003,10519,10648,10520,10266,9882,10140,10141,10526,10405,10535,10664,10413,10542,10033,10546,10034,10035,9779,10548,10292,10549,10293,10294,10045,9917,10046,10047,9791,9792,9923,10437,9925,10439,9927,10441,10442,10192,10193,10322,10325,10198,10327,10199,10200,10329,10201,9818,10075,10462,10463,9952,10465,10081,10340,9956,10342,9960,9961,9962,9834,9963,9964,10606,10222,9967,10480,10099,9971,10100,9972,9974,10104,10617,10489,10105,10493,10495) order by pedidod_pedido_id, pedidod_id [2026-11-11 09:39:48] commit; [2026-11-11 10:03:33] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 10:03:33] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 10:03:33] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 10:03:33] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=13 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 10:03:33] begin; [2026-11-11 10:03:33] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 10:03:33] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 10:03:33] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =13 order by pedido_registro desc limit 200 [2026-11-11 10:03:33] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10249,10000,10530,10531,10279,10280,10284,9773,10286,10543,9775,10545,10547,9786,10307,10308,10309,10310,10312,9801,10315,10060,9808,10065,9810,10588,10592,10083,10596,10601,10091,10605,9844,10357,9845,9846,10359,9847,9848,9849,9850,10363,9851,10364,9852,9853,9856,10625,10626,9863,10632,10120,10122,10639,10127,10387,10388,10646,10392,9881,10396,10397,9885,9887,10400,10145,10402,10403,9892,10149,9896,10153,10410,9900,10415,9904,10417,9906,10167,10433,10177,10434,10178,10181,10182,10451,10452,9940,9941,10461,10209,10210,10211,10475,10225,10491,10238) order by pedidod_pedido_id, pedidod_id [2026-11-11 10:03:34] commit; [2026-11-11 10:03:35] begin; [2026-11-11 10:03:35] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 10:03:35] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=5 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 10:03:35] commit; [2026-11-11 10:16:21] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 10:16:21] begin; [2026-11-11 10:16:21] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 10:16:21] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 10:16:21] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 10:16:21] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 10:16:21] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 10:16:21] commit; [2026-11-11 10:16:22] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 10:16:22] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 10:16:26] begin; [2026-11-11 10:16:26] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 10:16:26] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 10:16:26] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (9728,9729,9730,10252,10257,10263,9751,10264,9753,10267,10269,10270,9764,9765,9766,9767,10295,10297,9787,10301,9796,10324,10330,9822,9824,9825,10343,10349,9843,9331,9332,9333,9338,9342,10369,9860,9861,9862,9350,10375,9351,9864,10377,9865,9869,9357,9870,9358,9359,9360,9362,9363,9364,9365,9884,9381,9384,9390,9392,10424,10426,9918,9920,9921,9922,9924,10438,9926,9415,9929,9417,10443,10445,9933,9426,9427,9428,9949,9440,10466,9443,9959,10476,9965,9453,10478,9454,9969,10483,9464,9978,9979,10497,9474,9475,10500,9476,10502,10503,10506,10008,10011,9500,10013,9501,10014,9502,10527,10015,9504,10529,10017,10019,9508,10533,9510,10024,10541,9517,9518,9519,10032,9522,10037,10043,10556,10044,9532,10557,9533,10048,10049,9545,9546,9547,9549,9550,10073,9567,9568,9569,9570,10087,9576,9578,9581,9582,9585,9586,9589,10614,9590,10615,10103,9598,9599,9600,10629,10635,10637,9613,9614,10642,10139,10653,9629,9630,10655,10146,10661,9638,9639,9645,9646,9647,9648,10170,10173,9662,9666,9667,9668,9669,9683,9684,10202,10205,9695,9696,10215,10229,9717,10230,9719,9722,9723,9724,9725,9726,9727) order by pedidod_pedido_id, pedidod_id [2026-11-11 10:16:26] commit; [2026-11-11 10:20:04] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 10:20:04] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 10:20:04] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 10:20:04] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 10:20:04] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 10:20:04] begin; [2026-11-11 10:20:04] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 10:20:04] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 10:20:04] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,8145,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 10:20:04] commit; [2026-11-11 10:20:07] begin; [2026-11-11 10:20:07] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 10:20:07] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 10:20:07] commit; [2026-11-11 10:20:24] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 10:20:24] begin; [2026-11-11 10:20:24] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 10:20:24] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 10:20:24] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 10:20:24] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 10:20:24] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,8145,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 10:20:25] commit; [2026-11-11 10:44:44] 2026-11-11 10:44:44.533 WARN 5176 --- [MI TCP Accept-0] sun.rmi.transport.tcp : RMI TCP Accept-0: accept loop for ServerSocket[addr=0.0.0.0/0.0.0.0,localport=62461] throws [2026-11-11 10:44:44] [2026-11-11 10:44:44] java.io.IOException: The server sockets created using the LocalRMIServerSocketFactory only accept connections from clients running on the host where the RMI remote objects have been exported. [2026-11-11 10:44:44] at jdk.management.agent/sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:114) ~[na:na] [2026-11-11 10:44:44] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:394) ~[na:na] [2026-11-11 10:44:44] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:366) ~[na:na] [2026-11-11 10:44:44] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na] [2026-11-11 10:44:44] [2026-11-11 10:47:12] 2026-11-11 10:47:12.295 WARN 5176 --- [MI TCP Accept-0] sun.rmi.transport.tcp : RMI TCP Accept-0: accept loop for ServerSocket[addr=0.0.0.0/0.0.0.0,localport=62461] throws [2026-11-11 10:47:12] [2026-11-11 10:47:12] java.io.IOException: The server sockets created using the LocalRMIServerSocketFactory only accept connections from clients running on the host where the RMI remote objects have been exported. [2026-11-11 10:47:12] at jdk.management.agent/sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:114) ~[na:na] [2026-11-11 10:47:12] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:394) ~[na:na] [2026-11-11 10:47:12] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:366) ~[na:na] [2026-11-11 10:47:12] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na] [2026-11-11 10:47:12] [2026-11-11 10:47:12] 2026-11-11 10:47:12.685 WARN 5176 --- [MI TCP Accept-0] sun.rmi.transport.tcp : RMI TCP Accept-0: accept loop for ServerSocket[addr=0.0.0.0/0.0.0.0,localport=62461] throws [2026-11-11 10:47:12] [2026-11-11 10:47:12] java.io.IOException: The server sockets created using the LocalRMIServerSocketFactory only accept connections from clients running on the host where the RMI remote objects have been exported. [2026-11-11 10:47:12] at jdk.management.agent/sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:114) ~[na:na] [2026-11-11 10:47:12] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:394) ~[na:na] [2026-11-11 10:47:12] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:366) ~[na:na] [2026-11-11 10:47:12] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na] [2026-11-11 10:47:12] [2026-11-11 10:47:13] 2026-11-11 10:47:13.092 WARN 5176 --- [MI TCP Accept-0] sun.rmi.transport.tcp : RMI TCP Accept-0: accept loop for ServerSocket[addr=0.0.0.0/0.0.0.0,localport=62461] throws [2026-11-11 10:47:13] [2026-11-11 10:47:13] java.io.IOException: The server sockets created using the LocalRMIServerSocketFactory only accept connections from clients running on the host where the RMI remote objects have been exported. [2026-11-11 10:47:13] at jdk.management.agent/sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:114) ~[na:na] [2026-11-11 10:47:13] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:394) ~[na:na] [2026-11-11 10:47:13] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:366) ~[na:na] [2026-11-11 10:47:13] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na] [2026-11-11 10:47:13] [2026-11-11 10:47:13] 2026-11-11 10:47:13.513 WARN 5176 --- [MI TCP Accept-0] sun.rmi.transport.tcp : RMI TCP Accept-0: accept loop for ServerSocket[addr=0.0.0.0/0.0.0.0,localport=62461] throws [2026-11-11 10:47:13] [2026-11-11 10:47:13] java.io.IOException: The server sockets created using the LocalRMIServerSocketFactory only accept connections from clients running on the host where the RMI remote objects have been exported. [2026-11-11 10:47:13] at jdk.management.agent/sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:114) ~[na:na] [2026-11-11 10:47:13] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:394) ~[na:na] [2026-11-11 10:47:13] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:366) ~[na:na] [2026-11-11 10:47:13] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na] [2026-11-11 10:47:13] [2026-11-11 10:48:32] begin; [2026-11-11 10:48:32] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 10:48:32] commit; [2026-11-11 10:48:40] begin; [2026-11-11 10:48:40] select transporte_id,transporte_descripcion,transporte_bloqueado from sh_principal.tbl_ven_transporte where 1=1 and transporte_bloqueado=false order by transporte_descripcion [2026-11-11 10:48:40] commit; [2026-11-11 10:49:21] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=440 and cliente_descuento_producto_id=789 [2026-11-11 10:49:21] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=440 and producto_id=789 [2026-11-11 10:49:28] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=440 and cliente_descuento_producto_id=790 [2026-11-11 10:49:28] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=440 and producto_id=790 [2026-11-11 10:49:44] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 10:49:44] begin; [2026-11-11 10:49:44] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 10:49:44] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10665','CLINICA VETERINARIA HUELLAS/MELISSA ALVAREZ � Q1,148.00','/pedido/10665',10665,'tbl_ven_pedido',1,14) returning notificacion_id [2026-11-11 10:49:44] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 10:49:44] commit; [2026-11-11 10:49:44] begin; [2026-11-11 10:49:44] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 10:49:44] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and pedido_id =10665 order by pedido_registro desc limit 1 [2026-11-11 10:49:44] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10665) order by pedidod_pedido_id, pedidod_id [2026-11-11 10:49:44] commit; [2026-11-11 11:00:11] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 11:00:11] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 11:00:11] begin; [2026-11-11 11:00:11] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 11:00:11] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 11:00:11] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 11:00:11] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 11:00:11] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 11:00:11] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 11:00:11] commit; [2026-11-11 11:00:15] begin; [2026-11-11 11:00:15] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 11:00:15] commit; [2026-11-11 11:00:28] begin; [2026-11-11 11:00:28] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 11:00:28] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =1955 order by venta_fecha desc [2026-11-11 11:00:28] commit; [2026-11-11 11:00:54] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 11:00:54] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 11:00:54] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 11:00:54] begin; [2026-11-11 11:00:54] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 11:00:54] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 11:00:54] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 11:00:54] commit; [2026-11-11 11:07:45] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 11:07:45] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 11:07:45] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 11:07:45] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 11:07:45] begin; [2026-11-11 11:07:45] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 11:07:45] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 11:07:45] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 11:07:45] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 11:07:45] commit; [2026-11-11 11:07:47] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 11:07:47] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 11:07:54] begin; [2026-11-11 11:07:54] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 11:07:54] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 11:07:54] commit; [2026-11-11 11:25:48] begin; [2026-11-11 11:25:48] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 11:25:48] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =20 order by pedido_registro desc limit 200 [2026-11-11 11:25:48] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10370,10372,10373,10504,10248,10505,10636,10128,10002,10003,10519,10648,10520,10266,9882,10140,10141,10526,10405,10535,10664,10413,10542,10033,10546,10034,10035,9779,10548,10292,10549,10293,10294,10045,9917,10046,10047,9791,9792,9923,10437,9925,10439,9927,10441,10442,10192,10193,10322,10325,10198,10327,10199,10200,10329,10201,9818,10075,10462,10463,9952,10465,10081,10340,9956,10342,9960,9961,9962,9834,9963,9964,10606,10222,9967,10480,10099,9971,10100,9972,9974,10104,10617,10489,10105,10493,10495) order by pedidod_pedido_id, pedidod_id [2026-11-11 11:25:48] commit; [2026-11-11 11:25:51] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 11:25:51] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=20 and notificacion_usuario_leida=false [2026-11-11 11:25:57] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=20 and notificacion_usuario_leida=false [2026-11-11 11:25:57] begin; [2026-11-11 11:25:57] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 11:25:57] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =20 order by pedido_registro desc limit 200 [2026-11-11 11:25:57] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 11:25:57] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=20 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 11:25:57] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10370,10372,10373,10504,10248,10505,10636,10128,10002,10003,10519,10648,10520,10266,9882,10140,10141,10526,10405,10535,10664,10413,10542,10033,10546,10034,10035,9779,10548,10292,10549,10293,10294,10045,9917,10046,10047,9791,9792,9923,10437,9925,10439,9927,10441,10442,10192,10193,10322,10325,10198,10327,10199,10200,10329,10201,9818,10075,10462,10463,9952,10465,10081,10340,9956,10342,9960,9961,9962,9834,9963,9964,10606,10222,9967,10480,10099,9971,10100,9972,9974,10104,10617,10489,10105,10493,10495) order by pedidod_pedido_id, pedidod_id [2026-11-11 11:25:57] commit; [2026-11-11 11:26:37] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=718 and cliente_descuento_producto_id=2711 [2026-11-11 11:26:37] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=718 and producto_id=2711 [2026-11-11 11:26:51] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=718 and cliente_descuento_producto_id=2712 [2026-11-11 11:26:51] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=718 and producto_id=2712 [2026-11-11 11:27:04] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=718 and cliente_descuento_producto_id=2713 [2026-11-11 11:27:04] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=718 and producto_id=2713 [2026-11-11 11:27:16] 2026-11-11 11:27:16.497 INFO 5176 --- [io-8107-exec-51] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header [2026-11-11 11:27:16] Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level. [2026-11-11 11:27:16] [2026-11-11 11:27:16] java.lang.IllegalArgumentException: Invalid character found in the HTTP protocol [RTSP/1.00x0d0x0a0x0d0x0a...] [2026-11-11 11:27:16] at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:570) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:16] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:271) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:16] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:16] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:16] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1787) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:16] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:16] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:16] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:16] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:16] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na] [2026-11-11 11:27:16] [2026-11-11 11:27:21] 2026-11-11 11:27:21.387 INFO 5176 --- [io-8107-exec-48] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header [2026-11-11 11:27:21] Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level. [2026-11-11 11:27:21] [2026-11-11 11:27:21] java.lang.IllegalArgumentException: Invalid character found in method name [:0x000x000x00/0x000x000x000x020x000x00@0x020x0f0x000x010x00=0x050x000x000x000x000x000x000x000x000x000x000x000x00/0x000x000x000x000x000x000x000x000x00@0x1f0x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00...]. HTTP method names must be tokens [2026-11-11 11:27:21] at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:419) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:21] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:271) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:21] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:21] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:21] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1787) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:21] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:21] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:21] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:21] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.64.jar!/:na] [2026-11-11 11:27:21] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na] [2026-11-11 11:27:21] [2026-11-11 11:27:21] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=718 and cliente_descuento_producto_id=3550 [2026-11-11 11:27:21] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=718 and producto_id=3550 [2026-11-11 11:27:49] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=718 and cliente_descuento_producto_id=3706 [2026-11-11 11:27:49] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=718 and producto_id=3706 [2026-11-11 11:28:37] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 11:28:37] begin; [2026-11-11 11:28:37] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 11:28:37] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10666','KIMBERLY ARIANA TUNCHEZ YAT � Q430.00','/pedido/10666',10666,'tbl_ven_pedido',1,20) returning notificacion_id [2026-11-11 11:28:37] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 11:28:37] commit; [2026-11-11 11:28:37] begin; [2026-11-11 11:28:37] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 11:28:37] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and pedido_id =10666 order by pedido_registro desc limit 1 [2026-11-11 11:28:37] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10666) order by pedidod_pedido_id, pedidod_id [2026-11-11 11:28:37] commit; [2026-11-11 11:29:10] begin; [2026-11-11 11:29:10] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 11:29:10] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and pedido_id =10666 order by pedido_registro desc limit 1 [2026-11-11 11:29:10] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10666) order by pedidod_pedido_id, pedidod_id [2026-11-11 11:29:10] commit; [2026-11-11 11:29:39] begin; [2026-11-11 11:29:39] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 11:29:39] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =20 order by pedido_registro desc limit 200 [2026-11-11 11:29:39] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10370,10372,10373,10504,10248,10505,10636,10128,10002,10003,10519,10648,10520,10266,9882,10140,10141,10526,10405,10535,10664,10666,10413,10542,10033,10546,10034,10035,9779,10548,10292,10549,10293,10294,10045,9917,10046,10047,9791,9792,9923,10437,9925,10439,9927,10441,10442,10192,10193,10322,10325,10198,10327,10199,10200,10329,10201,9818,10075,10462,10463,9952,10465,10081,10340,9956,10342,9960,9961,9962,9834,9963,9964,10606,10222,9967,10480,10099,9971,10100,9972,9974,10104,10617,10489,10105,10493,10495) order by pedidod_pedido_id, pedidod_id [2026-11-11 11:29:39] commit; [2026-11-11 11:43:33] begin; [2026-11-11 11:43:33] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 11:43:33] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10666 FUE FACTURADO','KIMBERLY ARIANA TUNCHEZ YAT � FACTURA FCAM-21091 � Q430.00','/pedido/10666',10666,'tbl_ven_pedido',1,9) returning notificacion_id [2026-11-11 11:43:33] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1750,20) on conflict do nothing [2026-11-11 11:43:33] commit; [2026-11-11 11:43:33] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 11:43:33] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 11:43:33] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 11:43:33] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 11:43:33] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (20) and usuario_uid_push_endpoint<>'' [2026-11-11 11:44:34] begin; [2026-11-11 11:44:34] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 11:44:34] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10665 FUE FACTURADO','CLINICA VETERINARIA HUELLAS/MELISSA ALVAREZ � FACTURA FCAM-21092 � Q1,148.00','/pedido/10665',10665,'tbl_ven_pedido',1,9) returning notificacion_id [2026-11-11 11:44:34] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1751,14) on conflict do nothing [2026-11-11 11:44:34] commit; [2026-11-11 11:44:34] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 11:44:34] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 11:44:34] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 11:44:34] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 11:44:34] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (14) and usuario_uid_push_endpoint<>'' [2026-11-11 11:53:24] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=20 and notificacion_usuario_leida=false [2026-11-11 11:53:24] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 11:53:25] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 11:53:25] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=20 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 11:53:25] begin; [2026-11-11 11:53:25] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 11:53:25] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=20 and notificacion_usuario_leida=false [2026-11-11 11:53:25] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =20 order by pedido_registro desc limit 200 [2026-11-11 11:53:25] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (9793,10435,10564,10436,9798,10251,10573,10579,10133,10521,10652,10077,10338,9957,9893,10214,10663,10602,9835,10028,9836,9838,10223,9975,9913,10236,10494) order by pedidod_pedido_id, pedidod_id [2026-11-11 11:53:25] commit; [2026-11-11 11:54:04] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1827 and cliente_descuento_producto_id=3827 [2026-11-11 11:54:04] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1827 and producto_id=3827 [2026-11-11 11:54:22] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1827 and cliente_descuento_producto_id=3826 [2026-11-11 11:54:22] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1827 and producto_id=3826 [2026-11-11 11:54:39] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1827 and cliente_descuento_producto_id=3834 [2026-11-11 11:54:39] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1827 and producto_id=3834 [2026-11-11 11:55:05] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1827 and cliente_descuento_producto_id=3833 [2026-11-11 11:55:05] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1827 and producto_id=3833 [2026-11-11 11:55:16] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 11:55:16] begin; [2026-11-11 11:55:16] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 11:55:16] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10667','ATENCION VETERINARIA SOCIEDAD AN�NIMA � Q1,193.00','/pedido/10667',10667,'tbl_ven_pedido',5,20) returning notificacion_id [2026-11-11 11:55:16] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 11:55:16] commit; [2026-11-11 11:55:16] begin; [2026-11-11 11:55:16] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 11:55:16] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and pedido_id =10667 order by pedido_registro desc limit 1 [2026-11-11 11:55:16] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10667) order by pedidod_pedido_id, pedidod_id [2026-11-11 11:55:16] commit; [2026-11-11 11:57:13] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 11:57:13] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 11:57:15] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 11:57:15] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 11:57:15] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=13 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 11:57:15] begin; [2026-11-11 11:57:15] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 11:57:15] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =13 order by pedido_registro desc limit 200 [2026-11-11 11:57:15] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10249,10000,10530,10531,10279,10280,10284,9773,10286,10543,9775,10545,10547,9786,10307,10308,10309,10310,10312,9801,10315,10060,9808,10065,9810,10588,10592,10083,10596,10601,10091,10605,9844,10357,9845,9846,10359,9847,9848,9849,9850,10363,9851,10364,9852,9853,9856,10625,10626,9863,10632,10120,10122,10639,10127,10387,10388,10646,10392,9881,10396,10397,9885,9887,10400,10145,10402,10403,9892,10149,9896,10153,10410,9900,10415,9904,10417,9906,10167,10433,10177,10434,10178,10181,10182,10451,10452,9940,9941,10461,10209,10210,10211,10475,10225,10491,10238) order by pedidod_pedido_id, pedidod_id [2026-11-11 11:57:15] commit; [2026-11-11 11:57:16] begin; [2026-11-11 11:57:16] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 11:57:16] commit; [2026-11-11 11:57:20] begin; [2026-11-11 11:57:20] select transporte_id,transporte_descripcion,transporte_bloqueado from sh_principal.tbl_ven_transporte where 1=1 and transporte_bloqueado=false order by transporte_descripcion [2026-11-11 11:57:20] commit; [2026-11-11 11:57:26] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=736 and cliente_descuento_producto_id=3816 [2026-11-11 11:57:26] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=736 and producto_id=3816 [2026-11-11 11:57:34] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 11:57:34] begin; [2026-11-11 11:57:34] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 11:57:34] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10668','TODAS LAS CRIATURAS � Q1,095.00','/pedido/10668',10668,'tbl_ven_pedido',5,13) returning notificacion_id [2026-11-11 11:57:34] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 11:57:34] commit; [2026-11-11 11:57:34] begin; [2026-11-11 11:57:34] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 11:57:34] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and pedido_id =10668 order by pedido_registro desc limit 1 [2026-11-11 11:57:34] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10668) order by pedidod_pedido_id, pedidod_id [2026-11-11 11:57:34] commit; [2026-11-11 11:57:41] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 11:57:41] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 11:57:42] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 11:57:42] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=13 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 11:57:42] begin; [2026-11-11 11:57:42] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 11:57:42] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =13 order by pedido_registro desc limit 200 [2026-11-11 11:57:42] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 11:57:42] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10249,10000,10530,10531,10279,10280,10284,9773,10286,10543,9775,10545,10547,9786,10307,10308,10309,10310,10312,9801,10315,10060,9808,10065,9810,10588,10592,10083,10596,10601,10091,10605,9844,10357,9845,9846,10359,9847,9848,9849,9850,10363,9851,10364,9852,9853,9856,10625,10626,9863,10632,10120,10122,10639,10127,10387,10388,10646,10392,9881,10396,10397,9885,9887,10400,10145,10402,10403,9892,10149,9896,10153,10410,10668,9900,10415,9904,10417,9906,10167,10433,10177,10434,10178,10181,10182,10451,10452,9940,9941,10461,10209,10210,10211,10475,10225,10491,10238) order by pedidod_pedido_id, pedidod_id [2026-11-11 11:57:42] commit; [2026-11-11 12:00:30] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 12:00:30] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 12:00:31] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 12:00:31] begin; [2026-11-11 12:00:31] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:00:31] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 12:00:31] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:00:31] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 12:00:31] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:00:31] commit; [2026-11-11 12:00:35] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:00:35] begin; [2026-11-11 12:00:35] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:00:35] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 12:00:35] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 12:00:35] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:00:35] commit; [2026-11-11 12:00:36] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 12:01:05] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 12:01:05] begin; [2026-11-11 12:01:05] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:01:05] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:01:05] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 12:01:05] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 12:01:05] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:01:05] commit; [2026-11-11 12:01:05] begin; [2026-11-11 12:01:05] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:01:05] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 12:01:05] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:01:05] commit; [2026-11-11 12:01:05] begin; [2026-11-11 12:01:05] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:01:05] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 12:01:05] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:01:05] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 12:01:05] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 12:01:05] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:01:05] commit; [2026-11-11 12:01:06] begin; [2026-11-11 12:01:06] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:01:06] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 12:01:06] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:01:06] commit; [2026-11-11 12:01:06] begin; [2026-11-11 12:01:06] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:01:06] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 12:01:06] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:01:06] commit; [2026-11-11 12:04:08] begin; [2026-11-11 12:04:08] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 12:04:08] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10668 FUE FACTURADO','TODAS LAS CRIATURAS � FACTURA FCAM-2255 � Q1,095.00','/pedido/10668',10668,'tbl_ven_pedido',5,9) returning notificacion_id [2026-11-11 12:04:08] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1754,13) on conflict do nothing [2026-11-11 12:04:08] commit; [2026-11-11 12:04:08] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 12:04:08] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 12:04:08] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 12:04:08] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 12:04:08] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (13) and usuario_uid_push_endpoint<>'' [2026-11-11 12:07:00] begin; [2026-11-11 12:07:00] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:07:00] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=5 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 12:07:01] commit; [2026-11-11 12:11:57] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1519 and cliente_descuento_producto_id=3860 [2026-11-11 12:11:57] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1519 and producto_id=3860 [2026-11-11 12:13:07] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1519 and cliente_descuento_producto_id=3822 [2026-11-11 12:13:07] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1519 and producto_id=3822 [2026-11-11 12:13:30] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1519 and cliente_descuento_producto_id=3818 [2026-11-11 12:13:30] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1519 and producto_id=3818 [2026-11-11 12:13:49] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1519 and cliente_descuento_producto_id=3865 [2026-11-11 12:13:49] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1519 and producto_id=3865 [2026-11-11 12:14:40] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1519 and cliente_descuento_producto_id=3814 [2026-11-11 12:14:40] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1519 and producto_id=3814 [2026-11-11 12:14:47] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:14:47] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 12:14:47] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:14:47] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 12:14:47] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 12:14:47] begin; [2026-11-11 12:14:47] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 12:14:47] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 12:14:47] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:14:47] commit; [2026-11-11 12:14:52] begin; [2026-11-11 12:14:52] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 12:14:52] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 12:14:53] commit; [2026-11-11 12:15:09] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1519 and cliente_descuento_producto_id=3819 [2026-11-11 12:15:09] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1519 and producto_id=3819 [2026-11-11 12:15:20] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 12:15:20] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:15:21] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 12:15:21] begin; [2026-11-11 12:15:21] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 12:15:21] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=2 and pedido_anulado=false [2026-11-11 12:15:21] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=2 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 12:15:21] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10576,10449,9890,9842,10086,9814) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:15:21] commit; [2026-11-11 12:15:21] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:15:23] begin; [2026-11-11 12:15:23] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 12:15:23] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=2 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 12:15:24] commit; [2026-11-11 12:15:28] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1519 and cliente_descuento_producto_id=3820 [2026-11-11 12:15:28] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1519 and producto_id=3820 [2026-11-11 12:16:10] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:16:10] begin; [2026-11-11 12:16:10] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 12:16:10] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10669','ANDREA PONCE � Q7,852.00','/pedido/10669',10669,'tbl_ven_pedido',5,20) returning notificacion_id [2026-11-11 12:16:10] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 12:16:10] commit; [2026-11-11 12:16:11] begin; [2026-11-11 12:16:11] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:16:11] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and pedido_id =10669 order by pedido_registro desc limit 1 [2026-11-11 12:16:11] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10669) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:16:11] commit; [2026-11-11 12:20:38] begin; [2026-11-11 12:20:38] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 12:20:38] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=2 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 12:20:38] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 12:20:38] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:20:38] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=2 and pedido_anulado=false [2026-11-11 12:20:38] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10576,10449,9890,9842,10086,9814) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:20:38] commit; [2026-11-11 12:22:29] begin; [2026-11-11 12:22:29] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 12:22:29] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=2 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 12:22:29] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:22:29] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 12:22:29] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=2 and pedido_anulado=false [2026-11-11 12:22:30] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10576,10449,9890,9842,10086,9814) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:22:30] commit; [2026-11-11 12:22:41] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 12:22:41] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:22:41] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 12:22:41] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=2 and pedido_anulado=false [2026-11-11 12:22:41] begin; [2026-11-11 12:22:41] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 12:22:41] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=2 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 12:22:41] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:22:41] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10576,10449,9890,9842,10086,9814) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:22:41] commit; [2026-11-11 12:22:45] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:22:45] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 12:22:48] begin; [2026-11-11 12:22:48] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 12:22:48] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 12:22:48] commit; [2026-11-11 12:23:14] begin; [2026-11-11 12:23:14] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 12:23:14] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 12:23:14] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 12:23:14] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:23:14] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 12:23:14] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:23:14] commit; [2026-11-11 12:25:40] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 12:25:40] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 12:25:41] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 12:25:41] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=13 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 12:25:41] begin; [2026-11-11 12:25:41] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 12:25:41] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =13 order by pedido_registro desc limit 200 [2026-11-11 12:25:41] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 12:25:41] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10250,10253,10254,10258,10278,10281,10282,10283,10285,10311,10313,10314,10316,9811,9812,9813,10326,10334,10335,10336,10337,9826,9827,9828,9829,9830,9831,10353,10354,10356,10358,10360,10361,10362,10365,10366,9854,10368,9857,10374,10385,9873,10389,10390,9878,10391,9879,10393,10394,10398,10399,10404,9895,9897,9899,9901,10416,9905,10419,9908,10421,10422,9919,10432,10440,10444,9936,9937,10450,9938,9939,10453,10454,9942,10455,9943,10456,9944,9945,9946,9947,10460,9953,9954,9955,9958,10474,9968,10481,10484,9973,10490,10492,10501,9997,10510,9998,10511,9999,10512,10513,10001,10514,10515,10004,10517,10518,10009,10523,10012,10532,10021,10025,10539,10030,10544,10039,10567,10568,10569,10572,10061,10062,10063,10064,10066,10067,10068,10069,10586,10074,10587,10589,10590,10591,10593,10594,10082,10595,10597,10598,10600,10090,10603,10092,10095,10096,10611,10101,10102,10622,10623,10624,10117,10631,10119,10633,10121,10634,10123,10124,10125,10638,10126,10640,10129,10130,10132,10645,10134,10136,10148,10150,10151,10152,10154,10168,10169,10175,10176,10179,10180,10183,10184,10185,10186,10187,10195,10196,10207,10208,10212,10213,10224,10226,10232,10233,10234,10235,10239) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:25:41] commit; [2026-11-11 12:25:42] begin; [2026-11-11 12:25:42] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 12:25:42] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 12:25:43] commit; [2026-11-11 12:41:49] begin; [2026-11-11 12:41:49] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:41:49] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=5 and rsaldo<>0 and venta_anulada=false and cliente_id =829 order by venta_fecha desc [2026-11-11 12:41:50] commit; [2026-11-11 12:41:58] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 12:41:58] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 12:41:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 12:41:59] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 12:41:59] begin; [2026-11-11 12:41:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 12:41:59] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 12:41:59] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (9728,9729,9730,10252,10257,10263,9751,10264,9753,10267,10269,10270,9764,9765,9766,9767,10295,10297,9787,10301,9796,10324,10330,9822,9824,9825,10343,10349,9843,9331,9332,9333,9338,9342,10369,9860,9861,9862,9350,10375,9351,9864,10377,9865,9869,9357,9870,9358,9359,9360,9362,9363,9364,9365,9884,9381,9384,9390,9392,10424,10426,9918,9920,9921,9922,9924,10438,9926,9415,9929,9417,10443,10445,9933,9426,9427,9428,9949,9440,10466,9443,9959,10476,9965,9453,10478,9454,9969,10483,9464,9978,9979,10497,9474,9475,10500,9476,10502,10503,10506,10008,10011,9500,10013,9501,10014,9502,10527,10015,9504,10529,10017,10019,9508,10533,9510,10024,10541,9517,9518,9519,10032,9522,10037,10043,10556,10044,9532,10557,9533,10048,10049,9545,9546,9547,9549,9550,10073,9567,9568,9569,9570,10087,9576,9578,9581,9582,9585,9586,9589,10614,9590,10615,10103,9598,9599,9600,10629,10635,10637,9613,9614,10642,10139,10653,9629,9630,10655,10146,10661,9638,9639,9645,9646,9647,9648,10170,10173,9662,9666,9667,9668,9669,9683,9684,10202,10205,9695,9696,10215,10229,9717,10230,9719,9722,9723,9724,9725,9726,9727) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:41:59] commit; [2026-11-11 12:41:59] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 12:42:05] begin; [2026-11-11 12:42:05] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 12:42:05] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =829 order by venta_fecha desc [2026-11-11 12:42:05] commit; [2026-11-11 12:55:15] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 12:55:15] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:55:15] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:55:15] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 12:55:15] begin; [2026-11-11 12:55:15] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 12:55:15] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 12:55:15] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 12:55:15] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:55:15] commit; [2026-11-11 12:55:23] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 12:55:23] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:55:26] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 12:55:26] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:55:27] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:55:27] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 12:55:27] begin; [2026-11-11 12:55:27] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 12:55:27] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:55:27] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 12:55:27] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:55:27] commit; [2026-11-11 12:55:29] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:55:29] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 12:55:33] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 12:55:33] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:55:33] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 12:55:33] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=2 and pedido_anulado=false [2026-11-11 12:55:33] begin; [2026-11-11 12:55:33] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 12:55:33] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=2 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 12:55:33] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 12:55:33] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10576,10449,9890,9842,10086,9814) order by pedidod_pedido_id, pedidod_id [2026-11-11 12:55:33] commit; [2026-11-11 12:58:32] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 12:58:32] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 13:01:04] begin; [2026-11-11 13:01:04] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 13:01:04] commit; [2026-11-11 13:03:06] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 13:03:06] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:03:06] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 13:03:06] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=2 and pedido_anulado=false [2026-11-11 13:03:06] begin; [2026-11-11 13:03:06] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 13:03:06] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=2 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:03:06] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:03:06] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10576,10449,9890,9842,10086,9814) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:03:06] commit; [2026-11-11 13:03:08] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 13:03:08] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:03:11] begin; [2026-11-11 13:03:11] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:03:11] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:03:11] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:03:11] commit; [2026-11-11 13:06:38] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 13:06:38] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 13:06:39] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:06:39] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=13 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 13:06:39] begin; [2026-11-11 13:06:39] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:06:39] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =13 order by pedido_registro desc limit 200 [2026-11-11 13:06:39] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 13:06:39] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10249,10000,10530,10531,10279,10280,10284,9773,10286,10543,9775,10545,10547,9786,10307,10308,10309,10310,10312,9801,10315,10060,9808,10065,9810,10588,10592,10083,10596,10601,10091,10605,9844,10357,9845,9846,10359,9847,9848,9849,9850,10363,9851,10364,9852,9853,9856,10625,10626,9863,10632,10120,10122,10639,10127,10387,10388,10646,10392,9881,10396,10397,9885,9887,10400,10145,10402,10403,9892,10149,9896,10153,10410,10668,9900,10415,9904,10417,9906,10167,10433,10177,10434,10178,10181,10182,10451,10452,9940,9941,10461,10209,10210,10211,10475,10225,10491,10238) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:06:39] commit; [2026-11-11 13:18:46] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:18:46] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 13:18:46] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:18:46] begin; [2026-11-11 13:18:46] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:18:46] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:18:46] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:18:46] commit; [2026-11-11 13:35:16] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:35:16] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 13:35:17] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:35:17] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 13:35:17] begin; [2026-11-11 13:35:17] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:35:17] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:35:17] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:35:17] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:35:17] commit; [2026-11-11 13:35:19] begin; [2026-11-11 13:35:19] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:35:19] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:35:20] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:35:20] commit; [2026-11-11 13:35:22] begin; [2026-11-11 13:35:22] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:35:22] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:35:22] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:35:22] commit; [2026-11-11 13:35:58] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:35:58] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 13:35:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:35:59] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 13:35:59] begin; [2026-11-11 13:35:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:35:59] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:35:59] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:35:59] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:35:59] commit; [2026-11-11 13:36:01] begin; [2026-11-11 13:36:01] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:36:01] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:36:01] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:36:01] commit; [2026-11-11 13:36:28] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:36:28] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 13:36:28] begin; [2026-11-11 13:36:28] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:36:28] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:36:28] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:36:28] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:36:28] commit; [2026-11-11 13:36:29] begin; [2026-11-11 13:36:29] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:36:29] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=5 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 13:36:30] commit; [2026-11-11 13:37:08] begin; [2026-11-11 13:37:08] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:37:08] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:37:08] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:37:08] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 13:37:08] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:37:08] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:37:08] commit; [2026-11-11 13:37:08] begin; [2026-11-11 13:37:08] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:37:08] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:37:08] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:37:08] commit; [2026-11-11 13:37:08] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:37:08] begin; [2026-11-11 13:37:08] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:37:08] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 13:37:08] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:37:08] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:37:08] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:37:08] commit; [2026-11-11 13:37:15] begin; [2026-11-11 13:37:15] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:37:15] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:37:15] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:37:15] commit; [2026-11-11 13:37:15] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:37:15] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 13:37:15] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:37:15] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 13:37:15] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:37:15] begin; [2026-11-11 13:37:15] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:37:15] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:37:15] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:37:15] commit; [2026-11-11 13:37:17] begin; [2026-11-11 13:37:17] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 13:37:17] commit; [2026-11-11 13:37:24] begin; [2026-11-11 13:37:24] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:37:24] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=5 and rsaldo<>0 and venta_anulada=false and cliente_id =440 order by venta_fecha desc [2026-11-11 13:37:24] commit; [2026-11-11 13:37:26] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 13:37:26] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:37:27] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:37:27] begin; [2026-11-11 13:37:27] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:37:27] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 13:37:27] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:37:27] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:37:27] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:37:27] commit; [2026-11-11 13:37:35] begin; [2026-11-11 13:37:35] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:37:35] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =440 order by venta_fecha desc [2026-11-11 13:37:36] commit; [2026-11-11 13:38:27] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1827 and cliente_descuento_producto_id=3833 [2026-11-11 13:38:27] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1827 and producto_id=3833 [2026-11-11 13:38:41] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:38:41] begin; [2026-11-11 13:38:41] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 13:38:41] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10670','ATENCION VETERINARIA SOCIEDAD AN�NIMA � Q400.00','/pedido/10670',10670,'tbl_ven_pedido',5,20) returning notificacion_id [2026-11-11 13:38:41] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 13:38:41] commit; [2026-11-11 13:38:41] begin; [2026-11-11 13:38:41] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:38:41] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and pedido_id =10670 order by pedido_registro desc limit 1 [2026-11-11 13:38:41] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10670) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:38:41] commit; [2026-11-11 13:38:46] begin; [2026-11-11 13:38:46] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:38:46] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and pedido_id =10669 order by pedido_registro desc limit 1 [2026-11-11 13:38:46] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10669) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:38:46] commit; [2026-11-11 13:38:49] begin; [2026-11-11 13:38:49] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=20 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:38:49] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =20 order by pedido_registro desc limit 200 [2026-11-11 13:38:49] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (9793,10435,10564,10436,9798,10251,10573,10579,10133,10521,10652,10077,10338,9957,9893,10214,10663,10602,10667,9835,10028,9836,10669,10670,9838,10223,9975,9913,10236,10494) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:38:49] commit; [2026-11-11 13:50:35] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:50:35] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 13:50:35] begin; [2026-11-11 13:50:35] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:50:35] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:50:35] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:50:35] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:50:35] commit; [2026-11-11 13:50:39] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 13:50:39] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:50:40] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:50:40] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:50:40] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 13:50:40] begin; [2026-11-11 13:50:40] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:50:40] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:50:40] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:50:40] commit; [2026-11-11 13:50:42] begin; [2026-11-11 13:50:42] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:50:42] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=5 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 13:50:43] commit; [2026-11-11 13:52:30] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:52:30] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:52:30] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 13:52:30] begin; [2026-11-11 13:52:30] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:52:30] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:52:30] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:52:30] commit; [2026-11-11 13:52:55] begin; [2026-11-11 13:52:55] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:52:55] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:52:55] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:52:56] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:52:56] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 13:52:56] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:52:56] commit; [2026-11-11 13:54:31] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:54:31] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 13:54:31] begin; [2026-11-11 13:54:31] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:54:31] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:54:31] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:54:31] commit; [2026-11-11 13:54:31] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:55:51] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 13:55:51] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 13:55:52] begin; [2026-11-11 13:55:52] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 13:55:52] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 13:55:52] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=2 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 13:55:52] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10160,10498,10036,10296,10409,10026,10525,10029,10446) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:55:52] commit; [2026-11-11 13:55:52] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 13:55:52] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=2 and pedido_anulado=false [2026-11-11 13:55:53] begin; [2026-11-11 13:55:53] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 13:55:53] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=2 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 13:55:53] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10160,10498,10036,10296,10409,10026,10525,10029,10446) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:55:53] commit; [2026-11-11 13:57:11] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 13:57:11] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 13:57:12] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:57:12] begin; [2026-11-11 13:57:12] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:57:12] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 13:57:12] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 13:57:12] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:57:12] commit; [2026-11-11 13:57:13] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 13:57:14] begin; [2026-11-11 13:57:14] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:57:14] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=5 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 13:57:15] commit; [2026-11-11 13:58:47] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 13:58:47] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:58:47] begin; [2026-11-11 13:58:47] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:58:47] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:58:47] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 13:58:47] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 13:58:47] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:58:47] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:58:47] commit; [2026-11-11 13:58:48] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:58:48] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 13:58:53] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:58:53] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 13:58:53] begin; [2026-11-11 13:58:53] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:58:53] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:58:53] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:58:53] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:58:53] commit; [2026-11-11 13:58:54] begin; [2026-11-11 13:58:54] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:58:54] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 13:58:54] commit; [2026-11-11 13:59:35] begin; [2026-11-11 13:59:35] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:59:35] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 13:59:35] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 13:59:35] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 13:59:35] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 13:59:36] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 13:59:36] commit; [2026-11-11 14:09:56] begin; [2026-11-11 14:09:56] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:09:56] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=5 and rsaldo<>0 and venta_anulada=false and cliente_id =1386 order by venta_fecha desc [2026-11-11 14:09:56] commit; [2026-11-11 14:10:01] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 14:10:01] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 14:10:02] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:10:02] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 14:10:02] begin; [2026-11-11 14:10:02] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:10:02] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 14:10:02] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (9728,9729,9730,10252,10257,10263,9751,10264,9753,10267,10269,10270,9764,9765,9766,9767,10295,10297,9787,10301,9796,10324,10330,9822,9824,9825,10343,10349,9843,9331,9332,9333,9338,9342,10369,9860,9861,9862,9350,10375,9351,9864,10377,9865,9869,9357,9870,9358,9359,9360,9362,9363,9364,9365,9884,9381,9384,9390,9392,10424,10426,9918,9920,9921,9922,9924,10438,9926,9415,9929,9417,10443,10445,9933,9426,9427,9428,9949,9440,10466,9443,9959,10476,9965,9453,10478,9454,9969,10483,9464,9978,9979,10497,9474,9475,10500,9476,10502,10503,10506,10008,10011,9500,10013,9501,10014,9502,10527,10015,9504,10529,10017,10019,9508,10533,9510,10024,10541,9517,9518,9519,10032,9522,10037,10043,10556,10044,9532,10557,9533,10048,10049,9545,9546,9547,9549,9550,10073,9567,9568,9569,9570,10087,9576,9578,9581,9582,9585,9586,9589,10614,9590,10615,10103,9598,9599,9600,10629,10635,10637,9613,9614,10642,10139,10653,9629,9630,10655,10146,10661,9638,9639,9645,9646,9647,9648,10170,10173,9662,9666,9667,9668,9669,9683,9684,10202,10205,9695,9696,10215,10229,9717,10230,9719,9722,9723,9724,9725,9726,9727) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:10:02] commit; [2026-11-11 14:10:02] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 14:10:08] begin; [2026-11-11 14:10:08] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:10:08] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =1386 order by venta_fecha desc [2026-11-11 14:10:08] commit; [2026-11-11 14:21:15] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 14:21:15] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 14:21:16] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:21:16] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 14:21:16] begin; [2026-11-11 14:21:16] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:21:16] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 14:21:16] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:21:16] commit; [2026-11-11 14:21:16] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 14:21:16] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 14:21:16] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 14:21:16] begin; [2026-11-11 14:21:16] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-11-11 14:21:16] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=2 and rsaldo<>0 and venta_anulada=false and cliente_id =1386 order by venta_fecha desc [2026-11-11 14:21:16] commit; [2026-11-11 14:24:30] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 14:24:30] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 14:24:31] begin; [2026-11-11 14:24:31] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:24:31] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:24:31] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 14:24:31] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 14:24:31] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (9728,9729,9730,10252,10257,10263,9751,10264,9753,10267,10269,10270,9764,9765,9766,9767,10295,10297,9787,10301,9796,10324,10330,9822,9824,9825,10343,10349,9843,9331,9332,9333,9338,9342,10369,9860,9861,9862,9350,10375,9351,9864,10377,9865,9869,9357,9870,9358,9359,9360,9362,9363,9364,9365,9884,9381,9384,9390,9392,10424,10426,9918,9920,9921,9922,9924,10438,9926,9415,9929,9417,10443,10445,9933,9426,9427,9428,9949,9440,10466,9443,9959,10476,9965,9453,10478,9454,9969,10483,9464,9978,9979,10497,9474,9475,10500,9476,10502,10503,10506,10008,10011,9500,10013,9501,10014,9502,10527,10015,9504,10529,10017,10019,9508,10533,9510,10024,10541,9517,9518,9519,10032,9522,10037,10043,10556,10044,9532,10557,9533,10048,10049,9545,9546,9547,9549,9550,10073,9567,9568,9569,9570,10087,9576,9578,9581,9582,9585,9586,9589,10614,9590,10615,10103,9598,9599,9600,10629,10635,10637,9613,9614,10642,10139,10653,9629,9630,10655,10146,10661,9638,9639,9645,9646,9647,9648,10170,10173,9662,9666,9667,9668,9669,9683,9684,10202,10205,9695,9696,10215,10229,9717,10230,9719,9722,9723,9724,9725,9726,9727) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:24:31] commit; [2026-11-11 14:24:32] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 14:26:11] begin; [2026-11-11 14:26:11] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:26:11] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 14:26:11] commit; [2026-11-11 14:41:33] begin; [2026-11-11 14:41:33] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:41:33] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =829 order by venta_fecha desc [2026-11-11 14:41:33] commit; [2026-11-11 14:41:41] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 14:41:41] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 14:41:42] begin; [2026-11-11 14:41:42] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:41:42] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:41:42] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 14:41:42] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 14:41:42] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:41:42] commit; [2026-11-11 14:41:42] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 14:41:47] begin; [2026-11-11 14:41:47] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:41:47] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=5 and rsaldo<>0 and venta_anulada=false and cliente_id =829 order by venta_fecha desc [2026-11-11 14:41:48] commit; [2026-11-11 14:42:10] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 14:42:10] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 14:42:11] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:42:11] begin; [2026-11-11 14:42:11] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:42:11] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 14:42:11] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 14:42:11] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (9728,9729,9730,10252,10257,10263,9751,10264,9753,10267,10269,10270,9764,9765,9766,9767,10295,10297,9787,10301,9796,10324,10330,9822,9824,9825,10343,10349,9843,9331,9332,9333,9338,9342,10369,9860,9861,9862,9350,10375,9351,9864,10377,9865,9869,9357,9870,9358,9359,9360,9362,9363,9364,9365,9884,9381,9384,9390,9392,10424,10426,9918,9920,9921,9922,9924,10438,9926,9415,9929,9417,10443,10445,9933,9426,9427,9428,9949,9440,10466,9443,9959,10476,9965,9453,10478,9454,9969,10483,9464,9978,9979,10497,9474,9475,10500,9476,10502,10503,10506,10008,10011,9500,10013,9501,10014,9502,10527,10015,9504,10529,10017,10019,9508,10533,9510,10024,10541,9517,9518,9519,10032,9522,10037,10043,10556,10044,9532,10557,9533,10048,10049,9545,9546,9547,9549,9550,10073,9567,9568,9569,9570,10087,9576,9578,9581,9582,9585,9586,9589,10614,9590,10615,10103,9598,9599,9600,10629,10635,10637,9613,9614,10642,10139,10653,9629,9630,10655,10146,10661,9638,9639,9645,9646,9647,9648,10170,10173,9662,9666,9667,9668,9669,9683,9684,10202,10205,9695,9696,10215,10229,9717,10230,9719,9722,9723,9724,9725,9726,9727) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:42:11] commit; [2026-11-11 14:42:11] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 14:42:19] begin; [2026-11-11 14:42:19] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:42:19] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =829 order by venta_fecha desc [2026-11-11 14:42:19] commit; [2026-11-11 14:43:08] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 14:43:08] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 14:43:09] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 14:43:09] begin; [2026-11-11 14:43:09] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:43:09] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 14:43:09] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:43:09] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 14:43:09] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (9728,9729,9730,10252,10257,10263,9751,10264,9753,10267,10269,10270,9764,9765,9766,9767,10295,10297,9787,10301,9796,10324,10330,9822,9824,9825,10343,10349,9843,9331,9332,9333,9338,9342,10369,9860,9861,9862,9350,10375,9351,9864,10377,9865,9869,9357,9870,9358,9359,9360,9362,9363,9364,9365,9884,9381,9384,9390,9392,10424,10426,9918,9920,9921,9922,9924,10438,9926,9415,9929,9417,10443,10445,9933,9426,9427,9428,9949,9440,10466,9443,9959,10476,9965,9453,10478,9454,9969,10483,9464,9978,9979,10497,9474,9475,10500,9476,10502,10503,10506,10008,10011,9500,10013,9501,10014,9502,10527,10015,9504,10529,10017,10019,9508,10533,9510,10024,10541,9517,9518,9519,10032,9522,10037,10043,10556,10044,9532,10557,9533,10048,10049,9545,9546,9547,9549,9550,10073,9567,9568,9569,9570,10087,9576,9578,9581,9582,9585,9586,9589,10614,9590,10615,10103,9598,9599,9600,10629,10635,10637,9613,9614,10642,10139,10653,9629,9630,10655,10146,10661,9638,9639,9645,9646,9647,9648,10170,10173,9662,9666,9667,9668,9669,9683,9684,10202,10205,9695,9696,10215,10229,9717,10230,9719,9722,9723,9724,9725,9726,9727) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:43:09] commit; [2026-11-11 14:43:16] begin; [2026-11-11 14:43:16] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:43:16] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =935 order by venta_fecha desc [2026-11-11 14:43:16] commit; [2026-11-11 14:43:42] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 14:43:42] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:43:42] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:43:42] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:43:42] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 14:43:42] begin; [2026-11-11 14:43:42] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:43:42] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 14:43:42] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:43:43] commit; [2026-11-11 14:43:46] begin; [2026-11-11 14:43:46] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:43:46] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 14:43:46] commit; [2026-11-11 14:43:48] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:43:48] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 14:43:48] begin; [2026-11-11 14:43:48] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:43:48] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 14:43:48] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:43:48] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:43:48] commit; [2026-11-11 14:43:50] begin; [2026-11-11 14:43:50] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:43:50] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 14:43:50] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:43:50] commit; [2026-11-11 14:43:51] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:43:51] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:43:51] begin; [2026-11-11 14:43:51] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:43:51] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 14:43:51] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 14:43:52] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:43:52] commit; [2026-11-11 14:43:57] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:43:57] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 14:43:58] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:43:58] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 14:43:58] begin; [2026-11-11 14:43:58] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:43:58] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 14:43:58] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:43:58] commit; [2026-11-11 14:43:58] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:44:01] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:44:01] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 14:44:01] begin; [2026-11-11 14:44:01] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:44:01] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 14:44:01] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:44:01] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:44:01] commit; [2026-11-11 14:44:02] begin; [2026-11-11 14:44:02] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:44:02] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=5 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 14:44:03] commit; [2026-11-11 14:44:14] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:44:14] begin; [2026-11-11 14:44:14] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:44:14] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:44:14] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 14:44:14] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 14:44:14] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:44:15] commit; [2026-11-11 14:44:16] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:44:16] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 14:44:16] begin; [2026-11-11 14:44:16] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:44:16] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 14:44:16] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:44:16] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:44:16] commit; [2026-11-11 14:48:19] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 14:48:19] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:48:19] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:48:19] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 14:48:19] begin; [2026-11-11 14:48:19] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 14:48:19] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 14:48:19] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:48:19] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:48:19] commit; [2026-11-11 14:48:24] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 14:48:24] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:48:27] begin; [2026-11-11 14:48:27] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:48:27] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =829 order by venta_fecha desc [2026-11-11 14:48:28] commit; [2026-11-11 14:48:32] begin; [2026-11-11 14:48:32] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 14:48:32] commit; [2026-11-11 14:48:40] begin; [2026-11-11 14:48:40] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:48:40] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =517 order by venta_fecha desc [2026-11-11 14:48:40] commit; [2026-11-11 14:48:48] begin; [2026-11-11 14:48:48] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:48:48] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =935 order by venta_fecha desc [2026-11-11 14:48:48] commit; [2026-11-11 14:50:21] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:50:21] begin; [2026-11-11 14:50:21] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:50:21] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 14:50:21] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 14:50:21] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:50:21] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:50:21] commit; [2026-11-11 14:50:22] begin; [2026-11-11 14:50:22] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:50:22] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 14:50:22] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:50:22] commit; [2026-11-11 14:56:46] begin; [2026-11-11 14:56:46] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:56:46] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 14:56:46] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:56:46] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 14:56:46] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:56:46] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:56:46] commit; [2026-11-11 14:57:57] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 14:57:57] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:57:57] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:57:57] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 14:57:58] begin; [2026-11-11 14:57:58] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:57:58] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 14:57:58] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 14:57:58] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 14:57:58] commit; [2026-11-11 14:58:00] begin; [2026-11-11 14:58:00] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 14:58:00] commit; [2026-11-11 14:58:05] begin; [2026-11-11 14:58:05] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 14:58:05] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =517 order by venta_fecha desc [2026-11-11 14:58:05] commit; [2026-11-11 15:00:41] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 15:00:41] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 15:00:41] begin; [2026-11-11 15:00:41] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 15:00:41] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 15:00:41] commit; [2026-11-11 15:00:42] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 15:00:42] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:00:42] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 15:00:42] begin; [2026-11-11 15:00:42] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:00:42] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 15:00:42] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:00:42] commit; [2026-11-11 15:00:43] begin; [2026-11-11 15:00:43] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:00:43] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 15:00:44] commit; [2026-11-11 15:01:25] begin; [2026-11-11 15:01:25] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:01:25] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 15:01:25] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:01:25] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 15:01:25] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 15:01:25] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:01:25] commit; [2026-11-11 15:01:47] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 15:01:47] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 15:01:47] begin; [2026-11-11 15:01:47] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 15:01:47] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 15:01:47] commit; [2026-11-11 15:01:47] begin; [2026-11-11 15:01:47] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:01:47] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:01:47] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 15:01:47] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 15:01:47] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:01:47] commit; [2026-11-11 15:01:48] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 15:01:52] begin; [2026-11-11 15:01:52] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:01:52] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 15:01:53] commit; [2026-11-11 15:02:16] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:02:16] begin; [2026-11-11 15:02:16] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:02:16] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 15:02:16] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 15:02:16] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:02:16] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 15:02:16] commit; [2026-11-11 15:03:57] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:03:57] begin; [2026-11-11 15:03:57] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:03:57] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 15:03:57] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 15:03:57] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:03:57] commit; [2026-11-11 15:03:57] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 15:04:00] begin; [2026-11-11 15:04:00] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:04:00] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 15:04:00] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:04:00] commit; [2026-11-11 15:37:14] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 15:37:14] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 15:37:15] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:37:15] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 15:37:15] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=13 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 15:37:15] begin; [2026-11-11 15:37:15] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:37:15] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =13 order by pedido_registro desc limit 200 [2026-11-11 15:37:15] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10250,10253,10254,10258,10278,10281,10282,10283,10285,10311,10313,10314,10316,9811,9812,9813,10326,10334,10335,10336,10337,9826,9827,9828,9829,9830,9831,10353,10354,10356,10358,10360,10361,10362,10365,10366,9854,10368,9857,10374,10385,9873,10389,10390,9878,10391,9879,10393,10394,10398,10399,10404,9895,9897,9899,9901,10416,9905,10419,9908,10421,10422,9919,10432,10440,10444,9936,9937,10450,9938,9939,10453,10454,9942,10455,9943,10456,9944,9945,9946,9947,10460,9953,9954,9955,9958,10474,9968,10481,10484,9973,10490,10492,10501,9997,10510,9998,10511,9999,10512,10513,10001,10514,10515,10004,10517,10518,10009,10523,10012,10532,10021,10025,10539,10030,10544,10039,10567,10568,10569,10572,10061,10062,10063,10064,10066,10067,10068,10069,10586,10074,10587,10589,10590,10591,10593,10594,10082,10595,10597,10598,10600,10090,10603,10092,10095,10096,10611,10101,10102,10622,10623,10624,10117,10631,10119,10633,10121,10634,10123,10124,10125,10638,10126,10640,10129,10130,10132,10645,10134,10136,10148,10150,10151,10152,10154,10168,10169,10175,10176,10179,10180,10183,10184,10185,10186,10187,10195,10196,10207,10208,10212,10213,10224,10226,10232,10233,10234,10235,10239) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:37:15] commit; [2026-11-11 15:45:53] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 15:45:53] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 15:45:53] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:45:53] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 15:45:53] begin; [2026-11-11 15:45:53] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:45:53] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 15:45:53] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 15:45:53] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:45:53] commit; [2026-11-11 15:45:56] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 15:45:56] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 15:45:59] begin; [2026-11-11 15:45:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 15:45:59] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=5 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 15:45:59] commit; [2026-11-11 15:46:06] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 15:46:06] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 15:46:06] begin; [2026-11-11 15:46:06] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 15:46:06] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 15:46:06] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 15:46:06] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:46:06] commit; [2026-11-11 15:49:49] begin; [2026-11-11 15:49:49] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:49:49] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =13 order by pedido_registro desc limit 200 [2026-11-11 15:49:49] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 15:49:49] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:49:49] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=13 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 15:49:49] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10250,10253,10254,10258,10278,10281,10282,10283,10285,10311,10313,10314,10316,9811,9812,9813,10326,10334,10335,10336,10337,9826,9827,9828,9829,9830,9831,10353,10354,10356,10358,10360,10361,10362,10365,10366,9854,10368,9857,10374,10385,9873,10389,10390,9878,10391,9879,10393,10394,10398,10399,10404,9895,9897,9899,9901,10416,9905,10419,9908,10421,10422,9919,10432,10440,10444,9936,9937,10450,9938,9939,10453,10454,9942,10455,9943,10456,9944,9945,9946,9947,10460,9953,9954,9955,9958,10474,9968,10481,10484,9973,10490,10492,10501,9997,10510,9998,10511,9999,10512,10513,10001,10514,10515,10004,10517,10518,10009,10523,10012,10532,10021,10025,10539,10030,10544,10039,10567,10568,10569,10572,10061,10062,10063,10064,10066,10067,10068,10069,10586,10074,10587,10589,10590,10591,10593,10594,10082,10595,10597,10598,10600,10090,10603,10092,10095,10096,10611,10101,10102,10622,10623,10624,10117,10631,10119,10633,10121,10634,10123,10124,10125,10638,10126,10640,10129,10130,10132,10645,10134,10136,10148,10150,10151,10152,10154,10168,10169,10175,10176,10179,10180,10183,10184,10185,10186,10187,10195,10196,10207,10208,10212,10213,10224,10226,10232,10233,10234,10235,10239) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:49:49] commit; [2026-11-11 15:49:51] begin; [2026-11-11 15:49:51] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:49:51] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =13 order by pedido_registro desc limit 200 [2026-11-11 15:49:51] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10250,10253,10254,10258,10278,10281,10282,10283,10285,10311,10313,10314,10316,9811,9812,9813,10326,10334,10335,10336,10337,9826,9827,9828,9829,9830,9831,10353,10354,10356,10358,10360,10361,10362,10365,10366,9854,10368,9857,10374,10385,9873,10389,10390,9878,10391,9879,10393,10394,10398,10399,10404,9895,9897,9899,9901,10416,9905,10419,9908,10421,10422,9919,10432,10440,10444,9936,9937,10450,9938,9939,10453,10454,9942,10455,9943,10456,9944,9945,9946,9947,10460,9953,9954,9955,9958,10474,9968,10481,10484,9973,10490,10492,10501,9997,10510,9998,10511,9999,10512,10513,10001,10514,10515,10004,10517,10518,10009,10523,10012,10532,10021,10025,10539,10030,10544,10039,10567,10568,10569,10572,10061,10062,10063,10064,10066,10067,10068,10069,10586,10074,10587,10589,10590,10591,10593,10594,10082,10595,10597,10598,10600,10090,10603,10092,10095,10096,10611,10101,10102,10622,10623,10624,10117,10631,10119,10633,10121,10634,10123,10124,10125,10638,10126,10640,10129,10130,10132,10645,10134,10136,10148,10150,10151,10152,10154,10168,10169,10175,10176,10179,10180,10183,10184,10185,10186,10187,10195,10196,10207,10208,10212,10213,10224,10226,10232,10233,10234,10235,10239) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:49:51] commit; [2026-11-11 15:50:44] begin; [2026-11-11 15:50:44] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 15:50:44] commit; [2026-11-11 15:50:47] begin; [2026-11-11 15:50:47] select transporte_id,transporte_descripcion,transporte_bloqueado from sh_principal.tbl_ven_transporte where 1=1 and transporte_bloqueado=false order by transporte_descripcion [2026-11-11 15:50:47] commit; [2026-11-11 15:50:55] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1454 and cliente_descuento_producto_id=3706 [2026-11-11 15:50:55] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1454 and producto_id=3706 [2026-11-11 15:52:59] begin; [2026-11-11 15:52:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:52:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:53:00] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 15:53:00] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 15:53:00] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (9728,9729,9730,10252,10257,10263,9751,10264,9753,10267,10269,10270,9764,9765,9766,9767,10295,10297,9787,10301,9796,10324,10330,9822,9824,9825,10343,10349,9843,9331,9332,9333,9338,9342,10369,9860,9861,9862,9350,10375,9351,9864,10377,9865,9869,9357,9870,9358,9359,9360,9362,9363,9364,9365,9884,9381,9384,9390,9392,10424,10426,9918,9920,9921,9922,9924,10438,9926,9415,9929,9417,10443,10445,9933,9426,9427,9428,9949,9440,10466,9443,9959,10476,9965,9453,10478,9454,9969,10483,9464,9978,9979,10497,9474,9475,10500,9476,10502,10503,10506,10008,10011,9500,10013,9501,10014,9502,10527,10015,9504,10529,10017,10019,9508,10533,9510,10024,10541,9517,9518,9519,10032,9522,10037,10043,10556,10044,9532,10557,9533,10048,10049,9545,9546,9547,9549,9550,10073,9567,9568,9569,9570,10087,9576,9578,9581,9582,9585,9586,9589,10614,9590,10615,10103,9598,9599,9600,10629,10635,10637,9613,9614,10642,10139,10653,9629,9630,10655,10146,10661,9638,9639,9645,9646,9647,9648,10170,10173,9662,9666,9667,9668,9669,9683,9684,10202,10205,9695,9696,10215,10229,9717,10230,9719,9722,9723,9724,9725,9726,9727) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:53:00] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 15:53:00] commit; [2026-11-11 15:53:00] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 15:53:01] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 15:53:20] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:53:20] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=13 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 15:53:20] begin; [2026-11-11 15:53:20] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:53:20] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =13 order by pedido_registro desc limit 200 [2026-11-11 15:53:20] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 15:53:20] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10250,10253,10254,10258,10278,10281,10282,10283,10285,10311,10313,10314,10316,9811,9812,9813,10326,10334,10335,10336,10337,9826,9827,9828,9829,9830,9831,10353,10354,10356,10358,10360,10361,10362,10365,10366,9854,10368,9857,10374,10385,9873,10389,10390,9878,10391,9879,10393,10394,10398,10399,10404,9895,9897,9899,9901,10416,9905,10419,9908,10421,10422,9919,10432,10440,10444,9936,9937,10450,9938,9939,10453,10454,9942,10455,9943,10456,9944,9945,9946,9947,10460,9953,9954,9955,9958,10474,9968,10481,10484,9973,10490,10492,10501,9997,10510,9998,10511,9999,10512,10513,10001,10514,10515,10004,10517,10518,10009,10523,10012,10532,10021,10025,10539,10030,10544,10039,10567,10568,10569,10572,10061,10062,10063,10064,10066,10067,10068,10069,10586,10074,10587,10589,10590,10591,10593,10594,10082,10595,10597,10598,10600,10090,10603,10092,10095,10096,10611,10101,10102,10622,10623,10624,10117,10631,10119,10633,10121,10634,10123,10124,10125,10638,10126,10640,10129,10130,10132,10645,10134,10136,10148,10150,10151,10152,10154,10168,10169,10175,10176,10179,10180,10183,10184,10185,10186,10187,10195,10196,10207,10208,10212,10213,10224,10226,10232,10233,10234,10235,10239) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:53:20] commit; [2026-11-11 15:53:21] begin; [2026-11-11 15:53:21] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:53:21] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =13 order by pedido_registro desc limit 200 [2026-11-11 15:53:21] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10250,10253,10254,10258,10278,10281,10282,10283,10285,10311,10313,10314,10316,9811,9812,9813,10326,10334,10335,10336,10337,9826,9827,9828,9829,9830,9831,10353,10354,10356,10358,10360,10361,10362,10365,10366,9854,10368,9857,10374,10385,9873,10389,10390,9878,10391,9879,10393,10394,10398,10399,10404,9895,9897,9899,9901,10416,9905,10419,9908,10421,10422,9919,10432,10440,10444,9936,9937,10450,9938,9939,10453,10454,9942,10455,9943,10456,9944,9945,9946,9947,10460,9953,9954,9955,9958,10474,9968,10481,10484,9973,10490,10492,10501,9997,10510,9998,10511,9999,10512,10513,10001,10514,10515,10004,10517,10518,10009,10523,10012,10532,10021,10025,10539,10030,10544,10039,10567,10568,10569,10572,10061,10062,10063,10064,10066,10067,10068,10069,10586,10074,10587,10589,10590,10591,10593,10594,10082,10595,10597,10598,10600,10090,10603,10092,10095,10096,10611,10101,10102,10622,10623,10624,10117,10631,10119,10633,10121,10634,10123,10124,10125,10638,10126,10640,10129,10130,10132,10645,10134,10136,10148,10150,10151,10152,10154,10168,10169,10175,10176,10179,10180,10183,10184,10185,10186,10187,10195,10196,10207,10208,10212,10213,10224,10226,10232,10233,10234,10235,10239) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:53:21] commit; [2026-11-11 15:53:28] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1454 and cliente_descuento_producto_id=3706 [2026-11-11 15:53:28] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1454 and producto_id=3706 [2026-11-11 15:53:51] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:53:52] begin; [2026-11-11 15:53:52] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 15:53:52] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10671','MONICA NAJERA � Q5,500.00','/pedido/10671',10671,'tbl_ven_pedido',1,13) returning notificacion_id [2026-11-11 15:53:52] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 15:53:52] commit; [2026-11-11 15:53:52] begin; [2026-11-11 15:53:52] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:53:52] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and pedido_id =10671 order by pedido_registro desc limit 1 [2026-11-11 15:53:52] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10671) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:53:52] commit; [2026-11-11 15:53:59] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 15:53:59] begin; [2026-11-11 15:53:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:53:59] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =13 order by pedido_registro desc limit 200 [2026-11-11 15:53:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:53:59] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=13 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 15:53:59] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10250,10253,10254,10258,10278,10281,10282,10283,10285,10311,10313,10314,10316,9812,9813,10326,10334,10335,10336,10337,9826,9827,9828,9829,9830,9831,10353,10354,10356,10358,10360,10361,10362,10365,10366,9854,10368,9857,10374,10385,9873,10389,10390,9878,10391,9879,10393,10394,10398,10399,10404,9895,9897,9899,9901,10416,9905,10419,9908,10421,10422,9919,10432,10440,10444,9936,9937,10450,9938,9939,10453,10454,9942,10455,9943,10456,9944,9945,9946,9947,10460,9953,9954,9955,9958,10474,9968,10481,10484,9973,10490,10492,10501,9997,10510,9998,10511,9999,10512,10513,10001,10514,10515,10004,10517,10518,10009,10523,10012,10532,10021,10025,10539,10030,10544,10039,10567,10568,10569,10572,10061,10062,10063,10064,10066,10067,10068,10069,10586,10074,10587,10589,10590,10591,10593,10594,10082,10595,10597,10598,10600,10090,10603,10092,10095,10096,10611,10101,10102,10622,10623,10624,10117,10631,10119,10633,10121,10634,10123,10124,10125,10638,10126,10640,10129,10130,10132,10645,10134,10136,10148,10150,10151,10152,10154,10671,10168,10169,10175,10176,10179,10180,10183,10184,10185,10186,10187,10195,10196,10207,10208,10212,10213,10224,10226,10232,10233,10234,10235,10239) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:53:59] commit; [2026-11-11 15:54:01] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 15:54:01] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 15:54:01] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:54:01] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=13 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 15:54:01] begin; [2026-11-11 15:54:01] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:54:01] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =13 order by pedido_registro desc limit 200 [2026-11-11 15:54:01] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10250,10253,10254,10258,10278,10281,10282,10283,10285,10311,10313,10314,10316,9812,9813,10326,10334,10335,10336,10337,9826,9827,9828,9829,9830,9831,10353,10354,10356,10358,10360,10361,10362,10365,10366,9854,10368,9857,10374,10385,9873,10389,10390,9878,10391,9879,10393,10394,10398,10399,10404,9895,9897,9899,9901,10416,9905,10419,9908,10421,10422,9919,10432,10440,10444,9936,9937,10450,9938,9939,10453,10454,9942,10455,9943,10456,9944,9945,9946,9947,10460,9953,9954,9955,9958,10474,9968,10481,10484,9973,10490,10492,10501,9997,10510,9998,10511,9999,10512,10513,10001,10514,10515,10004,10517,10518,10009,10523,10012,10532,10021,10025,10539,10030,10544,10039,10567,10568,10569,10572,10061,10062,10063,10064,10066,10067,10068,10069,10586,10074,10587,10589,10590,10591,10593,10594,10082,10595,10597,10598,10600,10090,10603,10092,10095,10096,10611,10101,10102,10622,10623,10624,10117,10631,10119,10633,10121,10634,10123,10124,10125,10638,10126,10640,10129,10130,10132,10645,10134,10136,10148,10150,10151,10152,10154,10671,10168,10169,10175,10176,10179,10180,10183,10184,10185,10186,10187,10195,10196,10207,10208,10212,10213,10224,10226,10232,10233,10234,10235,10239) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:54:01] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 15:54:01] commit; [2026-11-11 15:55:41] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 15:55:41] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 15:55:41] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 15:55:41] begin; [2026-11-11 15:55:41] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 15:55:41] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 15:55:41] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 15:55:41] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:55:41] commit; [2026-11-11 15:55:41] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 15:55:42] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 15:55:42] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 15:55:45] begin; [2026-11-11 15:55:45] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:55:45] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 15:55:45] commit; [2026-11-11 15:56:44] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:56:44] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 15:56:44] begin; [2026-11-11 15:56:44] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:56:44] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 15:56:44] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 15:56:44] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:56:44] commit; [2026-11-11 15:57:06] begin; [2026-11-11 15:57:06] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:57:06] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 15:57:06] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 15:57:06] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 15:57:06] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 15:57:06] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 15:57:06] commit; [2026-11-11 16:00:49] begin; [2026-11-11 16:00:49] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:00:49] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:00:49] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:00:49] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 16:00:49] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:00:49] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:00:49] commit; [2026-11-11 16:01:41] begin; [2026-11-11 16:01:41] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:01:41] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:01:41] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:01:41] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:01:41] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 16:01:41] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:01:41] commit; [2026-11-11 16:02:58] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 16:02:58] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:02:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 16:02:59] begin; [2026-11-11 16:02:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 16:02:59] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 16:02:59] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:02:59] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:02:59] commit; [2026-11-11 16:03:00] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:03:02] begin; [2026-11-11 16:03:02] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 16:03:02] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=5 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 16:03:03] commit; [2026-11-11 16:03:21] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:03:21] begin; [2026-11-11 16:03:21] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 16:03:21] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 16:03:21] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:03:21] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 16:03:21] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:03:21] commit; [2026-11-11 16:03:42] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:03:42] begin; [2026-11-11 16:03:42] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 16:03:42] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 16:03:42] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:03:42] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 16:03:42] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:03:42] commit; [2026-11-11 16:05:42] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 16:05:42] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:11:07] begin; [2026-11-11 16:11:07] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 16:11:07] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10671 FUE FACTURADO','MONICA NAJERA � FACTURA FCAM-21094 � Q2,375.00','/pedido/10671',10671,'tbl_ven_pedido',1,9) returning notificacion_id [2026-11-11 16:11:07] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1758,13) on conflict do nothing [2026-11-11 16:11:07] commit; [2026-11-11 16:11:07] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 16:11:07] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 16:11:07] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 16:11:07] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 16:11:07] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (13) and usuario_uid_push_endpoint<>'' [2026-11-11 16:11:39] begin; [2026-11-11 16:11:39] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 16:11:39] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10671 FUE FACTURADO','MONICA NAJERA � FACTURA FCAM-21096 � Q2,375.00','/pedido/10671',10671,'tbl_ven_pedido',1,9) returning notificacion_id [2026-11-11 16:11:39] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1759,13) on conflict do nothing [2026-11-11 16:11:39] commit; [2026-11-11 16:11:39] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 16:11:39] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 16:11:39] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 16:11:39] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 16:11:39] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (13) and usuario_uid_push_endpoint<>'' [2026-11-11 16:22:02] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:22:02] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:22:02] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 16:22:02] begin; [2026-11-11 16:22:02] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:22:02] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:22:02] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:22:02] commit; [2026-11-11 16:23:05] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:23:05] begin; [2026-11-11 16:23:05] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:23:05] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:23:05] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:23:05] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 16:23:05] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 16:23:05] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:23:05] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:23:05] commit; [2026-11-11 16:23:08] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 16:23:08] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:23:12] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 16:23:12] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:23:17] begin; [2026-11-11 16:23:17] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:23:17] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:23:17] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:23:17] commit; [2026-11-11 16:23:25] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:23:25] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 16:23:25] begin; [2026-11-11 16:23:25] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:23:25] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:23:25] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:23:25] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:23:25] commit; [2026-11-11 16:23:31] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 16:23:31] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:23:31] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:23:31] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 16:23:31] begin; [2026-11-11 16:23:31] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:23:31] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:23:31] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:23:31] commit; [2026-11-11 16:23:32] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:23:36] begin; [2026-11-11 16:23:36] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 16:23:36] commit; [2026-11-11 16:23:47] begin; [2026-11-11 16:23:47] select transporte_id,transporte_descripcion,transporte_bloqueado from sh_principal.tbl_ven_transporte where 1=1 and transporte_bloqueado=false order by transporte_descripcion [2026-11-11 16:23:47] commit; [2026-11-11 16:24:00] begin; [2026-11-11 16:24:00] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:24:00] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:24:00] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:24:00] commit; [2026-11-11 16:24:05] begin; [2026-11-11 16:24:05] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:24:05] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 16:24:06] commit; [2026-11-11 16:24:54] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:24:54] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 16:24:54] begin; [2026-11-11 16:24:54] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:24:54] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:24:54] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:24:54] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:24:54] commit; [2026-11-11 16:24:58] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:24:58] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 16:24:59] begin; [2026-11-11 16:24:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:24:59] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:24:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:24:59] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 16:24:59] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:24:59] commit; [2026-11-11 16:24:59] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:25:06] begin; [2026-11-11 16:25:06] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:25:06] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:25:06] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (8715,9744,10259,8213,8214,8215,9754,8730,8732,8733,10271,9759,9762,8740,9253,8229,8232,8235,8237,10288,10291,8756,9269,9270,8759,10300,9789,8253,9278,9279,8768,9794,9795,10318,10320,8272,10321,8278,9815,9817,9307,9309,9315,8299,8300,9839,9328,9841,9337,8313,9339,9340,8316,9858,8836,9353,8847,8336,9877,8341,8342,9891,10406,9383,10408,10411,9902,9391,9393,8882,8885,8886,9912,10427,9408,9412,8905,9930,9932,8908,8397,9422,9423,8911,10448,8400,8914,8917,8918,8919,9433,8921,8922,9950,9444,8937,9966,8431,8432,8438,9976,8441,9467,9469,9470,9472,9480,8462,8978,9499,10524,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,10550,9526,10552,8504,10553,9529,9018,10555,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10574,10575,10578,10078,10079,9055,9056,8548,10085,9579,10093,10094,10097,8561,10610,10098,9596,8584,8586,9612,10131,9108,9621,8597,8598,9111,8600,10142,10143,8607,9636,9124,9637,9126,10665,9130,9131,10156,9132,10157,8633,8640,9164,9167,9169,9690,9692,9184,8672,8673,9699,8675,8677,8678,8680,8681,10219,8691,8694,9208) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:25:06] commit; [2026-11-11 16:25:20] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 16:25:20] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:25:21] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 16:25:21] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:25:21] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 16:25:21] begin; [2026-11-11 16:25:21] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 16:25:21] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:25:21] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:25:21] commit; [2026-11-11 16:25:24] begin; [2026-11-11 16:25:24] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 16:25:24] commit; [2026-11-11 16:25:31] begin; [2026-11-11 16:25:31] select transporte_id,transporte_descripcion,transporte_bloqueado from sh_principal.tbl_ven_transporte where 1=1 and transporte_bloqueado=false order by transporte_descripcion [2026-11-11 16:25:31] commit; [2026-11-11 16:25:37] begin; [2026-11-11 16:25:37] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 16:25:37] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=5 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 16:25:38] commit; [2026-11-11 16:25:42] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=34 and cliente_descuento_producto_id=3813 [2026-11-11 16:25:42] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=34 and producto_id=3813 [2026-11-11 16:25:49] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 16:25:49] begin; [2026-11-11 16:25:49] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 16:25:49] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10672','CONRADO MARROQUIN � Q510.00','/pedido/10672',10672,'tbl_ven_pedido',5,14) returning notificacion_id [2026-11-11 16:25:49] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 16:25:49] commit; [2026-11-11 16:25:50] begin; [2026-11-11 16:25:50] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 16:25:50] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and pedido_id =10672 order by pedido_registro desc limit 1 [2026-11-11 16:25:50] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10672) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:25:50] commit; [2026-11-11 16:25:51] begin; [2026-11-11 16:25:51] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 16:25:51] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:25:52] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,10672,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:25:52] commit; [2026-11-11 16:25:53] begin; [2026-11-11 16:25:53] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 16:25:53] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 16:25:53] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 16:25:53] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 16:25:53] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 16:25:53] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,10672,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:25:53] commit; [2026-11-11 16:31:36] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 16:31:36] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 16:31:36] begin; [2026-11-11 16:31:36] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:31:36] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 16:31:36] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:31:36] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 16:31:36] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:31:36] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 16:31:36] commit; [2026-11-11 16:31:36] begin; [2026-11-11 16:31:36] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 16:31:36] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 16:31:36] commit; [2026-11-11 16:31:38] begin; [2026-11-11 16:31:38] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:31:38] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 16:31:39] commit; [2026-11-11 16:32:31] begin; [2026-11-11 16:32:31] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:32:31] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 16:32:31] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 16:32:31] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:32:31] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 16:32:31] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:32:31] commit; [2026-11-11 16:35:14] begin; [2026-11-11 16:35:14] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 16:35:14] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10672 FUE FACTURADO','CONRADO MARROQUIN � FACTURA FCAM-2256 � Q510.00','/pedido/10672',10672,'tbl_ven_pedido',5,9) returning notificacion_id [2026-11-11 16:35:14] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1761,14) on conflict do nothing [2026-11-11 16:35:14] commit; [2026-11-11 16:35:14] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 16:35:14] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 16:35:14] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 16:35:14] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 16:35:14] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (14) and usuario_uid_push_endpoint<>'' [2026-11-11 16:57:09] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 16:57:09] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 16:57:09] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 16:57:09] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:57:10] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 16:57:10] begin; [2026-11-11 16:57:10] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:57:10] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 16:57:10] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:57:10] begin; [2026-11-11 16:57:10] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 16:57:10] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 16:57:10] commit; [2026-11-11 16:57:10] commit; [2026-11-11 16:57:11] begin; [2026-11-11 16:57:11] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:57:11] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 16:57:12] commit; [2026-11-11 16:59:17] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:59:17] begin; [2026-11-11 16:59:17] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 16:59:17] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 16:59:17] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 16:59:17] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 16:59:17] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 16:59:17] commit; [2026-11-11 17:03:11] begin; [2026-11-11 17:03:11] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 17:03:11] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=5 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 17:03:12] commit; [2026-11-11 17:03:56] begin; [2026-11-11 17:03:56] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 17:03:56] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 17:03:56] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 17:03:56] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 17:03:56] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 17:03:56] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 17:03:56] commit; [2026-11-11 17:04:22] begin; [2026-11-11 17:04:22] select transporte_id,transporte_descripcion,transporte_bloqueado from sh_principal.tbl_ven_transporte where 1=1 and transporte_bloqueado=false order by transporte_descripcion [2026-11-11 17:04:22] commit; [2026-11-11 17:04:36] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1279 and cliente_descuento_producto_id=3829 [2026-11-11 17:04:36] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1279 and producto_id=3829 [2026-11-11 17:04:41] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1279 and cliente_descuento_producto_id=3830 [2026-11-11 17:04:41] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1279 and producto_id=3830 [2026-11-11 17:04:53] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 17:04:53] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 17:04:53] begin; [2026-11-11 17:04:53] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 17:04:53] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 17:04:53] commit; [2026-11-11 17:04:54] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 17:04:54] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:04:54] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 17:04:54] begin; [2026-11-11 17:04:54] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:04:54] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 17:04:54] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 17:04:54] commit; [2026-11-11 17:04:56] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1279 and cliente_descuento_producto_id=3827 [2026-11-11 17:04:56] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1279 and producto_id=3827 [2026-11-11 17:04:58] begin; [2026-11-11 17:04:58] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:04:58] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 17:04:59] commit; [2026-11-11 17:05:07] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1279 and cliente_descuento_producto_id=3826 [2026-11-11 17:05:07] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1279 and producto_id=3826 [2026-11-11 17:05:13] begin; [2026-11-11 17:05:13] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 17:05:13] commit; [2026-11-11 17:05:21] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1279 and cliente_descuento_producto_id=3813 [2026-11-11 17:05:21] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1279 and producto_id=3813 [2026-11-11 17:05:25] begin; [2026-11-11 17:05:25] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:05:25] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =1783 order by venta_fecha desc [2026-11-11 17:05:25] commit; [2026-11-11 17:05:29] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 17:05:29] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 17:05:30] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:05:30] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 17:05:30] begin; [2026-11-11 17:05:30] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:05:30] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 17:05:30] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 17:05:30] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 17:05:30] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 17:05:30] begin; [2026-11-11 17:05:30] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 17:05:30] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =13 order by pedido_registro desc limit 200 [2026-11-11 17:05:30] commit; [2026-11-11 17:05:30] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 17:05:30] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=13 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 17:05:30] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10249,10000,10530,10531,10279,10280,10284,9773,10286,10543,9775,10545,10547,9786,10307,10308,10309,10310,10312,9801,10315,10060,9808,10065,9810,10588,10592,10083,10596,10601,10091,10605,9844,10357,9845,9846,10359,9847,9848,9849,9850,10363,9851,10364,9852,9853,9856,10625,10626,9863,10632,10120,10122,10639,10127,10387,10388,10646,10392,9881,10396,10397,9885,9887,10400,10145,10402,10403,9892,10149,9896,10153,10410,10668,9900,10415,9904,10417,9906,10167,10433,10177,10434,10178,10181,10182,10451,10452,9940,9941,10461,10209,10210,10211,10475,10225,10491,10238) order by pedidod_pedido_id, pedidod_id [2026-11-11 17:05:30] commit; [2026-11-11 17:05:34] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 17:05:34] begin; [2026-11-11 17:05:34] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 17:05:34] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10673','GRUPO DE INVERSORES EN MEDICINA VETERINARIA � Q4,685.00','/pedido/10673',10673,'tbl_ven_pedido',5,16) returning notificacion_id [2026-11-11 17:05:34] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 17:05:34] commit; [2026-11-11 17:05:34] begin; [2026-11-11 17:05:34] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 17:05:34] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and pedido_id =10673 order by pedido_registro desc limit 1 [2026-11-11 17:05:34] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10673) order by pedidod_pedido_id, pedidod_id [2026-11-11 17:05:34] commit; [2026-11-11 17:05:36] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 17:05:36] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 17:05:36] begin; [2026-11-11 17:05:36] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 17:05:36] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 17:05:36] commit; [2026-11-11 17:05:37] begin; [2026-11-11 17:05:37] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 17:05:37] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=5 and rsaldo<>0 and venta_anulada=false and cliente_id =1783 order by venta_fecha desc [2026-11-11 17:05:37] commit; [2026-11-11 17:05:37] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:05:37] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 17:05:37] begin; [2026-11-11 17:05:37] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:05:37] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 17:05:37] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 17:05:37] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 17:05:37] commit; [2026-11-11 17:05:39] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 17:05:39] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 17:05:41] begin; [2026-11-11 17:05:41] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:05:41] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 17:05:42] commit; [2026-11-11 17:06:04] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1279 and cliente_descuento_producto_id=582 [2026-11-11 17:06:04] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1279 and producto_id=582 [2026-11-11 17:06:13] begin; [2026-11-11 17:06:13] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:06:13] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:06:13] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 17:06:13] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 17:06:13] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 17:06:13] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 17:06:13] commit; [2026-11-11 17:06:15] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=1279 and cliente_descuento_producto_id=581 [2026-11-11 17:06:15] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=1279 and producto_id=581 [2026-11-11 17:06:22] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:06:22] begin; [2026-11-11 17:06:22] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 17:06:22] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10674','GRUPO DE INVERSORES EN MEDICINA VETERINARIA � Q660.00','/pedido/10674',10674,'tbl_ven_pedido',1,16) returning notificacion_id [2026-11-11 17:06:22] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 17:06:22] commit; [2026-11-11 17:06:22] begin; [2026-11-11 17:06:22] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:06:22] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and pedido_id =10674 order by pedido_registro desc limit 1 [2026-11-11 17:06:22] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10674) order by pedidod_pedido_id, pedidod_id [2026-11-11 17:06:22] commit; [2026-11-11 17:06:26] begin; [2026-11-11 17:06:26] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:06:26] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:06:26] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 17:06:26] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 17:06:26] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (9728,9729,9730,10252,10257,10263,9751,10264,9753,10267,10269,10270,9764,9765,9766,9767,10295,10297,9787,10301,9796,10324,10330,9822,9824,9825,10343,10349,9843,9332,9333,9338,9342,10369,9860,9861,9862,9350,10375,9351,9864,10377,9865,9869,9357,9870,9358,9359,9360,9362,9363,9364,9365,9884,9381,9384,9390,9392,10424,10426,9918,9920,9921,9922,9924,10438,9926,9415,9929,9417,10443,10445,9933,9426,9427,9428,9949,9440,10466,9443,9959,10476,9965,9453,10478,9454,9969,10483,9464,9978,9979,10497,9474,9475,10500,9476,10502,10503,10506,10008,10011,9500,10013,9501,10014,9502,10527,10015,9504,10529,10017,10019,9508,10533,9510,10024,10541,9517,9518,9519,10032,9522,10037,10043,10556,10044,9532,10557,9533,10048,10049,9545,9546,9547,9549,9550,10073,9567,9568,9569,9570,10087,9576,9578,9581,9582,9585,9586,9589,10614,9590,10615,10103,9598,9599,9600,10629,10635,10637,9613,9614,10642,10139,10653,9629,9630,10655,10146,10661,9638,9639,9645,9646,9647,9648,10674,10170,10173,9662,9666,9667,9668,9669,9683,9684,10202,10205,9695,9696,10215,10229,9717,10230,9719,9722,9723,9724,9725,9726,9727) order by pedidod_pedido_id, pedidod_id [2026-11-11 17:06:26] commit; [2026-11-11 17:06:28] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 17:06:28] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 17:06:30] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 17:06:30] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 17:06:30] begin; [2026-11-11 17:06:30] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 17:06:30] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 17:06:30] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10673,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 17:06:30] commit; [2026-11-11 17:08:50] begin; [2026-11-11 17:08:50] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 17:08:50] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10674 FUE FACTURADO','GRUPO DE INVERSORES EN MEDICINA VETERINARIA � FACTURA FCAM-21099 � Q660.00','/pedido/10674',10674,'tbl_ven_pedido',1,9) returning notificacion_id [2026-11-11 17:08:50] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1764,16) on conflict do nothing [2026-11-11 17:08:50] commit; [2026-11-11 17:08:50] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 17:08:50] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 17:08:50] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 17:08:50] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 17:08:50] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (16) and usuario_uid_push_endpoint<>'' [2026-11-11 17:10:02] begin; [2026-11-11 17:10:02] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='PEDIDO_FACTURADO' limit 1 [2026-11-11 17:10:02] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (3,'TU PEDIDO #10673 FUE FACTURADO','GRUPO DE INVERSORES EN MEDICINA VETERINARIA � FACTURA FCAM-2257 � Q4,685.00','/pedido/10673',10673,'tbl_ven_pedido',5,9) returning notificacion_id [2026-11-11 17:10:02] insert into sh_principal.tbl_gen_notificacion_usuario (notificacion_usuario_notificacion_id, notificacion_usuario_usuario_id) values (1765,16) on conflict do nothing [2026-11-11 17:10:02] commit; [2026-11-11 17:10:02] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PUBLIC_KEY' [2026-11-11 17:10:02] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_PRIVATE_KEY' [2026-11-11 17:10:02] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='VAPID_SUBJECT' [2026-11-11 17:10:02] select param_valor from sh_principal.tbl_gen_parametros where upper(trim(param_nombre))='URL_APP' limit 1 [2026-11-11 17:10:02] select usuario_uid_push_usuario_id, usuario_uid_push_endpoint, usuario_uid_push_p256dh, usuario_uid_push_auth from sh_principal.tbl_gen_usuario_uid_push where usuario_uid_push_usuario_id in (16) and usuario_uid_push_endpoint<>'' [2026-11-11 17:17:45] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 17:17:45] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 17:17:45] begin; [2026-11-11 17:17:45] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 17:17:45] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 17:17:45] commit; [2026-11-11 17:17:45] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:17:45] begin; [2026-11-11 17:17:45] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:17:45] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 17:17:45] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 17:17:45] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 17:17:45] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 17:17:45] commit; [2026-11-11 17:17:47] begin; [2026-11-11 17:17:47] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 17:17:47] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 17:17:47] commit; [2026-11-11 18:53:10] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-11-11 18:53:10] begin; [2026-11-11 18:53:10] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 18:53:10] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 18:53:10] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-11-11 18:53:10] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=16 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 18:53:10] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10496,10499,10376,10378,9866,9867,9871,10256,10262,10265,10138,10010,9883,10268,10654,9886,10528,9888,9889,10147,10660,10020,10662,9894,10540,10158,10159,10673,10289,10290,10038,10425,10041,10042,9915,10558,10559,10560,10562,10565,9928,10188,10317,10581,10328,10458,9948,10464,10080,10084,10345,10348,10607,10479,10608,10609,10482,9970,10612,10228,10613,10485,10231,9977,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-11-11 18:53:10] commit; [2026-11-11 19:13:46] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 19:13:46] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 19:13:46] begin; [2026-11-11 19:13:46] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 19:13:46] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 19:13:46] commit; [2026-11-11 19:13:46] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 19:13:46] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 19:13:46] begin; [2026-11-11 19:13:46] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 19:13:46] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 19:13:46] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 19:13:46] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 19:13:46] commit; [2026-11-11 19:13:52] begin; [2026-11-11 19:13:52] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 19:13:52] commit; [2026-11-11 19:14:04] begin; [2026-11-11 19:14:04] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 19:14:04] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =395 order by venta_fecha desc [2026-11-11 19:14:04] commit; [2026-11-11 19:15:15] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 19:15:15] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 19:15:15] begin; [2026-11-11 19:15:15] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 19:15:15] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 19:15:15] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 19:15:15] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 19:15:15] commit; [2026-11-11 19:47:05] begin; [2026-11-11 19:47:05] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 19:47:05] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=5 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 19:47:06] commit; [2026-11-11 20:58:13] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 20:58:13] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 20:58:13] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 20:58:13] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 20:58:13] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 20:58:13] begin; [2026-11-11 20:58:13] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 20:58:13] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 20:58:13] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,10672,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 20:58:13] commit; [2026-11-11 20:58:15] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 20:58:15] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 20:58:19] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 20:58:19] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 20:58:29] begin; [2026-11-11 20:58:29] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 20:58:29] commit; [2026-11-11 20:58:31] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 20:58:31] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 20:58:31] begin; [2026-11-11 20:58:31] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 20:58:31] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 20:58:31] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 20:58:31] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,10672,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 20:58:31] commit; [2026-11-11 21:05:58] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:05:58] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 21:05:58] begin; [2026-11-11 21:05:58] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 21:05:58] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 21:05:58] commit; [2026-11-11 21:05:58] begin; [2026-11-11 21:05:58] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:05:58] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:05:58] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:05:58] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:05:58] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 21:05:58] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:05:58] commit; [2026-11-11 21:06:05] begin; [2026-11-11 21:06:05] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 21:06:05] commit; [2026-11-11 21:06:11] begin; [2026-11-11 21:06:11] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:06:11] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =637 order by venta_fecha desc [2026-11-11 21:06:11] commit; [2026-11-11 21:13:53] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:13:53] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 21:13:53] begin; [2026-11-11 21:13:53] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 21:13:53] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 21:13:53] commit; [2026-11-11 21:13:54] begin; [2026-11-11 21:13:54] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:13:54] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:13:54] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:13:54] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:13:54] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 21:13:54] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,9591,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:13:54] commit; [2026-11-11 21:14:00] begin; [2026-11-11 21:14:00] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 21:14:00] commit; [2026-11-11 21:14:11] begin; [2026-11-11 21:14:11] select transporte_id,transporte_descripcion,transporte_bloqueado from sh_principal.tbl_ven_transporte where 1=1 and transporte_bloqueado=false order by transporte_descripcion [2026-11-11 21:14:11] commit; [2026-11-11 21:14:25] begin; [2026-11-11 21:14:25] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:14:25] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 21:14:26] commit; [2026-11-11 21:14:38] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=54 and cliente_descuento_producto_id=2957 [2026-11-11 21:14:38] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=54 and producto_id=2957 [2026-11-11 21:15:11] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=54 and cliente_descuento_producto_id=2960 [2026-11-11 21:15:11] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=54 and producto_id=2960 [2026-11-11 21:15:26] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=54 and cliente_descuento_producto_id=2950 [2026-11-11 21:15:26] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=54 and producto_id=2950 [2026-11-11 21:15:43] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=54 and cliente_descuento_producto_id=2976 [2026-11-11 21:15:43] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=54 and producto_id=2976 [2026-11-11 21:16:04] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=54 and cliente_descuento_producto_id=2946 [2026-11-11 21:16:04] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=54 and producto_id=2946 [2026-11-11 21:16:42] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:16:43] begin; [2026-11-11 21:16:43] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:16:43] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and pedido_id =10675 order by pedido_registro desc limit 1 [2026-11-11 21:16:43] begin; [2026-11-11 21:16:43] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 21:16:43] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10675','REPTILES Y ANFIBIOS EXCLUSIVOS DE GUATEMALA, SOCIEDAD ANONIMA � Q692.00','/pedido/10675',10675,'tbl_ven_pedido',1,15) returning notificacion_id [2026-11-11 21:16:43] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 21:16:43] commit; [2026-11-11 21:16:43] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10675) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:16:43] commit; [2026-11-11 21:17:42] begin; [2026-11-11 21:17:42] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:17:42] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:17:42] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:17:42] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:17:42] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 21:17:42] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10675,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:17:42] commit; [2026-11-11 21:17:44] begin; [2026-11-11 21:17:44] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:17:44] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:17:44] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10675,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:17:44] commit; [2026-11-11 21:18:48] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:18:48] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 21:18:48] begin; [2026-11-11 21:18:48] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:18:48] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:18:48] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:18:48] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,10616,9592,9593,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10675,10163,9651,10164,9652,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:18:48] commit; [2026-11-11 21:18:49] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 21:18:49] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:18:49] begin; [2026-11-11 21:18:49] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 21:18:49] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 21:18:49] commit; [2026-11-11 21:19:12] begin; [2026-11-11 21:19:12] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:19:12] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=5 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 21:19:12] commit; [2026-11-11 21:19:27] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=773 and cliente_descuento_producto_id=3860 [2026-11-11 21:19:27] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=773 and producto_id=3860 [2026-11-11 21:19:53] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 21:19:53] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:19:53] begin; [2026-11-11 21:19:53] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 21:19:53] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 21:19:53] commit; [2026-11-11 21:19:54] begin; [2026-11-11 21:19:54] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:19:54] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:19:54] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:19:54] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:19:54] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 21:19:54] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10112,9984,9986,10052,9989,9800,10379,10508,9868,10255,10384,9745,10644,10585,10651,10331,9819,9821,10274,10659,10536,9768,9769,9771,10350,9778,10486,10166,9910,10488,10106,10171,10620,10302,10110,9982) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:19:54] commit; [2026-11-11 21:20:04] begin; [2026-11-11 21:20:04] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:20:04] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:20:04] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10112,9984,9986,10052,9989,9800,10379,10508,9868,10255,10384,9745,10644,10585,10651,10331,9819,9821,10274,10659,10536,9768,9769,9771,10350,9778,10486,10166,9910,10488,10106,10171,10620,10302,10110,9982) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:20:04] commit; [2026-11-11 21:20:08] begin; [2026-11-11 21:20:08] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:20:08] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:20:08] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:20:08] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:20:08] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 21:20:08] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10112,9984,9986,10052,9989,9800,10379,10508,9868,10255,10384,9745,10644,10585,10651,10331,9819,9821,10274,10659,10536,9768,9769,9771,10350,9778,10486,10166,9910,10488,10106,10171,10620,10302,10110,9982) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:20:08] commit; [2026-11-11 21:21:46] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:21:46] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 21:21:46] begin; [2026-11-11 21:21:46] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 21:21:46] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 21:21:46] commit; [2026-11-11 21:21:48] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:21:48] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:21:48] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 21:21:48] begin; [2026-11-11 21:21:48] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:21:48] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:21:48] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10112,9984,9986,10052,9989,9800,10379,10508,9868,10255,10384,9745,10644,10585,10651,10331,9819,9821,10274,10659,10536,9768,9769,9771,10350,9778,10486,10166,9910,10488,10106,10171,10620,10302,10110,9982) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:21:48] commit; [2026-11-11 21:21:50] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 21:21:50] begin; [2026-11-11 21:21:50] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 21:21:50] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 21:21:50] commit; [2026-11-11 21:21:50] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:21:58] begin; [2026-11-11 21:21:58] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 21:21:58] commit; [2026-11-11 21:22:10] begin; [2026-11-11 21:22:10] select transporte_id,transporte_descripcion,transporte_bloqueado from sh_principal.tbl_ven_transporte where 1=1 and transporte_bloqueado=false order by transporte_descripcion [2026-11-11 21:22:10] commit; [2026-11-11 21:22:44] begin; [2026-11-11 21:22:44] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:22:44] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 21:22:45] commit; [2026-11-11 21:22:51] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=473 and cliente_descuento_producto_id=982 [2026-11-11 21:22:51] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=473 and producto_id=982 [2026-11-11 21:24:17] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=473 and cliente_descuento_producto_id=952 [2026-11-11 21:24:17] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=473 and producto_id=952 [2026-11-11 21:24:49] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=473 and cliente_descuento_producto_id=1526 [2026-11-11 21:24:49] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=473 and producto_id=1526 [2026-11-11 21:25:32] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:25:32] begin; [2026-11-11 21:25:32] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 21:25:32] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10676','BLANCA ESTELA AGUILAR � Q582.00','/pedido/10676',10676,'tbl_ven_pedido',1,15) returning notificacion_id [2026-11-11 21:25:32] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 21:25:32] commit; [2026-11-11 21:25:32] begin; [2026-11-11 21:25:32] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:25:32] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and pedido_id =10676 order by pedido_registro desc limit 1 [2026-11-11 21:25:32] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10676) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:25:32] commit; [2026-11-11 21:28:02] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=637 and cliente_descuento_producto_id=988 [2026-11-11 21:28:02] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=637 and producto_id=988 [2026-11-11 21:28:16] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=637 and cliente_descuento_producto_id=989 [2026-11-11 21:28:16] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=637 and producto_id=989 [2026-11-11 21:28:31] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=637 and cliente_descuento_producto_id=992 [2026-11-11 21:28:31] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=637 and producto_id=992 [2026-11-11 21:28:57] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:28:58] begin; [2026-11-11 21:28:58] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 21:28:58] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10677','LA SEMILLA, S.A. � Q5,136.00','/pedido/10677',10677,'tbl_ven_pedido',1,15) returning notificacion_id [2026-11-11 21:28:58] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 21:28:58] commit; [2026-11-11 21:28:58] begin; [2026-11-11 21:28:58] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:28:58] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and pedido_id =10677 order by pedido_registro desc limit 1 [2026-11-11 21:28:58] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10677) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:28:58] commit; [2026-11-11 21:31:02] begin; [2026-11-11 21:31:02] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:31:02] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:31:02] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,10616,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10675,10163,9651,10676,10164,9652,10677,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:31:02] commit; [2026-11-11 21:31:22] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:31:22] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 21:31:22] begin; [2026-11-11 21:31:22] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:31:22] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:31:22] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:31:22] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,10616,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,9603,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10675,10163,9651,10676,10164,9652,10677,10165,9653,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:31:22] commit; [2026-11-11 21:31:23] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:31:24] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 21:31:24] begin; [2026-11-11 21:31:24] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 21:31:24] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 21:31:24] commit; [2026-11-11 21:31:28] begin; [2026-11-11 21:31:28] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:31:28] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:31:28] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10112,9984,9986,10052,9989,9800,10379,10508,9868,10255,10384,9745,10644,10585,10651,10331,9819,9821,10274,10659,10536,9768,9769,9771,10350,9778,10486,10166,9910,10488,10106,10171,10620,10302,10110,9982) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:31:28] commit; [2026-11-11 21:32:46] begin; [2026-11-11 21:32:46] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:32:46] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:32:46] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:32:46] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:32:46] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 21:32:46] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10112,9984,9986,10052,9989,9800,10379,10508,9868,10255,10384,9745,10644,10585,10651,10331,9819,9821,10274,10659,10536,9768,9769,9771,10350,9778,10486,10166,9910,10488,10106,10171,10620,10302,10110,9982) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:32:46] commit; [2026-11-11 21:32:56] begin; [2026-11-11 21:32:56] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:32:56] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=5 and rsaldo<>0 and venta_anulada=false and cliente_id =878 order by venta_fecha desc [2026-11-11 21:32:56] commit; [2026-11-11 21:33:08] begin; [2026-11-11 21:33:08] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:33:08] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:33:08] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:33:08] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 21:33:08] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:33:08] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10112,9984,9986,10052,9989,9800,10379,10508,9868,10255,10384,9745,10644,10585,10651,10331,9819,9821,10274,10659,10536,9768,9769,9771,10350,9778,10486,10166,9910,10488,10106,10171,10620,10302,10110,9982) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:33:08] commit; [2026-11-11 21:38:57] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 21:38:57] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:38:57] begin; [2026-11-11 21:38:57] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 21:38:57] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 21:38:57] commit; [2026-11-11 21:39:00] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:39:00] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:39:00] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 21:39:00] begin; [2026-11-11 21:39:00] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:39:00] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:39:00] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10112,9984,9986,10052,9989,9800,10379,10508,9868,10255,10384,9745,10644,10585,10651,10331,9819,9821,10274,10659,10536,9768,9769,9771,10350,9778,10486,10166,9910,10488,10106,10171,10620,10302,10110,9982) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:39:00] commit; [2026-11-11 21:41:07] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 21:41:07] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:41:07] begin; [2026-11-11 21:41:07] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 21:41:07] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 21:41:07] commit; [2026-11-11 21:41:08] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:41:08] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 21:41:08] begin; [2026-11-11 21:41:08] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:41:08] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:41:08] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:41:08] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10112,9984,9986,10052,9989,9800,10379,10508,9868,10255,10384,9745,10644,10585,10651,10331,9819,9821,10274,10659,10536,9768,9769,9771,10350,9778,10486,10166,9910,10488,10106,10171,10620,10302,10110,9982) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:41:08] commit; [2026-11-11 21:41:10] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 21:41:10] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:41:10] begin; [2026-11-11 21:41:10] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 21:41:10] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 21:41:10] commit; [2026-11-11 21:41:15] begin; [2026-11-11 21:41:15] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 21:41:15] commit; [2026-11-11 21:41:24] begin; [2026-11-11 21:41:24] select transporte_id,transporte_descripcion,transporte_bloqueado from sh_principal.tbl_ven_transporte where 1=1 and transporte_bloqueado=false order by transporte_descripcion [2026-11-11 21:41:24] commit; [2026-11-11 21:41:59] begin; [2026-11-11 21:41:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:41:59] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 21:41:59] commit; [2026-11-11 21:42:21] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=647 and cliente_descuento_producto_id=2135 [2026-11-11 21:42:21] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=647 and producto_id=2135 [2026-11-11 21:42:36] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=647 and cliente_descuento_producto_id=2384 [2026-11-11 21:42:36] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=647 and producto_id=2384 [2026-11-11 21:43:07] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=647 and cliente_descuento_producto_id=2367 [2026-11-11 21:43:07] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=647 and producto_id=2367 [2026-11-11 21:44:24] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:44:24] begin; [2026-11-11 21:44:24] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 21:44:24] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10678','BENISA, S.A. � Q834.00','/pedido/10678',10678,'tbl_ven_pedido',1,15) returning notificacion_id [2026-11-11 21:44:24] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 21:44:24] commit; [2026-11-11 21:44:24] begin; [2026-11-11 21:44:24] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:44:24] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and pedido_id =10678 order by pedido_registro desc limit 1 [2026-11-11 21:44:24] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10678) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:44:24] commit; [2026-11-11 21:47:16] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:47:16] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 21:47:16] begin; [2026-11-11 21:47:16] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 21:47:16] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 21:47:16] commit; [2026-11-11 21:47:16] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:47:16] begin; [2026-11-11 21:47:16] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:47:16] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 21:47:16] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:47:16] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,10616,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10675,10163,9651,10676,10164,9652,10677,10165,9653,10678,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:47:16] commit; [2026-11-11 21:47:16] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:47:24] begin; [2026-11-11 21:47:24] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 21:47:24] commit; [2026-11-11 21:47:29] begin; [2026-11-11 21:47:29] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:47:29] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =1154 order by venta_fecha desc [2026-11-11 21:47:29] commit; [2026-11-11 21:48:14] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:48:15] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:48:15] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 21:48:15] begin; [2026-11-11 21:48:15] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:48:15] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 21:48:15] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,10616,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,10116,9604,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10675,10163,9651,10676,10164,9652,10677,10165,9653,10678,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:48:15] commit; [2026-11-11 21:50:31] begin; [2026-11-11 21:50:31] select transporte_id,transporte_descripcion,transporte_bloqueado from sh_principal.tbl_ven_transporte where 1=1 and transporte_bloqueado=false order by transporte_descripcion [2026-11-11 21:50:31] commit; [2026-11-11 21:50:43] begin; [2026-11-11 21:50:43] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:50:43] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 21:50:44] commit; [2026-11-11 21:51:40] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=601 and cliente_descuento_producto_id=3705 [2026-11-11 21:51:40] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=601 and producto_id=3705 [2026-11-11 21:51:56] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=601 and cliente_descuento_producto_id=578 [2026-11-11 21:51:56] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=601 and producto_id=578 [2026-11-11 21:52:15] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=601 and cliente_descuento_producto_id=3558 [2026-11-11 21:52:15] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=601 and producto_id=3558 [2026-11-11 21:52:27] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=601 and cliente_descuento_producto_id=3557 [2026-11-11 21:52:27] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=601 and producto_id=3557 [2026-11-11 21:53:07] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=601 and cliente_descuento_producto_id=2378 [2026-11-11 21:53:07] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=601 and producto_id=2378 [2026-11-11 21:53:35] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=601 and cliente_descuento_producto_id=2377 [2026-11-11 21:53:35] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=601 and producto_id=2377 [2026-11-11 21:54:29] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=601 and cliente_descuento_producto_id=2381 [2026-11-11 21:54:29] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=601 and producto_id=2381 [2026-11-11 21:55:12] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=601 and cliente_descuento_producto_id=2367 [2026-11-11 21:55:12] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=601 and producto_id=2367 [2026-11-11 21:56:22] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:56:22] begin; [2026-11-11 21:56:22] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 21:56:22] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10679','PET ZOO,S.A � Q962.00','/pedido/10679',10679,'tbl_ven_pedido',1,15) returning notificacion_id [2026-11-11 21:56:22] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 21:56:22] commit; [2026-11-11 21:56:22] begin; [2026-11-11 21:56:22] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 21:56:22] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and pedido_id =10679 order by pedido_registro desc limit 1 [2026-11-11 21:56:22] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10679) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:56:22] commit; [2026-11-11 21:56:27] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 21:56:27] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 21:56:27] begin; [2026-11-11 21:56:27] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 21:56:27] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 21:56:27] commit; [2026-11-11 21:56:56] begin; [2026-11-11 21:56:56] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:56:56] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=5 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 21:56:56] commit; [2026-11-11 21:57:02] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=601 and cliente_descuento_producto_id=3827 [2026-11-11 21:57:02] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=601 and producto_id=3827 [2026-11-11 21:57:14] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=601 and cliente_descuento_producto_id=3828 [2026-11-11 21:57:14] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=601 and producto_id=3828 [2026-11-11 21:57:31] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=601 and cliente_descuento_producto_id=3813 [2026-11-11 21:57:31] select cliente_descuento_porcentaje from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_ven_cliente_descuento_especie_producto on especie_producto_id=cliente_descuento_especie_producto_id where cliente_descuento_cliente_id=601 and producto_id=3813 [2026-11-11 21:58:09] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:58:09] begin; [2026-11-11 21:58:09] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-11-11 21:58:09] insert into sh_principal.tbl_gen_notificacion_app (notificacion_tipo_id, notificacion_titulo, notificacion_cuerpo, notificacion_ruta, notificacion_referencia_id, notificacion_referencia_tabla, notificacion_empresa_id, notificacion_usuario_creador_id) values (2,'NUEVO PEDIDO #10680','PET ZOO,S.A � Q2,816.00','/pedido/10680',10680,'tbl_ven_pedido',5,15) returning notificacion_id [2026-11-11 21:58:09] select notificacion_suscripcion_usuario_id from sh_principal.tbl_gen_notificacion_suscripcion inner join sh_principal.tbl_gen_usuario on usuario_id=notificacion_suscripcion_usuario_id where notificacion_suscripcion_tipo_id=2 and notificacion_suscripcion_activo=true and usuario_bloqueado=false [2026-11-11 21:58:09] commit; [2026-11-11 21:58:09] begin; [2026-11-11 21:58:09] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 21:58:09] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and pedido_id =10680 order by pedido_registro desc limit 1 [2026-11-11 21:58:09] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10680) order by pedidod_pedido_id, pedidod_id [2026-11-11 21:58:09] commit; [2026-11-11 22:03:15] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 22:03:15] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 22:03:15] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 22:03:15] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 22:03:15] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 22:03:15] begin; [2026-11-11 22:03:15] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 22:03:15] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 22:03:15] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,10672,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 22:03:15] commit; [2026-11-11 22:03:22] begin; [2026-11-11 22:03:22] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 22:03:22] commit; [2026-11-11 22:03:44] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 22:03:44] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 22:03:44] begin; [2026-11-11 22:03:44] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 22:03:44] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-11-11 22:03:44] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-11-11 22:03:44] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,10672,9840,10577,10161,9875,9876,10551,9816,10650,10554,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-11-11 22:03:44] commit; [2026-11-11 22:17:40] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 22:17:40] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 22:17:40] begin; [2026-11-11 22:17:40] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 22:17:40] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 22:17:40] commit; [2026-11-11 22:17:40] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 22:17:40] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 22:17:40] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 22:17:40] begin; [2026-11-11 22:17:40] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 22:17:40] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 22:17:40] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10112,9984,9986,10052,9989,9800,10379,10508,9868,10255,10384,9745,10644,10585,10651,10331,9819,9821,10274,10659,10536,9768,9769,9771,10350,9778,10486,10166,9910,10680,10488,10106,10171,10620,10302,10110,9982) order by pedidod_pedido_id, pedidod_id [2026-11-11 22:17:41] commit; [2026-11-11 22:17:42] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 22:17:42] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 22:17:42] begin; [2026-11-11 22:17:42] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 22:17:42] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 22:17:42] commit; [2026-11-11 22:17:48] begin; [2026-11-11 22:17:48] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 22:17:48] commit; [2026-11-11 22:17:55] begin; [2026-11-11 22:17:55] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 22:17:55] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =473 order by venta_fecha desc [2026-11-11 22:17:55] commit; [2026-11-11 22:17:57] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 22:17:57] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 22:17:57] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 22:17:57] begin; [2026-11-11 22:17:57] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 22:17:57] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 22:17:57] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,10616,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,10116,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10675,10163,9651,10676,10164,9652,10677,10165,9653,10678,10679,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 22:17:58] commit; [2026-11-11 22:18:09] begin; [2026-11-11 22:18:09] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 22:18:09] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=1 and rsaldo<>0 and venta_anulada=false and cliente_id =54 order by venta_fecha desc [2026-11-11 22:18:09] commit; [2026-11-11 22:18:11] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 22:18:11] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 22:18:11] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 22:18:11] begin; [2026-11-11 22:18:11] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 22:18:11] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 22:18:11] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,10616,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,10116,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10675,10163,9651,10676,10164,9652,10677,10165,9653,10678,10679,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 22:18:11] commit; [2026-11-11 22:18:43] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 22:18:43] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 22:18:43] begin; [2026-11-11 22:18:43] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 22:18:43] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 22:18:43] commit; [2026-11-11 22:18:44] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 22:18:44] begin; [2026-11-11 22:18:44] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 22:18:44] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 22:18:44] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 22:18:44] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,10616,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,10116,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10675,10163,9651,10676,10164,9652,10677,10165,9653,10678,10679,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 22:18:44] commit; [2026-11-11 22:18:44] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 22:18:49] begin; [2026-11-11 22:18:49] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 22:18:49] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 22:18:49] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,10616,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,10116,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10675,10163,9651,10676,10164,9652,10677,10165,9653,10678,10679,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 22:18:49] commit; [2026-11-11 22:18:57] begin; [2026-11-11 22:18:57] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 22:18:57] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=1 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 22:18:57] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 22:18:57] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=1 and pedido_anulado=false [2026-11-11 22:18:57] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 22:18:57] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10240,10242,10243,9731,10244,10245,9733,10246,10247,9742,9743,9746,9750,9752,9755,10273,10276,10277,9770,9777,9780,9781,9782,9783,10298,10303,10304,10305,10306,9799,9806,10323,10332,9820,10333,9823,10339,10341,10344,9832,9833,10347,9837,10351,10352,9855,10380,10381,10382,10383,9874,10414,9903,9909,9911,10428,9916,10429,10431,9934,9935,10457,10459,10467,10468,10470,10471,10472,10473,10477,10487,9980,9981,9983,9985,9987,9988,9990,9991,9992,9993,9994,10507,9995,9996,10509,10005,10006,10007,10522,10018,10022,10023,10537,10538,10040,10050,10563,10051,10053,10566,10054,10055,10056,10057,10570,10058,10571,10059,10580,10582,10070,10583,10071,10584,10072,10088,10089,10604,10616,10618,10619,10107,10621,10109,10111,10113,10114,10627,10115,10116,9617,9618,10643,9619,9620,9622,10135,9623,9624,10137,9628,9631,10656,10144,9632,10657,9633,10658,9649,10162,9650,10675,10163,9651,10676,10164,9652,10677,10165,9653,10678,10679,10172,10174,9670,9671,9672,9673,9674,10189,10190,10191,9679,10194,10197,9685,10203,9691,10204,9693,10206,9694,9700,9701,9702,9703,10216,9704,10217,9705,10218,9706,9707,9708,9709,10227,9720,9721,10237) order by pedidod_pedido_id, pedidod_id [2026-11-11 22:18:57] commit; [2026-11-11 22:18:59] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 22:18:59] begin; [2026-11-11 22:18:59] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 22:18:59] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 22:18:59] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 22:18:59] commit; [2026-11-11 22:19:03] begin; [2026-11-11 22:19:03] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 22:19:03] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 22:19:03] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10112,9984,9986,10052,9989,9800,10379,10508,9868,10255,10384,9745,10644,10585,10651,10331,9819,9821,10274,10659,10536,9768,9769,9771,10350,9778,10486,10166,9910,10680,10488,10106,10171,10620,10302,10110,9982) order by pedidod_pedido_id, pedidod_id [2026-11-11 22:19:03] commit; [2026-11-11 22:19:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 22:19:59] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 22:19:59] begin; [2026-11-11 22:19:59] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 22:19:59] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 22:19:59] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 22:19:59] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10112,9984,9986,10052,9989,9800,10379,10508,9868,10255,10384,9745,10644,10585,10651,10331,9819,9821,10274,10659,10536,9768,9769,9771,10350,9778,10486,10166,9910,10680,10488,10106,10171,10620,10302,10110,9982) order by pedidod_pedido_id, pedidod_id [2026-11-11 22:19:59] commit; [2026-11-11 22:20:11] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 22:20:11] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 22:20:11] begin; [2026-11-11 22:20:11] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_dispositivo_plataforma='ANDROID', usuario_uid_push_dispositivo_informacion='Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/30.0 Chrome/143.0.0.0 Mobile Safari/537.36 | es-US | 384x774', usuario_uid_push_version_app='0.06', usuario_uid_push_ultima_actualizacion=now(), usuario_uid_push_endpoint='https://fcm.googleapis.com/fcm/send/egAWSL1NDcE:APA91bE05xxCOPwQpdtTlkovLCTfinzITI_NLMLhIv9jKwuEY9ms_olRAzYkCylb7hsqpqCcSNBqZwCXYY6BRAu1g09g0t2F1OnmWukb0gnCvOArpGoSzpje5f9c3-lBMLqNC-OGgM85', usuario_uid_push_p256dh='BBWZBIXG8CqJXtMwPcHOygaA5TKfjp8vfVRxHgnrILQKJRTni6LL3pIdMEl2YvxD9INxMK6O4im_lDLlGmK-vP8', usuario_uid_push_auth='KM9NBYLVxHDJnY-yLnCjLQ' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id=15 [2026-11-11 22:20:11] update sh_principal.tbl_gen_usuario_uid_push set usuario_uid_push_endpoint='', usuario_uid_push_p256dh='', usuario_uid_push_auth='' where usuario_uid_push='d8e6737b-0974-463c-b829-deb2c629c29e' and usuario_uid_push_usuario_id<>15 and usuario_uid_push_endpoint<>'' [2026-11-11 22:20:11] commit; [2026-11-11 22:20:11] begin; [2026-11-11 22:20:11] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 22:20:11] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =15 order by pedido_registro desc limit 200 [2026-11-11 22:20:11] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 22:20:11] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=15 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 22:20:11] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=15 and notificacion_usuario_leida=false [2026-11-11 22:20:11] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10112,9984,9986,10052,9989,9800,10379,10508,9868,10255,10384,9745,10644,10585,10651,10331,9819,9821,10274,10659,10536,9768,9769,9771,10350,9778,10486,10166,9910,10680,10488,10106,10171,10620,10302,10110,9982) order by pedidod_pedido_id, pedidod_id [2026-11-11 22:20:11] commit; [2026-11-11 22:20:16] begin; [2026-11-11 22:20:16] select cliente_id,cliente_nombre_comercial,cliente_razon_social,cliente_nit,cliente_correo_electronico,cliente_direccion,cliente_bloqueado,cliente_limite_credito,cliente_dias_credito,municipio_geografico_descripcion,departamento_geografico_descripcion,vendedor_descripcion,cliente_telefono from sh_principal.tbl_ven_cliente inner join sh_principal.tbl_gen_municipio_geografico on cliente_municipio_geografico_id=municipio_geografico_id inner join sh_principal.tbl_gen_departamento_geografico on municipio_geografico_departamento_id=departamento_geografico_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=cliente_vendedor_id where 1=1 and cliente_bloqueado=false order by cliente_nombre_comercial [2026-11-11 22:20:16] commit; [2026-11-11 22:20:23] begin; [2026-11-11 22:20:23] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=15 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 22:20:23] select venta_id,venta_serie,venta_numero,to_char(venta_fecha,'DD/MM/YYYY') as fecha,venta_total,rsaldo as saldo FROM sh_principal.tbl_ven_venta inner join sh_principal.tbl_ven_cliente on cliente_id=venta_cliente_id inner join sh_principal.fn_ven_saldo_ventas(0,0) on venta_id=rventa_id where 1=1 and venta_empresa_id=5 and rsaldo<>0 and venta_anulada=false and cliente_id =878 order by venta_fecha desc [2026-11-11 22:20:23] commit; [2026-11-11 23:23:02] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 23:23:02] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 23:23:02] begin; [2026-11-11 23:23:02] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 23:23:02] select pedido_id,to_char(pedido_registro,'DD/MM/YYYY HH24:MI') as registro,to_char(pedido_fecha,'DD/MM/YYYY') as fecha,pedido_comentario,usuario_nombre,pedido_total,pedido_nombre,pedido_nit,case when pedido_anulado then 'ANULADO' when pedido_id in (select venta_pedido_id from sh_principal.tbl_ven_venta) then 'FACTURADO' ELSE 'PENDIENTE DE FACTURAR' END as estado,pedido_direccion,pedido_telefono,pedido_email,vendedor_descripcion,transporte_descripcion from sh_principal.tbl_ven_pedido inner join sh_principal.tbl_ven_transporte on pedido_transporte_id=transporte_id inner join sh_principal.tbl_gen_usuario on pedido_usuario_id=usuario_id inner join sh_principal.tbl_ven_vendedor on vendedor_id=pedido_vendedor_id where 1=1 and pedido_empresa_id=5 and usuario_id =13 order by pedido_registro desc limit 200 [2026-11-11 23:23:02] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 23:23:02] select pedidod_pedido_id,producto_id,producto_codigo,producto_descripcion,pedidod_cantidad,pedidod_descuento,pedidod_descuento_monto,pedidod_precio,pedidod_total from sh_principal.tbl_ven_pedidodet inner join sh_principal.tbl_inv_producto on pedidod_producto_id=producto_id where pedidod_pedido_id in (10249,10000,10530,10531,10279,10280,10284,9773,10286,10543,9775,10545,10547,9786,10307,10308,10309,10310,10312,9801,10315,10060,9808,10065,9810,10588,10592,10083,10596,10601,10091,10605,9844,10357,9845,9846,10359,9847,9848,9849,9850,10363,9851,10364,9852,9853,9856,10625,10626,9863,10632,10120,10122,10639,10127,10387,10388,10646,10392,9881,10396,10397,9885,9887,10400,10145,10402,10403,9892,10149,9896,10153,10410,10668,9900,10415,9904,10417,9906,10167,10433,10177,10434,10178,10181,10182,10451,10452,9940,9941,10461,10209,10210,10211,10475,10225,10491,10238) order by pedidod_pedido_id, pedidod_id [2026-11-11 23:23:03] commit; [2026-11-11 23:23:03] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-11-11 23:23:03] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-11-11 23:23:03] select count(*) filter (where pedido_registro::date = current_date) as pedidos_hoy, coalesce(sum(pedido_total) filter (where pedido_registro::date = current_date),0) as monto_dia, coalesce(sum(pedido_total) filter (where date_trunc('month',pedido_registro)=date_trunc('month',current_date)),0) as monto_mes from sh_principal.tbl_ven_pedido where pedido_usuario_id=13 and pedido_empresa_id=5 and pedido_anulado=false [2026-11-11 23:23:03] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-11-11 23:23:03] begin; [2026-11-11 23:23:03] select 1 from sh_principal.tbl_gen_usuario_empresa inner join sh_principal.tbl_gen_empresa on empresa_id=usuario_empresa_empresa_id where usuario_empresa_usuario_id=13 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-11-11 23:23:03] select producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,sum(rcantidad) as existencia,producto_bloqueado,exists(select 1 from sh_multimedia.tbl_inv_producto_multimedia m where m.producto_id=tbl_inv_producto.producto_id and coalesce(m.producto_imagen,'')<>'') as tiene_imagen from sh_principal.tbl_inv_producto inner join sh_principal.tbl_inv_proveedor on proveedor_id=producto_proveedor_id inner join sh_principal.tbl_inv_especie_producto on especie_producto_id=producto_especie_id inner join sh_principal.tbl_inv_especificacion_producto on especificacion_producto_id=producto_especificacion_id inner join sh_principal.fn_inv_saldo_productos_bodega_completo() on rproducto_id=producto_id inner join sh_principal.tbl_gen_empresa on empresa_id=producto_empresa_id inner join sh_principal.tbl_inv_bodega on bodega_id=rbodega_id and bodega_empresa_id=empresa_id where 1=1 and producto_empresa_id=1 and bodega_permitida_venta and producto_bloqueado=false and producto_precio>0 group by producto_id,producto_descripcion,proveedor_nombre,especie_producto_descripcion,especificacion_producto_descripcion,producto_precio,producto_bien,producto_servicio,producto_codigo,producto_codigo_barra,producto_maneja_existencia,producto_precio_editable,producto_bloqueado order by producto_descripcion [2026-11-11 23:23:04] commit;