Sei sulla pagina 1di 4

select

rownum s_no ,

org_name ,

org_code ,

customer_number ,

customer_code ,

invoice_number ,

trx_date transaction_date ,

curr currency ,

amount ,

invoice_type ,

nvl(salesman_name,RESOURCE_NAME) salesman_name

from

select b.name org_name, b.short_code org_code ,

a.CUSTOMER_TRX_ID , a.TRX_NUMBER invoice_number ,

a.TRX_DATE , a.CUST_TRX_TYPE_ID ,

a.SET_OF_BOOKS_ID , a.BILL_TO_ADDRESS_ID ,

a.BILL_TO_CUSTOMER_ID , f.account_number customer_number ,

a.BILL_TO_SITE_USE_ID , e.location customer_code ,

a.PRIMARY_SALESREP_ID , a.PAYING_SITE_USE_ID ,

g.EXTENDED_AMOUNT Amount , a.ORG_ID ,

c.type , d.name salesman_name ,

i.RESOURCE_NAME ,

a.INVOICE_CURRENCY_CODE curr, d.salesrep_number ,

h.meaning invoice_type

from ra_customer_trx_all a ,
hr_operating_units b ,

ra_cust_trx_types_all c ,

jtf_rs_salesreps d ,

hz_cust_site_uses_all e ,

hz_cust_accounts f ,

ra_customer_trx_lines_all g ,

ar_lookups h ,

jtf_rs_resource_extns_vl i

where a.org_id = b.organization_id

and b.set_of_books_id = 2089

and b.set_of_books_id = d.set_of_books_id(+)

and a.org_id = d.org_id(+)

and a.CUST_TRX_TYPE_ID = c.CUST_TRX_TYPE_ID

and a.primary_SALESREP_ID = d.SALESREP_ID(+)

and e.site_use_id = a.BILL_TO_SITE_USE_ID

and f.cust_account_id = a.BILL_TO_CUSTOMER_ID

and a.CUSTOMER_TRX_ID = g.CUSTOMER_TRX_ID

and h.lookup_code = c.type

and h.lookup_type = 'TRANSACTION TYPE'

and i.RESOURCE_ID(+) = d.RESOURCE_ID

--and a.trx_number = 'CRN0097361'

order by b.name

--where nvl(salesman_name,RESOURCE_NAME) like 'No%Sales%'

order by s_no , org_name ;

/
select * from ra_customer_trx_all where trx_number = 'DN156360';

select distinct PRIMARY_SALESREP_ID

from ra_customer_trx_all

where PRIMARY_SALESREP_ID

in

select distinct SALESREP_ID

from jtf_rs_salesreps

);

update ra_customer_trx_all set PRIMARY_SALESREP_ID = 100008128

where CUSTOMER_TRX_ID = 4483928;

select * from jtf_rs_salesreps where salesrep_id = 100008142; --RESOURCE_ID = 100009101;

select * from jtf_rs_resource_extns_vl where upper(resource_name) like upper('%2132%');

jtf_rs_salesreps

select primary_salesrep_id from hz_cust_site_uses_all where location = 'T701021';

select * from hz_cust_site_uses_all where site_use_id = 301474;


select * from ra_customer_trx_lines_all where CUSTOMER_TRX_ID = 4451065;

select * from hz_cust_accounts where cust_account_id = 4050;

select * from ra_customer_trx_all where set_of_books_id = 2089;

select * from ra_cust_trx_types_all where CUST_TRX_TYPE_ID = 13186

select * from ra_batch_sources_all where name = 'INV'

select * from jtf_rs_salesreps where SALESREP_ID = 100008091

select * from all_objects where object_name like 'RA%' and object_type = 'TABLE'

RA_CUSTOMER_TRX_V

RA_CUST_TRX_LINE_V

select * from ar_lookups where lookup_type = 'TRANSACTION TYPE'

Potrebbero piacerti anche