DBA Data[Home] [Help]

APPS.AR_CALC_LATE_CHARGE dependencies on AR_PAYMENT_SCHEDULES

Line 410: ar_payment_schedules ps,

406: 'MONTHLY',first_day(int_lines.due_date)) eff_due_date
407: from ar_interest_lines int_lines,
408: ar_interest_headers int_headers,
409: ar_cash_receipts cr,
410: ar_payment_schedules ps,
411: ar_lc_cust_sites_t cust_site,
412: ar_late_charge_cust_balance_gt bal
413: where ps.customer_id = cust_site.customer_id
414: and cust_site.customer_site_use_id = decode(ps.class,

Line 920: from ar_payment_schedules ps

916: END IF;
917:
918: select min(trx_date) -1
919: into l_next_date
920: from ar_payment_schedules ps
921: where customer_id = p_customer_id
922: and decode(ps.class,
923: 'BR',ar_calc_late_charge.get_bill_to_site_use_id(ps.customer_id,
924: ps.customer_site_use_id,

Line 1047: from ar_payment_schedules

1043: select sum(amount_due_original), sum(fin_charge_charged)
1044: into l_balance_due,l_fin_chrg_adjustment
1045: from
1046: (select amount_due_original,0 fin_charge_charged
1047: from ar_payment_schedules
1048: where payment_schedule_id = p_payment_schedule_id
1049: union all
1050: select nvl(-1 *(ra.amount_applied
1051: + nvl(ra.earned_discount_taken,0)

Line 1056: ar_payment_schedules ps_cm_cr

1052: + nvl(ra.unearned_discount_taken,0))
1053: ,0) amount_applied,
1054: 0 fin_charge_charged
1055: from ar_receivable_applications ra,
1056: ar_payment_schedules ps_cm_cr
1057: where applied_payment_schedule_id = p_payment_schedule_id
1058: and ra.status = 'APP'
1059: and nvl(ra.confirmed_flag,'Y') = 'Y'
1060: and ps_cm_cr.payment_schedule_id = ra.payment_schedule_id

Line 1094: /* For receipts the balance should be directly taken from ar_payment_schedules.

1090:
1091: ELSIF p_class ='PMT' THEN
1092: /* Compound and Simple Interest doesn't matter for Payments as there can not be any
1093: adjustments against receipts */
1094: /* For receipts the balance should be directly taken from ar_payment_schedules.
1095: amount_due_remaining. The receipt date is considered for calculating the balances
1096: of the transaction and not the application date */
1097: select ps.amount_due_remaining
1098: into l_balance_due

Line 1099: from ar_payment_schedules ps

1095: amount_due_remaining. The receipt date is considered for calculating the balances
1096: of the transaction and not the application date */
1097: select ps.amount_due_remaining
1098: into l_balance_due
1099: from ar_payment_schedules ps
1100: where ps.payment_schedule_id = p_payment_schedule_id
1101: and ps.class ='PMT'
1102: and nvl(ps.receipt_confirmed_flag,'Y') = 'Y';
1103: END IF;

Line 1146: from ar_payment_schedules ps

1142: and ci2.billing_date <= p_as_of_date
1143: and ci2.status in ('FINAL', 'ACCEPTED','IMPORTED'))
1144: union all
1145: select sum(amount_due_original)
1146: from ar_payment_schedules ps
1147: where ps.customer_id = p_customer_id
1148: and decode(ps.class,
1149: 'BR',ar_calc_late_charge.get_bill_to_site_use_id(ps.customer_id,
1150: ps.customer_site_use_id,

Line 1257: ar_payment_schedules ps

1253: and ci.status in ('FINAL', 'ACCEPTED','IMPORTED')
1254: union all
1255: select sum(ps.amount_due_original)
1256: from ar_cons_inv ci,
1257: ar_payment_schedules ps
1258: where ci.customer_id = p_customer_id
1259: and ci.site_use_id = p_site_use_id
1260: and ci.currency_code = p_currency_code
1261: and ci.org_id = p_org_id

Line 1333: from ar_payment_schedules ps

1329: l_first_activity_date DATE;
1330: BEGIN
1331: select min(trx_date)
1332: into l_first_activity_date
1333: from ar_payment_schedules ps
1334: where ps.customer_id = p_customer_id
1335: and decode(ps.class,
1336: 'BR',ar_calc_late_charge.get_bill_to_site_use_id(ps.customer_id,
1337: ps.customer_site_use_id,

Line 1621: from ar_payment_schedules ps,

1617: prof_amts.penalty_fixed_amount,
1618: prof_amts.penalty_schedule_id,
1619: site_use.last_accrue_charge_date,
1620: ps.org_id
1621: from ar_payment_schedules ps,
1622: ar_transaction_history th,
1623: ra_customer_trx trx,
1624: hz_cust_accounts cust_acct,
1625: hz_parties party,

Line 1836: ar_payment_schedules ps,

1832: cr.legal_entity_id,
1833: cr.org_id,
1834: -1* ps.amount_due_remaining balance_due
1835: from ar_cash_receipts cr,
1836: ar_payment_schedules ps,
1837: ar_lc_cust_sites_t cust_site,
1838: ar_late_charge_cust_balance_gt bal
1839: where ps.actual_date_closed > l_fin_charge_date
1840: and ps.class ='PMT'

Line 1883: from ar_payment_schedules ps,

1879: -1*ar_calc_late_charge.get_balance_as_of(ps.payment_schedule_id,
1880: l_fin_charge_date,
1881: 'CM',
1882: 'Y') balance_due
1883: from ar_payment_schedules ps,
1884: ra_customer_trx trx,
1885: ra_cust_trx_types types,
1886: ar_lc_cust_sites_t cust_site,
1887: ar_late_charge_cust_balance_gt bal

Line 1953: | i) amount_due_remaining from ar_payment_schedules |

1949: | |
1950: | PSEUDO CODE/LOGIC |
1951: | |
1952: | a) Get the overdue balances of the debit items as sum of |
1953: | i) amount_due_remaining from ar_payment_schedules |
1954: | ii) amount_applied + discount from ar_receivable_applications after the |
1955: | finance charge date. Note that the trx_date of the credit items is considered |
1956: | for determining this as compared to the application date |
1957: | iii) amount_adjusted from ar_adjustments after the finance charge date |

Line 2356: from ar_payment_schedules ps,

2352: cust_site.hold_charged_invoices_flag,
2353: ps.org_id,
2354: ps.cash_receipt_id,
2355: 'OVERDUE' charge_type
2356: from ar_payment_schedules ps,
2357: ar_adjustments adj,
2358: ar_lc_cust_sites_t cust_site,
2359: ar_late_charge_cust_balance_gt bal
2360: where ps.customer_id = cust_site.customer_id

Line 2481: from ar_payment_schedules ps,

2477: cust_site.hold_charged_invoices_flag,
2478: ps.org_id,
2479: ps.cash_receipt_id,
2480: 'OVERDUE' charge_type
2481: from ar_payment_schedules ps,
2482: ar_receivable_applications app,
2483: ar_payment_schedules ps_cm_cr,
2484: ar_lc_cust_sites_t cust_site,
2485: ar_late_charge_cust_balance_gt bal

Line 2483: ar_payment_schedules ps_cm_cr,

2479: ps.cash_receipt_id,
2480: 'OVERDUE' charge_type
2481: from ar_payment_schedules ps,
2482: ar_receivable_applications app,
2483: ar_payment_schedules ps_cm_cr,
2484: ar_lc_cust_sites_t cust_site,
2485: ar_late_charge_cust_balance_gt bal
2486: where ps.customer_id = cust_site.customer_id
2487: and cust_site.customer_site_use_id = decode(ps.class,

Line 2609: from ar_payment_schedules ps,

2605: cust_site.hold_charged_invoices_flag,
2606: ps.org_id,
2607: ps.cash_receipt_id,
2608: 'OVERDUE' charge_type
2609: from ar_payment_schedules ps,
2610: ar_lc_cust_sites_t cust_site,
2611: ar_late_charge_cust_balance_gt bal
2612: where ps.customer_id = cust_site.customer_id
2613: and cust_site.customer_site_use_id = decode(ps.class,

Line 2778: | i) amount_due_remaining from ar_payment_schedules |

2774: | |
2775: | PSEUDO CODE/LOGIC |
2776: | |
2777: | a) Get the overdue balances of the items as sum of |
2778: | i) amount_due_remaining from ar_payment_schedules |
2779: | ii) amount_applied + discount from ar_receivable_applications after the |
2780: | finance charge date. The data on which the credit item is created is used |
2781: | instead of the application date |
2782: | iii) amount_adjusted from ar_adjustments after the finance charge date |

Line 3063: from ar_payment_schedules ps,

3059: cust_site.hold_charged_invoices_flag,
3060: ps.org_id,
3061: ps.cash_receipt_id,
3062: 'OVERDUE' charge_type
3063: from ar_payment_schedules ps,
3064: ar_adjustments adj,
3065: ar_lc_cust_sites_t cust_site,
3066: ar_late_charge_cust_balance_gt bal
3067: where ps.customer_id = cust_site.customer_id

Line 3203: from ar_payment_schedules ps,

3199: cust_site.hold_charged_invoices_flag,
3200: ps.org_id,
3201: ps.cash_receipt_id,
3202: 'OVERDUE' charge_type
3203: from ar_payment_schedules ps,
3204: ar_receivable_applications app,
3205: ar_payment_schedules ps_cm_cr,
3206: ar_lc_cust_sites_t cust_site,
3207: ar_late_charge_cust_balance_gt bal

Line 3205: ar_payment_schedules ps_cm_cr,

3201: ps.cash_receipt_id,
3202: 'OVERDUE' charge_type
3203: from ar_payment_schedules ps,
3204: ar_receivable_applications app,
3205: ar_payment_schedules ps_cm_cr,
3206: ar_lc_cust_sites_t cust_site,
3207: ar_late_charge_cust_balance_gt bal
3208: where ps.customer_id = cust_site.customer_id
3209: and cust_site.customer_site_use_id = decode(ps.class,

Line 3338: from ar_payment_schedules ps,

3334: cust_site.hold_charged_invoices_flag,
3335: ps.org_id,
3336: ps.cash_receipt_id,
3337: 'OVERDUE' charge_type
3338: from ar_payment_schedules ps,
3339: ar_receivable_applications app,
3340: ar_lc_cust_sites_t cust_site,
3341: ar_late_charge_cust_balance_gt bal
3342: where ps.customer_id = cust_site.customer_id

Line 3463: from ar_payment_schedules ps,

3459: cust_site.hold_charged_invoices_flag,
3460: ps.org_id,
3461: ps.cash_receipt_id,
3462: 'OVERDUE' charge_type
3463: from ar_payment_schedules ps,
3464: ar_lc_cust_sites_t cust_site,
3465: ar_late_charge_cust_balance_gt bal
3466: where ps.customer_id = cust_site.customer_id
3467: and cust_site.customer_site_use_id = decode(ps.class,

Line 3926: from ar_payment_schedules ps,

3922: 'MONTHLY',first_day(ps.due_date)) eff_due_date,
3923: 'LATE' charge_type,
3924: cust_site.late_charge_calculation_trx eff_charge_type,
3925: cr.cash_receipt_id
3926: from ar_payment_schedules ps,
3927: ar_lc_cust_sites_t cust_site,
3928: ar_late_charge_cust_balance_gt bal,
3929: ar_receivable_applications app,
3930: ar_cash_receipts cr,

Line 3935: from ar_payment_schedules ps,

3931: ra_cust_trx_types types,
3932: ra_customer_trx trx,
3933: ar_transaction_history th,
3934: (select ps.payment_schedule_id ,sum(adj.amount) fin_charge_charged
3935: from ar_payment_schedules ps,
3936: ar_adjustments adj,
3937: ar_lc_cust_sites_t cust_site
3938: where ps.customer_id = cust_site.customer_id
3939: and decode(cust_site.customer_site_use_id,'','X', ps.customer_site_use_id)

Line 4491: from ar_payment_schedules ps,

4487: cust_sites.payment_grace_days,
4488: cust_sites.min_fc_balance_overdue_type,
4489: cust_sites.min_fc_balance_amount,
4490: cust_sites.min_fc_balance_percent
4491: from ar_payment_schedules ps,
4492: ar_lc_cust_sites_t cust_sites,
4493: ar_system_parameters sysparam
4494: where ps.customer_id = cust_sites.customer_id
4495: and decode(ps.class,

Line 4803: from ar_payment_schedules ps,

4799: cust_sites.payment_grace_days,
4800: cust_sites.min_fc_balance_overdue_type,
4801: cust_sites.min_fc_balance_amount,
4802: cust_sites.min_fc_balance_percent
4803: from ar_payment_schedules ps,
4804: ar_lc_cust_sites_t cust_sites,
4805: ar_system_parameters sysparam
4806: where ps.customer_id = cust_sites.customer_id
4807: and decode(ps.class,

Line 4916: (SELECT /*+ cardinality(cust_site,1) leading(cust_site ps) use_nl(cust_site ps) index(ps AR_PAYMENT_SCHEDULES_N6) */

4912: sum(open_bal) open_balance,
4913: sum(overdue_bal) overdue_balance,
4914: org_id
4915: FROM
4916: (SELECT /*+ cardinality(cust_site,1) leading(cust_site ps) use_nl(cust_site ps) index(ps AR_PAYMENT_SCHEDULES_N6) */
4917: cust_site.lc_cust_sites_id,
4918: ps.customer_id,
4919: cust_site.customer_site_use_id,
4920: ps.invoice_currency_code currency_code,

Line 4925: FROM ar_payment_schedules_all ps,

4921: sum(ps.amount_due_remaining) open_bal,
4922: sum((case when (decode(ps.class,'CM',ps.due_date,ps.due_date + NVL(cust_site.payment_grace_days,0))) < p_as_of_date then 1 else 0 end)
4923: * ps.amount_due_remaining) overdue_bal,
4924: ps.org_id
4925: FROM ar_payment_schedules_all ps,
4926: ar_lc_cust_sites_t cust_site,
4927: ra_customer_trx ct,
4928: ra_cust_trx_types typ
4929: WHERE ps.customer_id = cust_site.customer_id

Line 4963: FROM ar_payment_schedules ps,

4959: sum((case when ps.due_date + NVL(cust_site.payment_grace_days,0) < p_as_of_date then 1 else 0 end)
4960: * (ra.amount_applied + NVL(ra.earned_discount_taken,0)
4961: + NVL(ra.unearned_discount_taken,0))) overdue_bal,
4962: ps.org_id
4963: FROM ar_payment_schedules ps,
4964: ar_receivable_applications ra,
4965: ar_payment_schedules ps_cm_cr,
4966: ar_lc_cust_sites_t cust_site,
4967: ra_customer_trx ct,

Line 4965: ar_payment_schedules ps_cm_cr,

4961: + NVL(ra.unearned_discount_taken,0))) overdue_bal,
4962: ps.org_id
4963: FROM ar_payment_schedules ps,
4964: ar_receivable_applications ra,
4965: ar_payment_schedules ps_cm_cr,
4966: ar_lc_cust_sites_t cust_site,
4967: ra_customer_trx ct,
4968: ra_cust_trx_types typ
4969: WHERE ps.customer_id = cust_site.customer_id

Line 5009: FROM ar_payment_schedules ps,

5005: sum((case when ps.due_date + NVL(cust_site.payment_grace_days,0) < p_as_of_date then 1 else 0 end)
5006: * (ra.amount_applied + NVL(ra.earned_discount_taken,0)
5007: + NVL(ra.unearned_discount_taken,0))) overdue_bal,
5008: ps.org_id
5009: FROM ar_payment_schedules ps,
5010: ar_receivable_applications ra,
5011: ar_payment_schedules ps_cm_cr,
5012: ar_lc_cust_sites_t cust_site,
5013: ra_customer_trx ct,

Line 5011: ar_payment_schedules ps_cm_cr,

5007: + NVL(ra.unearned_discount_taken,0))) overdue_bal,
5008: ps.org_id
5009: FROM ar_payment_schedules ps,
5010: ar_receivable_applications ra,
5011: ar_payment_schedules ps_cm_cr,
5012: ar_lc_cust_sites_t cust_site,
5013: ra_customer_trx ct,
5014: ra_cust_trx_types typ
5015: WHERE ps.customer_id = cust_site.customer_id

Line 5053: FROM ar_payment_schedules ps,

5049: sum (-1*(case when ps.due_date < p_as_of_date then 1 else 0 end)
5050: *(ra.amount_applied + NVL(ra.earned_discount_taken,0)
5051: + NVL(ra.unearned_discount_taken,0))) overdue_bal,
5052: ps.org_id
5053: FROM ar_payment_schedules ps,
5054: ar_receivable_applications ra,
5055: ar_lc_cust_sites_t cust_site,
5056: ra_customer_trx ct,
5057: ra_cust_trx_types typ

Line 5096: ar_payment_schedules ps,

5092: sum(-1*(case when (decode(ps.class,'CM',ps.due_date,ps.due_date + NVL(cust_site.payment_grace_days,0))) < p_as_of_date then 1 else 0 end)
5093: *(adj.amount)) overdue_bal,
5094: ps.org_id
5095: FROM ar_adjustments adj ,
5096: ar_payment_schedules ps,
5097: ar_lc_cust_sites_t cust_site,
5098: ra_customer_trx ct,
5099: ra_cust_trx_types typ
5100: WHERE ps.customer_id = cust_site.customer_id

Line 5135: FROM ar_payment_schedules ps,

5131: ps.invoice_currency_code currency_code,
5132: sum(ps.amount_due_remaining) open_bal,
5133: sum(ps.amount_due_remaining) overdue_bal,
5134: ps.org_id
5135: FROM ar_payment_schedules ps,
5136: ar_lc_cust_sites_t cust_site
5137: WHERE ps.customer_id = cust_site.customer_id
5138: AND cust_site.customer_site_use_id = ar_calc_late_charge.get_bill_to_site_use_id(ps.customer_id,
5139: ps.customer_site_use_id,

Line 5166: FROM ar_payment_schedules ps,

5162: sum((case when ps.trx_date < p_as_of_date then 1 else 0 end)
5163: *(decode(nvl(ard.amount_cr,0), 0, nvl(ard.amount_dr,0),
5164: (ard.amount_cr * -1)))) overdue_bal,
5165: ps.org_id
5166: FROM ar_payment_schedules ps,
5167: ar_distributions ard,
5168: ar_transaction_history ath,
5169: ra_customer_trx_lines lines,
5170: ar_lc_cust_sites_t cust_site,

Line 7023: | from ar_payment_schedules). |

7019: | |
7020: | 2. Invoice Level Tolerances : Similar to the case above. Instead of the overdue |
7021: | customer balance, the overdue invoice amount will be used. Instead of the Open |
7022: | customer balance, the original invoice amount will be used (amount_due_original |
7023: | from ar_payment_schedules). |
7024: | |
7025: | In my example above, as of 31-Jan-2006, the invoice 101 is overdue by 600 USD and|
7026: | the original invoice amount is 1000 USD . So 60% of this invoice is overdue as of |
7027: | this date. Invoice 102 will not be considered as it is not overdue. |