[Home] [Help]
159: p_batch_id_from IN NUMBER,
160: p_batch_id_to IN NUMBER,
161: p_cutoff_date IN DATE) IS
162: --
163: p_curr_batch_id XTR_BATCHES.BATCH_ID%TYPE;
164: p_upgrade_batch XTR_BATCHES.UPGRADE_BATCH%TYPE;
165: p_period_start DATE;
166: p_period_end DATE;
167:
160: p_batch_id_to IN NUMBER,
161: p_cutoff_date IN DATE) IS
162: --
163: p_curr_batch_id XTR_BATCHES.BATCH_ID%TYPE;
164: p_upgrade_batch XTR_BATCHES.UPGRADE_BATCH%TYPE;
165: p_period_start DATE;
166: p_period_end DATE;
167:
168:
167:
168:
169: CURSOR BATCH_SEQ is
170: Select batch_id
171: From XTR_BATCHES
172: Where company_code = p_company_code
173: and batch_type is null
174: and batch_id between nvl(p_batch_id_from, batch_id) and nvl(p_batch_id_to, batch_id)
175: Order by batch_id asc;
175: Order by batch_id asc;
176:
177: CURSOR BATCH_PERIOD is
178: Select period_start, period_end, upgrade_batch
179: From XTR_BATCHES
180: Where batch_id = p_curr_batch_id;
181:
182: CURSOR FIND_USER (fnd_user_id in number) is
183: select dealer_code
199: and b.parameter_code = 'ACCNT_SUSAC';
200: --
201: CURSOR FIND_PRE_BATCH is -- Find the previous Non-Reval/Non-Accrual related Batch ID
202: select pre.batch_id
203: from XTR_BATCHES PRE,
204: XTR_BATCHES CUR
205: where cur.company_code = p_company_code
206: and cur.batch_id = p_curr_batch_id
207: and pre.company_code = cur.company_code
200: --
201: CURSOR FIND_PRE_BATCH is -- Find the previous Non-Reval/Non-Accrual related Batch ID
202: select pre.batch_id
203: from XTR_BATCHES PRE,
204: XTR_BATCHES CUR
205: where cur.company_code = p_company_code
206: and cur.batch_id = p_curr_batch_id
207: and pre.company_code = cur.company_code
208: and cur.period_start = (pre.period_end + 1)
208: and cur.period_start = (pre.period_end + 1)
209: and pre.upgrade_batch <> 'Y'
210: and pre.batch_type is null;
211:
212: l_pre_batch_id XTR_BATCHES.BATCH_ID%TYPE;
213:
214: CURSOR CHK_EARLY_BATCH is -- chck if the early batch id been generated journal
215: select 1
216: from XTR_BATCH_EVENTS
239:
240: -- Added for flex journals. 2404342. Creation of a new journal only batch.
241:
242: Cursor GEN_BATCH is
243: Select XTR_BATCHES_S.NEXTVAL
244: from DUAL;
245:
246: l_retcode NUMBER := 0;
247: l_warn_flag BOOLEAN;
404: Close GEN_BATCH;
405:
406: -- Insert new row to XTR_BATCH when new batch process staring from accrual
407:
408: Insert into XTR_BATCHES(batch_id, company_code, period_start, period_end,
409: gl_group_id, upgrade_batch, created_by, creation_date,
410: last_updated_by, last_update_date, last_update_login, batch_type)
411: values (p_curr_batch_id, p_company_code, p_cutoff_date, p_cutoff_date,
412: null, 'N', fnd_global.user_id, sysdate,
1105: -----------------------------------
1106: cursor UPGRADE_REVAL is
1107: select b.upgrade_batch
1108: from XTR_REVALUATION_DETAILS a,
1109: XTR_BATCHES b
1110: where a.company_code = in_company
1111: and a.batch_id = b.batch_id
1112: and nvl(b.upgrade_batch,'N') = 'Y';
1113: --
2967: If (nvl(l_ret_value,0) < 2) then
2968:
2969: -- Bug 3805480 begin
2970: -- Added condition to check for RA batch w/o jrnl entries.
2971: -- In such an event, do not create records in xtr_batches and
2972: -- xtr_batch_events table for it.
2973:
2974: If (nvl(in_source_option,'R') = 'J') then
2975: l_empty := 0;
3034: CLOSE C_NRA_PERIOD_FROM;
3035:
3036: If l_nra_period_from is not null then
3037:
3038: Update xtr_batches
3039: set period_start = l_nra_period_from
3040: where batch_id = in_batch_id;
3041:
3042: End if;
3317: and (party_code = nvl(p_company_code, party_code));
3318:
3319: Cursor BATCHES_BY_BID_RANGE (l_company_code IN VARCHAR2) is
3320: Select batch_id
3321: from xtr_batches
3322: where batch_id between nvl(p_batch_id_from, batch_id) and nvl(p_batch_id_to, batch_id)
3323: and batch_id in (Select BA.batch_id
3324: from xtr_batches BA,
3325: xtr_batch_events BE
3320: Select batch_id
3321: from xtr_batches
3322: where batch_id between nvl(p_batch_id_from, batch_id) and nvl(p_batch_id_to, batch_id)
3323: and batch_id in (Select BA.batch_id
3324: from xtr_batches BA,
3325: xtr_batch_events BE
3326: where BA.batch_id = BE.batch_id
3327: and BE.event_code = 'JRNLGN'
3328: and BA.company_code = l_company_code
3334: order by period_end, batch_id asc;
3335:
3336: Cursor BATCHES_BY_DATE (l_company_code IN VARCHAR2, l_cutoff_date IN DATE) is
3337: Select batch_id
3338: from xtr_batches
3339: where period_end <= nvl(l_cutoff_date, sysdate)
3340: and batch_id in (Select BA.batch_id
3341: from xtr_batches BA,
3342: xtr_batch_events BE
3337: Select batch_id
3338: from xtr_batches
3339: where period_end <= nvl(l_cutoff_date, sysdate)
3340: and batch_id in (Select BA.batch_id
3341: from xtr_batches BA,
3342: xtr_batch_events BE
3343: where BA.batch_id = BE.batch_id
3344: and BE.event_code = 'JRNLGN'
3345: and BA.company_code = l_company_code