159: select invoice_to_org_id,org_id into l_invoice_to_org_id,l_org_id
160: from oe_order_headers_all where header_id = p_header_id;
161: */
162: -- get cached value.
163: oe_order_cache.load_order_header(p_header_id);
164: l_invoice_to_org_id := OE_Order_Cache.g_header_rec.invoice_to_org_id;
165: l_org_id := OE_Order_Cache.g_header_rec.org_id;
166: END IF;
167: IF l_debug_level > 0 THEN
160: from oe_order_headers_all where header_id = p_header_id;
161: */
162: -- get cached value.
163: oe_order_cache.load_order_header(p_header_id);
164: l_invoice_to_org_id := OE_Order_Cache.g_header_rec.invoice_to_org_id;
165: l_org_id := OE_Order_Cache.g_header_rec.org_id;
166: END IF;
167: IF l_debug_level > 0 THEN
168: oe_debug_pub.add('Invoice_to_org_id'||l_invoice_to_org_id);
161: */
162: -- get cached value.
163: oe_order_cache.load_order_header(p_header_id);
164: l_invoice_to_org_id := OE_Order_Cache.g_header_rec.invoice_to_org_id;
165: l_org_id := OE_Order_Cache.g_header_rec.org_id;
166: END IF;
167: IF l_debug_level > 0 THEN
168: oe_debug_pub.add('Invoice_to_org_id'||l_invoice_to_org_id);
169: oe_debug_pub.add('org id'||l_org_id);
895: select invoice_to_org_id,org_id into l_invoice_to_org_id,l_org_id
896: from oe_order_headers_all where header_id = p_header_id;
897: */
898:
899: oe_order_cache.load_order_header(p_header_id);
900: l_invoice_to_org_id := OE_Order_Cache.g_header_rec.invoice_to_org_id;
901: l_org_id := OE_Order_Cache.g_header_rec.org_id;
902: end if;
903:
896: from oe_order_headers_all where header_id = p_header_id;
897: */
898:
899: oe_order_cache.load_order_header(p_header_id);
900: l_invoice_to_org_id := OE_Order_Cache.g_header_rec.invoice_to_org_id;
901: l_org_id := OE_Order_Cache.g_header_rec.org_id;
902: end if;
903:
904: IF l_debug_level > 0 THEN
897: */
898:
899: oe_order_cache.load_order_header(p_header_id);
900: l_invoice_to_org_id := OE_Order_Cache.g_header_rec.invoice_to_org_id;
901: l_org_id := OE_Order_Cache.g_header_rec.org_id;
902: end if;
903:
904: IF l_debug_level > 0 THEN
905: oe_debug_pub.add('INVOICE_TO_ORG_ID and ORG_ID'||l_invoice_to_org_id||' and '||l_org_id);
1922: select invoice_to_org_id,ORG_ID into l_invoice_to_org_id,l_org_id
1923: from oe_order_headers_all where header_id = p_header_id;
1924: */
1925:
1926: oe_order_cache.load_order_header(p_header_id);
1927: l_invoice_to_org_id := OE_Order_Cache.g_header_rec.invoice_to_org_id;
1928: l_org_id := OE_Order_Cache.g_header_rec.org_id;
1929: end if;
1930: IF l_debug_level > 0 THEN
1923: from oe_order_headers_all where header_id = p_header_id;
1924: */
1925:
1926: oe_order_cache.load_order_header(p_header_id);
1927: l_invoice_to_org_id := OE_Order_Cache.g_header_rec.invoice_to_org_id;
1928: l_org_id := OE_Order_Cache.g_header_rec.org_id;
1929: end if;
1930: IF l_debug_level > 0 THEN
1931: oe_debug_pub.add('INVOICE_TO_ORG_ID and ORG_ID'||l_invoice_to_org_id||' and '||l_org_id);
1924: */
1925:
1926: oe_order_cache.load_order_header(p_header_id);
1927: l_invoice_to_org_id := OE_Order_Cache.g_header_rec.invoice_to_org_id;
1928: l_org_id := OE_Order_Cache.g_header_rec.org_id;
1929: end if;
1930: IF l_debug_level > 0 THEN
1931: oe_debug_pub.add('INVOICE_TO_ORG_ID and ORG_ID'||l_invoice_to_org_id||' and '||l_org_id);
1932: END IF;
2491: IF p_line_id is not null then
2492: Select ORG_ID into l_org_id
2493: from oe_order_lines_all where line_id = p_line_id and header_id = p_header_id;
2494: else
2495: oe_order_cache.load_order_header(p_header_id);
2496: l_org_id := OE_Order_Cache.g_header_rec.org_id;
2497: end if;
2498: --For ACH and direct debit payment types, the site use id that
2499: --needs to be queried from payment tables is different from the query
2492: Select ORG_ID into l_org_id
2493: from oe_order_lines_all where line_id = p_line_id and header_id = p_header_id;
2494: else
2495: oe_order_cache.load_order_header(p_header_id);
2496: l_org_id := OE_Order_Cache.g_header_rec.org_id;
2497: end if;
2498: --For ACH and direct debit payment types, the site use id that
2499: --needs to be queried from payment tables is different from the query
2500: --for Credit card payments. Hence to differentiate this, the payment