on 06-23-2015 11:53 PM
Estimados Expertos
Estoy tratando de hacer un reporte de Documentos del 2014 (facturas de deudor y factura de reserva de proveedor) pagados por medio de reconciliación en el transcurso del 2015, es decir tuve pago a cuenta (en 2014 o 2015) y posteriormente se reconcilio (en 2015) el pago a un documento.
El query en el generador de consultas lo tengo asi:
SELECT T1."ReconType", T0."ReconNum",T1."ReconDate", T0."ShortName", T0."SrcObjAbs", T0."ReconSumFC", T0."ReconSum", T0."ReconSumSC", T2."BaseRef", T0."SrcObjTyp", T4."DocNum", T4,"DocDate"
FROM ITR1 T0 INNER JOIN OITR T1 ON T0."ReconNum" = T1."ReconNum" INNER JOIN OJDT T2 ON T0."TransId" = T2."TransId" INNER JOIN ORCT T3 ON T2."BaseRef" = T3."DocNum" INNER JOIN OVPM T4 ON T2."BaseRef" = T4."DocNum"
WHERE T1."ReconDate" >='20150101' AND T4."DocDate" <='20141231' and ( T1."ReconType" = 0 or T1."ReconType" =3)
En primera no se si es correcto para lo que necesito filtrar por T1."ReconType" =3
La tabla OVPM T4 la cambio por OINV para obtener la info de clientes
El problema que tengo es que no me arroja informacion coherente.
Espero me puedan auxiliar.
Gracias
Hola Francisco
Te modifiqué el query, creo que te faltaba establecerle el tipo de documento en la reconciliación y el inner a la OINV. Chequea y me avisas
SELECT T1.ReconType, T0.ReconNum,T1.ReconDate, T0.ShortName, T0.SrcObjAbs, T0.ReconSumFC, T0.ReconSum, T0.ReconSumSC,
T2.BaseRef, T0.SrcObjTyp, T4.DocNum, T4.DocDate
FROM ITR1 T0
INNER JOIN OITR T1 ON T0.ReconNum = T1.ReconNum and SrcObjTyp=13
INNER JOIN OJDT T2 ON T0.TransId = T2.TransId
INNER JOIN ORCT T3 ON T2.BaseRef = T3.DocNum
INNER JOIN OINV T4 ON T0.SrcObjAbs = T4.Docentry
WHERE T1.ReconDate >='20150101' AND T4.DocDate <='20141231' and ( T1.ReconType = 0 or T1.ReconType =3)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.