==== NUEVO DIA: 2026-10-31 ==== [2026-10-31 07:07: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-10-31 07:07:41] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-10-31 08:05: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-10-31 08:05:48] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 08:05: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-10-31 08:05:49] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 08:05:49] begin; [2026-10-31 08:05: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-10-31 08:05: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-10-31 08:05: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-10-31 08:05: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,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,9526,8504,9529,9018,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10078,10079,9055,9056,8035,8548,10085,8040,8041,9579,10093,10094,10097,8561,10098,9596,8069,8071,8584,8586,9612,10131,9108,9621,8597,8085,8598,9111,8600,10142,10143,8607,9636,9124,9637,8101,9126,9130,9131,10156,9132,10157,8111,8633,8640,8138,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-10-31 08:05:50] commit; [2026-10-31 08:05: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-10-31 08:05:53] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 08:05: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-10-31 08:05:57] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 08:05: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=5 and empresa_bloqueada=false limit 1 [2026-10-31 08:05: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=5 and pedido_anulado=false [2026-10-31 08:05:57] begin; [2026-10-31 08:05: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=5 and empresa_bloqueada=false limit 1 [2026-10-31 08:05:57] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 08:05: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 =14 order by pedido_registro desc limit 200 [2026-10-31 08:05: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 (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10161,9875,9876,9816,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-10-31 08:05:57] commit; [2026-10-31 08:06: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-10-31 08:06:03] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 08:06: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-10-31 08:06:08] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 08:06:08] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 08:06: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=2 and empresa_bloqueada=false limit 1 [2026-10-31 08:06: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=2 and pedido_anulado=false [2026-10-31 08:06:08] begin; [2026-10-31 08:06: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=2 and empresa_bloqueada=false limit 1 [2026-10-31 08:06: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=2 and usuario_id =14 order by pedido_registro desc limit 200 [2026-10-31 08:06: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 (10449,9890,9842,10086,9814) order by pedidod_pedido_id, pedidod_id [2026-10-31 08:06:08] commit; [2026-10-31 09:50:39] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-10-31 09: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-10-31 09:50:40] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-10-31 09:50: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-10-31 09:50:42] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-10-31 09: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=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-10-31 09:50: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=1 and pedido_anulado=false [2026-10-31 09:50:42] begin; [2026-10-31 09: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=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-10-31 09:50: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 =16 order by pedido_registro desc limit 200 [2026-10-31 09:50: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 (9728,9729,9730,10252,9228,9229,10257,9235,9236,10263,9751,10264,9753,10267,10269,10270,9764,9765,9766,9254,9767,9255,9256,9257,9258,9259,9268,10295,10297,9787,10301,9280,9796,10324,10330,9822,9824,9312,9825,10343,10349,9327,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,9474,9475,9476,10008,10011,9500,10013,9501,10014,9502,10015,9504,10017,10019,9508,9510,10024,9517,9518,9519,10032,9522,10037,10043,10044,9532,9533,10048,10049,9545,9546,9547,9549,9550,10073,9567,9568,9569,9570,10087,9576,9578,9581,9582,9585,9586,9589,9590,10103,9598,9599,9600,9613,9614,10139,9629,9630,10146,9638,9639,9645,9646,9647,9648,10170,10173,9662,9666,9667,9668,9669,9683,9684,10202,10205,9695,9696,10215,9204,10229,9717,9205,10230,9719,9209,9722,9210,9723,9211,9724,9725,9726,9727,9215) order by pedidod_pedido_id, pedidod_id [2026-10-31 09:50:42] commit; [2026-10-31 09:50:44] begin; [2026-10-31 09:50: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=16 and usuario_empresa_empresa_id=1 and empresa_bloqueada=false limit 1 [2026-10-31 09:50: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-10-31 09:50:46] commit; [2026-10-31 10:32:31] 2026-10-31 10:32:31.686 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-10-31 10:32:31] [2026-10-31 10:32:31] 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-10-31 10:32:31] at jdk.management.agent/sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:114) ~[na:na] [2026-10-31 10:32:31] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:394) ~[na:na] [2026-10-31 10:32:31] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:366) ~[na:na] [2026-10-31 10:32:31] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na] [2026-10-31 10:32:31] [2026-10-31 10:35:13] 2026-10-31 10:35:13.085 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-10-31 10:35:13] [2026-10-31 10:35: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-10-31 10:35:13] at jdk.management.agent/sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:114) ~[na:na] [2026-10-31 10:35:13] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:394) ~[na:na] [2026-10-31 10:35:13] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:366) ~[na:na] [2026-10-31 10:35:13] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na] [2026-10-31 10:35:13] [2026-10-31 10:35:13] 2026-10-31 10:35:13.491 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-10-31 10:35:13] [2026-10-31 10:35: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-10-31 10:35:13] at jdk.management.agent/sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:114) ~[na:na] [2026-10-31 10:35:13] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:394) ~[na:na] [2026-10-31 10:35:13] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:366) ~[na:na] [2026-10-31 10:35:13] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na] [2026-10-31 10:35:13] [2026-10-31 10:35:13] 2026-10-31 10:35:13.898 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-10-31 10:35:13] [2026-10-31 10:35: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-10-31 10:35:13] at jdk.management.agent/sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:114) ~[na:na] [2026-10-31 10:35:13] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:394) ~[na:na] [2026-10-31 10:35:13] at java.rmi/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:366) ~[na:na] [2026-10-31 10:35:13] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na] [2026-10-31 10:35:13] [2026-10-31 13:04:34] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-10-31 13:04:34] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 13:04:34] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 13:04:34] begin; [2026-10-31 13:04: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=14 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-10-31 13:04: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=2 and usuario_id =14 order by pedido_registro desc limit 200 [2026-10-31 13:04: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=14 and usuario_empresa_empresa_id=2 and empresa_bloqueada=false limit 1 [2026-10-31 13:04:34] 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-10-31 13:04: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 (10449,9890,9842,10086,9814) order by pedidod_pedido_id, pedidod_id [2026-10-31 13:04:34] commit; [2026-10-31 13:04: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-10-31 13:04:36] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 13:04: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-10-31 13:04:40] begin; [2026-10-31 13:04: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-10-31 13:04: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=1 and pedido_anulado=false [2026-10-31 13:04: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=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-10-31 13:04:40] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 13:04: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 (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,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,9526,8504,9529,9018,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10078,10079,9055,9056,8035,8548,10085,8040,8041,9579,10093,10094,10097,8561,10098,9596,8069,8071,8584,8586,9612,10131,9108,9621,8597,8085,8598,9111,8600,10142,10143,8607,9636,9124,9637,8101,9126,9130,9131,10156,9132,10157,8111,8633,8640,8138,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-10-31 13:04:40] commit; [2026-10-31 13:04:41] begin; [2026-10-31 13:04: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-10-31 13:04: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-10-31 13:04:41] commit; [2026-10-31 13:05: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-10-31 13:05: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=1 and pedido_anulado=false [2026-10-31 13:05:28] begin; [2026-10-31 13:05: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-10-31 13:05:28] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 13:05: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=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-10-31 13:05: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 (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,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,9526,8504,9529,9018,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10078,10079,9055,9056,8035,8548,10085,8040,8041,9579,10093,10094,10097,8561,10098,9596,8069,8071,8584,8586,9612,10131,9108,9621,8597,8085,8598,9111,8600,10142,10143,8607,9636,9124,9637,8101,9126,9130,9131,10156,9132,10157,8111,8633,8640,8138,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-10-31 13:05:28] commit; [2026-10-31 13:05:46] begin; [2026-10-31 13:05: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-10-31 13:05: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-10-31 13:05: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-10-31 13:05: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-10-31 13:05:46] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 13:05: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,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,9526,8504,9529,9018,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10078,10079,9055,9056,8035,8548,10085,8040,8041,9579,10093,10094,10097,8561,10098,9596,8069,8071,8584,8586,9612,10131,9108,9621,8597,8085,8598,9111,8600,10142,10143,8607,9636,9124,9637,8101,9126,9130,9131,10156,9132,10157,8111,8633,8640,8138,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-10-31 13:05:46] commit; [2026-10-31 13:06:46] begin; [2026-10-31 13:06: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-10-31 13:06: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-10-31 13:06: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,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,9526,8504,9529,9018,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10078,10079,9055,9056,8035,8548,10085,8040,8041,9579,10093,10094,10097,8561,10098,9596,8069,8071,8584,8586,9612,10131,9108,9621,8597,8085,8598,9111,8600,10142,10143,8607,9636,9124,9637,8101,9126,9130,9131,10156,9132,10157,8111,8633,8640,8138,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-10-31 13:06:46] commit; [2026-10-31 13:07:21] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-10-31 13:07:21] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 13:07: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=5 and empresa_bloqueada=false limit 1 [2026-10-31 13:07: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=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-10-31 13:07:23] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 13:07:23] begin; [2026-10-31 13:07: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=5 and empresa_bloqueada=false limit 1 [2026-10-31 13:07: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=5 and usuario_id =14 order by pedido_registro desc limit 200 [2026-10-31 13:07: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 (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10161,9875,9876,9816,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-10-31 13:07:23] commit; [2026-10-31 13:07:25] begin; [2026-10-31 13:07: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=5 and empresa_bloqueada=false limit 1 [2026-10-31 13:07: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 =14 order by pedido_registro desc limit 200 [2026-10-31 13:07: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 (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10161,9875,9876,9816,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-10-31 13:07:26] commit; [2026-10-31 13:08:19] begin; [2026-10-31 13:08: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-10-31 13:08: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-10-31 13:08: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,10161,9875,9876,9816,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-10-31 13:08:19] commit; [2026-10-31 13:08: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-10-31 13:08:21] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 13:08: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-10-31 13:08:21] begin; [2026-10-31 13:08: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-10-31 13:08: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-10-31 13:08: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,10161,9875,9876,9816,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-10-31 13:08:21] commit; [2026-10-31 13:08:21] begin; [2026-10-31 13:08: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-10-31 13:08: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-10-31 13:08: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,10161,9875,9876,9816,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-10-31 13:08:21] commit; [2026-10-31 13:08:21] begin; [2026-10-31 13:08: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-10-31 13:08:21] 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-10-31 13:08:22] commit; [2026-10-31 13:15:25] select empresa_id, coalesce(empresa_imagen,'') as empresa_imagen from sh_principal.tbl_gen_empresa where empresa_bloqueada=false order by empresa_id [2026-10-31 13:15:25] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-10-31 13:15: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=5 and empresa_bloqueada=false limit 1 [2026-10-31 13:15: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=5 and pedido_anulado=false [2026-10-31 13:15:26] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-10-31 13:15:26] begin; [2026-10-31 13:15: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=5 and empresa_bloqueada=false limit 1 [2026-10-31 13:15: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=5 and usuario_id =16 order by pedido_registro desc limit 200 [2026-10-31 13:15: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 (10376,9928,10378,9866,9867,10188,10317,9871,10256,10262,10328,10265,10458,10138,10010,9883,10268,9948,9886,10464,10080,9888,9889,10147,10084,10020,9894,10345,10348,10158,10479,10159,10289,10482,10290,9970,10228,10038,10231,10425,10041,9977,10042,9915,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-10-31 13:15:26] commit; [2026-10-31 13:15:29] begin; [2026-10-31 13:15: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-10-31 13:15:29] commit; [2026-10-31 13:15:33] begin; [2026-10-31 13:15:33] 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-10-31 13:15:33] commit; [2026-10-31 13:15:43] begin; [2026-10-31 13:15: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=16 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-10-31 13:15: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=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-10-31 13:15:43] commit; [2026-10-31 13:15:46] select cliente_descuento_porcentaje from sh_principal.tbl_ven_cliente_descuento_producto where cliente_descuento_cliente_id=715 and cliente_descuento_producto_id=3828 [2026-10-31 13:15:46] 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=715 and producto_id=3828 [2026-10-31 13:15: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=5 and empresa_bloqueada=false limit 1 [2026-10-31 13:15:53] begin; [2026-10-31 13:15:53] select notificacion_tipo_id from sh_principal.tbl_gen_notificacion_tipo where upper(trim(notificacion_tipo_codigo))='NUEVO_PEDIDO' limit 1 [2026-10-31 13:15:53] 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 #10485','CASA VETERINARIA SOCIEDAD AN�NIMA � Q1,200.00','/pedido/10485',10485,'tbl_ven_pedido',5,16) returning notificacion_id [2026-10-31 13:15:53] 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-10-31 13:15:53] commit; [2026-10-31 13:15:53] begin; [2026-10-31 13:15: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=5 and empresa_bloqueada=false limit 1 [2026-10-31 13:15: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 pedido_id =10485 order by pedido_registro desc limit 1 [2026-10-31 13:15: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 (10485) order by pedidod_pedido_id, pedidod_id [2026-10-31 13:15:53] commit; [2026-10-31 13:15: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=5 and empresa_bloqueada=false limit 1 [2026-10-31 13:15: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=5 and pedido_anulado=false [2026-10-31 13:15:59] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=16 and notificacion_usuario_leida=false [2026-10-31 13:15:59] begin; [2026-10-31 13:15: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=5 and empresa_bloqueada=false limit 1 [2026-10-31 13:15: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 =16 order by pedido_registro desc limit 200 [2026-10-31 13:15: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 (10376,9928,10378,9866,9867,10188,10317,9871,10256,10262,10328,10265,10458,10138,10010,9883,10268,9948,9886,10464,10080,9888,9889,10147,10084,10020,9894,10345,10348,10158,10479,10159,10289,10482,10290,9970,10228,10485,10038,10231,10425,10041,9977,10042,9915,10108,10367) order by pedidod_pedido_id, pedidod_id [2026-10-31 13:15:59] commit; [2026-10-31 15:05:57] begin; [2026-10-31 15:05: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=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-10-31 15:05: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 =13 order by pedido_registro desc limit 200 [2026-10-31 15:05:57] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-10-31 15:05: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=13 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-10-31 15:05: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=13 and pedido_empresa_id=5 and pedido_anulado=false [2026-10-31 15:05:57] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=13 and notificacion_usuario_leida=false [2026-10-31 15:05: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-10-31 15:05: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 (9856,9863,10120,10249,10122,10127,10000,10387,10388,10392,9881,10396,10397,9885,9887,10400,10145,10402,10403,9892,10149,10279,10280,9896,10153,10410,10284,9900,9773,10286,10415,9775,9904,10417,9906,10167,9786,10433,10177,10434,10178,10307,10308,10309,10181,10310,10182,10312,9801,10315,10060,9808,10065,9810,10451,10452,9940,9941,10461,10209,10210,10211,10083,10475,10091,10225,9844,10357,9845,9846,10359,9847,9848,9849,9850,10363,9851,10364,9852,9853,10238) order by pedidod_pedido_id, pedidod_id [2026-10-31 15:05:57] commit; [2026-10-31 15:06:00] begin; [2026-10-31 15:06: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-10-31 15:06: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 =13 order by pedido_registro desc limit 200 [2026-10-31 15:06: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 (9856,9863,10120,10249,10122,10127,10000,10387,10388,10392,9881,10396,10397,9885,9887,10400,10145,10402,10403,9892,10149,10279,10280,9896,10153,10410,10284,9900,9773,10286,10415,9775,9904,10417,9906,10167,9786,10433,10177,10434,10178,10307,10308,10309,10181,10310,10182,10312,9801,10315,10060,9808,10065,9810,10451,10452,9940,9941,10461,10209,10210,10211,10083,10475,10091,10225,9844,10357,9845,9846,10359,9847,9848,9849,9850,10363,9851,10364,9852,9853,10238) order by pedidod_pedido_id, pedidod_id [2026-10-31 15:06:00] commit; [2026-10-31 22:52: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-10-31 22:52:51] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 22:52: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-10-31 22:52: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=5 and pedido_anulado=false [2026-10-31 22:52:51] begin; [2026-10-31 22:52: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-10-31 22:52:51] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 22:52: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-10-31 22:52: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 (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10161,9875,9876,9816,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-10-31 22:52:51] commit; [2026-10-31 22:52:56] begin; [2026-10-31 22:52:56] 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-10-31 22:52:56] commit; [2026-10-31 22:53:40] begin; [2026-10-31 22:53: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-10-31 22:53: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 =2023 order by venta_fecha desc [2026-10-31 22:53:40] commit; [2026-10-31 22:54:00] begin; [2026-10-31 22:54: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=5 and empresa_bloqueada=false limit 1 [2026-10-31 22:54: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 =14 order by pedido_registro desc limit 200 [2026-10-31 22:54:00] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 22:54: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=5 and empresa_bloqueada=false limit 1 [2026-10-31 22:54: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=14 and pedido_empresa_id=5 and pedido_anulado=false [2026-10-31 22:54: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 (10272,10371,9859,10407,9898,10412,10220,10447,10319,10287,9840,10161,9875,9876,9816,9914,10299,10076,9951) order by pedidod_pedido_id, pedidod_id [2026-10-31 22:54:00] commit; [2026-10-31 22:54:12] begin; [2026-10-31 22:54: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=14 and usuario_empresa_empresa_id=5 and empresa_bloqueada=false limit 1 [2026-10-31 22:54:12] 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 =1766 order by venta_fecha desc [2026-10-31 22:54:12] commit; [2026-10-31 22:54: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-10-31 22:54:28] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 22:54:29] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 22:54:29] begin; [2026-10-31 22:54: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=1 and empresa_bloqueada=false limit 1 [2026-10-31 22:54: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=1 and empresa_bloqueada=false limit 1 [2026-10-31 22:54: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=1 and usuario_id =14 order by pedido_registro desc limit 200 [2026-10-31 22:54: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=1 and pedido_anulado=false [2026-10-31 22:54: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 (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,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,9526,8504,9529,9018,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10078,10079,9055,9056,8035,8548,10085,8040,8041,9579,10093,10094,10097,8561,10098,9596,8069,8071,8584,8586,9612,10131,9108,9621,8597,8085,8598,9111,8600,10142,10143,8607,9636,9124,9637,8101,9126,9130,9131,10156,9132,10157,8111,8633,8640,8138,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-10-31 22:54:29] commit; [2026-10-31 22:54:38] begin; [2026-10-31 22:54: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=1 and empresa_bloqueada=false limit 1 [2026-10-31 22:54:38] 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 =2023 order by venta_fecha desc [2026-10-31 22:54:38] commit; [2026-10-31 22:54: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-10-31 22:54:44] begin; [2026-10-31 22:54: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-10-31 22:54: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-10-31 22:54: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-10-31 22:54:44] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 22:54: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,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,9526,8504,9529,9018,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10078,10079,9055,9056,8035,8548,10085,8040,8041,9579,10093,10094,10097,8561,10098,9596,8069,8071,8584,8586,9612,10131,9108,9621,8597,8085,8598,9111,8600,10142,10143,8607,9636,9124,9637,8101,9126,9130,9131,10156,9132,10157,8111,8633,8640,8138,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-10-31 22:54:44] commit; [2026-10-31 22:54:45] select count(*) from sh_principal.tbl_gen_notificacion_usuario where notificacion_usuario_usuario_id=14 and notificacion_usuario_leida=false [2026-10-31 22:54:45] begin; [2026-10-31 22:54: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-10-31 22:54: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-10-31 22:54: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-10-31 22:54: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-10-31 22:54: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,10016,8993,8994,9509,9511,9512,9513,9514,10031,9521,9526,8504,9529,9018,9019,9535,8511,8512,8513,8515,8516,9032,8521,9548,9037,10078,10079,9055,9056,8035,8548,10085,8040,8041,9579,10093,10094,10097,8561,10098,9596,8069,8071,8584,8586,9612,10131,9108,9621,8597,8085,8598,9111,8600,10142,10143,8607,9636,9124,9637,8101,9126,9130,9131,10156,9132,10157,8111,8633,8640,8138,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-10-31 22:54:45] commit;