Wednesday, 18 October 2017

How to find GSTIN Number

First Party GSTIN  Number:

SELECT  'GSTIN : '||b.registration_number
        --INTO   :cp_org_gst
        FROM   ja.jai_party_regs a, ja.jai_party_reg_lines b
       WHERE       org_id = :p_org_id
               AND a.party_id= :P_INV_ORG_ID
               AND a.party_reg_id = b.party_reg_id
               AND a.reg_class_code = b.reg_class_code
               AND a.reg_class_code = 'FIRST_PARTY'
               AND a.party_class_name = 'Transaction Tax'
               AND a.PARTY_TYPE_CODE='IO'
               AND b.registration_type_name = 'GSTIN'
               AND a.party_site_id IS NOT NULL
               AND SYSDATE BETWEEN b.effective_from
                               AND  NVL (b.effective_to, SYSDATE);

How To Find HSN Code

/***From Base Table***/

SELECT reporting_code
INTO v_hsn_code
FROM apps.jai_item_templ_hdr jith,
     apps.jai_reporting_associations jra,
     apps.jai_regimes jr
WHERE     jith.template_hdr_id = jra.entity_id
      AND jra.reporting_usage = 'LR'
      --and jra.EFFECTIVE_FROM='01-JAN-2017'
      AND jra.effective_to IS NULL
      --and jra.REGIME_CODE='GST'
      AND jr.regime_id = jra.regime_id
      AND jr.regime_code = 'GST'
      AND jith.inventory_item_id = :inventory_item_id
GROUP BY reporting_code