[Home] [Help]
267:
268: ) IS
269:
270: l_cr_rec ar_cash_receipts%ROWTYPE;
271: l_crh_rec ar_cash_receipt_history%ROWTYPE;
272: l_crh_rec_new ar_cash_receipt_history%ROWTYPE;
273: l_ps_rec ar_payment_schedules%ROWTYPE;
274: l_dist_rec ar_distributions%ROWTYPE;
275: l_crh_id_new ar_cash_receipt_history.cash_receipt_history_id%TYPE;
268: ) IS
269:
270: l_cr_rec ar_cash_receipts%ROWTYPE;
271: l_crh_rec ar_cash_receipt_history%ROWTYPE;
272: l_crh_rec_new ar_cash_receipt_history%ROWTYPE;
273: l_ps_rec ar_payment_schedules%ROWTYPE;
274: l_dist_rec ar_distributions%ROWTYPE;
275: l_crh_id_new ar_cash_receipt_history.cash_receipt_history_id%TYPE;
276: l_ra_id_unapp ar_receivable_applications.receivable_application_id%TYPE;
271: l_crh_rec ar_cash_receipt_history%ROWTYPE;
272: l_crh_rec_new ar_cash_receipt_history%ROWTYPE;
273: l_ps_rec ar_payment_schedules%ROWTYPE;
274: l_dist_rec ar_distributions%ROWTYPE;
275: l_crh_id_new ar_cash_receipt_history.cash_receipt_history_id%TYPE;
276: l_ra_id_unapp ar_receivable_applications.receivable_application_id%TYPE;
277: l_ra_id_unid ar_receivable_applications.receivable_application_id%TYPE;
278: l_ae_doc_rec ae_doc_rec_type;
279:
315:
316: -- other stuff:
317:
318: l_source_type ar_distributions.source_type%TYPE;
319: l_creation_status ar_cash_receipt_history.status%TYPE;
320: l_rev_crh_id ar_cash_receipt_history.reversal_cash_receipt_hist_id%TYPE;
321:
322: -- dummy variables:
323:
316: -- other stuff:
317:
318: l_source_type ar_distributions.source_type%TYPE;
319: l_creation_status ar_cash_receipt_history.status%TYPE;
320: l_rev_crh_id ar_cash_receipt_history.reversal_cash_receipt_hist_id%TYPE;
321:
322: -- dummy variables:
323:
324: l_override_dummy ar_cash_receipts.override_remit_account_flag%TYPE;
337:
338: -- old stuff:
339: /*
340: l_source_type_old ar_distributions.source_type%TYPE;
341: l_creation_status_old ar_cash_receipt_history.status%TYPE;
342: l_acctd_amount_old ar_cash_receipt_history.acctd_amount%TYPE;
343: l_ccid_old ar_cash_receipt_history.account_code_combination_id%TYPE;
344: l_source_type_new ar_distributions.source_type%TYPE;
345: l_creation_status_new ar_cash_receipt_history.status%TYPE;
338: -- old stuff:
339: /*
340: l_source_type_old ar_distributions.source_type%TYPE;
341: l_creation_status_old ar_cash_receipt_history.status%TYPE;
342: l_acctd_amount_old ar_cash_receipt_history.acctd_amount%TYPE;
343: l_ccid_old ar_cash_receipt_history.account_code_combination_id%TYPE;
344: l_source_type_new ar_distributions.source_type%TYPE;
345: l_creation_status_new ar_cash_receipt_history.status%TYPE;
346: l_acctd_amount_new ar_cash_receipt_history.acctd_amount%TYPE;
339: /*
340: l_source_type_old ar_distributions.source_type%TYPE;
341: l_creation_status_old ar_cash_receipt_history.status%TYPE;
342: l_acctd_amount_old ar_cash_receipt_history.acctd_amount%TYPE;
343: l_ccid_old ar_cash_receipt_history.account_code_combination_id%TYPE;
344: l_source_type_new ar_distributions.source_type%TYPE;
345: l_creation_status_new ar_cash_receipt_history.status%TYPE;
346: l_acctd_amount_new ar_cash_receipt_history.acctd_amount%TYPE;
347: l_ccid_new ar_cash_receipt_history.account_code_combination_id%TYPE;
341: l_creation_status_old ar_cash_receipt_history.status%TYPE;
342: l_acctd_amount_old ar_cash_receipt_history.acctd_amount%TYPE;
343: l_ccid_old ar_cash_receipt_history.account_code_combination_id%TYPE;
344: l_source_type_new ar_distributions.source_type%TYPE;
345: l_creation_status_new ar_cash_receipt_history.status%TYPE;
346: l_acctd_amount_new ar_cash_receipt_history.acctd_amount%TYPE;
347: l_ccid_new ar_cash_receipt_history.account_code_combination_id%TYPE;
348: l_ps_id ar_payment_schedules.payment_schedule_id%TYPE;
349: l_id_dummy NUMBER;
342: l_acctd_amount_old ar_cash_receipt_history.acctd_amount%TYPE;
343: l_ccid_old ar_cash_receipt_history.account_code_combination_id%TYPE;
344: l_source_type_new ar_distributions.source_type%TYPE;
345: l_creation_status_new ar_cash_receipt_history.status%TYPE;
346: l_acctd_amount_new ar_cash_receipt_history.acctd_amount%TYPE;
347: l_ccid_new ar_cash_receipt_history.account_code_combination_id%TYPE;
348: l_ps_id ar_payment_schedules.payment_schedule_id%TYPE;
349: l_id_dummy NUMBER;
350: l_amount_changed BOOLEAN := FALSE;
343: l_ccid_old ar_cash_receipt_history.account_code_combination_id%TYPE;
344: l_source_type_new ar_distributions.source_type%TYPE;
345: l_creation_status_new ar_cash_receipt_history.status%TYPE;
346: l_acctd_amount_new ar_cash_receipt_history.acctd_amount%TYPE;
347: l_ccid_new ar_cash_receipt_history.account_code_combination_id%TYPE;
348: l_ps_id ar_payment_schedules.payment_schedule_id%TYPE;
349: l_id_dummy NUMBER;
350: l_amount_changed BOOLEAN := FALSE;
351: l_rev_crh_id ar_cash_receipt_history.cash_receipt_history_id%TYPE;
347: l_ccid_new ar_cash_receipt_history.account_code_combination_id%TYPE;
348: l_ps_id ar_payment_schedules.payment_schedule_id%TYPE;
349: l_id_dummy NUMBER;
350: l_amount_changed BOOLEAN := FALSE;
351: l_rev_crh_id ar_cash_receipt_history.cash_receipt_history_id%TYPE;
352: l_ra_unapp_ccid NUMBER;
353: l_ra_unid_ccid NUMBER;
354: l_ra_unapp_ccid_old NUMBER;
355: l_ra_unid_ccid_old NUMBER;
876: -- deal with amount changes
877: -- -------------------------------------------------------------
878:
879: -- if the receipt status is APPROVED, we only update the amounts in
880: -- ar_cash_receipts, ar_cash_receipt_history, and ar_payment_schedules,
881: -- but not ar_receivable_applications, since this is being taken
882: -- care of by the applications form and its server-side code:
883:
884:
1025: select 'Y'
1026: into l_bank_charges_row_exists
1027: from dual
1028: where exists (select crh.cash_receipt_history_id
1029: from ar_cash_receipt_history crh, ar_distributions dis
1030: where crh.cash_receipt_id = l_crh_rec.cash_receipt_id
1031: and dis.source_id = crh.cash_receipt_history_id
1032: and dis.source_table = 'CRH'
1033: and dis.source_type ='BANK_CHARGES');
1093: l_sum_acctd_fda_credits
1094: from ar_distributions dis
1095: where dis.source_id in
1096: (select crh.cash_receipt_history_id
1097: from ar_cash_receipt_history crh
1098: where crh.cash_receipt_id = p_cash_receipt_id ) /* Bug2855253 removed and crh.current_record_flag ='N' */
1099:
1100: and dis.source_table = 'CRH'
1101: and dis.source_type = 'BANK_CHARGES';
1815: p_new_status_dsp,
1816: p_new_state,
1817: p_new_state_dsp
1818: FROM
1819: ar_cash_receipt_history crh_current,
1820: ar_cash_receipts cr,
1821: ar_lookups l_cr_status,
1822: ar_lookups l_crh_status
1823: WHERE