1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
| select ACCT.ACCOUNT_NUMBER
, hps.party_site_number
, ACCT.CUST_ACCOUNT_ID
--, 'DEFAULT' SET_CODE
, STID.SET_CODE
, custprof.CLEARING_DAYS
, custprof.CREDIT_BALANCE_STATEMENTS
, custprof.CREDIT_CHECKING
, custprof.CREDIT_HOLD
, custprof.PROFILE_CLASS_ID
, decode(custprof.DISCOUNT_TERMS, 'N', NULL, custprof.DISCOUNT_GRACE_DAYS) DISCOUNT_GRACE_DAYS
, custprof.DISCOUNT_TERMS
, 'Y' DUNNING_LETTERS
, custprof.EFFECTIVE_START_DATE
, custprof.EFFECTIVE_END_DATE
, custprof.LAST_CREDIT_REVIEW_DATE
, custprof.NEXT_CREDIT_REVIEW_DATE
, custprof.OVERRIDE_TERMS
, HP.PARTY_ID
, custprof.PERCENT_COLLECTABLE
, custprof.SEND_STATEMENTS
, custprof.TOLERANCE
, coll.NAME CollectorName
, custprof.EXCHANGE_RATE_TYPE
, RTM.name PaymentTerms
, custprof.AUTOCASH_HIERARCHY_ID
, null ApplicationExceptionRuleSet
, aar.Name AutoMatchRuleSet
, custprof.AUTOCASH_HIERARCHY_ID_FOR_ADR
, cyc.NAME StatementCycle
, grp.name GroupingRule
, custprof.CREDIT_CLASSIFICATION
, custprof.ACCOUNT_STATUS
, custprof.RISK_CODE
, custprof.CREDIT_RATING
, custprof.CONS_BILL_LEVEL
, custprof.CONS_INV_TYPE
, custprof.LOCKBOX_MATCHING_OPTION
, replace(custprof.PREF_CONTACT_METHOD, 'EMAIL', 'E-Mail') PREF_CONTACT_METHOD
, replace(custprof.TXN_DELIVERY_METHOD, 'EMAIL', 'E-Mail') TXN_DELIVERY_METHOD
, custprof.PRINTING_OPTION_CODE
, custprof.MATCH_BY_AUTOUPDATE_FLAG
, custprof.AUTO_REC_INCL_DISPUTED_FLAG
, custprof.CONS_INV_FLAG
, NULL CREDIT_REVIEW_CYCLE
, custprof.CREDIT_ANALYST_ID
, custprof.CREDIT_LIMIT
, custprof.CREDIT_CURRENCY_CODE
, replace(custprof.STMT_DELIVERY_METHOD, 'EMAIL', 'E-Mail') STMT_DELIVERY_METHOD
, custprof.ORDER_AMOUNT_LIMIT
from HZ_PARTIES hp
JOIN HZ_PARTY_SITES hps on HPS.PARTY_ID = HP.PARTY_ID
JOIN HZ_CUST_ACCOUNTS ACCT on ACCT.PARTY_ID = HP.PARTY_ID
JOIN HZ_CUST_ACCT_SITES_ALL ACTS ON (ACTS.CUST_ACCOUNT_ID = ACCT.CUST_ACCOUNT_ID
AND HPS.party_site_id = ACTS.party_site_id)
JOIN HZ_CUSTOMER_PROFILES_F custprof ON (hp.party_id = custprof.party_id
AND ACCT.CUST_ACCOUNT_ID = custprof.CUST_ACCOUNT_ID)
join HZ_CUST_SITE_USES_ALL usg ON (usg.SITE_USE_ID = custprof.SITE_USE_ID
and usg.CUST_ACCT_SITE_ID = ACTS.CUST_ACCT_SITE_ID)
JOIN HZ_CUST_PROFILE_CLASSES class ON (custprof.PROFILE_CLASS_ID = class.PROFILE_CLASS_ID)
JOIN FND_SETID_SETS STId ON (STID.SET_ID = ACTS.SET_ID)
join AR_COLLECTORS coll on (coll.collector_id = custprof.COLLECTOR_ID)
join AR_STATEMENT_CYCLES cyc on (cyc.statement_cycle_id = custprof.STATEMENT_CYCLE_ID)
join RA_GROUPING_RULES grp on (custprof.GROUPING_RULE_ID = grp.GROUPING_RULE_ID)
JOIN RA_TERMS RTM ON (custprof.STANDARD_TERMS = rtm.TERM_ID)
left JOIN AR_AUTOMATCH_RULES aar on (custprof.AUTOMATCH_RULE_ID = aar.AUTOMATCH_RULE_ID)
where custprof.status = 'A'
and class.status = 'A'
AND ACTS.STATUS = 'A'
and hp.party_type = 'ORGANIZATION'
AND hp.status = 'A'
and custprof.site_use_id is not null
and sysdate between custprof.EFFECTIVE_START_DATE and custprof.EFFECTIVE_END_DATE
and class.NAME = 'DEFAULT'
|