--Query to find the GST Taxes against Sales Order
SELECT jtl.TRX_ID, jtl.TRX_DATE,
jtl.tax_invoice_num, jtl.tax_invoice_date, jtl.org_id,
jtl.organization_id, jtl.creation_date, jtl.item_id,
jtl.event_type_code, jtl.tax_event_class_code, jtl.ledger_id,
jtl.trx_number, jtl.trx_line_number, jtl.line_amt,
jtl.trx_line_quantity, jtl.trx_currency_code,
jtl.currency_conversion_rate, jtl.currency_conversion_date,
jtl.functional_currency_code, jtl.tax_regime_id, jtl.tax_regime_code,
jtl.first_party_primary_reg_name, jtl.first_party_primary_reg_num,
jtl.first_party_secondary_reg_name, jtl.first_party_secondary_reg_num,
jtl.tax_point_basis, jtl.tax_rate_code, jtl.tax_rate_type,
jtl.tax_rate_percentage, jtl.tax_rounding_factor,
jtl.unround_tax_amt_fun_curr, jtl.unround_tax_amt_trx_curr,
jtl.rounded_tax_amt_fun_curr, jtl.rounded_tax_amt_trx_curr,
jtl.rounded_taxable_amt_fun_curr, jtl.rounded_taxable_amt_trx_curr
FROM jai_tax_lines jtl,
oe_order_headers_all ooha,
oe_order_lines_all oola,
jai_regimes jr,
jai_tax_types jtt
WHERE 1 = 1
AND jtl.trx_id = ooha.header_id
and ooha.HEADER_ID = oola.HEADER_ID
AND jtl.trx_id = :p_order_header_id
AND jtl.event_type_code = 'CREATE'
AND jtl.trx_line_id = oola.line_id
AND jtl.org_id = :p_org_id
AND jtl.tax_regime_id = jr.regime_id
AND jtl.tax_type_id = jtt.tax_type_id;
--Query to find the GST Taxes against Delivery for Sales Order
SELECT jtl.TRX_ID, jtl.TRX_DATE,
jtl.tax_invoice_num, jtl.tax_invoice_date, jtl.org_id,
jtl.organization_id, jtl.creation_date, jtl.item_id,
jtl.event_type_code, jtl.tax_event_class_code, jtl.ledger_id,
jtl.trx_number, jtl.trx_line_number, jtl.line_amt,
jtl.trx_line_quantity, jtl.trx_currency_code,
jtl.currency_conversion_rate, jtl.currency_conversion_date,
jtl.functional_currency_code, jtl.tax_regime_id, jtl.tax_regime_code,
jtl.first_party_primary_reg_name, jtl.first_party_primary_reg_num,
jtl.first_party_secondary_reg_name, jtl.first_party_secondary_reg_num,
jtl.tax_point_basis, jtl.tax_rate_code, jtl.tax_rate_type,
jtl.tax_rate_percentage, jtl.tax_rounding_factor,
jtl.unround_tax_amt_fun_curr, jtl.unround_tax_amt_trx_curr,
jtl.rounded_tax_amt_fun_curr, jtl.rounded_tax_amt_trx_curr,
jtl.rounded_taxable_amt_fun_curr, jtl.rounded_taxable_amt_trx_curr
FROM jai_tax_lines jtl,
oe_order_headers_all ooha,
oe_order_lines_all oola,
wsh_new_deliveries wnd,
wsh_delivery_assignments wda,
wsh_delivery_details wdd,
jai_regimes jr,
jai_tax_types jtt
WHERE 1 = 1
AND jtl.trx_id = wnd.DELIVERY_ID
and jtl.REF_DOC_TRX_ID = ooha.HEADER_ID
and jtl.REF_DOC_LINE_ID = oola.LINE_ID
and wdd.source_header_id = ooha.header_id
and ooha.HEADER_ID = oola.HEADER_ID
AND jtl.trx_id = :p_order_header_id
AND jtl.event_type_code IN ( 'SHIPMENT_CREATED','SHIPMENT_UPDATED')
AND jtl.trx_line_id = wdd.delivery_detail_id
and wdd.source_line_id = oola.line_id
and wda.delivery_id = wnd.DELIVERY_ID
and wda.delivery_detail_id = wdd.DELIVERY_DETAIL_ID
AND jtl.org_id = :p_org_id
AND jtl.tax_regime_id = jr.regime_id
AND jtl.tax_type_id = jtt.tax_type_id;
SELECT jtl.TRX_ID, jtl.TRX_DATE,
jtl.tax_invoice_num, jtl.tax_invoice_date, jtl.org_id,
jtl.organization_id, jtl.creation_date, jtl.item_id,
jtl.event_type_code, jtl.tax_event_class_code, jtl.ledger_id,
jtl.trx_number, jtl.trx_line_number, jtl.line_amt,
jtl.trx_line_quantity, jtl.trx_currency_code,
jtl.currency_conversion_rate, jtl.currency_conversion_date,
jtl.functional_currency_code, jtl.tax_regime_id, jtl.tax_regime_code,
jtl.first_party_primary_reg_name, jtl.first_party_primary_reg_num,
jtl.first_party_secondary_reg_name, jtl.first_party_secondary_reg_num,
jtl.tax_point_basis, jtl.tax_rate_code, jtl.tax_rate_type,
jtl.tax_rate_percentage, jtl.tax_rounding_factor,
jtl.unround_tax_amt_fun_curr, jtl.unround_tax_amt_trx_curr,
jtl.rounded_tax_amt_fun_curr, jtl.rounded_tax_amt_trx_curr,
jtl.rounded_taxable_amt_fun_curr, jtl.rounded_taxable_amt_trx_curr
FROM jai_tax_lines jtl,
oe_order_headers_all ooha,
oe_order_lines_all oola,
jai_regimes jr,
jai_tax_types jtt
WHERE 1 = 1
AND jtl.trx_id = ooha.header_id
and ooha.HEADER_ID = oola.HEADER_ID
AND jtl.trx_id = :p_order_header_id
AND jtl.event_type_code = 'CREATE'
AND jtl.trx_line_id = oola.line_id
AND jtl.org_id = :p_org_id
AND jtl.tax_regime_id = jr.regime_id
AND jtl.tax_type_id = jtt.tax_type_id;
--Query to find the GST Taxes against Delivery for Sales Order
SELECT jtl.TRX_ID, jtl.TRX_DATE,
jtl.tax_invoice_num, jtl.tax_invoice_date, jtl.org_id,
jtl.organization_id, jtl.creation_date, jtl.item_id,
jtl.event_type_code, jtl.tax_event_class_code, jtl.ledger_id,
jtl.trx_number, jtl.trx_line_number, jtl.line_amt,
jtl.trx_line_quantity, jtl.trx_currency_code,
jtl.currency_conversion_rate, jtl.currency_conversion_date,
jtl.functional_currency_code, jtl.tax_regime_id, jtl.tax_regime_code,
jtl.first_party_primary_reg_name, jtl.first_party_primary_reg_num,
jtl.first_party_secondary_reg_name, jtl.first_party_secondary_reg_num,
jtl.tax_point_basis, jtl.tax_rate_code, jtl.tax_rate_type,
jtl.tax_rate_percentage, jtl.tax_rounding_factor,
jtl.unround_tax_amt_fun_curr, jtl.unround_tax_amt_trx_curr,
jtl.rounded_tax_amt_fun_curr, jtl.rounded_tax_amt_trx_curr,
jtl.rounded_taxable_amt_fun_curr, jtl.rounded_taxable_amt_trx_curr
FROM jai_tax_lines jtl,
oe_order_headers_all ooha,
oe_order_lines_all oola,
wsh_new_deliveries wnd,
wsh_delivery_assignments wda,
wsh_delivery_details wdd,
jai_regimes jr,
jai_tax_types jtt
WHERE 1 = 1
AND jtl.trx_id = wnd.DELIVERY_ID
and jtl.REF_DOC_TRX_ID = ooha.HEADER_ID
and jtl.REF_DOC_LINE_ID = oola.LINE_ID
and wdd.source_header_id = ooha.header_id
and ooha.HEADER_ID = oola.HEADER_ID
AND jtl.trx_id = :p_order_header_id
AND jtl.event_type_code IN ( 'SHIPMENT_CREATED','SHIPMENT_UPDATED')
AND jtl.trx_line_id = wdd.delivery_detail_id
and wdd.source_line_id = oola.line_id
and wda.delivery_id = wnd.DELIVERY_ID
and wda.delivery_detail_id = wdd.DELIVERY_DETAIL_ID
AND jtl.org_id = :p_org_id
AND jtl.tax_regime_id = jr.regime_id
AND jtl.tax_type_id = jtt.tax_type_id;
gst compliance in banking
ReplyDeletePersonalize products, offers, pricing and loyalty programs; prevent revenue leakage and ensure regulatory compliance with a billing solution.