{"rutaError":{"error":"(1064)You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (C.emp_codigo=config.ven_client -- Cliente PRedeterminado u Ocasional ' at line 21","sql":"SELECT C.emp_secuen,C.emp_catego,C.emp_nacion as tipoid,C.emp_ruc,C.emp_codigo,C.emp_concre,C.emp_plazo,C.emp_tolera ,REPLACE(C.emp_descri,CHAR(39),space(1))as descri,C.emp_contacto ,REPLACE(C.emp_direcc,CHAR(39),space(1))as emp_direcc,C.emp_coorde ,C.emp_credito,C.emp_precio as emp_tipre,C.emp_subprecio,CONCAT(TRIM(C.emp_tel),' ',TRIM(C.emp_cel))as telefono ,rut_codigo,rut_descri,rut_do ,(SELECT SUM(ROUND(IF(ISNULL(doc_saldo),0,doc_saldo),2)) FROM .cjdocumento WHERE doc_person=C.emp_codigo and doc_saldo>0 and doc_tipo=1 and doc_anula='F' GROUP BY doc_person) AS saldo1 ,(SELECT SUM(ROUND(IF(ISNULL(doc_saldo),0,IF(doc_vence<=current_date(),doc_saldo,0)),2)) FROM .cjdocumento WHERE doc_person=C.emp_codigo and doc_saldo>0 and doc_tipo=1 and doc_anula='F' GROUP BY doc_person) AS mora ,(SELECT SUM(IF(ISNULL(item_cant),0.0,(item_cant-item_devuelto)*item_pago)) FROM .faccab INNER JOIN .facitems ON fac_cod=item_cod WHERE fac_clie=C.emp_codigo and fac_vendedor=V.emp_codigo and fac_fecha>='-00-01' and fac_fecha<='-00-31' and fac_anula='F' GROUP BY fac_clie) AS venta ,IF(ISNULL(obc_monto),0.0,obc_monto)as obc_monto FROM .empresas V INNER JOIN .config INNER JOIN .rutas ON rut_vended=V.emp_codigo INNER JOIN .empresas C ON rut_codigo=C.emp_ruta OR rut_codigo=C.emp_ruta2 -- sin en SELECT va usar SUM tener en cuenta que se puede duplicar si cliente pertence al vendedor en ambas rutas(1 y 2) LEFT JOIN .objetivtacli ON C.emp_codigo=obc_client AND obc_mes=00 AND obc_anho= WHERE (C.emp_codigo=config.ven_client -- Cliente PRedeterminado u Ocasional OR C.emp_codigo= -- Datos del vendedor OR (V.emp_codigo= and =1) -- Clientes de las rutas del vendedor ) and C.emp_cliente=1 and C.emp_activo=1 GROUP BY C.emp_codigo UNION /*ALL no uso porque no quiero duplicar cliente si son la misma ruta, rutas diferentes si*/ SELECT C.emp_secuen,C.emp_catego,C.emp_nacion as tipoid,C.emp_ruc,C.emp_codigo,C.emp_concre,C.emp_plazo,C.emp_tolera ,REPLACE(C.emp_descri,CHAR(39),space(1))as descri,C.emp_contacto ,REPLACE(C.emp_direcc,CHAR(39),space(1))as emp_direcc,C.emp_coorde ,C.emp_credito,C.emp_precio as emp_tipre,C.emp_subprecio,CONCAT(TRIM(C.emp_tel),' ',TRIM(C.emp_cel))as telefono ,rut_codigo,rut_descri,rut_do ,(SELECT SUM(ROUND(IF(ISNULL(doc_saldo),0,doc_saldo),2)) FROM .cjdocumento WHERE doc_person=C.emp_codigo and doc_saldo>0 and doc_tipo=1 and doc_anula='F' GROUP BY doc_person) AS saldo1 ,(SELECT SUM(ROUND(IF(ISNULL(doc_saldo),0,IF(doc_vence<=current_date(),doc_saldo,0)),2)) FROM .cjdocumento WHERE doc_person=C.emp_codigo and doc_saldo>0 and doc_tipo=1 and doc_anula='F' GROUP BY doc_person) AS mora ,(SELECT SUM(IF(ISNULL(item_cant),0.0,(item_cant-item_devuelto)*item_pago)) FROM .faccab INNER JOIN .facitems ON fac_cod=item_cod WHERE fac_clie=C.emp_codigo and fac_vendedor=V.emp_codigo and fac_fecha>='-00-01' and fac_fecha<='-00-31' and fac_anula='F' GROUP BY fac_clie) AS venta ,IF(ISNULL(obc_monto),0.0,obc_monto) AS obc_monto FROM .rutas INNER JOIN .rutas_det ON rut_codigo=rud_rutcod INNER JOIN .empresas C ON rud_clicod=C.emp_codigo INNER JOIN .empresas V ON rut_vended=V.emp_codigo #LEFT JOIN .cjdocumento ON C.emp_codigo=doc_person and doc_anula='F' and doc_saldo>0 and doc_tipo=1 LEFT JOIN .objetivtacli ON C.emp_codigo=obc_client AND obc_mes=00 AND obc_anho= WHERE (rut_vended= and =1) GROUP BY C.emp_codigo ORDER BY rut_codigo,emp_secuen,descri"},"ProducError":{"error":"(1064)You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and mae_activo=1 and mae_kitcant>0 and dep_activo=1 and ((dep_status=1 and' at line 27","sql":".$xsql."},"creditoError":{"error":"(1064)You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and C.emp_cliente=1 and C.emp_activo=1 INNER JOIN .cjdocumento ON C.emp_codigo=d' at line 1","sql":".$xsql."},"monedacot":[{"mon_codigo":"1","mon_simbol":"U$S","mon_descri":"DOLAR","mon_cotiza":"27","mon_imagen":"d:\\aracel\\imagenes\\dolar.gif","mon_tipcot":"1","cot_compra":"5000.000000000000000","cot_venta":"6750.000000000000000","cot_arbitro":"2","mon_precis":"2","ven_monmer":"2","ven_monfac":"2"},{"mon_codigo":"2","mon_simbol":"G$","mon_descri":"GUARANI","mon_cotiza":"27","mon_imagen":"d:\\aracel\\imagenes\\guarani.jpg","mon_tipcot":"1","cot_compra":"1.000000000000000","cot_venta":"1.000000000000000","cot_arbitro":"2","mon_precis":"0","ven_monmer":"2","ven_monfac":"2"},{"mon_codigo":"3","mon_simbol":"RS","mon_descri":"REAL","mon_cotiza":"27","mon_imagen":"d:\\aracel\\imagenes\\real.gif","mon_tipcot":"1","cot_compra":"1500.000000000000000","cot_venta":"1250.000000000000000","cot_arbitro":"2","mon_precis":"2","ven_monmer":"2","ven_monfac":"2"}],"bancos":[{"ban_codigo":"9","ban_descri":"ABN AMRO BANK"},{"ban_codigo":"5","ban_descri":"BANCO AMAMBAY"},{"ban_codigo":"19","ban_descri":"Banco Atlas S.A."},{"ban_codigo":"24","ban_descri":"BANCO BASA."},{"ban_codigo":"7","ban_descri":"BANCO CONTINENTAL"},{"ban_codigo":"20","ban_descri":"Banco de la Naci\u00f3n Argentina"},{"ban_codigo":"6","ban_descri":"BANCO DO BRASIL S.A."},{"ban_codigo":"16","ban_descri":"BANCO EL COMERCIO"},{"ban_codigo":"15","ban_descri":"BANCO FAMILIAR SA"},{"ban_codigo":"22","ban_descri":"Banco GNB"},{"ban_codigo":"2","ban_descri":"Banco Integracion S.A."},{"ban_codigo":"13","ban_descri":"BANCO ITAPUA SAECA"},{"ban_codigo":"4","ban_descri":"Banco Nacional de Fomento"},{"ban_codigo":"1","ban_descri":"BANCO REGIONAL S.A."},{"ban_codigo":"25","ban_descri":"BANCO RIO."},{"ban_codigo":"3","ban_descri":"BANCO SUDAMERIS"},{"ban_codigo":"21","ban_descri":"Bancop"},{"ban_codigo":"8","ban_descri":"BBVA BANCO"},{"ban_codigo":"14","ban_descri":"BBVA BANCO CTA CTE"},{"ban_codigo":"12","ban_descri":"CREDI UNION"},{"ban_codigo":"17","ban_descri":"HSBC"},{"ban_codigo":"10","ban_descri":"INTERBANCO"},{"ban_codigo":"23","ban_descri":"Interfisa"},{"ban_codigo":"18","ban_descri":"Itau Banco"},{"ban_codigo":"11","ban_descri":"VISION DE FINANZAS"},{"ban_codigo":"26","ban_descri":"Zetabanco"}],"medioscobro":[{"med_codigo":"1","med_descri":"EFECTIVO","med_simbol":"EF","med_banco":"0"},{"med_codigo":"2","med_descri":"FACTURA CREDITO","med_simbol":"FCR","med_banco":"0"},{"med_codigo":"3","med_descri":"PAGARE","med_simbol":"PA","med_banco":"0"},{"med_codigo":"4","med_descri":"CHEQUE","med_simbol":"CH","med_banco":"1"},{"med_codigo":"5","med_descri":"NOTA DE CREDITO","med_simbol":"NC","med_banco":"0"},{"med_codigo":"6","med_descri":"Nota Deposito","med_simbol":"NDP","med_banco":"1"},{"med_codigo":"7","med_descri":"CHEQUE DESCONTADO","med_simbol":"CHD","med_banco":"1"},{"med_codigo":"8","med_descri":"CHEQUE REBOTADOS","med_simbol":"CHR","med_banco":"1"},{"med_codigo":"9","med_descri":"RETENC. IVA-COBRO","med_simbol":"RTC","med_banco":"0"},{"med_codigo":"10","med_descri":"FACTURA CONTADO","med_simbol":"FCO","med_banco":"0"},{"med_codigo":"11","med_descri":"NOTA CRED PROV","med_simbol":"NCP","med_banco":"0"},{"med_codigo":"12","med_descri":"Extraccion","med_simbol":"EXT","med_banco":"1"},{"med_codigo":"13","med_descri":"RETENC. IVA-Pagos","med_simbol":"RTP","med_banco":"0"}],"emisoresError":{"sql":".$xsql.","error":"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and emi_timbre=emd_timbre and emd_nulo=0 GROUP BY emd_id ORDER BY emi_id,' at line 14"},"comportamientosError":{"sql":"SELECT codigo as id ,IF((codigo='MODIPRECIO' and =232) ,'SI' ,valor )As valor ,descripcion FROM comportamiento ORDER BY idcomporta","error":"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=232) ,'SI' ,valor )As valor ,descripcion FROM comportamiento ORDER BY' at line 2"},"membrete":[{"limitems":99,"membrete":"DISTRIMAX ALIMENTOS S.A.,Km9 Acaray,R.U.C.:80090455-9","expedi":"","facura":0,"negocio_descrip":"Comercio al por mayor de carnes, menudencias y productos derivados;Comercio al por mayor de comestibles, excepto carne;Comercio al por mayor de carnes y pescados"}],"lisPrecioCabError":{"sql":"","error":"Lista productos(cab) vacia"},"lisPrecioItError":{"sql":"","error":"Lista productos(it) vacia"},"rubroCliente":[{"clirub_cod":"1","clirub_nom":"AMBULANTES - OPERADORES"},{"clirub_cod":"2","clirub_nom":"AUTOSERVICIOS"},{"clirub_cod":"3","clirub_nom":"DESPENSAS"},{"clirub_cod":"5","clirub_nom":"ESTACION DE SERVICIO"},{"clirub_cod":"8","clirub_nom":"MAYORISTAS"},{"clirub_cod":"10","clirub_nom":"GASTRONOMIA"},{"clirub_cod":"11","clirub_nom":"SUPERMERCADOS B"},{"clirub_cod":"12","clirub_nom":"VARIOS"},{"clirub_cod":"13","clirub_nom":"FUNCIONARIOS"},{"clirub_cod":"36","clirub_nom":"POLLERIAS"},{"clirub_cod":"37","clirub_nom":"CHURRASQUERIAS Y RESTAURANT"},{"clirub_cod":"38","clirub_nom":"CARNICERIAS"},{"clirub_cod":"39","clirub_nom":"DISTRIBUIDORAS."},{"clirub_cod":"40","clirub_nom":"SUPERMERCADO A"}],"tipoId":[{"identif_cod":"11","identif_nom":"RUC","identif_iva":"1"},{"identif_cod":"12","identif_nom":"CEDULA DE IDENTIDAD","identif_iva":"1"},{"identif_cod":"13","identif_nom":"PASAPORTE","identif_iva":"2"},{"identif_cod":"14","identif_nom":"CEDULA EXTRANJERO","identif_iva":"2"},{"identif_cod":"15","identif_nom":"SIN NOMBRE","identif_iva":"1"},{"identif_cod":"16","identif_nom":"DIPLOMATICO","identif_iva":"0"},{"identif_cod":"17","identif_nom":"IDENTIFICACION TRIBUTARIA","identif_iva":"1"}],"configError":{"sql":"SELECT abcdvariable ,emp_fuente3 AS modusoperandi /*PEDIDOS, VENTAS*/ ,1 AS diasincroniza ,ven_client /*desde app v:1.48 f:2024-01-07*/ FROM config LEFT JOIN empresas V ON emp_codigo= ","error":"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 6"}}