Skip to Content
0

SALDOS DE CUENTAS POR 11420000

Jan 16 at 09:52 AM

12

avatar image
Former Member

Buen día, tengo el siguiente query pero quisiera agregar el numero de documentos ya sea factura, notas de creditos, pagos, etc.. y sus folios fiscales.. ya he buscado de todo pero nada.. este query tengo lo que busco solo es complementar con las dos columnas que pido "Numero de documento" "Documento electronico".

SELECT tipo, Account, FormatCode, AcctName, TransId, RefDate, debit, credit, SYSdebit, SYScredit, LineMemo, TransType, Project FROM (SELECT O.GroupMask AS tipo, O.AcctCode AS Account, O.FormatCode, O.AcctName, J.TransId, J.RefDate, CASE WHEN J.credit < 0 THEN J.credit * - 1 ELSE CASE WHEN isnull(J.debit, 0) < 0 THEN 0 ELSE isnull(J.debit, 0) END END AS debit, CASE WHEN isnull(J.debit, 0) < 0 THEN J.debit * - 1 ELSE CASE WHEN isnull(J.credit, 0) < 0 THEN 0 ELSE isnull(J.credit, 0) END END AS credit, CASE WHEN isnull(J.SYScred, 0) < 0 THEN isnull(J.SYScred, 0) * - 1 ELSE CASE WHEN isnull(J.SYSdeb, 0) < 0 THEN 0 ELSE isnull(J.SYSdeb, 0) END END AS SYSdebit, CASE WHEN isnull(J.SYSDeb, 0) < 0 THEN isnull(J.SYSdeb, 0) * - 1 ELSE CASE WHEN isnull(J.SYScred, 0) < 0 THEN 0 ELSE isnull(j.SYScred, 0) END END AS SYScredit, J.LineMemo, J.TransType, J.Project FROM dbo.JDT1 AS J INNER JOIN dbo.OACT AS O ON J.Account = O.AcctCode) AS A ORDER BY tipo, FormatCode

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers