-- Journal Import, Short Name: GLLEZL
--========================================================
-- 取得GL_JOURNAL_IMPORT_S Sequence最新序號
v_journal_import_id := GL_INTERFACE_CONTROL_PKG.GET_UNIQUE_RUN_ID;
GL_INTERFACE_CONTROL_PKG.INSERT_ROW(1, v_journal_import_id, ls_JE_SOURCE_NAME, FND_GLOBAL.CONC_REQUEST_ID, NULL);
-- submit Request
ln_req_id := fnd_request.submit_request
('SQLGL'
,'GLLEZL'
,'YLGLR113:--' -- Request 顯示別名, 得知是那個Request丢出來的
,'',FALSE,
,TO_CHAR(v_journal_import_id), --GL_JOURNAL_IMPORT_S Sequence最新序號
,1 -- Set of Books ID
,'N' -- Post errors to suspense
,NULL -- Start Date
,NULL -- End Date
,'N' -- Create Summary Journal
,'W' -- Import Descriptive Flexfields-- N:No W:With Validation
);
--========================================================
-- Reverse Journals, Short Name: GLPREV
--========================================================
Dig dig dig
Dig dig dig
1: [ FORM ] GLXJEENT
2: [ Program Unit] HEADER_REVERSE_PRIVATE_REVPD.accrual_rev_period_name
3: [ Program ] gl_autoreverse_date_pkg.get_reversal_period_date(X_Sob_Id => gl_sob.sob_id,
X_Je_Category => :HEADER.je_category,
X_Je_Source => 'Manual',
X_Je_Period_Name => :HEADER.period_name,
X_Je_Date => :HEADER.default_effective_date,
X_Reversal_Method => new_rev_method,
X_Reversal_Period
=> :HEADER.accrual_rev_period_name,
X_Reversal_Date => new_rev_date);
4: accrual_rev_change_sign_flag
設定 GL \ Setup \ Journal \ AutoReverse \ Method \
Y= Swith Dr/Cr 借貸相反的回轉分錄
N=Change Sign 借貸一致, 但以負數呈現
UPDATE gl_je_headers
SET accrual_rev_flag = 'Y'
,accrual_rev_period_name = P03_GL_PERIOD
,accrual_rev_change_sign_flag = 'Y'
,accrual_rev_effective_date = SYSDATE
WHERE JE_HEADER_ID = I.JE_HEADER_ID;
-- SUBMIT Reverse Journals
ln_req_id := fnd_request.submit_request
('SQLGL'
,'GLPREV'
,'YLGLR113:回轉'
,'',FALSE
, TO_CHAR(V_JE_HEADER_ID) -- GL_JOURNAL_IMPORT_S Sequence最新序號
);
沒有留言:
張貼留言