Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2720

Re: Query de Asientos contables

$
0
0

Intenta así:

 

SELECT je1.TransId , je.baseref 'Num. Origen',je.Ref1 'Referencia',je.RefDate  ,je.createdate 'Fecha de sistema',acc.AcctCode 'Numero Cuenta',acc.AcctName'Nombre Cuenta' ,

  je.Memo'Transaccion' ,je1.Debit'Debito' ,je1.Credit'Credito',

  Quien_lo_creo = CASE je.usersign

  when 1 then 'Manager'

  when 2 then 'B1i'

  when 3 then 'Jesus Alberto Anderson Olivas'

  when 4 then 'Alba Nidia Arredondo Zubiran'

  when 5 then 'Nancy Maldonado Morales'

  when 6 then 'Flor Nayeli Delgado Delgado'

  when 7 then 'Perla de Jesus Irigoyen Diaz'

  when 8 then 'Flor Nayeli Delgado Delgado'

  when 9 then 'Juan Antonio Ontiveros Gardea'

  when 10 then 'Claudia Angelica Olivas Grijalva'

  when 11 then 'Perla'

  when 12 then 'Rocio Rodriguez'

  end,

  Quien_lo_modifico = CASE je.usersign2

  when 1 then 'Manager'

  when 2 then 'B1i'

  when 3 then 'Jesus Alberto Anderson Olivas'

  when 4 then 'Alba Nidia Arredondo Zubiran'

  when 5 then 'Nancy Maldonado Morales'

  when 6 then 'Flor Nayeli Delgado Delgado'

  when 7 then 'Perla de Jesus Irigoyen Diaz'

  when 8 then 'Flor Nayeli Delgado Delgado'

  when 9 then 'Juan Antonio Ontiveros Gardea'

  when 10 then 'Claudia Angelica Olivas Grijalva'

  when 11 then 'Perla'

  when 12 then 'Rocio Rodriguez'

  end,

  isnull(OI.Footer,'') + isnull(OC.Footer,'') as 'Footer Document

/* o intenta con las siguientes dos líneas, no indicas si lo necesitas separado o en una columna:

OI.Footer 'Footer Factura clientes'

OC.Footer 'Footer OC' */

  FROM JDT1 as je1

left join OPRC as prc on je1.ProfitCode = prc.PrcCode

left join OPRC as prc2 on je1.OcrCode2 = prc2.PrcCode

left join OPRC as prc3 on je1.OcrCode3 = prc3.PrcCode

left join OPRC as prc4 on je1.OcrCode4 = prc4.PrcCode

left join OPRC as prc5 on je1.OcrCode5 = prc5.PrcCode

inner join OACT as acc on je1.Account = acc.AcctCode

join OJDT as je on je1.TransId = je.TransId

left join OINV OI on OI.TransId=je1.TransId

left join OPOR OC on OC.TransId=je1.TransId

join ousr b on je.usersign=b.internal_K

order by 4

 

 

Sólo agregarle los LEFT JOINs q te hagan falta de los otros tipos de documento...

 

Saludos y suerte


Viewing all articles
Browse latest Browse all 2720

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>