会计科目相关函数

1.根据科目取得或创建CCID.

   fnd_flex_ext.get_segs('SQLGL',
                               'GL#',
                               gcc.chart_of_accounts_id,
                               gcc.code_combination_id);

    fnd_flex_ext.get_ccid(application_short_name => 'SQLGL',
                                      key_flex_code          => 'GL#',
                                      structure_number       => L_CHART_OF_ACCOUNTS_ID,--50470,
                                      validation_date        => to_char(sysdate, 'YYYY/MM/DD HH24:MI:SS'),
                                      concatenated_segments  =>:CUX_17_CST_MAPP_RULE_ALL.ACCOUNTING);

2.取得科目描述

    

SELECT xla_oa_functions_pkg.get_ccid_description(gcc.chart_of_accounts_id
                                                ,gcc.code_combination_id) account_desc
      ,gcc.*
  FROM gl_code_combinations gcc;
 

3.FORM中增加会计科目弹性域:when-new-form-instance

     L_LEDGER_ID:=fnd_profile.value('GL_SET_OF_BKS_ID');
   select CHART_OF_ACCOUNTS_ID INTO L_CHART_OF_ACCOUNTS_ID from  gl_ledgers G WHERE G.LEDGER_ID=L_LEDGER_ID;
   
   FND_KEY_FLEX.Define
   (
       BLOCK => 'CUX_17_CST_MAPP_RULE_ALL',
       FIELD => 'ACCOUNTING',
       ID    => 'CODE_COMBINATION_ID',
       description=>'ACCOUNT_DES',
       APPL_SHORT_NAME => 'SQLGL',
       CODE => 'GL#',
       NUM  => L_CHART_OF_ACCOUNTS_ID,--CHART_OF_ACCOUNTS_ID',
       REQUIRED => 'Y',
       VALIDATE => 'FULL',
       USEDBFLDS => 'N',
       DINSERT => 'Y',
       allownulls => 'N',
       query_security => 'Y',
       updateable => 'ALL',
       insertable => 'ALL',
        vrule     =>'\\nSUMMARY_FLAG\\nI\\n' ||
                              'APPL=SQLGL;NAME=GL_JE_SUMMARY_ACCOUNT\\nN\\0' ||
                              'GL_GLOBAL\\nDETAIL_POSTING_ALLOWED' ||
                              '\\nI\\n' ||
                             'APPL=SQLGL;NAME=GL_JE_POSTING_NOT_ALLOWED\\nY',
       where_clause => 'summary_flag <>''Y'''
   );

你可能感兴趣的:(会计科目相关函数)