Monday, February 17, 2025

Customer Tax Registration - EBS Query

             SELECT DISTINCT 
hp.party_type,
hp.party_name,
hca.account_name,
hp.party_number,
hps.party_site_number,
hca.account_number,
hcsu.location,
hcsu.site_use_code,
zr.registration_id,
            zr.registration_number,
            zr.registration_status_code,
            zr.tax_regime_code,
            zr.tax,
            zr.attribute1           country_cod,
            zr.party_tax_profile_id,
hca.cust_account_id,
hp.party_id,
hps.party_site_id,
hcsu.site_use_id,
hps.location_id,
hcsa.cust_acct_site_id,
hl.address1,
hl.city,
hl.state,
hl.country,
hl.postal_code,
hcsa.bill_to_flag,
hcsu.org_id,
hcsu.status site_use_status,
hcsa.status acct_site_status,
hps.status party_site_status,
hca.creation_date    account_creation,
hcsa.creation_date    acct_site_creation,
hcsu.creation_date    site_use_creation
FROM hz_parties             hp,
hz_party_sites         hps,
hz_locations           hl,
hz_cust_accounts_all   hca,
hz_cust_acct_sites_all hcsa,
hz_cust_site_uses_all  hcsu,
zx.zx_party_tax_profile tax_prof,
zx_registrations     zr
WHERE hp.party_id = hps.party_id
AND hps.location_id = hl.location_id
AND hp.party_id = hca.party_id
AND hcsa.party_site_id = hps.party_site_id
AND tax_prof.party_id = hps.party_site_id
AND hcsu.cust_acct_site_id = hcsa.cust_acct_site_id
AND hca.cust_account_id = hcsa.cust_account_id
AND tax_prof.party_type_code = 'THIRD_PARTY_SITE'
AND zr.party_tax_profile_id = tax_prof.party_tax_profile_id
AND hp.status = 'A'
AND hca.status = 'A'
--AND hcsa.status = 'A'
--AND hcsu.status = 'A'
          AND location IN('47840945','47840946','142842','142843')--'52042893','50354303','50343674','51957873')
--and hp.party_id=9860;
--and party_number='391490'; 
-- AND hca.account_number='435080'--'24830389';  
ORDER BY 3, 8 DESC;


SELECT zr.creation_date,
      -- zr.created_by,
       hp.party_number,
       hp.party_name,
       hca.account_number,
       hca.account_name,
       hps.party_site_number,
    --   zr.registration_id,
       zr.registration_number,
       zr.registration_status_code,
       zr.tax_regime_code,
       zr.tax,
       (select distinct location FROM 
            hz_cust_acct_sites_all hcsa,
hz_cust_site_uses_all  hcsu
WHERE hcsu.cust_acct_site_id = hcsa.cust_acct_site_id
AND hcsa.party_site_id = hps.party_site_id
AND hcsu.site_use_code='SHIP_TO') ship_to_location ,
       (select distinct location FROM 
            hz_cust_acct_sites_all hcsa,
hz_cust_site_uses_all  hcsu
WHERE hcsu.cust_acct_site_id = hcsa.cust_acct_site_id
AND hcsa.party_site_id = hps.party_site_id
AND hcsu.site_use_code='BILL_TO') bill_to_location,
   zr.attribute1     country_cod,
       zr.party_tax_profile_id,
       zptp.party_id          
  FROM zx_party_tax_profile  zptp,
       zx_registrations      zr,
       hz_party_sites        hps,
       hz_parties            hp,
       hz_cust_accounts      hca
 WHERE     zr.party_tax_profile_id = zptp.party_tax_profile_id
       AND hp.party_id = hps.party_id
       AND hp.party_id = hca.party_id
       AND hps.party_site_id = zptp.party_id
       AND zptp.party_type_code = 'THIRD_PARTY_SITE'
       AND hca.account_number = '50354303';

   

Tuesday, January 28, 2025

Item - Category Query

      SELECT 
    msi.segment1 AS Item_Code,  
    msi.DESCRIPTION AS Item_Desc,  
    mcs.CATEGORY_SET_NAME,  
    mck.CONCATENATED_SEGMENTS,  
    mck.SEGMENT1, mck.SEGMENT2, mck.SEGMENT3, mck.SEGMENT4, mck.SEGMENT5,  
    mck.SEGMENT6, mck.SEGMENT7, mck.SEGMENT8, mck.SEGMENT9, mck.SEGMENT10,  
    mck.SEGMENT11, mck.SEGMENT12, mck.SEGMENT13, mck.SEGMENT14, mck.SEGMENT15,  
    mck.SEGMENT16, mck.SEGMENT17, mck.SEGMENT18, mck.SEGMENT19, mck.SEGMENT20  
FROM 
    mtl_system_items_b msi,  
    mtl_item_categories mic,  
    MTL_CATEGORIES_KFV mck,  
    MTL_CATEGORY_SETS_TL mcs  
WHERE 
    msi.INVENTORY_ITEM_ID = mic.INVENTORY_ITEM_ID  
    AND msi.ORGANIZATION_ID = mic.ORGANIZATION_ID  
    AND mic.CATEGORY_ID = mck.CATEGORY_ID  
    AND mcs.CATEGORY_SET_ID = mic.CATEGORY_SET_ID  
    AND mcs.LANGUAGE = 'US' 
    AND msi.ORGANIZATION_ID = :P_Org_id
    AND mcs.CATEGORY_SET_NAME='Tax Classification'
    AND msi.segment1='23542345234'

Wednesday, January 22, 2025

Oracle Order Management - Tax Calculation Stages in Sales Orders

 


Tax calculation in Oracle Order Management can be controlled at the order header level during any of the following events:


  1. Order Entry
  2. Order Booking
  3. Invoicing

This is configured when Order Types are created in the Order Management Transaction Types window. The specific event to calculate tax for an entire order is specified during setup.

Navigation Steps to Configure:

  1. Navigate to:
    India Local Order ManagementOracle Order ManagementSetupTransaction TypesDefineFinance Tab

  2. In the Finance Tab, specify the event at which tax should be calculated for the entire order.




Order Entry: Tax Calculation at Entry
  • When tax calculation is set to Order Entry, tax is calculated as each order line is entered.
  • This is commonly used in scenarios where businesses require the user performing order entry to view the total order amount (including tax) to provide a quote to the customer.
  • To include tax in the commitment applied amount, ensure that the tax event is set to Entry.



Order Booking: Tax Calculation at Booking

  • When tax calculation is set to Order Booking, tax is calculated on each of the booked order lines.
  • This option is suitable for businesses that require tax visibility for booked orders, but wish to improve order entry efficiency by avoiding tax calculation at entry.



Invoicing: Tax Calculation at Invoicing

  • When tax calculation is set to Invoicing, no tax calculations occur within Order Management.
  • Instead, tax calculation is performed in Oracle Receivables at the time the order or order line is invoiced.



Wednesday, September 11, 2024

Price List Query for Item

 SELECT qph.list_header_id,

       qph.name,
       qph.description,
       qphh.start_date_active,
       qphh.currency_code,
       qphh.source_system_code,
       qphh.active_flag,
       qphh.orig_system_header_ref,
       qphh.orig_org_id,
       qphh.global_flag,
       qpl.list_line_id,
       qpl.start_date_active,
       qpl.end_date_active,
       qpl.arithmetic_operator,
       qpl.operand,
       qpl.orig_sys_line_ref,
       qpp.pricing_attribute_id,
       qpp.product_attribute_context,
       qpp.product_attribute,
       qpp.product_attr_value,
       qpp.product_uom_code,
       qpp.comparison_operator_code,
       qpp.orig_sys_pricing_attr_ref,
       mtl.inventory_item_id,
       mtl.segment1,
       mtlc.cross_reference_type,
       mtlc.cross_reference
  FROM apps.qp_list_headers_b       qphh,
       apps.qp_list_headers_tl      qph,
       apps.qp_list_lines           qpl,
       apps.qp_pricing_attributes   qpp,
       apps.mtl_system_items_b      mtl,
       apps.mtl_cross_references_b  mtlc
WHERE     qph.list_header_id = qphh.list_header_id
       AND qph.list_header_id = qpl.list_header_id
       AND qph.list_header_id = qpp.list_header_id
       AND qpl.list_line_id = qpp.list_line_id
       AND to_char(mtl.inventory_item_id) = (qpp.product_attr_value)
      -- AND   mtl.organization_id   = 344 
--       (SELECT UNIQUE master_organization_id FROM   mtl_parameters)
       AND mtl.inventory_item_id = mtlc.inventory_item_id
       AND SYSDATE BETWEEN qpl.start_date_active
                       AND NVL (qpl.end_date_active, SYSDATE)
       AND SYSDATE BETWEEN qphh.start_date_active
                       AND NVL (qphh.end_date_active, SYSDATE)
                       and  qph.name like '%SG%'
                       AND qpl.END_DATE_ACTIVE IS NULL
       AND mtl.segment1 = '9780749172008';

       select * from mtl_system_items_b where segment1='A101708534498'

Thursday, July 11, 2024

OTL - Query with PROJECTS, TASKS

   SELECT DISTINCT PP.SEGMENT1              "Project Number",
                  PP.NAME                  PROJECT_NAME,
                  PT.TASK_NUMBER,
                  PT.TASK_NAME,
                  HTA.ATTRIBUTE3,
                  submission_date,
                  DAY.START_TIME,
                  DET.MEASURE,
                  hts.APPROVAL_STATUS,
                  DET.COMMENT_TEXT,
                  papf.employee_number     employee_number,
                  papf.first_name,
                  papf.last_name,
                  papf.middle_names,
                  papf.full_name,
                  sup.first_name           sup_first_name,
                  sup.last_name            sup_last_name,
                  sup.middle_names         sup_middle_name,
                  sup.full_name            sup_full_name
    FROM (SELECT TIME_BUILDING_BLOCK_ID,
                 PARENT_BUILDING_BLOCK_ID,
                 PARENT_BUILDING_BLOCK_OVN,
                 OBJECT_VERSION_NUMBER,
                 MEASURE,
                 RESOURCE_ID,
                 APPROVAL_STATUS,
                 COMMENT_TEXT,
                 TRANSLATION_DISPLAY_KEY
            FROM HXC_TIME_BUILDING_BLOCKS
           WHERE SCOPE = 'DETAIL') DET,
         (SELECT TIME_BUILDING_BLOCK_ID,
                 PARENT_BUILDING_BLOCK_ID,
                 PARENT_BUILDING_BLOCK_OVN,
                 OBJECT_VERSION_NUMBER,
                 START_TIME,
                 APPROVAL_STATUS,
                 RESOURCE_ID
            FROM HXC_TIME_BUILDING_BLOCKS
           WHERE SCOPE = 'DAY') DAY,
         (SELECT TIME_BUILDING_BLOCK_ID,
                 START_TIME,
                 APPROVAL_STATUS,
                 OBJECT_VERSION_NUMBER,
                 COMMENT_TEXT,
                 RESOURCE_ID
            FROM HXC_TIME_BUILDING_BLOCKS
           WHERE SCOPE = 'TIMECARD') TC,
         HXC_TIME_ATTRIBUTE_USAGES HTAU,
         HXC_TIME_ATTRIBUTES      HTA,
         PA_PROJECTS_ALL          PP,
         PA_TASKS                 PT,
         hxc_timecard_summary     hts,
         per_all_people_f         papf,
         per_all_assignments_f    paaf,
         per_all_people_f         sup
   WHERE     DAY.PARENT_BUILDING_BLOCK_ID = TC.TIME_BUILDING_BLOCK_ID
         AND DAY.PARENT_BUILDING_BLOCK_OVN = TC.OBJECT_VERSION_NUMBER
         AND DET.PARENT_BUILDING_BLOCK_ID = DAY.TIME_BUILDING_BLOCK_ID
         AND DET.PARENT_BUILDING_BLOCK_OVN = DAY.OBJECT_VERSION_NUMBER
         AND TRUNC (DAY.START_TIME) BETWEEN '1-MAY-2024' AND '31-MAY-2024'
         AND DAY.RESOURCE_ID = (SELECT EMPLOYEE_ID from FND_USER WHERE USER_NAME='XXX')
         AND TC.OBJECT_VERSION_NUMBER =
             (SELECT MAX (OBJECT_VERSION_NUMBER)
                FROM HXC_TIME_BUILDING_BLOCKS
               WHERE     SCOPE = 'TIMECARD'
                     AND TIME_BUILDING_BLOCK_ID = TC.TIME_BUILDING_BLOCK_ID)
         AND DET.OBJECT_VERSION_NUMBER =
             (SELECT MAX (OBJECT_VERSION_NUMBER)
                FROM HXC_TIME_BUILDING_BLOCKS
               WHERE     SCOPE = 'DETAIL'
                     AND TIME_BUILDING_BLOCK_ID = DET.TIME_BUILDING_BLOCK_ID)
         AND DET.TIME_BUILDING_BLOCK_ID = HTAU.TIME_BUILDING_BLOCK_ID
         AND DET.OBJECT_VERSION_NUMBER = HTAU.TIME_BUILDING_BLOCK_OVN
         AND HTAU.TIME_ATTRIBUTE_ID = HTA.TIME_ATTRIBUTE_ID
         AND HTA.ATTRIBUTE1 = TO_CHAR (PP.PROJECT_ID)
         AND HTA.ATTRIBUTE2 = TO_CHAR (PT.TASK_ID)
         AND HTA.ATTRIBUTE5 = 'ST'
         AND HTS.timecard_id = TC.TIME_BUILDING_BLOCK_ID
         -- papf, paaf, sup
         AND TC.resource_id = papf.person_id
         AND SYSDATE BETWEEN papf.effective_start_date
                         AND papf.effective_end_date
         AND papf.person_id = paaf.person_id
         AND SYSDATE BETWEEN paaf.effective_start_date
                         AND paaf.effective_end_date
         AND paaf.supervisor_id = sup.person_id
         AND SYSDATE BETWEEN sup.effective_start_date
                         AND sup.effective_end_date
-- tms
ORDER BY 7;

Thursday, May 23, 2024

EBS - Form currently using user details for submission

 WITH vs AS (
     SELECT
         ROWNUM rnum,
         inst_id,
         sid,
         serial#,
         status,
         username,
         last_call_et,
         command,
         machine,
         osuser,
         module,
         action,
         resource_consumer_group,
         client_info,
         client_identifier,
         type,
         terminal,
         sql_id,
         sql_child_number
     FROM
         gv$session
)
SELECT
     vs.inst_id,
     vs.sid,
     serial#       serial,
     vs.sql_id,
     vs.sql_child_number,
     vs.username   "Username",
     CASE
         WHEN vs.status = 'ACTIVE' THEN last_call_et
         ELSE NULL
     END "Seconds in Wait",
     (
         SELECT
             command_name
         FROM
             v$sqlcommand
         WHERE
             command_type = vs.command
     ) "Command",
     vs.machine    "Machine",
     vs.osuser     "OS User",
     lower(vs.status) "Status",
     vs.module     "Module",
     vs.action     "Action",
     vs.resource_consumer_group,
     vs.client_info,
     vs.client_identifier
FROM
     vs
WHERE
     vs.username IS NOT NULL
     AND nvl(vs.osuser,'x') <> 'SYSTEM'
     AND vs.type <> 'BACKGROUND'
     AND module = 'e:ONT:frm:OEXOEORD'
ORDER BY
     1,
     2,
     3;

Wednesday, May 22, 2024

EBS - Order Type associated with Workflow details query

select * from hr_operating_units;

exec MO_GLOBAL.SET_POLICY_CONTEXT('S',12762);

SELECT OWA.order_type_id,
       ol.name,
       oe.meaning item_type_code,
       wf.display_name line_flow
  FROM wf_activities_vl wf,
       oe_workflow_assignments OWA,
       oe_line_types_v ol,
       oe_lookups oe
 WHERE     OWA.line_type_id = ol.line_type_id
       AND oe.lookup_type(+) = 'WF_ASSIGN_ITEM_TYPES'
       AND oe.lookup_code(+) = OWA.item_type_code
       AND wf.name = OWA.process_name
       AND wf.item_type = 'OEOL'
       AND wf.version =
              (SELECT MAX (version)
                 FROM wf_activities_vl wf1
                WHERE wf1.name = wf.name AND wf1.item_type = 'OEOL');

Customer Tax Registration - EBS Query

              SELECT DISTINCT  hp.party_type, hp.party_name, hca.account_name, hp.party_number, hps.party_site_number, ...