55: BEGIN
56: SELECT NVL(gsa_indicator,'N')
57: INTO G_Customer_Info.gsa_indicator
58: FROM hz_cust_site_uses hsu
59: WHERE site_use_id = OE_ORDER_PUB.G_HDR.invoice_to_org_id
60: --added for moac
61: and hsu.org_id = QP_ATTR_MAPPING_PUB.G_ORG_ID;
62: /*
63: AND NVL(hsu.org_id,
625: l_inv_precision NUMBER := 40;
626:
627: BEGIN
628:
629: -- l_ordered_uom := OE_ORDER_PUB.G_LINE.order_quantity_uom;
630: oe_debug_pub.add('Inv Precision: ' || l_inv_precision);
631:
632: BEGIN
633:
665: x_return number;
666:
667: BEGIN
668:
669: x_return := Get_Period1_Item_Quantity(p_cust_id , p_inventory_item_id , OE_ORDER_PUB.G_LINE.order_quantity_uom);
670:
671: return x_return;
672:
673: END;
719: x_return number;
720:
721: BEGIN
722:
723: x_return := Get_Period2_Item_Quantity(p_cust_id , p_inventory_item_id , OE_ORDER_PUB.G_LINE.order_quantity_uom);
724:
725: return x_return;
726:
727: END;
773: x_return number;
774:
775: BEGIN
776:
777: x_return := Get_Period3_Item_Quantity(p_cust_id , p_inventory_item_id , OE_ORDER_PUB.G_LINE.order_quantity_uom);
778:
779: return x_return;
780:
781: END;
835: );
836: End If;
837: /*
838: x_amount := gl_currency_api.convert_amount(l_sob_currency,
839: oe_order_pub.g_hdr.transactional_curr_code,
840: oe_order_pub.g_hdr.conversion_rate_date,
841: oe_order_pub.g_hdr.conversion_type_code,
842: x_amount);
843: */
836: End If;
837: /*
838: x_amount := gl_currency_api.convert_amount(l_sob_currency,
839: oe_order_pub.g_hdr.transactional_curr_code,
840: oe_order_pub.g_hdr.conversion_rate_date,
841: oe_order_pub.g_hdr.conversion_type_code,
842: x_amount);
843: */
844:
837: /*
838: x_amount := gl_currency_api.convert_amount(l_sob_currency,
839: oe_order_pub.g_hdr.transactional_curr_code,
840: oe_order_pub.g_hdr.conversion_rate_date,
841: oe_order_pub.g_hdr.conversion_type_code,
842: x_amount);
843: */
844:
845: RETURN QP_NUMBER.NUMBER_TO_CANONICAL(x_amount);
854: BEGIN
855:
856: x_return := Get_Period1_Item_Amount(p_cust_id,
857: p_inventory_item_id,
858: oe_order_pub.g_hdr.transactional_curr_code,
859: oe_order_pub.g_hdr.conversion_rate_date,
860: oe_order_pub.g_hdr.Pricing_date,
861: oe_order_pub.g_hdr.conversion_rate,
862: oe_order_pub.g_hdr.conversion_type_code);
855:
856: x_return := Get_Period1_Item_Amount(p_cust_id,
857: p_inventory_item_id,
858: oe_order_pub.g_hdr.transactional_curr_code,
859: oe_order_pub.g_hdr.conversion_rate_date,
860: oe_order_pub.g_hdr.Pricing_date,
861: oe_order_pub.g_hdr.conversion_rate,
862: oe_order_pub.g_hdr.conversion_type_code);
863:
856: x_return := Get_Period1_Item_Amount(p_cust_id,
857: p_inventory_item_id,
858: oe_order_pub.g_hdr.transactional_curr_code,
859: oe_order_pub.g_hdr.conversion_rate_date,
860: oe_order_pub.g_hdr.Pricing_date,
861: oe_order_pub.g_hdr.conversion_rate,
862: oe_order_pub.g_hdr.conversion_type_code);
863:
864: return x_return;
857: p_inventory_item_id,
858: oe_order_pub.g_hdr.transactional_curr_code,
859: oe_order_pub.g_hdr.conversion_rate_date,
860: oe_order_pub.g_hdr.Pricing_date,
861: oe_order_pub.g_hdr.conversion_rate,
862: oe_order_pub.g_hdr.conversion_type_code);
863:
864: return x_return;
865:
858: oe_order_pub.g_hdr.transactional_curr_code,
859: oe_order_pub.g_hdr.conversion_rate_date,
860: oe_order_pub.g_hdr.Pricing_date,
861: oe_order_pub.g_hdr.conversion_rate,
862: oe_order_pub.g_hdr.conversion_type_code);
863:
864: return x_return;
865:
866: END;
920: End If;
921:
922: /*
923: x_amount := gl_currency_api.convert_amount(l_sob_currency,
924: oe_order_pub.g_hdr.transactional_curr_code,
925: oe_order_pub.g_hdr.conversion_rate_date,
926: oe_order_pub.g_hdr.conversion_type_code,
927: x_amount);
928:
921:
922: /*
923: x_amount := gl_currency_api.convert_amount(l_sob_currency,
924: oe_order_pub.g_hdr.transactional_curr_code,
925: oe_order_pub.g_hdr.conversion_rate_date,
926: oe_order_pub.g_hdr.conversion_type_code,
927: x_amount);
928:
929: */
922: /*
923: x_amount := gl_currency_api.convert_amount(l_sob_currency,
924: oe_order_pub.g_hdr.transactional_curr_code,
925: oe_order_pub.g_hdr.conversion_rate_date,
926: oe_order_pub.g_hdr.conversion_type_code,
927: x_amount);
928:
929: */
930: RETURN QP_NUMBER.NUMBER_TO_CANONICAL(x_amount);
939: BEGIN
940:
941: x_return := Get_Period2_Item_Amount(p_cust_id,
942: p_inventory_item_id,
943: oe_order_pub.g_hdr.transactional_curr_code,
944: oe_order_pub.g_hdr.conversion_rate_date,
945: oe_order_pub.g_hdr.Pricing_date,
946: oe_order_pub.g_hdr.conversion_rate,
947: oe_order_pub.g_hdr.conversion_type_code);
940:
941: x_return := Get_Period2_Item_Amount(p_cust_id,
942: p_inventory_item_id,
943: oe_order_pub.g_hdr.transactional_curr_code,
944: oe_order_pub.g_hdr.conversion_rate_date,
945: oe_order_pub.g_hdr.Pricing_date,
946: oe_order_pub.g_hdr.conversion_rate,
947: oe_order_pub.g_hdr.conversion_type_code);
948:
941: x_return := Get_Period2_Item_Amount(p_cust_id,
942: p_inventory_item_id,
943: oe_order_pub.g_hdr.transactional_curr_code,
944: oe_order_pub.g_hdr.conversion_rate_date,
945: oe_order_pub.g_hdr.Pricing_date,
946: oe_order_pub.g_hdr.conversion_rate,
947: oe_order_pub.g_hdr.conversion_type_code);
948:
949: return x_return;
942: p_inventory_item_id,
943: oe_order_pub.g_hdr.transactional_curr_code,
944: oe_order_pub.g_hdr.conversion_rate_date,
945: oe_order_pub.g_hdr.Pricing_date,
946: oe_order_pub.g_hdr.conversion_rate,
947: oe_order_pub.g_hdr.conversion_type_code);
948:
949: return x_return;
950:
943: oe_order_pub.g_hdr.transactional_curr_code,
944: oe_order_pub.g_hdr.conversion_rate_date,
945: oe_order_pub.g_hdr.Pricing_date,
946: oe_order_pub.g_hdr.conversion_rate,
947: oe_order_pub.g_hdr.conversion_type_code);
948:
949: return x_return;
950:
951: END;
1004: End If;
1005:
1006:
1007: /* Old Code
1008: If l_sob_currency <> oe_order_pub.g_hdr.transactional_curr_code Then
1009:
1010: x_amount := QP_Cross_Order_Volume_Load.convert_to_base_curr(
1011: p_trans_amount => x_amount,
1012: p_From_currency => l_sob_currency,
1009:
1010: x_amount := QP_Cross_Order_Volume_Load.convert_to_base_curr(
1011: p_trans_amount => x_amount,
1012: p_From_currency => l_sob_currency,
1013: p_to_currency => oe_order_pub.g_hdr.transactional_curr_code,
1014: p_conversion_date => nvl(oe_order_pub.g_hdr.conversion_rate_date,
1015: oe_order_pub.g_hdr.Pricing_date),
1016: p_conversion_rate => oe_order_pub.g_hdr.conversion_rate,
1017: p_conversion_type => oe_order_pub.g_hdr.conversion_type_code
1010: x_amount := QP_Cross_Order_Volume_Load.convert_to_base_curr(
1011: p_trans_amount => x_amount,
1012: p_From_currency => l_sob_currency,
1013: p_to_currency => oe_order_pub.g_hdr.transactional_curr_code,
1014: p_conversion_date => nvl(oe_order_pub.g_hdr.conversion_rate_date,
1015: oe_order_pub.g_hdr.Pricing_date),
1016: p_conversion_rate => oe_order_pub.g_hdr.conversion_rate,
1017: p_conversion_type => oe_order_pub.g_hdr.conversion_type_code
1018: );
1011: p_trans_amount => x_amount,
1012: p_From_currency => l_sob_currency,
1013: p_to_currency => oe_order_pub.g_hdr.transactional_curr_code,
1014: p_conversion_date => nvl(oe_order_pub.g_hdr.conversion_rate_date,
1015: oe_order_pub.g_hdr.Pricing_date),
1016: p_conversion_rate => oe_order_pub.g_hdr.conversion_rate,
1017: p_conversion_type => oe_order_pub.g_hdr.conversion_type_code
1018: );
1019: End If;
1012: p_From_currency => l_sob_currency,
1013: p_to_currency => oe_order_pub.g_hdr.transactional_curr_code,
1014: p_conversion_date => nvl(oe_order_pub.g_hdr.conversion_rate_date,
1015: oe_order_pub.g_hdr.Pricing_date),
1016: p_conversion_rate => oe_order_pub.g_hdr.conversion_rate,
1017: p_conversion_type => oe_order_pub.g_hdr.conversion_type_code
1018: );
1019: End If;
1020: */
1013: p_to_currency => oe_order_pub.g_hdr.transactional_curr_code,
1014: p_conversion_date => nvl(oe_order_pub.g_hdr.conversion_rate_date,
1015: oe_order_pub.g_hdr.Pricing_date),
1016: p_conversion_rate => oe_order_pub.g_hdr.conversion_rate,
1017: p_conversion_type => oe_order_pub.g_hdr.conversion_type_code
1018: );
1019: End If;
1020: */
1021:
1031: BEGIN
1032:
1033: x_return := Get_Period3_Item_Amount(p_cust_id,
1034: p_inventory_item_id,
1035: oe_order_pub.g_hdr.transactional_curr_code,
1036: oe_order_pub.g_hdr.conversion_rate_date,
1037: oe_order_pub.g_hdr.Pricing_date,
1038: oe_order_pub.g_hdr.conversion_rate,
1039: oe_order_pub.g_hdr.conversion_type_code);
1032:
1033: x_return := Get_Period3_Item_Amount(p_cust_id,
1034: p_inventory_item_id,
1035: oe_order_pub.g_hdr.transactional_curr_code,
1036: oe_order_pub.g_hdr.conversion_rate_date,
1037: oe_order_pub.g_hdr.Pricing_date,
1038: oe_order_pub.g_hdr.conversion_rate,
1039: oe_order_pub.g_hdr.conversion_type_code);
1040:
1033: x_return := Get_Period3_Item_Amount(p_cust_id,
1034: p_inventory_item_id,
1035: oe_order_pub.g_hdr.transactional_curr_code,
1036: oe_order_pub.g_hdr.conversion_rate_date,
1037: oe_order_pub.g_hdr.Pricing_date,
1038: oe_order_pub.g_hdr.conversion_rate,
1039: oe_order_pub.g_hdr.conversion_type_code);
1040:
1041: return x_return;
1034: p_inventory_item_id,
1035: oe_order_pub.g_hdr.transactional_curr_code,
1036: oe_order_pub.g_hdr.conversion_rate_date,
1037: oe_order_pub.g_hdr.Pricing_date,
1038: oe_order_pub.g_hdr.conversion_rate,
1039: oe_order_pub.g_hdr.conversion_type_code);
1040:
1041: return x_return;
1042:
1035: oe_order_pub.g_hdr.transactional_curr_code,
1036: oe_order_pub.g_hdr.conversion_rate_date,
1037: oe_order_pub.g_hdr.Pricing_date,
1038: oe_order_pub.g_hdr.conversion_rate,
1039: oe_order_pub.g_hdr.conversion_type_code);
1040:
1041: return x_return;
1042:
1043: END;
1097: );
1098: End If;
1099: /*
1100: x_total_amount := gl_currency_api.convert_amount(l_sob_currency,
1101: oe_order_pub.g_hdr.transactional_curr_code,
1102: oe_order_pub.g_hdr.conversion_rate_date,
1103: oe_order_pub.g_hdr.conversion_type_code,
1104: x_total_amount) ;
1105: --+ G_Order_Info.order_amount;
1098: End If;
1099: /*
1100: x_total_amount := gl_currency_api.convert_amount(l_sob_currency,
1101: oe_order_pub.g_hdr.transactional_curr_code,
1102: oe_order_pub.g_hdr.conversion_rate_date,
1103: oe_order_pub.g_hdr.conversion_type_code,
1104: x_total_amount) ;
1105: --+ G_Order_Info.order_amount;
1106: */
1099: /*
1100: x_total_amount := gl_currency_api.convert_amount(l_sob_currency,
1101: oe_order_pub.g_hdr.transactional_curr_code,
1102: oe_order_pub.g_hdr.conversion_rate_date,
1103: oe_order_pub.g_hdr.conversion_type_code,
1104: x_total_amount) ;
1105: --+ G_Order_Info.order_amount;
1106: */
1107:
1119: x_return number;
1120:
1121: BEGIN
1122:
1123: x_return := Get_Period1_Order_Amount(p_cust_id, oe_order_pub.g_hdr.transactional_curr_code, oe_order_pub.g_hdr.conversion_rate_date, oe_order_pub.g_hdr.Pricing_date, oe_order_pub.g_hdr.conversion_rate, oe_order_pub.g_hdr.conversion_type_code);
1124:
1125: return x_return;
1126:
1127: END;
1180: );
1181: End If;
1182: /*
1183: x_total_amount := gl_currency_api.convert_amount( l_sob_currency,
1184: oe_order_pub.g_hdr.transactional_curr_code,
1185: oe_order_pub.g_hdr.conversion_rate_date,
1186: oe_order_pub.g_hdr.conversion_type_code,
1187: x_total_amount) ;
1188: --+ G_Order_Info.order_amount;
1181: End If;
1182: /*
1183: x_total_amount := gl_currency_api.convert_amount( l_sob_currency,
1184: oe_order_pub.g_hdr.transactional_curr_code,
1185: oe_order_pub.g_hdr.conversion_rate_date,
1186: oe_order_pub.g_hdr.conversion_type_code,
1187: x_total_amount) ;
1188: --+ G_Order_Info.order_amount;
1189: */
1182: /*
1183: x_total_amount := gl_currency_api.convert_amount( l_sob_currency,
1184: oe_order_pub.g_hdr.transactional_curr_code,
1185: oe_order_pub.g_hdr.conversion_rate_date,
1186: oe_order_pub.g_hdr.conversion_type_code,
1187: x_total_amount) ;
1188: --+ G_Order_Info.order_amount;
1189: */
1190:
1201: x_return number;
1202:
1203: BEGIN
1204:
1205: x_return := Get_Period2_Order_Amount(p_cust_id, oe_order_pub.g_hdr.transactional_curr_code, oe_order_pub.g_hdr.conversion_rate_date, oe_order_pub.g_hdr.Pricing_date, oe_order_pub.g_hdr.conversion_rate, oe_order_pub.g_hdr.conversion_type_code);
1206:
1207: return x_return;
1208:
1209: END;
1262: );
1263: End If;
1264: /*
1265: x_total_amount := gl_currency_api.convert_amount(l_sob_currency,
1266: oe_order_pub.g_hdr.transactional_curr_code,
1267: oe_order_pub.g_hdr.conversion_rate_date,
1268: oe_order_pub.g_hdr.conversion_type_code,
1269: x_total_amount) ;
1270: --+ G_Order_Info.order_amount;
1263: End If;
1264: /*
1265: x_total_amount := gl_currency_api.convert_amount(l_sob_currency,
1266: oe_order_pub.g_hdr.transactional_curr_code,
1267: oe_order_pub.g_hdr.conversion_rate_date,
1268: oe_order_pub.g_hdr.conversion_type_code,
1269: x_total_amount) ;
1270: --+ G_Order_Info.order_amount;
1271:
1264: /*
1265: x_total_amount := gl_currency_api.convert_amount(l_sob_currency,
1266: oe_order_pub.g_hdr.transactional_curr_code,
1267: oe_order_pub.g_hdr.conversion_rate_date,
1268: oe_order_pub.g_hdr.conversion_type_code,
1269: x_total_amount) ;
1270: --+ G_Order_Info.order_amount;
1271:
1272: */
1284: x_return number;
1285:
1286: BEGIN
1287:
1288: x_return := Get_Period3_Order_Amount(p_cust_id, oe_order_pub.g_hdr.transactional_curr_code, oe_order_pub.g_hdr.conversion_rate_date, oe_order_pub.g_hdr.Pricing_date, oe_order_pub.g_hdr.conversion_rate, oe_order_pub.g_hdr.conversion_type_code);
1289:
1290: return x_return;
1291:
1292: END;
1591: x_return NUMBER;
1592:
1593: BEGIN
1594:
1595: x_return := QP_NUMBER.NUMBER_TO_CANONICAL(NVL(p_pricing_qty,p_ordered_qty) * NVL(OE_ORDER_PUB.G_LINE.UNIT_LIST_PRICE_PER_PQTY, OE_ORDER_PUB.G_LINE.UNIT_LIST_PRICE));
1596:
1597: IF (OE_ORDER_PUB.G_LINE.UNIT_LIST_PRICE_PER_PQTY IS NULL) AND (OE_ORDER_PUB.G_LINE.UNIT_LIST_PRICE is NULL) THEN
1598: x_return := 0;
1599: END IF;
1593: BEGIN
1594:
1595: x_return := QP_NUMBER.NUMBER_TO_CANONICAL(NVL(p_pricing_qty,p_ordered_qty) * NVL(OE_ORDER_PUB.G_LINE.UNIT_LIST_PRICE_PER_PQTY, OE_ORDER_PUB.G_LINE.UNIT_LIST_PRICE));
1596:
1597: IF (OE_ORDER_PUB.G_LINE.UNIT_LIST_PRICE_PER_PQTY IS NULL) AND (OE_ORDER_PUB.G_LINE.UNIT_LIST_PRICE is NULL) THEN
1598: x_return := 0;
1599: END IF;
1600:
1601: RETURN x_return;