Skip to content

Commit 5ffba33

Browse files
authored
Add files via upload
1 parent 5432424 commit 5ffba33

File tree

4 files changed

+252
-0
lines changed

4 files changed

+252
-0
lines changed

AP Supplier Cleanup.sql

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---SUMMARY OF SUPPLIERS-------
2+
3+
select --pv.*,
4+
pv.segment1 supplier_no,
5+
pv.vendor_name supplier_name,
6+
pv.pay_group_lookup_code,
7+
pv.creation_date,
8+
pv.enabled_flag,
9+
pv.end_date_active,
10+
papf.full_name emp_name,
11+
papf.current_employee_flag,
12+
decode(pv.enabled_flag, 'N', 'Inactive', decode(pv.end_date_active, NULL, 'Active', 'Inactive')) active,
13+
(select count(*) from apps.po_headers_all poh where poh.vendor_id = pv.vendor_id and poh.closed_code not in ('CLOSED','FINALLY CLOSED')) Open_POs,
14+
decode((select count(*) from apps.ap_checks_all apc where apc.vendor_id = pv.vendor_id and check_date > '01-DEC-2012'), 0, 'No Payments', 'Payment Activity') Payment_Activity,
15+
decode((select creation_date from apps.po_vendors pv2 where pv2.vendor_id = pv.vendor_id and pv2.creation_date > '01-DEC-2013'), null, 'Not New', 'New') New_Status
16+
from apps.po_vendors pv
17+
,apps.per_all_people_f papf
18+
where pv.employee_id = papf.person_id (+)
19+
and trunc(sysdate) between papf.effective_start_date (+) and nvl(papf.effective_end_date (+), '31-DEC-4712')
20+
;
21+
select * from apps.po_headers_all where closed_date is null and vendor_id = 99534;
22+
select * from apps.ap_checks_all;
23+
select * from apps.per_all_people_f;
24+
25+
26+
--SITES SETUP TO non 002 Location--
27+
28+
29+
select pv.segment1, pv.vendor_name, pvsa.vendor_site_code, pvsa.purchasing_site_flag, pvsa.pay_site_flag, gcc.segment1, gcc.segment2, gcc.segment3, gcc.segment4
30+
from apps.po_vendor_sites_all pvsa
31+
,apps.po_vendors pv
32+
,apps.gl_code_combinations gcc
33+
where pvsa.accts_pay_code_Combination_id = gcc.code_combination_id
34+
and pvsa.vendor_id = pv.vendor_id
35+
and gcc.segment1 <> '002'
36+
and pvsa.inactive_date is not null;
37+
38+
39+
--OPEN POs------
40+
41+
select pv.segment1 supplier_no,
42+
pv.vendor_name supplier_name,
43+
poh.segment1 PO_Num,
44+
--poh.cancel_flag,
45+
poh.* from
46+
apps.po_headers_all poh,
47+
apps.po_vendors pv
48+
where poh.vendor_id = pv.vendor_id
49+
and poh.closed_code not in ('CLOSED','FINALLY CLOSED');
50+

AR Customer Cleanup.sql

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
--CUSTOMER CLEANUP STATUS--
2+
3+
select rc.customer_number,
4+
rc.customer_name,
5+
rc.creation_date,
6+
rc.status,
7+
decode((select count(*) from apps.ra_customer_trx_all rcta where rcta.bill_to_customer_id = rc.customer_id and rcta.trx_date > '01-DEC-2012'), 0, 'No Billing', 'Billing Activity') Billing_Activity,
8+
decode((select count(*) from apps.ra_customer_trx_all rcta where rcta.ship_to_customer_id = rc.customer_id and rcta.trx_date > '01-DEC-2012'), 0, 'No Shipping', 'Shipping Activity') Shipping_Activity,
9+
decode((select customer_id from apps.ar_payment_schedules_all apsa where apsa.customer_id = rc.customer_id and apsa.amount_due_remaining > 0 group by customer_id), null, 'No Aging', 'Aging Activity') Aging_Activity,
10+
decode((select rc2.creation_date from apps.ra_customers rc2 where rc2.customer_id = rc.customer_id and rc2.creation_date > '01-DEC-2013'), null, 'Not New', 'New') New_Status
11+
from apps.ra_customers rc;
12+
13+
select distinct ship_to_customer_id from apps.ra_customer_trx_all where trx_date > '01-DEC-2012';
14+
15+
---CUSTOMER HEADER CREATION ANALYSIS--
16+
select fu.user_name, papf.full_name, hou.name, ppt.system_person_type, count(rc.customer_id)
17+
from apps.ra_customers rc
18+
,apps.fnd_user fu
19+
,apps.per_all_people_f papf
20+
,apps.per_person_types ppt
21+
,apps.per_all_assignments_f paaf
22+
,apps.hr_organization_units hou
23+
where rc.creation_date > '01-JUL-2013'
24+
and rc.created_by = fu.user_id
25+
and papf.person_type_id = ppt.person_type_id
26+
and fu.employee_id = papf.person_id
27+
and papf.person_id = paaf.person_id
28+
and paaf.organization_id = hou.organization_id
29+
and trunc(sysdate) between papf.effective_start_date and nvl(papf.effective_end_date, '31-DEC-4712')
30+
and trunc(sysdate) between paaf.effective_start_date and nvl(paaf.effective_end_date, '31-DEC-4712')
31+
group by fu.user_name, papf.full_name, hou.name, ppt.system_person_type
32+
order by papf.full_name
33+
;
34+
--CUSTOMER SITE CREATION ANALYSIS--
35+
select fu.user_name
36+
, papf.full_name EMPLOYEE_NAME
37+
, hou.name COST_CENTER
38+
, ppt.system_person_type STATUS
39+
, hpsu.site_use_type SITE_USE
40+
, count(hpsu.party_site_use_id) "# Of Sites Created"
41+
from apps.hz_party_site_uses hpsu
42+
,apps.fnd_user fu
43+
,apps.per_all_people_f papf
44+
,apps.per_person_types ppt
45+
,apps.per_all_assignments_f paaf
46+
,apps.hr_organization_units hou
47+
where fu.user_id = hpsu.created_by
48+
and hpsu.creation_date > '01-JUL-2013'
49+
and papf.person_type_id = ppt.person_type_id
50+
and fu.employee_id = papf.person_id
51+
and papf.person_id = paaf.person_id
52+
and paaf.organization_id = hou.organization_id
53+
and trunc(sysdate) between papf.effective_start_date and nvl(papf.effective_end_date, '31-DEC-4712')
54+
and trunc(sysdate) between paaf.effective_start_date and nvl(paaf.effective_end_date, '31-DEC-4712')
55+
--and fu.end_date is null
56+
group by fu.user_name, papf.full_name, hou.name, ppt.system_person_type, hpsu.site_use_type
57+
order by papf.full_name
58+
;
59+
60+
select *
61+
from apps.hz_party_sites;
62+
63+
64+
select * from apps.ra_customer_trx_all;
65+
select * from apps.RA_CUSTOMER_TRX_PARTIAL_V;
66+
select * from apps.ar_receipts_all;
67+
select * from all_tables where table_name like '%SITE%' and owner = 'AR';
68+
select * from apps.ar_payment_schedules_all where amount_due_remaining > 0 and customer_id = 1022;--group by customer_id;
69+
70+
select * from apps.ra_customers where customer_number = '1000';
71+
72+
begin
73+
dbms_application_info.set_client_info('47');
74+
end;

GL Detail.sql

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
select * from all_tables where table_name like '%JE_BATCH%';
2+
3+
---balance by flexfield---
4+
5+
select gcc.segment1
6+
,gcc.segment2
7+
,gcc.segment3
8+
,gcc.segment4
9+
,gcc.segment5,
10+
gjh.je_source
11+
,gjh.je_category
12+
,nvl(accounted_dr, 0)
13+
,nvl(accounted_cr, 0)
14+
,nvl(accounted_dr, 0) - nvl(accounted_cr,0) net
15+
,gjl.description
16+
from apps.gl_je_lines gjl
17+
,apps.gl_je_headers gjh
18+
,apps.gl_je_batches gjb
19+
,apps.gl_code_combinations gcc
20+
where gjl.code_combination_id = gcc.code_combination_id
21+
and gjh.je_batch_id = gjb.je_batch_id
22+
and gjh.je_header_id = gjl.je_header_id
23+
--and gjh.je_source = 'Inventory'
24+
--and gjl.description like '%75 Inventory%'
25+
and gjb.name like '%STD 76A%'
26+
--and gcc.segment2 in ('1020')
27+
--and gcc.segment3 in ('49004')
28+
--and gcc.segment4 in ('51605','51606','51607','51608','51301','57301','57302','57317','57401','57402','57409','57421','57422','57430')
29+
--and gcc.segment4 between '50000' and '99999'
30+
--and gcc.segment5 = '2626958'
31+
--and gcc.segment5 != '0000000'
32+
--and gjl.period_name in ('APR-11','MAY-11','JUN-11','JUL-11','AUG-11','SEP-11','OCT-11','NOV-11','DEC-11','JAN-12','FEB-12','MAR-12')
33+
--and gjl.period_name in ('APR-12','MAY-12','JUN-12','JUL-12','AUG-12','SEP-12','OCT-12','NOV-12','DEC-12','JAN-13','FEB-13','MAR-13')
34+
--and gjl.period_name in ('APR-08','MAY-08','JUN-08','JUL-08','AUG-08','SEP-08','OCT-08','NOV-08','DEC-08','JAN-09','FEB-09','MAR-09')
35+
and gjl.period_name = 'NOV-13'
36+
--group by gcc.segment1, gcc.segment2, gcc.segment3, gcc.segment4, gcc.segment5;
37+
;
38+
39+
40+
--summary total--
41+
42+
select sum(nvl(accounted_dr, 0))
43+
,sum(nvl(accounted_cr, 0))
44+
,sum(nvl(accounted_cr, 0) - nvl(accounted_dr,0)) sum
45+
from apps.gl_je_lines gjl
46+
,apps.gl_code_combinations gcc
47+
where gjl.code_combination_id = gcc.code_combination_id
48+
--and gcc.segment2 in ('0226','0227','0228','0235','0236','0237','0238','0240','0251','0462','0463')
49+
--and gcc.segment3 in ('40213','40252','50220','50222','70003','70004','70005','70006','70007','70008','70009','70010','70011','70012','70026','70196','70402','70404','70595','70597','71004','71006','71007','71008','71011','71023','72003','72004','72005','72198','72201','72202','72203','72204','72205','72206','72207','72208','72209','72210','72211','72212','72213','72214','72215','72216','72217','72218','72219','72231','72232','72233','72294','72296','72297','72298','72299','72301','72505','72801','72803','73101','73102','74001','75002','75003','75004','76002','76003','76102','76506')
50+
--and gcc.segment4 in ('51101','51102','51201','51301','51302','51303','51401','51402','51403','51404','51405','51406','51407','51420','51421','51501','51502','51503','51504','51505','51506','51507','51508','51509','51510','51511','51512','51520','51601','51602','51603','51604','51605','51606','51607','51608','51701','51702','51703','51801','51802','51803','51804','51805','51806','51807','51808','51809','51810','51901','52001','52002','52003','52004','52005','52006','52007','52008','52009','52010','52012','52013','52026','52101','52102','52103','52104','53101','53102','53103','53201','53202','53203','53204','53205','53209','53210','53211','53212','54101','54102','54103','54104','54201','54202','54203','54204','54205','54206','55101','55102','56001','57001','57017','57018','57020','57021','57022','57023','57306','59001','59002','60001','60002','60003','60004','60005','60006','60007','60008','60009','60010','60011','60012','60013','60014','60015','60050','60101','60102','60201','60202','60203','60204','60205','60206','60207','60208','60209','60210','60301','60302','60401','60501','60502','61001','61002','61003','61004','61005','61006','61007','61008','61009','61010','61011','61012','61013','61014','61015','61016','61017','61018','61019','61020','61021','61022','61023','62001','62002','62003','62004','62005','62006','62007','62008','62009','62010','62011','62012','63001','63002','63003','63004','63005','63006','63007','63008','63009','63010','63011','64001','64002','64003','64004','64005','64006','64007','64008','64009','64010','64011','64012','64013','64014','64015','64016','64017','64018','65101','65102','65103','65104','65105','65106','65107','65201','65202','65203','66101','66102','66103','66104','66105','66106','66107','66108','66109','66110','66111','66112','66201','66202','66203','66204','66301','66302','66303','66304','66305','66306','66307','66308','66309','66310','66311','66312','66401','66402','66403','66404','66405','67001','67002','67003','67004','67005','67006','67007','67008','67009','67010','67011','67012','67013','67020','67021','67022','67023','67024','67025','67026','67027','67028','67029','67030','67031','68101','68102','68103','68104','68105','68106','68107','68201','68202','68203','68204','68205','68206','68207','68208','68209','68210','68211','68212','68213','68214','68215','68216','68217','68218','68219','68220','68221','68222','68230','68250','68251','68252','68260','68261','68262','68263','68264','68301','68401','68402','68403','68404','68405','68406','69001','69002','69003','69101','69102','70001','70002','70003','70004','70005','70006','70007','70008','70009','70010','70011','70012','70013','70014','70015','70016','70017','70018','70019','70020','70021','70022','70100','71001','71002','71301','71302','72101','72102','72103','72104','81004','81006','81007','81010','81011','81020','81021','90000','91000','91100','91200','91201','91202','91203','91204','91205','91300','91301','92100','92101','92110','92111','92115','92116','92200','92201','92202','92203','92210','92211','92212','92213','92220','92221','92222','92223','92231','92232','92233','92234','92235','92236','92237','92238','92300','92301','92302','92303','92304','92305','92321','92322','92323','92324','92400','92401','92402','92403','92501','92503','93010','93011','93012','93013','93100','93101','93200','93201','93300','93301','93310','93311','93315','93316','93317','93318','93320','93321','93325','93326','93330','93331','93340','93341','93350','93351','93360','93361','93370','93371','93380','93381','93382','93383','93384','94101','94102','94103','94104','94105','94106','94107','94110','94111','95001','95002','95003','95004')
51+
--and gjl.period_name = 'OCT-12'
52+
and gcc.segment4 = '24404'
53+
group by gcc.segment6;
54+
55+
---balance by flexfield---
56+
57+
select gcc.segment1
58+
,gcc.segment2
59+
,gcc.segment3
60+
,gcc.segment4
61+
,gcc.segment5
62+
,sum(nvl(accounted_dr, 0))
63+
,sum(nvl(accounted_cr, 0))
64+
,sum(nvl(accounted_dr, 0) - nvl(accounted_cr,0)) sum
65+
from apps.gl_je_lines gjl
66+
,apps.gl_je_headers gjh
67+
,apps.gl_code_combinations gcc
68+
where gjl.code_combination_id = gcc.code_combination_id
69+
and gjh.je_header_id = gjl.je_header_id
70+
--and gcc.segment2 in ()
71+
--and gcc.segment3 in ('40213','40252','50220','50222','70003','70004','70005','70006','70007','70008','70009','70010','70011','70012','70026','70196','70402','70404','70595','70597','71004','71006','71007','71008','71011','71023','72003','72004','72005','72198','72201','72202','72203','72204','72205','72206','72207','72208','72209','72210','72211','72212','72213','72214','72215','72216','72217','72218','72219','72231','72232','72233','72294','72296','72297','72298','72299','72301','72505','72801','72803','73101','73102','74001','75002','75003','75004','76002','76003','76102','76506')
72+
--and gcc.segment4 in ('72101','72102','72103','72104')
73+
and gcc.segment4 = '51806'
74+
--and gcc.segment5 in ('B170014')
75+
and gjl.period_name in ('APR-12', 'MAY-12', 'JUN-12', 'JUL-12', 'AUG-12', 'SEP-12', 'OCT-12', 'NOV-12', 'DEC-12', 'JAN-12')
76+
group by gcc.segment1, gcc.segment2, gcc.segment3, gcc.segment4, gcc.segment5;

R12 Data Validation Queries.SQL

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
--SUPPLIERS--
2+
SELECT --count(*)
3+
vendor_name, segment1, match_option, decode(inspection_required_flag, 'Y', '4-Way', decode(receipt_required_flag, 'Y', '3-Way', '2-Way')) match_type,enabled_flag
4+
FROM apps.ap_suppliers where creation_date < '01-AUG-2014';
5+
6+
--CUSTOMERS--
7+
--CUSTOMERS--
8+
--select count(*)
9+
--from (
10+
select --hzca.*
11+
hzp.party_number, hzp.party_name, decode(hzp.country, 'US', hzp.state, hzp.province) location, hzca.account_number, hzca.status
12+
--hzp.party_name, hzp.party_id, hzp.party_type, hzca.account_number ,hzca.status cust_account_status
13+
from apps.hz_parties hzp
14+
, apps.hz_cust_accounts hzca
15+
where hzp.party_id = hzca.party_id
16+
and hzca.creation_date < '01-JUL-2014'
17+
--and hzp.party_number = '1004'
18+
--) a
19+
--group by cust_account_status
20+
;
21+
22+
--EXPENDITURES--
23+
select count(*) from apps.pa_expenditure_items_all where creation_date <'01-JUL-2014'
24+
;
25+
26+
--ASSETS--
27+
select fa.asset_number, fa.description, fb.book_type_code, fb.cost, fb.deprn_method_code, fb.life_in_months from apps.fa_additions fa, apps.fa_books fb where fa.asset_id = fb.asset_id and fa.creation_date < '01-JUL-2014' and fb.last_update_date < '01-JUL-2014';
28+
;
29+
select count(*) from apps.fa_additions fa where creation_date < '01-JUL-2014';
30+
31+
---BUDGETS---
32+
select pa_cost_budgets.segment1 proj_num
33+
,pa_cost_budgets.burdened_cost cost_budget
34+
,pa_rev_budgets.revenue revenue_budget
35+
from (select pbv.budget_version_id, ppa.segment1, pbv.burdened_cost, ppa.creation_date
36+
from apps.pa_budget_versions pbv
37+
,apps.pa_projects_all ppa
38+
where pbv.project_id = ppa.project_id
39+
and pbv.budget_status_code = 'W'
40+
and pbv.budget_type_code = 'AC'
41+
) pa_cost_budgets
42+
,(select pbv.budget_version_id, ppa.segment1, pbv.revenue
43+
from apps.pa_budget_versions pbv
44+
,apps.pa_projects_all ppa
45+
where pbv.project_id = ppa.project_id
46+
and pbv.budget_status_code = 'W'
47+
and pbv.budget_type_code = 'AR'
48+
) pa_rev_budgets
49+
where pa_cost_budgets.segment1 = pa_rev_budgets.segment1
50+
--and pa_cost_budgets.segment1 = '2601035';
51+
and pa_cost_budgets.creation_date < '01-JUL-2014'
52+
order by pa_cost_budgets.segment1 asc;

0 commit comments

Comments
 (0)