合弁企業売掛/未収金請求書を印刷するためのBusiness Intelligence Publisherの構成

Oracle Receivablesから合弁企業請求書を印刷するために、既存のOracle Business Intelligence Publisher (BI Publisher)データ・モデルとテンプレートを売掛/未収金請求書の印刷用に構成できます。このようにすると、請求書を印刷するときに、各請求書に関連付けられた合弁企業トランザクションおよびパートナ情報の概要がわかるようなフォーマットにすることができます。

これを行うには、アプリケーション実装コンサルタントが次の1回かぎりのタスクを実行する必要があります:

  1. 合弁企業データ・ソースが含まれるように売掛管理のデータ・モデルを更新します。

  2. サンプルXMLファイルを合弁企業のデータ・ソースとして使用して、RTFテンプレートを作成します。

合弁企業データ・ソースを含めるための売掛管理のデータ・モデルの更新

データ・モデルには、BI Publisherがレポートのデータを取得して構成するための指示のセットが含まれています。1つのデータ・モデルは複数のデータ・セットで構成されており、これらは単一または複数のデータ・ソースから取得されます(たとえば、売掛管理表の列から返されるデータ)。売掛/未収金請求書の印刷用のデータ・セットを使用して合弁企業請求書を印刷するには、合弁企業のデータ・ソースが含まれるようにそのデータ・セットを更新します。

売掛管理のトランザクション印刷データ・モデルに対するSQL問合せで、合弁企業データを「合弁企業配分」や「合弁企業トランザクション」などの表の列から取得するように問合せを更新します。少なくとも、SQL問合せに次の合弁企業データ・フィールドを追加することをお薦めします:

  • 合弁企業名

  • トランザクション日

  • 請求パートナ名

  • 所有割合

  • 総額

  • プライマリ元帳通貨

  • 配分金額

  • プロジェクト

  • タスク名

  • 支出項目名

  1. BI Publisher Enterpriseのカタログにアクセスします。

  2. 「カタログ」の「フォルダ」ペインで、「財務」、「売掛管理」にナビゲートし、「請求提示」をクリックします。

  3. 「データ・モデル」フォルダの下にある「展開」ボタンをクリックし、「トランザクション印刷データ・モデル」を検索します。「編集」をクリックして、このデータ・モデルを更新します。

  4. TransactionsPrintDmページで、「ダイアグラム」タブが選択されていることを確認し、下にスクロールしてデータ列にアクセスします。

    G_Line列には、請求書明細のデータ・フィールドが含まれます。合弁企業請求書は明細レベルで作成されるため、この列を取得するようにSQL問合せを更新する必要があります。

  5. G_Line列を選択した状態で、「選択したデータ・セットの編集」(鉛筆アイコン)をクリックします。

  6. データ・セット明細の編集で、合弁企業の問合せを既存のSQL問合せに追加します。

    次のSQL問合せを例として使用して、合弁企業のデータ・ソースを追加します。

    ,
    c.interface_line_attribute1 jv_jv_name,
    (select to_char(transaction_date, 'YYYY-MM-DD' )from jv_distributions where c.interface_line_attribute5
    = to_char(distribution_id ) ) jv_transaction_date,
    (select INVOICING_PARTNER_SHORT_NAME from jv_invoicing_partners_b inv, jv_stakeholders_b stk,
    jv_distributions dis where
    c.interface_line_attribute5 = to_char(dis.distribution_id ) and stk.INVOICING_PARTNER_ID =
    inv.INVOICING_PARTNER_ID and dis.STAKEHOLDER_ID = stk.STAKEHOLDER_ID) jv_ip_name,
    (select PERCENTAGE_OF_INTEREST from jv_distributions where c.interface_line_attribute5 =
    to_char(distribution_id )) jv_ownership_percentage,
    ((select case when gl.accounted_DR is not null then gl.accounted_DR else gl.accounted_CR
    end from jv_distributions dis ,jv_transactions tran, gl_je_lines gl
    where c.interface_line_attribute5 = to_char(distribution_id) and tran.application_id <=-99 and
    gl.JE_HEADER_ID = tran.header_id
    and gl.je_line_num = tran.line_num
    and dis.TRANSACTION_ID = tran.TRANSACTION_ID)
    union
    (select case when ae.accounted_DR is not null then ae.accounted_DR else ae.accounted_CR
    end from jv_distributions dis ,jv_transactions tran, xla_ae_lines ae
    where c.interface_line_attribute5 = to_char(distribution_id) and tran.application_id >0 and
    ae.AE_HEADER_ID = tran.header_id
    and ae.ae_line_num = tran.line_num
    AND dis.TRANSACTION_ID = tran.TRANSACTION_ID )
    union
    (select case when oh.DEBIT_AMOUNT is not null then oh.DEBIT_AMOUNT else oh.CREDIT_AMOUNT
    end from jv_distributions dis ,jv_transactions tran, jv_generated_transactions oh
    where c.interface_line_attribute5 = to_char(distribution_id) and 
    tran.application_id = -10568 and
    oh.HEADER_ID = tran.header_id
    and oh.LINE_NUM = tran.line_num
    and dis.TRANSACTION_ID = tran.TRANSACTION_ID)) jv_gross_amount,
    (select currency_code from jv_distributions where c.interface_line_attribute5 = to_char(distribution_id ) ) as jv_primary_ledger_currency,
    (select nvl(distributed_debit_amount,distributed_credit_amount) from jv_distributions where c.interface_line_attribute5 = to_char(distribution_id ) ) as jv_distributed_amount,
    (select name from pjf_projects_all_vl proj, jv_distributions dist, jv_transactions tran where
    c.interface_line_attribute5 = to_char(dist.distribution_id ) and tran.transaction_id =
    dist.transaction_id and tran.project_id = proj.project_id ) jv_project,
    (select name from PJF_PROJ_ELEMENTS_VL proj, jv_distributions dist, jv_transactions tran
    where c.interface_line_attribute5 = to_char(dist.distribution_id )
    and tran.transaction_id = dist.transaction_id and tran.TASK_ID = proj.PROJ_ELEMENT_ID ) jv_task_name,
    (select EXPENDITURE_TYPE_NAME from PJF_EXP_TYPES_VL expen, jv_distributions dist, jv_transactions tran
    where c.interface_line_attribute5 = to_char(dist.distribution_id )
    and tran.transaction_id = dist.transaction_id and tran.EXPENDITURE_TYPE_ID = expen.EXPENDITURE_TYPE_ID )
    jv_exp_item_name
          

    次の例は、前述の例で示した問合せを追加した後の完成したSQL問合せを示しています。合弁企業の問合せは、識別しやすいように太字で表記されています。

    select
    base.*,
    to_char(rownum) as sequence_number
    from
    (SELECT   c.customer_trx_id customer_trx_id_line,
              c.customer_trx_line_id customer_trx_line_id,
          to_char(decode( c2.line_number, null, c.line_number, null)) line_number,
          c.line_type line_type,
              AR_BPA_UTILS_PKG.fn_get_line_description(c.customer_trx_line_id) line_description,
           decode(c.line_type, 'TAX', null, nvl(c.quantity_invoiced, c.quantity_credited)) quantity,
           uom.unit_of_measure unit_of_measure_name,
           eitem.item_number item_number,
              --null unit_of_measure_name,
              c.unit_selling_price unit_price,
              to_char(c.extended_amount,fnd_currency.get_format_mask(trx.invoice_currency_code,40))
              extended_amount,
          c.sales_order            line_sales_order,
          c.uom_code,
          --    null uom_code,
           trx.trx_number line_trx_number,
              decode(c.line_type, 'TAX', null, AR_INVOICE_SQL_FUNC_PUB.get_taxyn ( c.customer_trx_line_id ))
              tax_exists_for_this_line_flag,
              c.tax_rate    as line_tax_rate,
              --decode(c.line_type, 'TAX', v.tax_code, null) as line_tax_code,
              null line_tax_code,
              null printed_tax_name,
              --decode(c.line_type, 'TAX', v.printed_tax_name, null) as line_printed_tax_name,
     (SELECT party_site.PARTY_SITE_NAME
              FROM hz_party_sites       party_site,
                      hz_cust_site_uses_all   acct_uses  ,
                      hz_cust_acct_sites_all acct_site
              WHERE party_site.party_site_id = acct_site.party_site_id
              and acct_site.cust_acct_site_id = acct_uses.cust_acct_site_id
              and acct_uses.site_use_id = c.ship_to_site_use_id ) ship_to_site_name,   --Bug: 18705899	
              c.interface_line_attribute1,
              c.interface_line_attribute2,
              c.interface_line_attribute3,
              c.interface_line_attribute4,
              c.interface_line_attribute5,
              c.interface_line_attribute6,
              c.interface_line_attribute7,
              c.interface_line_attribute8,
              c.interface_line_attribute9,
              c.interface_line_attribute10,
              c.interface_line_attribute11,
              c.interface_line_attribute12,
              c.interface_line_attribute13,
              c.interface_line_attribute14,
              c.interface_line_attribute15,
              to_char(c.unit_selling_price) unformatted_unit_price,
              to_char(nvl(c.extended_amount,0)) unformatted_extended_amount,
              c.ATTRIBUTE1,
              c.ATTRIBUTE2,
              c.ATTRIBUTE3,
              c.ATTRIBUTE4,
              c.ATTRIBUTE5,
              c.ATTRIBUTE6,
              c.ATTRIBUTE7,
              c.ATTRIBUTE8,
              c.ATTRIBUTE9,
              c.ATTRIBUTE10,
              c.ATTRIBUTE11,
              c.ATTRIBUTE12,
              c.ATTRIBUTE13,
              c.ATTRIBUTE14,
              c.ATTRIBUTE15,
              c.SET_OF_BOOKS_ID,
              c.REASON_CODE,
              c.QUANTITY_ORDERED,
              c.QUANTITY_CREDITED,
              c.UNIT_STANDARD_PRICE,
              c.SALES_ORDER_LINE,
              to_char(c.SALES_ORDER_DATE,'YYYY-MM-DD') SALES_ORDER_DATE,
              c.ACCOUNTING_RULE_DURATION,
              c.ATTRIBUTE_CATEGORY,
              to_char(c.RULE_START_DATE, 'YYYY-MM-DD') RULE_START_DATE,
              to_char(c.billing_period_start_date,'YYYY-MM-DD')  billing_period_start_date,
              to_char(c.billing_period_end_date,'YYYY-MM-DD')  billing_period_end_date,
              c.INTERFACE_LINE_CONTEXT,
              c.SALES_ORDER_SOURCE,
              c.REVENUE_AMOUNT,
              c.DEFAULT_USSGL_TRANSACTION_CODE,
              c.DEFAULT_USSGL_TRX_CODE_CONTEXT,
              c.LAST_PERIOD_TO_CREDIT,
              c.ITEM_CONTEXT,
              c.TAX_EXEMPT_FLAG,
              c.TAX_EXEMPT_NUMBER,
              c.TAX_EXEMPT_REASON_CODE,
              c.TAX_VENDOR_RETURN_CODE,
              c.GLOBAL_ATTRIBUTE_CATEGORY,
              c.GROSS_UNIT_SELLING_PRICE,
              c.GROSS_EXTENDED_AMOUNT,
              c.EXTENDED_ACCTD_AMOUNT,
              c.MRC_EXTENDED_ACCTD_AMOUNT,
              c.ORG_ID line_org_id,
              c.GLOBAL_ATTRIBUTE1,
              c.GLOBAL_ATTRIBUTE2,
              c.GLOBAL_ATTRIBUTE3,
              c.GLOBAL_ATTRIBUTE4,
              c.GLOBAL_ATTRIBUTE5,
              c.GLOBAL_ATTRIBUTE6,
              c.GLOBAL_ATTRIBUTE7,
              c.GLOBAL_ATTRIBUTE8,
              c.GLOBAL_ATTRIBUTE9,
              c.GLOBAL_ATTRIBUTE10,
              c.GLOBAL_ATTRIBUTE11,
              c.GLOBAL_ATTRIBUTE12,
              c.GLOBAL_ATTRIBUTE13,
              c.GLOBAL_ATTRIBUTE14,
              c.GLOBAL_ATTRIBUTE15,
              c.GLOBAL_ATTRIBUTE16,
              c.GLOBAL_ATTRIBUTE17,
              c.GLOBAL_ATTRIBUTE18,
              c.GLOBAL_ATTRIBUTE19,
              c.GLOBAL_ATTRIBUTE20,
    c.interface_line_attribute1 jv_jv_name,
    (select to_char(transaction_date, 'YYYY-MM-DD' )from jv_distributions where c.interface_line_attribute5
    = to_char(distribution_id ) ) jv_transaction_date,
    (select INVOICING_PARTNER_SHORT_NAME from jv_invoicing_partners_b inv, jv_stakeholders_b stk,
    jv_distributions dis where
    c.interface_line_attribute5 = to_char(dis.distribution_id ) and stk.INVOICING_PARTNER_ID =
    inv.INVOICING_PARTNER_ID and dis.STAKEHOLDER_ID = stk.STAKEHOLDER_ID) jv_ip_name,
    (select PERCENTAGE_OF_INTEREST from jv_distributions where c.interface_line_attribute5 =
    to_char(distribution_id )) jv_ownership_percentage,
    ((select case when gl.accounted_DR is not null then gl.accounted_DR else gl.accounted_CR
    end from jv_distributions dis ,jv_transactions tran, gl_je_lines gl
    where c.interface_line_attribute5 = to_char(distribution_id) and tran.application_id <=-99 and
    gl.JE_HEADER_ID = tran.header_id
    and gl.je_line_num = tran.line_num
    and dis.TRANSACTION_ID = tran.TRANSACTION_ID)
    union
    (select case when ae.accounted_DR is not null then ae.accounted_DR else ae.accounted_CR
    end from jv_distributions dis ,jv_transactions tran, xla_ae_lines ae
    where c.interface_line_attribute5 = to_char(distribution_id) and tran.application_id >0 and
    ae.AE_HEADER_ID = tran.header_id
    and ae.ae_line_num = tran.line_num
    AND dis.TRANSACTION_ID = tran.TRANSACTION_ID )
    union
    (select case when oh.DEBIT_AMOUNT is not null then oh.DEBIT_AMOUNT else oh.CREDIT_AMOUNT
    end from jv_distributions dis ,jv_transactions tran, jv_generated_transactions oh
    where c.interface_line_attribute5 = to_char(distribution_id) and 
    tran.application_id = -10568 and
    oh.HEADER_ID = tran.header_id
    and oh.LINE_NUM = tran.line_num
    and dis.TRANSACTION_ID = tran.TRANSACTION_ID)) jv_gross_amount,
    (select currency_code from jv_distributions where c.interface_line_attribute5 = to_char(distribution_id ) ) as jv_primary_ledger_currency,
    (select nvl(distributed_debit_amount,distributed_credit_amount) from jv_distributions where c.interface_line_attribute5 = to_char(distribution_id ) ) as jv_distributed_amount,
    (select name from pjf_projects_all_vl proj, jv_distributions dist, jv_transactions tran where
    c.interface_line_attribute5 = to_char(dist.distribution_id ) and tran.transaction_id =
    dist.transaction_id and tran.project_id = proj.project_id ) jv_project,
    (select name from PJF_PROJ_ELEMENTS_VL proj, jv_distributions dist, jv_transactions tran
    where c.interface_line_attribute5 = to_char(dist.distribution_id )
    and tran.transaction_id = dist.transaction_id and tran.TASK_ID = proj.PROJ_ELEMENT_ID ) jv_task_name,
    (select EXPENDITURE_TYPE_NAME from PJF_EXP_TYPES_VL expen, jv_distributions dist, jv_transactions tran
    where c.interface_line_attribute5 = to_char(dist.distribution_id )
    and tran.transaction_id = dist.transaction_id and tran.EXPENDITURE_TYPE_ID = expen.EXPENDITURE_TYPE_ID )
    jv_exp_item_name
    from      ra_customer_trx_lines_all   c,
          ra_customer_trx_lines_all  c2,
          inv_units_of_measure_vl    uom,
              ra_customer_trx_all        trx,
          egp_system_items_vl         eitem,
          ar_system_parameters_all   sysp	
          --ar_vat_tax_all_vl          v
    where     c.customer_trx_id = :customer_trx_id
    AND        trx.customer_trx_id = c.customer_trx_id
    AND      trx.org_id = c.org_id
    AND        trx.complete_flag = 'Y'
    and       c.link_to_cust_trx_line_id     = c2.customer_trx_line_id(+)
    and       c.org_id                = c2.org_id(+)
    and       c.uom_code                            = uom.uom_code(+)
    and       c.inventory_item_id = eitem.inventory_item_id (+)
    and       c.org_id = sysp.org_id
    and       ( (c.inventory_item_id is not null
                 and sysp.item_validation_org_id = eitem.organization_id)
              or c.inventory_item_id is null)
    --and      c.vat_tax_id =  v.vat_tax_id(+)
    --and       c.org_id     = v.org_id(+)
    --and         c.line_type in ('LINE', 'TAX', 'CB')
    --&WHERE_LINE_TYPE
    order by
                     decode( c2.line_number,
                                    null, decode( c.line_type,
                                                            'LINE', c.line_number*10000+0,
                                                            'TAX',  c.line_number*10000+8000,
                                                                        100000000000),
                                  decode( c2.line_type,
                                                  'LINE', c2.line_number*10000+0,
                                                  'TAX',  c2.line_number*10000+8000,
                                                             c2.line_number*10000+9000) +
                                      decode( c.line_type,
                                                     'LINE',          0, 'CB',          0,
                                                      'TAX',          8000,
                                                     'FREIGHT',  9000)  +
                                      c.line_number )) base
  7. 「OK」をクリックして問合せを保存します。

    ノート: 右カッコの欠落に関するエラーが発生した場合は、次に示す行がSQL問合せの中でコメント化されていることを確認してください: --&WHERE_LINE_TYPE
  8. SQL行に字句参照の値を入力するためのウィンドウが表示された場合は、LINESと入力して「OK」をクリックします。

  9. 「保存」アイコンをクリックします。

サンプルXMLファイルを合弁企業のデータ・ソースとして使用するRTFテンプレートの作成

データ・モデルを構築した後に、そのデータ・モデルから生成した代表的なサンプル・データのセットを添付する必要があります。BI Publisher Template Builderでテンプレートを作成するには、サンプル・データが必要です。

  1. サンプルXMLファイルを取得するには、「売掛/未収金トランザクションの印刷」ESSプロセスを合弁企業請求書に対して実行します。「出力」セクションに移動し、XMLファイルをダウンロードします。データ・モデルが変更されたため、このXMLファイルには合弁企業情報があります。

  2. サンプルXMLファイルをローカル・ディレクトリからデータ・モデルにアップロードします。実行方法は次のとおりです:

    1. 既存のデフォルト請求書テンプレートのコピーをBI Publisherからローカル・ディレクトリにダウンロードします。

      ダウンロードするには、「カタログ」タブの「共有フォルダ」、「財務」、「売掛/未収金」および「請求提示」にナビゲートします。「請求書印刷テンプレート」の下の「編集」をクリックし、「デフォルト請求書テンプレート」の下にある「編集」ボタンをクリックしてダウンロードします。

    2. ダウンロードしたテンプレートを開き、サンプルXMLファイルをアップロードします。

      合弁企業のデータ・フィールドがRTFテンプレートに追加されます。

  3. 必要に応じてテンプレートを編集します。請求書に印刷するデータ・フィールドを追加し、適切な名前でテンプレートをBI Publisherにアップロードします。

    新しいテンプレートがBI Publisherで使用できるようになると、「売掛/未収金トランザクションの印刷」ESSプロセスのオプションとして使用可能になります。

関連情報

レポートとレイアウトの作成