Skip to Content
author's profile photo Former Member
Former Member

Informe de Facturas y Notas de Crédito abiertas

Como Puedo crear un informe que detalle (nombre de empleado de ventas,cod cliente, nombre de empleado, numero de referencia, nro de doc,fecha de cont, fecha de venc,monto total, pago a cuenta, saldo) esto es de la tabla OINv y ORIN

yo saque esta consulta pero solo me muestra las facturas abiertas, y no me muestra las notas abiertas....

SELECT
T1.[SlpName],
T0.[CardCode],
T0.[CardName],
T0.[NumAtCard],
T0.[DocNum],
T0.[DocDate],
T0.[DocDueDate],
T0.[DocTotal],
T0.[PaidToDate] ,
(T0.[DocTotal] - T0.[PaidToDate]) Saldo

FROM OINV T0 INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode

WHERE T0.[DocStatus]='O'

favor ayuda estoy comenzando recien en esto.....

desde ya les agradezco

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2013 at 10:47 PM

    Buen dia, creo que este te servira, saludos !

    SELECT T0.[DocNum], T0.[EDocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[DocTotal] + ISNULL(T1.[WTAmnt],0) - T0.[VatSum] as 'Importe', T1.[WTAmnt], T0.[VatSum], T0.[DocTotal] as 'Total'

    FROM OINV T0

    LEFT JOIN INV5 T1 ON T0.[DocEntry] = T1.[AbsEntry]

    WHERE T0.[DocStatus]='O'

    UNION ALL

    SELECT T0.[DocNum], T0.[EDocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[DocTotal] + ISNULL(T1.[WTAmnt],0) - T0.[VatSum] as 'Importe', T1.[WTAmnt], T0.[VatSum], T0.[DocTotal] as 'Total'

    FROM ORIN T0

    LEFT JOIN RIN5 T1 ON T0.[DocEntry] = T1.[AbsEntry]

    WHERE T0.[DocStatus]='O'

    Ya solo agrega y quita los campos que necesitas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2013 at 04:12 PM

    Hola Julio,

    solo tengo una pequeña duda

    como puedo distinguir la clase de documento (Factura o Nota ), para realizar la sumatoria:

    EJemplo:

    Tipo Saldo

    RF 1245

    RC 35

    RF 256

    ------------------------

    1466

    RF: Facturas

    RC: Notas

    en la misma consulta

    gracias de antemano..

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.