src/org/openbravo/erpCommon/ad_callouts/SL_Order_Product_data.xsql
changeset 799 fef2c5e2feb7
parent 423 ecf368072c48
child 1167 dfb5705d8664
equal deleted inserted replaced
798:4994e5a604bb 799:fef2c5e2feb7
    55       FROM M_PRODUCT_UOM 
    55       FROM M_PRODUCT_UOM 
    56       WHERE M_PRODUCT_ID = TO_NUMBER(?)
    56       WHERE M_PRODUCT_ID = TO_NUMBER(?)
    57     </Sql>
    57     </Sql>
    58     <Parameter name="mProductId"/>
    58     <Parameter name="mProductId"/>
    59   </SqlMethod>
    59   </SqlMethod>
    60   <SqlMethod name="lastPriceSo" type="preparedStatement" return="String" default="">
       
    61     <SqlMethodComment></SqlMethodComment>
       
    62     <Sql>
       
    63       SELECT MAX(PRICEACTUAL) AS LASTPRICESO
       
    64       FROM C_ORDER, C_ORDERLINE
       
    65       WHERE C_ORDER.C_ORDER_ID = C_ORDERLINE.C_ORDER_ID
       
    66       AND C_ORDER.DATEORDERED = (SELECT MAX(C_ORDER.DATEORDERED) FROM C_ORDER, C_ORDERLINE
       
    67       WHERE C_ORDER.C_ORDER_ID = C_ORDERLINE.C_ORDER_ID
       
    68       AND C_ORDER.C_BPARTNER_ID = TO_NUMBER(?)
       
    69       AND C_ORDERLINE.M_PRODUCT_ID = TO_NUMBER(?)
       
    70       AND C_ORDER.DOCSTATUS = 'CO')
       
    71       AND C_ORDER.C_BPARTNER_ID = TO_NUMBER(?)
       
    72       AND C_ORDERLINE.M_PRODUCT_ID = TO_NUMBER(?)
       
    73       AND C_ORDER.DOCSTATUS = 'CO'
       
    74     </Sql>
       
    75     <Parameter name="cBpartnerId"/>
       
    76     <Parameter name="mProductId"/>
       
    77     <Parameter name="cBpartnerId"/>
       
    78     <Parameter name="mProductId"/>
       
    79   </SqlMethod>
       
    80 
       
    81 
    60 
    82   <SqlMethod name="getOffersPrice" type="preparedStatement" return="String" default="0">
    61   <SqlMethod name="getOffersPrice" type="preparedStatement" return="String" default="0">
    83     <SqlMethodComment></SqlMethodComment>
    62     <SqlMethodComment></SqlMethodComment>
    84     <Sql>
    63     <Sql>
    85       SELECT ROUND(M_GET_OFFERS_PRICE(TO_DATE(?),TO_NUMBER(?),TO_NUMBER(?),TO_NUMBER(?), TO_NUMBER(?), TO_NUMBER(?)),
    64       SELECT ROUND(M_GET_OFFERS_PRICE(TO_DATE(?),TO_NUMBER(?),TO_NUMBER(?),TO_NUMBER(?), TO_NUMBER(?), TO_NUMBER(?)),