[Home] [Help]
7: p_cost_mthd IN cm_cmpt_dtl.cost_mthd_code%TYPE,
8: p_Prd_start_date IN DATE,
9: p_Prd_end_date IN DATE,
10: p_item_id IN ic_item_mst.item_id%TYPE DEFAULT NULL,
11: P_customer_id IN op_ordr_hdr.billcust_id%TYPE DEFAULT NULL,
12: p_top_n IN NUMBER
13: )
14: RETURN NUMBER
15: IS
33: SUM(pmi_sales_pkg.PMISA_GET_CHARGE(orderdetail.order_Id,orderdetail.line_Id,
34: orderdetail.extended_price,orderdetail.billing_currency,orderdetail.base_currency,
35: orderdetail.exchange_rate,orderdetail.mul_div_sign)) Margin
36: FROM
37: OP_ORDR_HDR orderhdr,
38: OP_ORDR_DTL orderdetail,
39: IC_ITEM_MST itemmst
40: WHERE orderhdr.order_id = orderdetail.order_id
41: AND orderdetail.item_id = itemmst.item_id
63: SUM(pmi_sales_pkg.PMISA_GET_CHARGE(orderdetail.order_Id,orderdetail.line_Id,
64: orderdetail.extended_price,orderdetail.billing_currency,orderdetail.base_currency,
65: orderdetail.exchange_rate,orderdetail.mul_div_sign)) Margin
66: FROM
67: OP_ORDR_HDR orderhdr,
68: OP_ORDR_DTL orderdetail,
69: IC_ITEM_MST itemmst
70: WHERE orderhdr.order_id = orderdetail.order_id
71: AND orderdetail.item_id = itemmst.item_id
215: pmi_sales_pkg.PMISA_GET_CHARGE(orderdetail.order_Id,orderdetail.line_Id,
216: orderdetail.extended_price,orderdetail.billing_currency,orderdetail.base_currency,
217: orderdetail.exchange_rate,orderdetail.mul_div_sign) line_Margin
218: FROM
219: OP_ORDR_HDR orderhdr,
220: OP_ORDR_DTL orderdetail,
221: IC_ITEM_MST itemmst,
222: SY_ORGN_MST org,
223: GL_PLCY_MST pol
301: pmi_sales_pkg.PMISA_GET_CHARGE(orderdetail.order_Id,orderdetail.line_Id,
302: orderdetail.extended_price,orderdetail.billing_currency,orderdetail.base_currency,
303: orderdetail.exchange_rate,orderdetail.mul_div_sign) line_Margin
304: FROM
305: OP_ORDR_HDR orderhdr,
306: OP_ORDR_DTL orderdetail,
307: IC_ITEM_MST itemmst,
308: SY_ORGN_MST org,
309: GL_PLCY_MST pol