Thursday, 19 May 2022

Query to Get Purchase Category hierarchy In oracle Fusion

 SELECT (SELECT category_name

                 FROM   por_browse_categories_tl pbct

                 WHERE  pbct.category_id = picpl.level1_cat_id) Level_1_Name,

                (SELECT category_name

                 FROM   por_browse_categories_tl pbct

                 WHERE  pbct.category_id = picpl.level2_cat_id) Level_2_Name,

                (SELECT category_name

                 FROM   por_browse_categories_tl pbct

                 WHERE  pbct.category_id = picpl.level3_cat_id) Level_3_Name

FROM   por_item_cat_parent_levels picpl

WHERE  picpl.type = 'SOURCING'

ORDER  BY level_1_name,

          level_2_name,

          level_3_name

Wednesday, 4 May 2022

Sample payload To Create a Payables Invoice using Rest API in Oracle Fusion

Rest API : https://Host/fscmRestApi/resources/latest/invoices 

Method: Post

Sample payload 

{
    "InvoiceNumber""Test_Rest_007",
    "InvoiceCurrency""USD",
    "InvoiceAmount"2112.75,
    "InvoiceDate""2022-05-02",
    "BusinessUnit""Business Unit",
      "InvoiceSource""Manual invoice entry",
        "InvoiceType""Standard",
  "PayGroup":"Refund",
    "Supplier""Test Supplier ",
    "SupplierSite""MAIN",
       "LiabilityDistribution""100.00000.20501.00000.000",
    "invoiceLines": [
        {
            "LineNumber"1,
            "LineAmount"2112.75,
            "Description"null,
            "invoiceDistributions": [
                {
                    "DistributionLineNumber"1,
                    "DistributionLineType""Item",
                    "DistributionAmount"2112.75,
                    "DistributionCombination""100.00000.60005.00000.000"
                }
            ]
        }
    ]
}

Query to get Account Segment Description

 SELECT gl_flexfields_pkg.get_description_sql

                                     (chart_of_accounts_id,--- chart of account id

                                      1,----- Position of segment

                                      segment1 ---- Segment value

                                     )

FROM gl_code_combinations

Query to get concatenated Code combination of a code combination id

 SELECT gl_flexfields_pkg.get_concat_description

                                          (chart_of_accounts_id,

                                           code_combination_id)

            FROM gl_code_combinations