54: BEGIN
55: SELECT NVL(gsa_indicator,'N')
56: INTO G_Customer_Info.gsa_indicator
57: FROM hz_cust_site_uses hsu
58: WHERE site_use_id = OE_ORDER_PUB.G_HDR.invoice_to_org_id
59: --added for moac
60: and hsu.org_id = QP_ATTR_MAPPING_PUB.G_ORG_ID;
61: /*
62: AND NVL(hsu.org_id,
633: l_inv_precision NUMBER := 40;
634:
635: BEGIN
636:
637: -- l_ordered_uom := OE_ORDER_PUB.G_LINE.order_quantity_uom;
638: oe_debug_pub.add('Inv Precision: ' || l_inv_precision);
639:
640: BEGIN
641:
673: x_return number;
674:
675: BEGIN
676:
677: x_return := Get_Period1_Item_Quantity(p_cust_id , p_inventory_item_id , OE_ORDER_PUB.G_LINE.order_quantity_uom);
678:
679: return x_return;
680:
681: END;
727: x_return number;
728:
729: BEGIN
730:
731: x_return := Get_Period2_Item_Quantity(p_cust_id , p_inventory_item_id , OE_ORDER_PUB.G_LINE.order_quantity_uom);
732:
733: return x_return;
734:
735: END;
781: x_return number;
782:
783: BEGIN
784:
785: x_return := Get_Period3_Item_Quantity(p_cust_id , p_inventory_item_id , OE_ORDER_PUB.G_LINE.order_quantity_uom);
786:
787: return x_return;
788:
789: END;
843: );
844: End If;
845: /*
846: x_amount := gl_currency_api.convert_amount(l_sob_currency,
847: oe_order_pub.g_hdr.transactional_curr_code,
848: oe_order_pub.g_hdr.conversion_rate_date,
849: oe_order_pub.g_hdr.conversion_type_code,
850: x_amount);
851: */
844: End If;
845: /*
846: x_amount := gl_currency_api.convert_amount(l_sob_currency,
847: oe_order_pub.g_hdr.transactional_curr_code,
848: oe_order_pub.g_hdr.conversion_rate_date,
849: oe_order_pub.g_hdr.conversion_type_code,
850: x_amount);
851: */
852:
845: /*
846: x_amount := gl_currency_api.convert_amount(l_sob_currency,
847: oe_order_pub.g_hdr.transactional_curr_code,
848: oe_order_pub.g_hdr.conversion_rate_date,
849: oe_order_pub.g_hdr.conversion_type_code,
850: x_amount);
851: */
852:
853: RETURN QP_NUMBER.NUMBER_TO_CANONICAL(x_amount);
862: BEGIN
863:
864: x_return := Get_Period1_Item_Amount(p_cust_id,
865: p_inventory_item_id,
866: oe_order_pub.g_hdr.transactional_curr_code,
867: oe_order_pub.g_hdr.conversion_rate_date,
868: oe_order_pub.g_hdr.Pricing_date,
869: oe_order_pub.g_hdr.conversion_rate,
870: oe_order_pub.g_hdr.conversion_type_code);
863:
864: x_return := Get_Period1_Item_Amount(p_cust_id,
865: p_inventory_item_id,
866: oe_order_pub.g_hdr.transactional_curr_code,
867: oe_order_pub.g_hdr.conversion_rate_date,
868: oe_order_pub.g_hdr.Pricing_date,
869: oe_order_pub.g_hdr.conversion_rate,
870: oe_order_pub.g_hdr.conversion_type_code);
871:
864: x_return := Get_Period1_Item_Amount(p_cust_id,
865: p_inventory_item_id,
866: oe_order_pub.g_hdr.transactional_curr_code,
867: oe_order_pub.g_hdr.conversion_rate_date,
868: oe_order_pub.g_hdr.Pricing_date,
869: oe_order_pub.g_hdr.conversion_rate,
870: oe_order_pub.g_hdr.conversion_type_code);
871:
872: return x_return;
865: p_inventory_item_id,
866: oe_order_pub.g_hdr.transactional_curr_code,
867: oe_order_pub.g_hdr.conversion_rate_date,
868: oe_order_pub.g_hdr.Pricing_date,
869: oe_order_pub.g_hdr.conversion_rate,
870: oe_order_pub.g_hdr.conversion_type_code);
871:
872: return x_return;
873:
866: oe_order_pub.g_hdr.transactional_curr_code,
867: oe_order_pub.g_hdr.conversion_rate_date,
868: oe_order_pub.g_hdr.Pricing_date,
869: oe_order_pub.g_hdr.conversion_rate,
870: oe_order_pub.g_hdr.conversion_type_code);
871:
872: return x_return;
873:
874: END;
928: End If;
929:
930: /*
931: x_amount := gl_currency_api.convert_amount(l_sob_currency,
932: oe_order_pub.g_hdr.transactional_curr_code,
933: oe_order_pub.g_hdr.conversion_rate_date,
934: oe_order_pub.g_hdr.conversion_type_code,
935: x_amount);
936:
929:
930: /*
931: x_amount := gl_currency_api.convert_amount(l_sob_currency,
932: oe_order_pub.g_hdr.transactional_curr_code,
933: oe_order_pub.g_hdr.conversion_rate_date,
934: oe_order_pub.g_hdr.conversion_type_code,
935: x_amount);
936:
937: */
930: /*
931: x_amount := gl_currency_api.convert_amount(l_sob_currency,
932: oe_order_pub.g_hdr.transactional_curr_code,
933: oe_order_pub.g_hdr.conversion_rate_date,
934: oe_order_pub.g_hdr.conversion_type_code,
935: x_amount);
936:
937: */
938: RETURN QP_NUMBER.NUMBER_TO_CANONICAL(x_amount);
947: BEGIN
948:
949: x_return := Get_Period2_Item_Amount(p_cust_id,
950: p_inventory_item_id,
951: oe_order_pub.g_hdr.transactional_curr_code,
952: oe_order_pub.g_hdr.conversion_rate_date,
953: oe_order_pub.g_hdr.Pricing_date,
954: oe_order_pub.g_hdr.conversion_rate,
955: oe_order_pub.g_hdr.conversion_type_code);
948:
949: x_return := Get_Period2_Item_Amount(p_cust_id,
950: p_inventory_item_id,
951: oe_order_pub.g_hdr.transactional_curr_code,
952: oe_order_pub.g_hdr.conversion_rate_date,
953: oe_order_pub.g_hdr.Pricing_date,
954: oe_order_pub.g_hdr.conversion_rate,
955: oe_order_pub.g_hdr.conversion_type_code);
956:
949: x_return := Get_Period2_Item_Amount(p_cust_id,
950: p_inventory_item_id,
951: oe_order_pub.g_hdr.transactional_curr_code,
952: oe_order_pub.g_hdr.conversion_rate_date,
953: oe_order_pub.g_hdr.Pricing_date,
954: oe_order_pub.g_hdr.conversion_rate,
955: oe_order_pub.g_hdr.conversion_type_code);
956:
957: return x_return;
950: p_inventory_item_id,
951: oe_order_pub.g_hdr.transactional_curr_code,
952: oe_order_pub.g_hdr.conversion_rate_date,
953: oe_order_pub.g_hdr.Pricing_date,
954: oe_order_pub.g_hdr.conversion_rate,
955: oe_order_pub.g_hdr.conversion_type_code);
956:
957: return x_return;
958:
951: oe_order_pub.g_hdr.transactional_curr_code,
952: oe_order_pub.g_hdr.conversion_rate_date,
953: oe_order_pub.g_hdr.Pricing_date,
954: oe_order_pub.g_hdr.conversion_rate,
955: oe_order_pub.g_hdr.conversion_type_code);
956:
957: return x_return;
958:
959: END;
1012: End If;
1013:
1014:
1015: /* Old Code
1016: If l_sob_currency <> oe_order_pub.g_hdr.transactional_curr_code Then
1017:
1018: x_amount := QP_Cross_Order_Volume_Load.convert_to_base_curr(
1019: p_trans_amount => x_amount,
1020: p_From_currency => l_sob_currency,
1017:
1018: x_amount := QP_Cross_Order_Volume_Load.convert_to_base_curr(
1019: p_trans_amount => x_amount,
1020: p_From_currency => l_sob_currency,
1021: p_to_currency => oe_order_pub.g_hdr.transactional_curr_code,
1022: p_conversion_date => nvl(oe_order_pub.g_hdr.conversion_rate_date,
1023: oe_order_pub.g_hdr.Pricing_date),
1024: p_conversion_rate => oe_order_pub.g_hdr.conversion_rate,
1025: p_conversion_type => oe_order_pub.g_hdr.conversion_type_code
1018: x_amount := QP_Cross_Order_Volume_Load.convert_to_base_curr(
1019: p_trans_amount => x_amount,
1020: p_From_currency => l_sob_currency,
1021: p_to_currency => oe_order_pub.g_hdr.transactional_curr_code,
1022: p_conversion_date => nvl(oe_order_pub.g_hdr.conversion_rate_date,
1023: oe_order_pub.g_hdr.Pricing_date),
1024: p_conversion_rate => oe_order_pub.g_hdr.conversion_rate,
1025: p_conversion_type => oe_order_pub.g_hdr.conversion_type_code
1026: );
1019: p_trans_amount => x_amount,
1020: p_From_currency => l_sob_currency,
1021: p_to_currency => oe_order_pub.g_hdr.transactional_curr_code,
1022: p_conversion_date => nvl(oe_order_pub.g_hdr.conversion_rate_date,
1023: oe_order_pub.g_hdr.Pricing_date),
1024: p_conversion_rate => oe_order_pub.g_hdr.conversion_rate,
1025: p_conversion_type => oe_order_pub.g_hdr.conversion_type_code
1026: );
1027: End If;
1020: p_From_currency => l_sob_currency,
1021: p_to_currency => oe_order_pub.g_hdr.transactional_curr_code,
1022: p_conversion_date => nvl(oe_order_pub.g_hdr.conversion_rate_date,
1023: oe_order_pub.g_hdr.Pricing_date),
1024: p_conversion_rate => oe_order_pub.g_hdr.conversion_rate,
1025: p_conversion_type => oe_order_pub.g_hdr.conversion_type_code
1026: );
1027: End If;
1028: */
1021: p_to_currency => oe_order_pub.g_hdr.transactional_curr_code,
1022: p_conversion_date => nvl(oe_order_pub.g_hdr.conversion_rate_date,
1023: oe_order_pub.g_hdr.Pricing_date),
1024: p_conversion_rate => oe_order_pub.g_hdr.conversion_rate,
1025: p_conversion_type => oe_order_pub.g_hdr.conversion_type_code
1026: );
1027: End If;
1028: */
1029:
1039: BEGIN
1040:
1041: x_return := Get_Period3_Item_Amount(p_cust_id,
1042: p_inventory_item_id,
1043: oe_order_pub.g_hdr.transactional_curr_code,
1044: oe_order_pub.g_hdr.conversion_rate_date,
1045: oe_order_pub.g_hdr.Pricing_date,
1046: oe_order_pub.g_hdr.conversion_rate,
1047: oe_order_pub.g_hdr.conversion_type_code);
1040:
1041: x_return := Get_Period3_Item_Amount(p_cust_id,
1042: p_inventory_item_id,
1043: oe_order_pub.g_hdr.transactional_curr_code,
1044: oe_order_pub.g_hdr.conversion_rate_date,
1045: oe_order_pub.g_hdr.Pricing_date,
1046: oe_order_pub.g_hdr.conversion_rate,
1047: oe_order_pub.g_hdr.conversion_type_code);
1048:
1041: x_return := Get_Period3_Item_Amount(p_cust_id,
1042: p_inventory_item_id,
1043: oe_order_pub.g_hdr.transactional_curr_code,
1044: oe_order_pub.g_hdr.conversion_rate_date,
1045: oe_order_pub.g_hdr.Pricing_date,
1046: oe_order_pub.g_hdr.conversion_rate,
1047: oe_order_pub.g_hdr.conversion_type_code);
1048:
1049: return x_return;
1042: p_inventory_item_id,
1043: oe_order_pub.g_hdr.transactional_curr_code,
1044: oe_order_pub.g_hdr.conversion_rate_date,
1045: oe_order_pub.g_hdr.Pricing_date,
1046: oe_order_pub.g_hdr.conversion_rate,
1047: oe_order_pub.g_hdr.conversion_type_code);
1048:
1049: return x_return;
1050:
1043: oe_order_pub.g_hdr.transactional_curr_code,
1044: oe_order_pub.g_hdr.conversion_rate_date,
1045: oe_order_pub.g_hdr.Pricing_date,
1046: oe_order_pub.g_hdr.conversion_rate,
1047: oe_order_pub.g_hdr.conversion_type_code);
1048:
1049: return x_return;
1050:
1051: END;
1105: );
1106: End If;
1107: /*
1108: x_total_amount := gl_currency_api.convert_amount(l_sob_currency,
1109: oe_order_pub.g_hdr.transactional_curr_code,
1110: oe_order_pub.g_hdr.conversion_rate_date,
1111: oe_order_pub.g_hdr.conversion_type_code,
1112: x_total_amount) ;
1113: --+ G_Order_Info.order_amount;
1106: End If;
1107: /*
1108: x_total_amount := gl_currency_api.convert_amount(l_sob_currency,
1109: oe_order_pub.g_hdr.transactional_curr_code,
1110: oe_order_pub.g_hdr.conversion_rate_date,
1111: oe_order_pub.g_hdr.conversion_type_code,
1112: x_total_amount) ;
1113: --+ G_Order_Info.order_amount;
1114: */
1107: /*
1108: x_total_amount := gl_currency_api.convert_amount(l_sob_currency,
1109: oe_order_pub.g_hdr.transactional_curr_code,
1110: oe_order_pub.g_hdr.conversion_rate_date,
1111: oe_order_pub.g_hdr.conversion_type_code,
1112: x_total_amount) ;
1113: --+ G_Order_Info.order_amount;
1114: */
1115:
1127: x_return number;
1128:
1129: BEGIN
1130:
1131: 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);
1132:
1133: return x_return;
1134:
1135: END;
1188: );
1189: End If;
1190: /*
1191: x_total_amount := gl_currency_api.convert_amount( l_sob_currency,
1192: oe_order_pub.g_hdr.transactional_curr_code,
1193: oe_order_pub.g_hdr.conversion_rate_date,
1194: oe_order_pub.g_hdr.conversion_type_code,
1195: x_total_amount) ;
1196: --+ G_Order_Info.order_amount;
1189: End If;
1190: /*
1191: x_total_amount := gl_currency_api.convert_amount( l_sob_currency,
1192: oe_order_pub.g_hdr.transactional_curr_code,
1193: oe_order_pub.g_hdr.conversion_rate_date,
1194: oe_order_pub.g_hdr.conversion_type_code,
1195: x_total_amount) ;
1196: --+ G_Order_Info.order_amount;
1197: */
1190: /*
1191: x_total_amount := gl_currency_api.convert_amount( l_sob_currency,
1192: oe_order_pub.g_hdr.transactional_curr_code,
1193: oe_order_pub.g_hdr.conversion_rate_date,
1194: oe_order_pub.g_hdr.conversion_type_code,
1195: x_total_amount) ;
1196: --+ G_Order_Info.order_amount;
1197: */
1198:
1209: x_return number;
1210:
1211: BEGIN
1212:
1213: 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);
1214:
1215: return x_return;
1216:
1217: END;
1270: );
1271: End If;
1272: /*
1273: x_total_amount := gl_currency_api.convert_amount(l_sob_currency,
1274: oe_order_pub.g_hdr.transactional_curr_code,
1275: oe_order_pub.g_hdr.conversion_rate_date,
1276: oe_order_pub.g_hdr.conversion_type_code,
1277: x_total_amount) ;
1278: --+ G_Order_Info.order_amount;
1271: End If;
1272: /*
1273: x_total_amount := gl_currency_api.convert_amount(l_sob_currency,
1274: oe_order_pub.g_hdr.transactional_curr_code,
1275: oe_order_pub.g_hdr.conversion_rate_date,
1276: oe_order_pub.g_hdr.conversion_type_code,
1277: x_total_amount) ;
1278: --+ G_Order_Info.order_amount;
1279:
1272: /*
1273: x_total_amount := gl_currency_api.convert_amount(l_sob_currency,
1274: oe_order_pub.g_hdr.transactional_curr_code,
1275: oe_order_pub.g_hdr.conversion_rate_date,
1276: oe_order_pub.g_hdr.conversion_type_code,
1277: x_total_amount) ;
1278: --+ G_Order_Info.order_amount;
1279:
1280: */
1292: x_return number;
1293:
1294: BEGIN
1295:
1296: 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);
1297:
1298: return x_return;
1299:
1300: END;
1599: x_return NUMBER;
1600:
1601: BEGIN
1602:
1603: 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));
1604:
1605: 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
1606: x_return := 0;
1607: END IF;
1601: BEGIN
1602:
1603: 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));
1604:
1605: 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
1606: x_return := 0;
1607: END IF;
1608:
1609: RETURN x_return;