3348: ORDER BY NVL(pll.promised_date, Nvl(pll.need_by_date,pll.creation_date)), Nvl(pll.need_by_date,pll.creation_date), pll.creation_date; --bug10022180
3349:
3350: /***** Bug # 1553154
3351: ***** There was a performance issue since the cursor DISTRIBUTIONS
3352: ***** was driving through PO_HEADERS_ALL followed by PO_DISTRIBUTIONS_ALL
3353: ***** Modified the Select statement so that it will drive through
3354: ***** PO_HEADERS_ALL followed by PO_LINES_ALL which is followed by
3355: ***** PO_LINE_LOCATIONS_ALL which in turn is followed by
3356: ***** PO_DISTRIBUTIONS_ALL so that there is an improvement in
3352: ***** was driving through PO_HEADERS_ALL followed by PO_DISTRIBUTIONS_ALL
3353: ***** Modified the Select statement so that it will drive through
3354: ***** PO_HEADERS_ALL followed by PO_LINES_ALL which is followed by
3355: ***** PO_LINE_LOCATIONS_ALL which in turn is followed by
3356: ***** PO_DISTRIBUTIONS_ALL so that there is an improvement in
3357: ***** Performance
3358: *****/
3359: CURSOR count_distributions(
3360: header_id NUMBER,
11063: AND (l_num_of_distributions > 1)) THEN --}{
11064:
11065: /* Bug 5354379: {
11066: If the po_distribution_id is populated in RTI, then derive the
11067: distribution number from po_distributions_all table */
11068:
11069: IF ( x_cascaded_table(n).po_distribution_id IS NOT NULL
11070: AND (x_cascaded_table(n).document_distribution_num IS NULL)) THEN
11071:
11417: where line_location_id = x_po_transferrec.po_line_location_id;
11418:
11419: select distribution_num
11420: into l_po_dist_num
11421: from po_distributions_all
11422: where po_distribution_id = x_po_transferrec.po_distribution_id;
11423:
11424: if x_cascaded_table(n).po_release_id is not null then --5439085
11425: select release_num
11760: --
11761:
11762:
11763: /* Bug 5354379:
11764: We should not compare the transaction quantity with the po_distributions_all.ordered_quantity,
11765: because we won't be able to do DELIVER txn for the RECEIVE txns with overreceipt made.
11766: If the RECEIVE txn for that DELIVER txns lies in RT, we have to make use of mtl_supply
11767: to get the AVAILABLE quantity for DELIVER txn.
11768: If the RECEIVE txn for that DELIVER txns lies in RTI, there is no mtl_supply or rcv_supply.
17043:
17044: BEGIN
17045: select deliver_to_person_id
17046: into l_deliver_to_person_id
17047: from po_distributions_all
17048: where po_distribution_id = x_cascaded_table(n).po_distribution_id;
17049:
17050: x_cascaded_table(n).deliver_to_person_id := l_deliver_to_person_id;
17051: IF (g_asn_debug = 'Y') THEN
17064:
17065: BEGIN
17066: select count(po_distribution_id)
17067: into l_distribution_count
17068: from po_distributions_all
17069: where line_location_id = x_cascaded_table(n).po_line_location_id;
17070:
17071: IF (g_asn_debug = 'Y') THEN
17072: asn_debug.put_line('Inside poll not null..l_distribution_count:'||l_distribution_count);
17074:
17075: IF l_distribution_count = 1 THEN
17076: select deliver_to_person_id
17077: into l_deliver_to_person_id
17078: from po_distributions_all
17079: where line_location_id = x_cascaded_table(n).po_line_location_id;
17080:
17081: x_cascaded_table(n).deliver_to_person_id := l_deliver_to_person_id;
17082: IF (g_asn_debug = 'Y') THEN